Why is batching the single biggest throughput lever for LLM decode?
Explain mechanically why batching N concurrent requests during decode raises GPU throughput far more than batching does for, say, a CNN classifier. Where does the linear scaling start to break down?
Decode is memory-bound, so one weight read per step is wasted on a single token. Batching amortizes that read across many tokens, raising throughput near-linearly until the compute roof.
Imagine a chef who must walk to a huge pantry and haul out every ingredient just to cook one tiny dish. The walk is the slow part, not the cooking. If only one order is on the ticket, that long walk feeds a single plate. But if twenty orders are waiting, the chef hauls the same ingredients once and plates all twenty in roughly the same trip. The walk to the pantry is reading the model weights from memory. The cooking is the actual math. Because the walk dominates, serving twenty requests together is almost as cheap as serving one. That is why batching is the biggest single throughput win for language model serving. It pays the expensive memory trip once and spreads it across many answers.
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: decode is memory-bound at batch 1 + weight-read amortization across the batch + arithmetic intensity on the roofline + critical batch B-star + continuous batching + throughput-latency tension.
Real products, models, and research that use this idea.
- vLLM continuous batching keeps the decode batch full by scheduling at the token level, delivering several times the throughput of static batching on Llama 4 serving.
- NVIDIA TensorRT-LLM exposes in-flight batching plus a tunable max batch size so operators can sit near the critical batch on H200 and B200 hardware.
- Anthropic and OpenAI run high-concurrency batched decode behind their APIs, which is why per-token prices fall as aggregate traffic rises.
- SGLang batches DeepSeek V4 and Qwen 3 requests with prefix sharing, raising effective batch size for workloads with common system prompts.
- The roofline model from Berkeley is the standard tool engineers use to locate the ridge point that sets a model's critical batch on a given GPU.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you estimate the critical batch B-star for a given model and GPU?
QWhy does continuous batching beat static batching even when both target the same max batch?
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.
Claiming batching helps because the GPU has spare compute. The real reason is amortizing the weight read in a memory-bound regime; spare compute is the symptom, not the cause.
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.