---
title: "PagedAttention"
type: "glossary term"
url: "https://aifordevs.org/glossary#paged-attention"
markdown: "https://aifordevs.org/glossary/paged-attention.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/glossary#paged-attention"
---

# PagedAttention

PagedAttention is the KV cache memory manager introduced with vLLM (Kwon et al., 2023). It stores the cache in fixed-size blocks, like pages in virtual memory, so requests do not need one contiguous allocation and fragmentation stays low.

Equal-size blocks remove external fragmentation, and small blocks limit internal fragmentation. Kwon et al. measured that earlier systems used only 20.4% to 38.2% of KV cache memory for actual token state, and they report 2 to 4 times the throughput at the same latency.

## Example

vLLM defaults to 16-token blocks. A 100-token sequence takes 7 blocks, or 112 slots, so 12 slots sit idle.

## Source

[Kwon et al., Efficient Memory Management for Large Language Model Serving with PagedAttention (2023)](https://arxiv.org/abs/2309.06180)

## Related terms

- [KV cache](https://aifordevs.org/glossary#kv-cache)
- [Throughput](https://aifordevs.org/glossary#throughput)
- [Continuous batching](https://aifordevs.org/glossary#continuous-batching)
- [Prefix caching](https://aifordevs.org/glossary#prefix-caching)

## Read the article

[KV cache explained: what it stores and what it costs](https://aifordevs.org/articles/kv-cache-explained)

## Cite this term

AI for Devs. "PagedAttention." https://aifordevs.org/glossary#paged-attention

- Page: https://aifordevs.org/glossary#paged-attention
- Markdown: https://aifordevs.org/glossary/paged-attention.md
- Reuse: Quote or summarize with a link to this page. Terms: https://aifordevs.org/reuse
- Publisher: AI for Devs
