Each decode step loads ___ from HBM, regardless of how many tokens have already been generated
Each decode step reads the full model weights (constant) plus the live KV cache (grows linearly with context length). Decode is bandwidth-bound, and the KV term is what makes long-context decode slow.
Imagine the model is a chef cooking one dish at a time. Every dish, the chef has to grab the entire recipe book from a shelf, that is the model weights, and it is always the same weight no matter what dish. The chef also has to read every note they wrote down from earlier dishes in the meal, that is the KV cache, and after twenty dishes the stack of notes is twenty pages. After two hundred dishes it is two hundred pages. The recipe-book trip is constant per dish, but the notes-reading trip grows. By dish number two hundred, reading the notes takes longer than reading the recipe. That is why long stories get slower to write as they get longer.
Detailed answer & concept explanation~7 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: name both byte terms (weights constant, KV linear in T), quantify them on a typical 70B model, explain the crossover at long context, and name the optimization that targets each term.
| Term | Per-step bytes | Scaling | Optimizations |
|---|---|---|---|
| Model weights | Param count * bytes-per-param | Constant per step | Lower-precision dtype (FP8/FP4), tensor parallelism |
| KV cache | 2 * L * H_kv * d_h * b * T | Linear in T (and in batch) | GQA / MQA / MLA, FP8/FP4 KV, sliding-window, paged attention |
Real products, models, and research that use this idea.
- Llama 3.1 70B with GQA-8 in FP8 loads roughly 70 GB of weights and about 32 GB of KV at 200k context per decode step on a single GPU, dominated by weight bandwidth at short context and by KV bandwidth at long context.
- DeepSeek V4 ships Multi-head Latent Attention specifically to compress the KV term, replacing per-head K and V with a low-rank latent that streams far fewer bytes per token at long context.
- vLLM's PagedAttention keeps the KV cache in fixed-size blocks so fragmentation does not waste bandwidth, but each decode step still reads all live blocks of all active sequences.
- FP8 KV cache (supported in vLLM and TensorRT-LLM) halves the KV bytes per token versus FP16, directly cutting long-context decode latency without changing the model.
- GPT-5.5 at 200k tokens shows visibly slower per-token decode than at 4k tokens, the dominant cause being the KV cache size growing far beyond the model weights term.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does the KV cache load per step include both K and V even though the new token only adds one K and one V?
QHow does FP8 KV (versus FP16 KV) change the crossover point between weights and KV bytes?
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.
Saying decode only re-reads what it needs for that one new token. Wrong: each decode step reloads the entire weight matrix plus the entire current KV cache from HBM, because every output token must be computed against the full parameter set and the full attention history.
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.