Training Low-Resource Language Models with Custom Tokenization and Kernel Optimization

azercell · Telecommunications · 2026 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Low-resource language model adaptation

Azercell needed an Azerbaijani LLM for telecom chatbots and customer-facing use cases, but Azerbaijani is morphologically rich, low-resource, and poorly served by English-optimized tokenizers and base models.

Constraints:

Architecture

Azercell and AWS built a three-stage SageMaker AI pipeline: custom BBPE tokenizer development, continued pre-training with distributed optimizations, and supervised fine-tuning with LoRA. They selected a 100,000-token vocabulary, measured BPB and fertility score, then used FSDP and Liger Kernel optimizations to improve throughput and reduce GPU memory.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  azerbaijani_data_corpus["Azerbaijani data corpus"] --> custom_bbpe_tokenizer["Custom BBPE tokenizer"]
  custom_bbpe_tokenizer --> continued_pretraining_pipeline["Continued pretraining pipeline"]
  continued_pretraining_pipeline --> fsdp_and_liger_optimizations["FSDP and Liger optimizations"]
  continued_pretraining_pipeline --> lora_fine_tuning_stage["LoRA fine-tuning stage"]
  lora_fine_tuning_stage --> azerbaijani_chatbot_model["Azerbaijani chatbot model"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Azerbaijani data corpus Provides language data for tokenizer training and model adaptation. Custom BBPE tokenizer
Custom BBPE tokenizer Improves encoding efficiency for Azerbaijani morphology. Azerbaijani data corpus, Continued pretraining pipeline
Continued pretraining pipeline Adapts the base model to Azerbaijani language data. Custom BBPE tokenizer, FSDP and Liger optimizations, LoRA fine-tuning stage
FSDP and Liger optimizations Improve training throughput and reduce peak GPU memory. Continued pretraining pipeline
LoRA fine-tuning stage Supervised fine-tunes the model for conversational behavior. Continued pretraining pipeline, Azerbaijani chatbot model
Azerbaijani chatbot model Powers telecom use cases and customer-facing chatbot interactions. LoRA fine-tuning stage

Data flow

Azerbaijani data is used to train and evaluate custom tokenizers, the selected tokenizer feeds continued pretraining on SageMaker AI, distributed optimizations improve memory and throughput, and LoRA supervised fine-tuning adapts the model for Azerbaijani conversational telecom use cases.

3 supporting quotes
“they developed a three-stage production-ready framework on Amazon SageMaker AI: custom tokenizer development, continued pre-training with distributed training optimizations, and supervised fine-tuning with LoRA.”summary, stated
“The solution implements a three-stage sequential pipeline where each stage produces artifacts that feed into the next.”summary, stated
“After systematic evaluation, they selected a 100,000-token vocabulary as optimal.”summary, stated

Why this architecture

The pipeline separates tokenization, pretraining, and fine-tuning because low-resource language quality depends first on efficient tokenization, then on language adaptation, then on conversational instruction behavior.

“This modular architecture allows for independent optimization of each component and supports iterative improvement without requiring full pipeline reruns.”summary, stated
“Standard tokenizers trained on English split such words into multiple subword tokens, which effectively reduces the amount of actual content”summary, stated

Models used: Llama 3.2 · LoRA fine-tuned Azerbaijani model · Amazon SageMaker AI

Scale

Alternatives considered (roads not taken)

Use baseline English-optimized tokenizers directly

Rejected because: They fragmented Azerbaijani words and wasted context capacity.

“using baseline English-optimized tokenizers directly, extending existing vocabularies with Azerbaijani tokens, and training custom monolingual tokenizers from scratch.”summary, stated

Extend existing vocabularies

Rejected because: The team selected a custom monolingual 100,000-token tokenizer after evaluation.

“After systematic evaluation, they selected a 100,000-token vocabulary as optimal.”summary, stated

Optimize perplexity directly across tokenizers

Rejected because: Vocabulary differences bias perplexity, so the team used Bits-Per-Byte.

“Rather than comparing perplexity directly (which would be biased by vocabulary differences), they measured Bits-Per-Byte (BPB)”summary, stated

Patterns

fine-tuning-adaptation (language adaptation)

The model was adapted through continued pretraining and LoRA supervised fine-tuning for Azerbaijani.

“continued pre-training with distributed training optimizations, and supervised fine-tuning with LoRA.”summary, stated

context-engineering (tokenization)

Custom tokenization increased how much Azerbaijani content fits into the model context.

“effectively doubling the content the model can consider at once.”summary, stated

latency-optimization (training efficiency)

FSDP and Liger Kernel improved training throughput and memory efficiency.

“23% higher training throughput and 58% lower peak GPU memory usage through FSDP and Liger Kernel optimizations”summary, stated

Tradeoffs

Train a custom tokenizer.

Chose 100,000-token monolingual BBPE tokenizer over Baseline English tokenizer or simple vocabulary extension.

Rationale: It doubled encoding efficiency without degrading BPB quality.

“The custom tokenizer achieved 0.5795 BPB on the validation set compared to 0.6830 for the baseline, confirming improved efficiency without quality degradation.”summary, stated

Use modular three-stage training.

Chose Tokenizer, continued pretraining, then LoRA fine-tuning over One monolithic adaptation run.

Rationale: Separate stages allow independent optimization and reruns.

“This modular architecture allows for independent optimization of each component and supports iterative improvement without requiring full pipeline reruns.”summary, stated

Gotchas (what bit them)

English tokenizers waste low-resource language context windows.

Root cause: Morphologically rich Azerbaijani words are split into too many subword tokens.

Resolution: Train and evaluate a custom monolingual BBPE tokenizer.

“Azerbaijani is morphologically rich, meaning single words encode grammatical information through suffixes that English would express using multiple separate words.”summary, stated

Tokenizer quality cannot be judged by naive perplexity.

Root cause: Vocabulary differences bias perplexity comparisons.

Resolution: Use Bits-Per-Byte to compare prediction quality across tokenizers.

“measured Bits-Per-Byte (BPB), which normalizes for vocabulary by measuring prediction quality at the byte level.”summary, stated

Evaluation

Azercell evaluated tokenizers through fertility score and BPB, then measured training throughput, GPU memory, and conversational quality after adaptation.

Metrics: 2x improved encoding efficiency. · Fertility score from 3.22 to 1.59 tokens per word. · BPB 0.5795 versus 0.6830 baseline. · 23% higher throughput. · 58% lower peak GPU memory.

“baseline Llama 3.2 tokenizer averaged 3.22 tokens per Azerbaijani word, while the custom monolingual tokenizer achieved 1.59”summary, stated
“The solution achieved 2× improved encoding efficiency through custom tokenization, 23% higher training throughput and 58% lower peak GPU memory usage through FSDP and Liger Kernel optimizations, and produced coherent Azerbaijani conversational responses where the base model failed.”summary, stated

Outcomes

The project ran for six weeks and targeted customer-facing telecom chatbots.

“The solution achieved 2× improved encoding efficiency through custom tokenization, 23% higher training throughput and 58% lower peak GPU memory usage through FSDP and Liger Kernel optimizations, and produced coherent Azerbaijani conversational responses where the base model failed.”summary, stated