What concretely breaks when you try to load a pretrained model checkpoint with a different tokenizer vocabulary?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
A team has a pretrained LLM checkpoint trained with a 50,000-token vocabulary. They want to swap to a new tokenizer with a 100,000-token vocabulary that has better multilingual coverage. Explain precisely what breaks at the model architecture and weight level, and describe what remediation options exist with their costs.
Swapping vocabularies misaligns the embedding table and lm_head, both indexed by token ID, so every lookup and logit points at the wrong token; fixes range from expansion to adaptation to full retrain.
Imagine you wrote a phone book where each name sits at a numbered line, and you memorized which name lives on which line. Now a friend hands you a new phone book with twice the names, in a totally different order. Your memorized line numbers all point to the wrong people now. The model has the same kind of memory: it learned what lives at each numbered line, the tokenizer is what assigns those line numbers, and a new tokenizer reshuffles the lines. You either rewrite the whole memory from scratch, or carefully copy what you can and learn the new entries, but you cannot just trust the old line numbers anymore.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: two tensors carry vocab_size + remapping misaligns old rows + expansion adds untrained rows + expand vs adapt vs retrain + subword-average init + why the choice is sticky.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Listing only the embedding table while forgetting that the lm_head shares the vocab_size dimension and breaks identically on the output side.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.