PagedAttention: Mathematical Foundations, Virtual Memory Block Allocation, Non-Contiguous KV-Cache Management, and Prefix Sharing Dynamics
PagedAttention is an attention algorithm and memory management architecture designed to eliminate memory waste and fragmentation in autoregressive Large Language Model (LLM) serving. Introduced by researchers at UC Berkeley and published at SOSP 2023 alongside the vLLM serving engine, PagedAttention adapts the classic operating system principles of virtual memory, paging, and copy-on-write to the management of dynamic Key-Value (KV) caches in GPU High Bandwidth Memory (HBM). During autoregressi















