Senior interview question
You're moving a product from a model that uses cl100k_base to one that uses o200k_base. Nothing crashes in staging. What could still be broken, and what goes into the migration plan?
Model answer
Anything that stores tokens, because tokenizer mismatches fail silently: decoding IDs with the wrong tokenizer returns plausible garbage, not an error. The plan:
- Cached token IDs: rebuild them.
- Chunks sized in tokens: re-chunk and re-index.
- Token budgets and cost estimates: recount; the same text gives different counts.
- Throughput dashboards: tokens per second now means a different amount of text, so old and new numbers don't compare.
Keeping the old tokenizer isn't an option: model and tokenizer were trained together.
Practise the rest
11 Tokenization questions, 492 in all, each with a model answer. Free.
More Tokenization interview questions
- When you send a prompt to a language model, what does the model actually receive?
- What is a token, and why do most models use subword tokens rather than whole words or single characters?
- How does byte pair encoding learn a vocabulary, and how does it then encode a word it never saw in training?
- A colleague estimates next month's API bill by counting the words in a batch of English and Hindi support tickets and multiplying by the price per token. What's wrong with the estimate, and how would you do it instead?
- A ticket summariser crashes because tiktoken raises ValueError on a ticket that contains the literal end-of-text marker. A teammate's fix is to pass allowed_special='all'. What's your review comment?
- Compare the main NLP tokenization approaches. Then, how would you design a recommender that uses an LLM?