# PagedAttention

- **Canonical URL:** https://getaimath.com/dictionary/pagedattention/
- **Topics:** [LLM Inference: Prefill & Decode](https://getaimath.com/dictionary/category/llm-inference-prefill-and-decode/)
- **Last updated:** 2026-11-25

## What is PagedAttention?

**In one sentence:** PagedAttention is a way to store the KV cache in small fixed-size blocks, like pages in a book, to avoid wasting memory.

Without it, servers reserve one big chunk of memory per request, much of which goes unused. PagedAttention hands out small pages only as needed and can share pages between requests. It was introduced by vLLM.

![How an AI Replies: 1. Read Your Question → 2. Type the Answer — Simple two-step cartoon: Step 1 (Prefill) shows the AI scanning your entire question in one flash (causing the brief pause before it starts talking); Step 2 (Decode) shows it typing out the reply one word at a time.](https://getaimath.com/diagrams/llm-inference-prefill-and-decode.png)
*Napkin Diagram (LLM Inference: Prefill & Decode): Every AI reply has two halves: gulping down your whole prompt at once, then speaking the answer one word at a time.*

## What is an example of PagedAttention?

Two users sending the same long system prompt can share the same KV cache pages.

## Why does PagedAttention matter?

PagedAttention lets servers handle many more users at once.

## Related Concepts

- [KV Cache Quantization](https://getaimath.com/dictionary/kv-cache-quantization/): KV cache quantization stores the KV cache in fewer bits to save memory.
- [Continuous Batching](https://getaimath.com/dictionary/continuous-batching/): Continuous batching lets a server add new requests to a running batch as soon as others finish, instead of waiting for the whole batch.
- [KV Cache Size](https://getaimath.com/dictionary/kv-cache-size/): KV cache size is how much memory the KV cache needs, which grows with context length, layers, heads and number of users.
- [Static Batching](https://getaimath.com/dictionary/static-batching/): Static batching groups requests together and runs them as one fixed batch until all of them are finished.
- [Value Cache](https://getaimath.com/dictionary/value-cache/): The value cache is the part of the KV cache that stores the values for all previous tokens.
- [Dynamic Batching](https://getaimath.com/dictionary/dynamic-batching/): Dynamic batching waits a short moment to collect incoming requests and then runs them together as a batch.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/pagedattention/)
