What is the primary mechanism by which PagedAttention increases serving throughput?
PagedAttention stores the KV cache in fixed-size blocks tracked by a block table, killing the fragmentation that contiguous reservation wastes, so more requests fit and batch size rises.
Imagine a parking lot where every car must park in one long unbroken strip of spaces, and you reserve the strip based on the longest trip anyone might take. Most drivers leave early, so huge stretches sit empty but blocked. The lot looks full while half of it is wasted. PagedAttention instead breaks the lot into small numbered bays and hands out one bay at a time, only as each car actually needs it. A little map records which bays belong to which car, so they can be scattered anywhere. Nothing is reserved that is not used, the empty gaps vanish, and far more cars fit at once. Fitting more cars at once is exactly what raises a serving system's throughput.
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: fragmentation in contiguous KV reservation, block table and paged allocation, why freed memory raises batch size, and how decode bandwidth amortization turns that into throughput.
Real products, models, and research that use this idea.
- vLLM (UC Berkeley) introduced PagedAttention in 2023 and is the default serving engine behind most open-source LLM deployments in 2026.
- SGLang builds on paged blocks with RadixAttention to share prompt prefixes across batched requests serving Llama 4 and Qwen 3.
- TensorRT-LLM (NVIDIA) ships a paged KV cache plus chunked prefill as the production reference on H100 and B200 GPUs.
- Anthropic and OpenAI prompt caching exposes the same prefix-sharing idea as a billing feature, charging a fraction for repeated prompt prefixes.
- Hugging Face TGI adopted paged KV allocation to lift concurrent-request throughput for hosted Llama 4 and Mistral Large 3 endpoints.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does eliminating fragmentation translate into higher throughput rather than just lower memory use?
QHow do copy-on-write blocks help beam search and parallel sampling?
QDoes PagedAttention compete with or compose with GQA and MLA?
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 PagedAttention speeds up the attention math or compresses the KV cache. It changes only the memory layout; the arithmetic per token is unchanged.
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.