the.ai

Inference / Memory

verified

Paged Attention

A KV cache has to be contiguous, and nobody knows how long a sequence will get, so servers reserve the maximum up front. Most of that is never used. Paged attention borrows virtual memory: the cache lives in fixed-size blocks that need not be adjacent, allocated as the sequence actually grows.

Viz primitive · budget-splitblock = 16

block holds 50% of the budget; rest holds the remaining 50%.

Share of reserved cache actually holding tokens against the slack beside it. Drag the block size to trade fragmentation against bookkeeping.

16

Reviewed by opendroid · 2026-08-04

  • arXiv:2309.06180 — Efficient Memory Management for Large Language Model Serving with PagedAttention