Pair KV-cache eviction and KV-quantization with the situation each one is the right answer for
KV eviction reduces the NUMBER of cached tokens (drop old ones); KV quantization reduces the BYTES per cached token (lower precision).
Imagine a filing cabinet that fills up as a conversation grows. Two ways to make it fit. The first approach throws out old folders to make room, but those folders are gone for good, so anything you needed from them is forgotten. The second approach keeps every folder but writes the contents in a smaller, slightly smudgier font so each folder is thinner. The cabinet is still full of every file, but each file is less detailed. The throwing-out trick is what you want when the cabinet would otherwise overflow forever (a never-ending chat); the smaller-font trick is what you want when the cabinet fits but is still too slow to flip through. You can combine both: throw out old folders AND write the rest in the smaller font.
Detailed answer & concept explanation~7 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: factor the cache as (tokens) * (bytes per token), assign eviction and quantization to each dimension, identify unbounded session versus bounded long context as the selector, and explicitly state that they stack with a StreamingLLM-plus-FP8 example.
| Property | KV eviction | KV quantization |
|---|---|---|
| Dimension reduced | Number of cached tokens | Bytes per cached token |
| Right workload | Unbounded session length | Bounded but long context |
| Quality failure mode | Hard cliff: evicted tokens are gone | Soft slope: all tokens slightly noisy |
| Typical 2026 recipe | StreamingLLM sink plus sliding | FP8 with per-channel calibration |
| Saving | Bounded cache size regardless of session length | 2x at FP8, 4x at INT4 |
| Stacks with the other? | Yes | Yes |
Real products, models, and research that use this idea.
- vLLM ships both FP8 KV quantization and configurable eviction policies (sliding window, StreamingLLM-style sinks) as orthogonal flags.
- SGLang's long-session serving for chat agents combines FP8 KV with attention-sink retention to handle multi-hour conversations without OOM.
- Claude Opus 4.7's deployed long-context handling uses KV quantization plus aggressive prefix caching to make 200k-token contexts economically tractable.
- TensorRT-LLM exposes per-layer KV quantization (FP8, INT8) as a build-time option, with eviction handled at the runtime scheduler level.
- H2O (Heavy-Hitter Oracle) and SnapKV introduced importance-based eviction policies that retain the most-attended tokens within a fixed budget, used in research-grade long-context stacks.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy do attention sinks form on the first few tokens, and what happens if you evict them?
QHow does importance-based eviction (H2O, SnapKV) differ from sliding window?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating the two as competing techniques. They attack different dimensions of the cache (token count versus bytes per token) and stack cleanly: a long-session production setup often runs FP8-quantized KV with a StreamingLLM-style sink plus sliding eviction policy.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.