Explain KV cache offloading and cross-request reuse beyond a single GPU's memory. When does loading a cached prefix beat just recomputing prefill?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
GPU HBM only holds a small working set of KV, so blocks get evicted and the next request re-prefills the same prefix from scratch. Offloading adds tiers below HBM: host RAM first, then NVMe, then a shared network tier so any replica can pull a prefix another replica computed an hour ago. LMCache and vLLM's KV connector interface are the common implementations, and the same machinery moves KV from prefill nodes to decode nodes under PD disaggregation.
Full worked answer
GPU HBM only holds a small working set of KV, so blocks get evicted and the next request re-prefills the same prefix from scratch. Offloading adds tiers below HBM: host RAM first, then NVMe, then a shared network tier so any replica can pull a prefix another replica computed an hour ago. LMCache and vLLM's KV connector interface are the common implementations, and the same machinery moves KV from prefill nodes to decode nodes under PD disaggregation.
The decision is a bandwidth comparison: recomputing a prefix costs prefill FLOPs, loading it costs bytes over a link. Work it per model.
kv_bytes_per_token = 320_000 # ~320 KB, 70B-shape model, FP16 KV
link_bw = 50e9 # ~50 GB/s achievable over PCIe Gen5 x16
load_tokens_per_s = link_bw / kv_bytes_per_token # ~156K tokens/s
# prefill for a 70B model is order of a few thousand tokens/s per GPU
Host RAM wins by a wide margin, so offloading to CPU memory almost always beats recompute when the hit is real. NVMe at single-digit GB/s is a closer call, and a network tier closer still. The model architecture flips the answer: MLA-style attention with tiny KV per token makes loading trivially cheap, while a fat-KV model pushes you back toward recompute.
Failure modes worth naming:
- Hit rate is everything. A 20% hit rate means you mostly pay transfer overhead for nothing.
- Interference. Fetch and decompression contend with inference for PCIe bandwidth and SMs, so a naive implementation slows the requests it is trying to help.
- Correctness. The cache key must include model version, quantization, adapter, TP layout and positional handling. Serving KV computed under a different config is a silent quality bug, and it is a classic outage.
Where it pays: multi-turn chat and agents with long stable prefixes, RAG over a repeated corpus, and document Q&A where one long document is queried many times.
What a good answer covers
- GPU HBM only holds a small working set of KV, so blocks get evicted and the next request re-prefills the…
- Offloading adds tiers below HBM
- LMCache and vLLM's KV connector interface are the common implementations, and the same machinery moves…
- The decision is a bandwidth comparison
- Host RAM wins by a wide margin, so offloading to CPU memory almost always beats recompute when the hit…
Key terms: Hit rate is everything · Interference · Correctness
In the glossary: HBM · vLLM · Prefill · Decode · Quantization · RAG
Interviewer follow-ups to expect
What exactly must go into the cache key?
At what hit rate does an NVMe tier stop paying for itself?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep