Explainer: how the KV cache makes ChatGPT faster — and memory-hungry
udmrzn · x · 2026-12-01
A thread breaking down how Transformers generate text: input is split into tokens, embedded as vectors, and attention heads compare each token against earlier ones with learned weights, layer by layer, until the next token is predicted. To speed things up, models store earlier attention results in a KV cache and reuse them — but the cache grows with conversation length, eating memory. The piece covers two mitigation strategies: letting multiple heads share stored data, and compressing the cache. Based on the "Understanding Transformers" paper explainer.
More from Infra
- Google AI Pro includes a 96GB RTX 6000 Blackwell via Colab MCP that Claude Code can drive — Yamapama · 2026-12-01
- 196k-path stress test: debt-loaded GPU data centers are AI finance's weakest link, not Nvidia — tohangout · 2026-12-01
- Nvidia to require geolocation tracking on chips for non-US clouds, days after Huang called it infeasible — peterwildeford · 2026-12-01
- Arm and Meta launch ExecuTorch Developer Days to bring PyTorch models on-device — PyTorch · 2026-12-01
- Reflection AI launches Project Iris; vLLM blocks cyber attacks before the first token — VoidAsuka · 2026-12-01
- Anthropic's Capability Gains per R&D Dollar Fell to 0.31x as Spending Grew 6.19x, Analysis Finds — soumitrashukla9 · 2026-12-01