TL;DR
Swapping out an LLM’s tokenizer can dramatically speed up inference for underrepresented languages, but it usually breaks the model's brain. This paper introduces Model-Aware Tokenizer Transfer (MATT), a method that teaches new token embeddings how to "talk" to each other by mimicking the original model's internal attention patterns. In just a few GPU hours, you get a faster, specialized tokenizer while recovering over 90% of the model’s original intelligence.
What Problem Does This Paper Address?
Modern LLMs are remarkably polyglot, yet they are handcuffed to fixed tokenizers that heavily favor English and Latin scripts. If you feed a model Ukrainian or Georgian, its tokenizer shatters words into tiny fragments—slowing down generation and hurting accuracy.
The practical fix is tokenizer transfer: swapping in a specialized, high-compression tokenizer and initializing new embeddings for the added vocabulary while keeping the rest of the model frozen. Historically, we’ve had two choices here:
- Fast heuristics: Averaging old embeddings based on surface-level word similarity (e.g., FOCUS, WECHSEL). It’s cheap, but ignores how the deeper layers of the Transformer actually process context, causing text generation to collapse.
- Brute-force optimization: Training the new embeddings via standard Next Token Prediction (NTP), which requires agonizingly expensive forward and backward passes through the entire multi-billion-parameter network.
How do we get the high quality of full-model awareness on a grad-student compute budget?
Methods
Instead of just matching static dictionary meanings at layer zero, MATT looks inside the Transformer. Most factual knowledge lives in the feed-forward layers, meaning the main distortion from a new tokenizer happens in the attention layers, where tokens exchange information across context.
MATT introduces Attention Influence Modeling (AIM)—a teacher-student distillation objective:
- Common Ground via Segments: Because the old and new tokenizers slice text differently (e.g.,
_for+m+ulavs._formula), you can't compare their attention matrices token-by-token. MATT groups tokens into shared, minimal segments (roughly words) where boundaries align across both tokenizers. - Matching Attention Influence: Using the final token of a segment as the query, MATT sums up the attention-weighted value vectors for each preceding segment. The student model (new tokenizer, frozen body, trainable new embeddings) is trained via Mean Squared Error loss to match these segment-level representations with the frozen teacher model.
- Early Stopping in Depth: Because AIM operates directly on attention layers, you don't need to run the whole model! MATT initializes embeddings with a standard heuristic (FOCUS) and only computes the forward/backward pass up to an early-middle layer (e.g., layer 12 of 48), drastically slashing VRAM and compute time.
Datasets
No new benchmarks are introduced; the authors rely on established multilingual corpora:
- Training: The Kobza corpus for Ukrainian (~240M tokens for MATT; 1.86B tokens for baselines), HPLT 2.0 Cleaned (~250M tokens per language for Arabic, German, Japanese, and Swahili), plus OpenSubtitles and NLLB parallel data for baseline alignment.
- Evaluation: Discriminative understanding is tested on Belebele, Global MMLU, and MMMLU. Generative capabilities are tested on XL-Sum (summarization), WMT24++, and Long FLORES (document-level translation, an existing extension of FLORES).
Key Insights and Ideas
- Heuristics can pass multiple-choice tests, but fail to speak: Surface-level embedding heuristics recover ~70% of discriminative accuracy, yet plummet below 16% of original generative performance. Coherent generation requires preserving higher-layer inter-token dynamics.
- The "Detokenization Plateau": You only need the first quarter to third of an LLM's layers for tokenizer transfer. Performance climbs in early layers, plateaus in the middle—right where Transformers naturally fuse subwords into coherent word-level concepts—and slightly degrades in final layers.
- Quadratic Supervision per Document: Unlike Token Distillation (which matches a single hidden state per token sequence), AIM constrains how every segment attends to every preceding segment. This quadratic web of constraints extracts a much richer training signal per document.
Key Results
On Gemma 3 12B PT adapted to Ukrainian (reassigning >80,000 tokens), the new tokenizer increased compression from 2.98 to 4.44 characters/token—translating to a nearly 50% inference speedup.
With just 7 hours of training, MATT recovered 98.8% of discriminative accuracy (77.27 vs. 78.18 original) and 93.1% of generative BLEU score (11.81 vs. 12.68). It decisively beat standard NTP even when NTP was given 50% more compute time (10.5 hours, reaching 74.01 discriminative / 8.46 generative), and avoided the catastrophic one-way translation collapse seen in Token Distillation under temperature sampling. Across Gemma 3 4B and Qwen 3 4B on Arabic, German, Japanese, and Swahili (1.2x–1.6x compression gains), MATT won aggregate discriminative and generative metrics across the board.
Limitations and Future Work
- Bounded by the Teacher: Because MATT is a self-distillation method, it can only unlock languages the base model already knows. It cannot teach a model a brand-new language from scratch.
- Untied Embeddings Overhead: MATT only trains input embeddings. If a model doesn't share (tie) its input and output LM-head weights, MATT must be combined with an NTP loss, reducing its efficiency advantage.
- Warm-up, Not the Finish Line: A small performance gap remains on generative tasks when model weights stay frozen. Unfreezing the full model for continual pretraining across diverse languages—alongside proper hyperparameter tuning for MATT—is left for future work.
Summary updated