The shelves fill before the users do
The workshop speaker works the numbers for a 7-billion-parameter model: each token costs 131 KB, 80 users at 4K context need 42 GB, and a 24 GB card is out of room. More users means a shorter context, or the answers are cut. Harshul Jain, AI Engineer, Sep 8, 2026
LessonCount the cache per user before promising users; then page, squeeze, offload or shorten.
Raising reasoning effort mid-task throws the cache away
In GLM-5.3-Flash the chat template writes the reasoning effort into the very first system block, ahead of the tools and conversation, so changing it from low to high makes the next request differ at almost the first token and the whole session is processed again, on a long run hundreds of thousands of tokens. Ollama blog, Nov 16, 2026
LessonPick an effort level at the start and keep it; start a fresh session or compact first if more thinking is needed.
Data-parallel attention hides the cache from the router
Serving MiniMax M3 on GB200 with data-parallel attention (TP4/EP4/DPA) at concurrency 32, only 28.8% of prompt tokens hit the cache against 96.0% theoretically, and throughput was 0.60x of plain TP4 at over 3x the p90 time to first token. Each data-parallel rank owns its own part of the pool, so a session landing on a different rank recomputes everything. SemiAnalysis, Aug 24, 2026
LessonCount each rank's cache as separate: route sessions to the rank that holds them, or skip data-parallel attention when sessions are long.
Short-lived window pages push out the durable prefix
In models with sliding-window attention, window pages and prefix pages come from one pool; the window turns over constantly while the prefix sits still, so under pressure the transient allocation displaces the durable one. Subagent bursts do the same to the main agent's cache when eviction is not tuned. SemiAnalysis, Aug 24, 2026
LessonKeep long-context checkpoints out of reach of window allocations (retain them selectively).
One sequence slot means one user
In the early DeepSeek V4 days an AMD engine hardcoded its cache to a single sequence slot, so a second concurrent request had nowhere to store its KV state; the batching machinery was not in place, so only batch size one could be benchmarked. SemiAnalysis, Jun 9, 2026
LessonCheck that the cache allocator hands out per-request slots or blocks before trusting a concurrency result.
A latent-attention model run as plain multi-head attention
A thread on GLM-4.7-Flash (30B-A3B, built on MLA to keep the cache small) asked why vLLM reported about 1 MB per token of context while a first-principles estimate was 54 KB: an MLA model run in a naive MHA regime stores the full keys and values and the cache explodes, so the 200k context that fits on paper does not fit. AINews, Jan 20, 2026
LessonCheck the engine's reported cache per token against the architecture's own figure before sizing a deployment.
A stuck connection keeps its blocks
A client that gives up but leaves its connection open keeps the GPU memory of its cache, because the server frees it only when the request finishes or the client disconnects. Harshul Jain, AI Engineer, Nov 9, 2026
LessonClose the connection when you give up, and admit work by what its cache will take.
An engine crash loses the cache and takes minutes to refill
When one of two GLM-5.2 workers was killed, a cold restart (load weights, size the KV cache, tune, capture CUDA graphs) took 283 seconds while the other worker absorbed all traffic. A preinitialized shadow engine took 7.3 seconds, but the KV cache is not yet preserved: the shadow materializes an empty cache and rebuilds it as traffic arrives. NVIDIA, Aug 25, 2026
LessonPlan for the cache to be lost with the engine process; keep a warm standby and expect extra prefill after failover.
Something that changes every turn sits at the top of the prompt
A harness that re-renders the system prompt with fresh values each turn (a current timestamp, the git status, a moving working directory) makes every turn a full re-read. Values fixed per session but different across sessions (user name, start date) do not hurt that session but stop new sessions from reusing a cached setup. Ollama blog, Nov 16, 2026
LessonKeep the system prompt identical everywhere and put such values in the task message, once.
A tool-call pause evicts the whole prefix
Under plain LRU, an agent that waits 2-30 seconds for a tool lets its blocks age out while other traffic fills the cache; when it resumes, the entire prefix is recomputed. LRU sees only recency, not that system prompts are reused every turn and reasoning tokens never. NVIDIA, Apr 17, 2026
LessonPin the prefix for the expected pause (a TTL), or give blocks a priority so low-value blocks go first.
KV Cache, explained: how it works, part by part, with all 14 failure stories.