Swapping a model's tokenizer without retraining, via OMP
- Source
- arxiv.org
- Publisher
- Arcee AI
- Author
- Arcee.ai
- Date

Context
A reads text through a fixed vocabulary of , and each token has a learned vector, its , that the rest of the network depends on. Giving a model another model's tokenizer is easy for tokens the two vocabularies share, whose embeddings can be copied, but every unfamiliar token needs a new embedding, and simple fillers such as zeros or the average embedding degrade performance. In a June 2025 paper, Arcee researchers Charles Goddard and Fernando Fernandes Neto fill those gaps with Orthogonal Matching Pursuit, a greedy algorithm that rebuilds a vector from a few other vectors. For each missing token, it picks a small set of shared anchor tokens whose weighted sum approximates that token inside the donor model, then applies the same weights to the anchors' embeddings in the receiving model. No step is involved. Arcee's companion blog post introduced the same method for a general audience.
On ordinary text the reconstruction holds up. Moving Llama 3's roughly 128,000-token vocabulary into the 12-billion-parameter Mistral NeMo, where only about 54% of tokens overlap, MMLU accuracy went from 64.5% to 62.2% with 64 anchors per token, while the zero and mean fillers fell to about 58%. Moving Qwen 2.5's vocabulary into a 1-billion-parameter Llama 3 model, with about 86% overlap, MMLU stayed at 36.40% against a 36.73% baseline. Approximating about 41,000 tokens for that second pair took 38 seconds on a single H100 GPU with 8 anchors, where CLPTransfer, one of the published alternatives, took about 9 hours on a CPU.
Math is where the transplant breaks. GSM8K scores fell by 73.8% and 78.7% relative to the baselines in the two experiments, and the transplanted models often gave single-digit answers to multi-digit problems. The authors trace this to how numbers are split: Mistral NeMo and Qwen write every number one digit at a time, while Llama 3 groups digits in chunks of up to three and has 1,110 dedicated number tokens, so most of one model's number tokens must be approximated from anchors that may not be numbers at all. To test that explanation, they moved Mistral NeMo's tokenizer into Qwen 2.5 7B, a pair whose vocabularies differ but which both split numbers into single digits, and GSM8K dropped only from 82.6% to 78.0%. The paper concludes that matching numeric schemes preserves arithmetic far better and that arbitrary tokenizer pairs may need special handling for number tokens. The method ships in the open-source mergekit-tokensurgeon tool.
- Large language model — A model trained on large amounts of data to process and generate language.
- Token — A piece of text, such as a word, part of a word or a punctuation mark, that a language model represents as numbers and handles as a unit.
- embedding — A list of numbers representing a piece of text's meaning, so that similar meanings end up numerically close and can be searched.
- Training — The process that adjusts a model using examples and a measure of how well it performs.






