PagedAttention
Category: Generative AI / LLM
A memory management technique for LLM inference that stores the attention key-value cache in non-contiguous memory blocks, reducing waste and enabling more concurrent requests.
Full Explanation
PagedAttention is an innovative memory management approach for the key-value (KV) cache used during LLM inference, inspired by virtual memory and paging in operating systems. During autoregressive generation, each sequence requires a KV cache that grows with each generated token. Traditional approaches allocate contiguous memory for the maximum possible sequence length, wasting memory on unused space. PagedAttention instead divides the KV cache into fixed-size blocks (pages) that can be stored anywhere in GPU memory, with a page table tracking their locations. This eliminates memory fragmentation and over-allocation, typically reducing KV cache memory waste from 60-80% to near zero. PagedAttention also enables efficient memory sharing for parallel sampling and beam search through copy-on-write mechanisms. Introduced by vLLM, PagedAttention has been adopted by multiple inference frameworks and is considered a fundamental optimization for LLM serving.
Related Terms
More in Generative AI / LLM
Explore More
- AI Tools Library — Discover AI tools related to PagedAttention
- AI Education — Courses to learn about Generative AI / LLM
- AI News — Latest news and updates