the.ai

Inference / Memory

verified

KV Cache

Generating a token requires attending to everything before it. Without a cache, each new token would recompute the keys and values for the entire prefix — work already done, and done again for every token. The cache keeps them, turning quadratic regeneration into a single step per token.

Viz primitive · budget-splitcontext = 4096

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

Share of accelerator memory taken by the cache against the weights beside it. Drag the context length to watch the cache overtake the model itself.

4096

Reviewed by opendroid · 2026-08-17

  • arXiv:1911.02150 — Fast Transformer Decoding: One Write-Head is All You Need
  • arXiv:2309.06180 — Efficient Memory Management for Large Language Model Serving with PagedAttention
  • arXiv:2305.13245 — GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints