Spot the errors in this 'batching is universal' claim
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.
Detailed answer & concept explanation~8 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: 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.
- vLLM continuous batching is the headline decode throughput lever; it amortizes weight reads across requests and drives utilization toward the compute roof.
- SGLang batches Llama 4 and Qwen 3 decode steps so a single HBM weight read serves dozens of concurrent sequences.
- NVIDIA TensorRT-LLM uses in-flight batching on H100 and B200 precisely because decode GEMV kernels are HBM-bandwidth-bound at batch 1.
- DeepSeek V4 serving stacks pair large decode batches with MLA so the KV cache does not eat the memory headroom that batching needs.
- A ResNet-50 image classifier on an H100 is compute-bound at batch 1; doubling the batch mostly queues work and barely lifts throughput.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does batching turn a memory-bound decode step into a compute-bound one?
QWhat caps the maximum useful decode batch size in production?
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 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.
Same topic, related formats. Practice these next.