PagedAttention & Continuous Batching
PagedAttention is a memory-management algorithm for LLM serving that partitions each request's key-value (KV) cache into fixed-size blocks stored in non-contiguous physical GPU memory, analogous to virtual memory paging in operating systems. Paired with iteration-level continuous batching—which inserts new requests and evicts finished ones at every decoding step rather than waiting for an entire static batch to complete—it eliminates internal and external memory fragmentation and enables fine-grained KV cache sharing across requests. It improves memory utilization and serving throughput, but it does not reduce the underlying algorithmic complexity of attention.
Origin and context
Prior to 2023, LLM inference engines pre-allocated contiguous GPU memory tensors sized to the maximum possible sequence length of each request, wasting 60% to 80% of KV cache capacity on unused reservation slots and fragmentation. Building on Orca’s iteration-level scheduling (OSDI 2022), researchers at UC Berkeley introduced PagedAttention and the vLLM engine in June 2023 (SOSP 2023). By mapping logical KV token blocks to physical GPU memory pages through a block table, PagedAttention enabled near-zero memory waste and copy-on-write prefix sharing. The mechanism was rapidly adopted across TensorRT-LLM, Text Generation Inference (TGI), SGLang, and llama.cpp.
Why it matters
During autoregressive generation, GPU memory capacity—not raw FLOPs—typically limits how many concurrent requests a server can batch together. Because output lengths are unknown in advance, contiguous memory allocation forces servers to run tiny batch sizes, leaving GPU compute units idle. PagedAttention frees that stranded memory so the scheduler can pack 2x to 4x more concurrent sequences into a single continuous batch, directly multiplying serving throughput and enabling zero-copy sharing of common system prompts or parallel beam/sample prefixes.
Example
When ten concurrent users query a customer-support model that shares a 4,000-token system prompt, a vLLM server stores the system prompt’s KV blocks once in physical GPU pages and points all ten requests’ logical block tables to those shared read-only pages. As each user generates a different response, new physical pages are allocated on demand in 16-token blocks, and as soon as one request emits its end-of-sequence token, its pages are immediately reclaimed and assigned to a newly arriving request on the very next forward pass.
Maturity and evidence
Limits and open questions
Non-contiguous memory lookups introduce pointer-indirection overhead inside custom attention kernels, which requires carefully tuned CUDA/Triton block sizes and can slightly increase per-step kernel latency compared with contiguous FlashAttention when batch sizes are small. Moreover, paging manages memory layout but does not shrink the total number of KV bytes required by a single ultra-long sequence unless combined with quantization or architectural compression such as GQA or MLA.
Related terms
References
- Efficient Memory Management for Large Language Model Serving with PagedAttentionKwon et al. / UC Berkeley & SOSP 2023 (arXiv) · 2023-09-12 · class A
- Orca: A Distributed Serving System for Transformer-Based Generative ModelsYu et al. / USENIX OSDI 2022 · 2022-07-11 · class A
- vLLM PagedAttention Design DocumentationvLLM Project · 2024-01-15 · class B
Last updated: 2026-10-19
This term is also covered in the Skills Atlas as vllm skill.
This term is also covered in the Skills Atlas as llm inference serving skill.
This term is also covered in the Skills Atlas as inference optimization skill.
This term is also covered in the Skills Atlas as kv cache optimization skill.
Referencing this analysis in documentation, research, or an engineering write-up? Copy a formatted link or citation below:
Show citation text & canonical URL
[PagedAttention & Continuous Batching — AI Glossary — Skills Intelligence](https://www.skillsintelligence.tools/glossary/term/paged-attention)Skills Intelligence. (2026). PagedAttention & Continuous Batching — AI Glossary. Skills Intelligence AI Glossary. Retrieved from https://www.skillsintelligence.tools/glossary/term/paged-attention