Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Explain why a textbook ML optimization instinct (reduce FLOPs to speed up inference) fails on LLM decode. What does work, and what was the engineer's confusion?
Decode at small batch is HBM-bandwidth-bound, not compute-bound. Cutting FLOPs without cutting bytes-per-token leaves the dominant memory read unchanged, so latency barely moves.
Imagine a chef who must walk to a giant pantry and carry back every ingredient in the kitchen before cooking each single dish. The walk takes a long time; the actual chopping is quick. If you give the chef faster knives, dinner barely speeds up, because the walk is the bottleneck, not the chopping. LLM decode is like that. Generating one token forces the GPU to read the entire model from slow memory, which dwarfs the tiny amount of math per token. Buying a chip with more raw math power, like sharper knives, helps almost nothing if the pantry walk, the memory bandwidth, stays the same. To go faster you shrink what must be carried or carry it once for many dishes.
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: roofline regimes + where decode sits + estimate the per-token weight read + why FLOP cuts miss + byte-cutting and amortization levers + the diagnostic rule.
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.
Assuming peak FLOPs sets decode speed. At batch 1 decode is gated by reading weights from HBM, so a chip with more FLOPs but equal bandwidth barely helps token latency.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.