Skip to main content
Back

Token Distillation Beats Costly Vocabulary Methods in Under 10 Minutes

A new initialization method matches multi-subtoken attention behavior in a single embedding, outperforming pretrained hyper-networks while training in under 10 minutes.

Pro

  • Token Distillation initializes new token embeddings by matching hidden states between original subtoken and new single-token tokenizations.
  • Method outperforms subtoken mean, NTP tuning, and pretrained hyper-networks like ZeTT across eight open-weight models.
  • Initializes 2,500 new tokens in under 10 minutes on a single H100 GPU using only 25 snippets per token.
  • On Arabic adaptation of Mistral-7B, cuts token counts 36% while matching original tokenization after brief continued training.
  • Code available on GitHub; works on Mistral, Llama 3/3.1/3.2, OLMo2, and Qwen3.
  • Limitations: struggles with short ambiguous subwords, does not learn output embeddings, and cannot handle fully unseen languages.

Adding new tokens to a pretrained language model sounds simple: extend the vocabulary, initialize the new embeddings, and keep going. In practice, the initialization step is where most methods stumble, because the semantics of a whole word are not really stored in the embeddings of its subword pieces. A new paper from researchers at Hasso Plattner Institute and the University of Copenhagen proposes Token Distillation, which pulls that missing information out of the Transformer layers themselves and packs it into a single new embedding, in under 10 minutes per 2,500 tokens.

Why static vocabularies hurt

Pretrained language models are trained with a fixed tokenizer that often fragments domain-specific or novel terms into multiple subtokens. That fragmentation is not just cosmetic. Excessive tokenization leads to reduced performance on downstream tasks and increases the computational and financial cost due to inflated sequence lengths. For example, adding 1,000 Arabic tokens to Mistral-7B via AdaptiVocab cuts token counts on Arabic benchmarks by 36%, which the authors note translates to compute savings of up to 50% thanks to the quadratic cost of attention.

The catch is that most existing initialization methods for new tokens are variations on the same theme: take a weighted average of the original subtoken embeddings. The authors argue this is fundamentally limited. Consider a new token like palatable that would have been split into _pal, at, able. Those subtokens carry almost no signal about the whole word on their own. The semantics of a word composed of multiple subtokens will largely not be stored in their raw input embeddings at all, but rather constructed by the Transformer's attention and feed-forward layer stack during contextualization.

The distillation trick

Token Distillation reframes initialization as a small self-distillation problem. The frozen pretrained model itself is the teacher. The recipe:

  1. Grab a handful of example sequences containing the new token (retrieved from a corpus, or generated by prompting the model).
  2. Run the sequences through the model twice: once tokenized with the original vocabulary (splitting the new token into subtokens), and once with the new single token.
  3. Only the new embedding is trainable. Minimize the mean-squared error between the hidden states produced by the two versions, at positions that would attend to the new token.

The intuition is that if a single embedding can reproduce the downstream hidden states that the multi-subtoken version induces, it has effectively absorbed whatever the attention and feed-forward layers were computing on the fly. Training is cheap: the authors restrict to 25 example sequences per target token, truncate to a context length of 50 tokens, and initialize 2,500 new tokens on a single GPU in under 10 minutes.

How it stacks up

The paper benchmarks eight open-weight models spanning Mistral-7B, Llama 3 / 3.1 / 3.2 variants, OLMo2, and Qwen3. On the Open Medical-LLM leaderboard after adding roughly 2,600 biomedical tokens, Token Distillation averages 64.6% versus 60.8% for subtoken mean, 63.0% for next-token-prediction tuning, and 62.7% for ZeTT (the strongest baseline, a pretrained hyper-network from Zero-Shot Tokenizer Transfer). The original tokenization scores 66.5%, so the gap to a fully pretrained model is small.

Two results stand out. First, on French adaptation of Llama3-8B-Instruct, Token Distillation actually beats the original tokenization (72.9 vs 72.1) without any further training of the Transformer layers. Second, when paired with a short continued-training phase on Arabic, Token Distillation matches the original tokenization while cutting token counts by 36%. It also beats ZeTT while using less than 1% of ZeTT's pretraining compute budget.

An in-depth analysis of the target layer for the distillation loss shows that the last layer is not always optimal, and that early layers already contain much of the subtoken-specific context, opening the door to further speedups by terminating the forward pass early.

Performance vs target layer for Token Distillation across learning rates

Where it breaks

The method has honest limitations. It cannot initialize embeddings for tokens the original model has never really seen, so it is not a fix for completely unseen languages. It also struggles on short, lexically ambiguous subwords like ed or fer that appear in many contexts. And because the distillation objective operates on hidden states, it only learns input embeddings; output embeddings need a separate objective (the paper adds a downweighted next-token-prediction loss as a lightweight fix, especially for models with tied input/output weights like Llama3.2-3B where an unconstrained embedding norm caused a failure mode).

Availability

The code is open source on GitHub. For anyone doing domain adaptation, multilingual extension, or sequence-compression via multi-word tokens, this is a drop-in initialization step that requires no auxiliary pretraining, no hyper-network per model family, and no expensive continued training to get useful embeddings. It plugs in wherever subtoken mean initialization currently lives, and generally does better in a few minutes of GPU time.