LLM & Transformer Fundamentals·Question 44 of 109Intermediate

You are migrating to a model whose tokenizer produces about 30% more tokens for the same text. What breaks, and how do you find out before your users do?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

This is a real migration, not a thought experiment: Anthropic says the tokenizer introduced with Claude Opus 4.7, and used by later models, produces about 30% more tokens for the same text, so a 1M-token window now holds roughly 555k words instead of roughly 750k. The model may be better, but every number in your system that is denominated in tokens just changed meaning.

Full worked answer with diagram

This is a real migration, not a thought experiment: Anthropic says the tokenizer introduced with Claude Opus 4.7, and used by later models, produces about 30% more tokens for the same text, so a 1M-token window now holds roughly 555k words instead of roughly 750k. The model may be better, but every number in your system that is denominated in tokens just changed meaning.

What breaks, roughly in order of how often it bites:

  • Output caps. A max_tokens of 1,000 now buys about 770 old-tokens of text (1 / 1.3). Summaries, JSON objects and code blocks that used to fit now truncate, and a truncated JSON object is a parse failure, not a shorter answer. This usually shows up first as a spike in max_tokens stop reasons.
  • Context budgets and truncation logic. If you allocate 120k tokens for history and retrieval, you now fit about 23% less text. Truncation and compaction fire earlier, so an agent that compacted at step 60 now compacts at step 45, with different behaviour.
  • Chunking. Chunks sized in the generation model's tokens hold less text, so retrieval returns smaller units. Chunks sized for an embedding model's tokenizer are unaffected, which is a reason to keep those two budgets separate in config.
  • Cost forecasts. Same per-token price, about 30% more tokens, so the bill goes up even if the price sheet did not change. Compare cost per task, not price per million tokens.
  • Rate limits. A tokens-per-minute quota now carries less traffic. Capacity plans built on TPM need redoing.
  • Client-side token counting. Any local tokenizer library you use for pre-flight budget checks is now wrong for the new model. Use the provider's counting endpoint or the usage fields in responses.
  • Latency. More output tokens for the same answer means more decode steps, so TPOT times output length grows even if per-token speed is unchanged.
  • Eval thresholds. Anything with a token threshold (length penalties, "answer under 200 tokens" checks, compression ratios) silently shifts.

How to catch it: replay a sample of production traffic through both models and diff the usage fields per request, not just quality scores. Plot input and output token ratios per route, because the inflation is not uniform: code, non-English text and numbers can move differently from English prose. Then re-derive every token-denominated constant from that ratio, ideally from one config value rather than a dozen hard-coded numbers.

Worth sketching. Drawing it is optional, but it shows that one ratio fans out into every budget in the system.

flowchart LR
    A["Replay traffic<br/>on both models"] --> B["Per-route token ratio<br/>(about 1.3x)"]
    B --> C["max_tokens caps"]
    B --> D["Context and<br/>compaction budgets"]
    B --> E["Chunk sizes"]
    B --> F["Cost and TPM<br/>forecasts"]
    B --> G["Eval length<br/>thresholds"]

The senior framing: tokens are a unit of account that the vendor controls. Store budgets in config keyed by model, measure them per model, and treat a tokenizer change like a currency change.

What a good answer covers

  • This is a real migration, not a thought experiment
  • The model may be better, but every number in your system that is denominated in tokens just changed meaning
  • Output caps
  • Context budgets and truncation logic
  • Chunking

Key terms: Output caps · Context budgets and truncation logic · Chunking · Cost forecasts · Rate limits · Client-side token counting · Latency · Eval thresholds

Interviewer follow-ups to expect

  1. Which of these would you expect to surface first in production monitoring, and on which metric?

  2. Why might the inflation ratio differ between English prose, code and Japanese text?

  3. How would you make your budgets survive the next tokenizer change without a code release?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep