Token 1234 means 'the' in one model and garbage in another. Why?
Each tokenizer builds its own vocabulary independently, so id 1234 is a row index into one specific table. Different tokenizer, different table, different meaning. Raw text is the only portable representation.
Imagine each tokenizer has a numbered locker room. Token id 47 means 'locker 47 in this specific room'. Inside locker 47 is the embedding vector representing one piece of text. Now imagine a different building with its own locker room. Locker 47 there holds something completely different. There is no relationship between locker 47 in building A and locker 47 in building B. Token ids work the same way. The id is a coordinate inside one tokenizer's vocabulary, not a global name. The only way two models can share information is through the raw text: detokenize on one side, re-tokenize on the other. Passing token ids directly between models is like mailing someone your gym locker number and expecting it to mean something at their gym.
Detailed answer & concept explanation~5 min readEverything 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. 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.
3 min: define a token id as an integer index into the tokenizer's vocabulary, name the two model components it touches (embedding matrix at input, lm_head at output), explain non-portability with a concrete example, and close with the rule that raw text is the only safe representation across model boundaries.
Real products, models, and research that use this idea.
- In tiktoken cl100k_base the token ' the' (with leading space) has a specific id; that same surface form in o200k_base has a different id because the vocabularies differ.
- Llama 3's tokenizer assigns specific ids to chat template control tokens; mismatching these breaks apply_chat_template and generation behavior.
- When fine-tuning a model and adding domain-specific tokens, you append new rows to the embedding matrix and lm_head; those ids become useful only after training exercises them.
- Cross-model evaluation pipelines (comparing GPT-5.5 and Claude Opus 4.7 on the same prompt) always pass through text space at the boundary, not token id space.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat happens inside the model the moment a token id is read from the input?
QWhy is adding new tokens to a pretrained model such a heavy operation?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating token ids as portable between models. They are integer indices into a specific tokenizer's vocabulary; the same id in two tokenizers points to two unrelated entries.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.