Identify PagedAttention and the project it ships with
PagedAttention is vLLM's block-based KV-cache allocator that borrows OS virtual-memory paging, eliminating the fragmentation waste of contiguous max-length reservations.
Imagine renting a parking garage where every car gets a private aisle sized for the biggest truck the garage might ever see. Hatchbacks waste most of their aisle. Now picture the garage manager dividing every aisle into uniform stalls and giving each car only the stalls it actually needs, picked from anywhere in the building. A central clipboard remembers which stalls belong to which car. The garage fits far more cars, and nobody hoards space they will never use. PagedAttention is that clipboard for the KV cache: fixed-size blocks anywhere in HBM, looked up through a per-sequence table.
Detailed answer & concept explanation~5 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: vLLM origin + OS paging analogy + the fragmentation problem with contiguous allocation + block tables + enabler for continuous batching and prefix caching.
Real products, models, and research that use this idea.
- vLLM, the project that introduced PagedAttention, is the default open-source serving engine in 2026 for Llama 3.1, Mistral Large 3, and DeepSeek V4 deployments.
- Hugging Face TGI adopted block-based KV allocation directly inspired by PagedAttention.
- NVIDIA TensorRT-LLM ships its own paged KV implementation to support continuous (in-flight) batching on H100 and B200.
- SGLang uses RadixAttention, a tree-structured variant of paged KV that captures shared prefixes across many concurrent requests.
- Anthropic's prompt caching and OpenAI's automatic prefix caching are conceptually downstream of paged KV: sharing physical blocks for byte-identical prefixes.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does PagedAttention enable prompt prefix caching?
QWhat is the overhead of the extra indirection on attention compute?
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.
Calling PagedAttention a new attention math. It is a KV-cache allocator. The math is unchanged; only how K and V are laid out in HBM differs.
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.