Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Click any words you think contain an error. Click again to unmark.
Batching helps because decode is memory-bound: at batch 1 the GPU streams weights from HBM and barely computes, so adding requests amortizes one weight load over many tokens.
Picture a delivery truck driving across town to hand over one envelope, then driving back empty. The drive is the expensive part; the envelope weighs nothing. That round trip is loading the model weights from memory. Doing it for a single token wastes the whole journey. Batching is loading the truck with envelopes for many addresses on one trip. The drive costs the same whether you carry one envelope or fifty, so the cost per delivery plummets. LLM decode is exactly this: reading the weights dominates, the math per token is tiny. Pack more requests into one weight read and throughput soars. But a workload that already fills the truck every trip gains nothing from a bigger truck.
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: roofline regimes + why decode is a memory-bound GEMV at batch 1 + how batching amortizes the weight load into a GEMM + why prefill and CNN inference gain little + the KV cache batch ceiling.
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.
Claiming batching helps by adding more compute or because the workload is compute-bound. Decode is memory-bound at batch 1; batching wins by amortizing one weight load over many tokens, not by adding FLOPs.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.