At Scale, KV Cache Becomes a Storage System: How LLMs Serve GBs of Cached State
blaizedsouza · x · 2026-09-10
A technical deep-dive (a popular LLM interview question) on how production LLMs handle gigabytes of KV cache:
- Every attention layer creates KV tensors while processing a prompt; during generation the model reads this state instead of re-processing the sequence for each new token. For a single request it's temporary GPU data.
- But when multiple requests and inference workers reuse the same prompt prefix, cached data must survive after the original request finishes — even after the creating engine restarts.
- A cache hit then requires locating relevant blocks, bringing them back to GPU memory, evicting old blocks, and letting multiple workers share data: the cache effectively becomes a storage system.
- The article explains KV, Prefix, Prompt and Semantic caching from first principles, paired with LMCache (11.7k GitHub stars), an open-source KV cache layer for LLMs.
Related event: Engineer's Deep Dive into KV Cache Compression for LLM Serving(2 posts)→
More from Infra
- Token demand on OpenRouter grew 27x to 165T weekly, open models now serve 72% — FinanceYF5 · 2026-10-28
- AI's unusual bet: buying compute for years, selling intelligence by the token — vaibhavbetter · 2026-10-28
- OpenAI's Will Depue says compute locks in US primacy as 'end of human history' nears — willdepue · 2026-10-28
- Malaysia has overtaken Singapore in data center capacity, planned buildout 10x — bytebot · 2026-10-28
- Why Cloudflare Is the Best Platform to Build AI Agent Operating Systems — ritakozlov · 2026-10-28
- Shared KV memory makes Looped Transformers better and 4.7x cheaper: Cornell/IBM paper — yoavartzi · 2026-10-28