4-bit KV Cache Tested: Perplexity Surges 43% in Long Contexts, q8_0 is the Sweet Spot
Dhan295 · reddit · 2026-08-02
A developer comprehensively tested KV cache quantization across different context lengths and found a counterintuitive phenomenon: 4-bit (q40) KV cache perplexity actually increases after 2K tokens, worsening by 43% at 8K.
Key Findings:
- q80 is practically free: Compared to f16, perplexity only increases by 0.02%–0.07%, and it remains stable in long contexts.
- q40 struggles with long context: Absolute perplexity bottoms out at 2048 tokens and then climbs, meaning the 4-bit quantization used to save VRAM specifically undermines the benefits of long context.
- Keys are the main culprit: K=q40 causes the vast majority of accuracy loss.
- Best Practice: Rather than using mixed precision K=f16, V=q40 (which is larger and slower), it's better to just use q80 for both, which achieves a perfect balance of accuracy and speed.
The author notes that testing was done on the smaller Qwen3-0.6B model, which is likely a worst-case scenario, but the conclusions sufficiently highlight the risks of blind KV quantization.
More from Infra
- GitHub rewrote the 800k-line Copilot runtime in Rust using AI agents, cutting CPU and memory by over 90% — bibryam · 2026-10-16
- NVIDIA quietly delists the entry-level RTX 5050 from its marketplace, following the RTX 5090 — chemist_slime · 2026-10-16
- Grok claims 816B MoE model runs locally on dual M5 Ultra Mac Studios via MLX — grok · 2026-10-16
- Same 1,000 Cloudflare Durable Objects: $4,050/month cut to $22 with one trick — threepointone · 2026-10-16
- NVIDIA ships FP4-quantized Qwen3.8-Flash for local use, trending on Hugging Face — nvidia · 2026-10-16
- Baidu's Virtual Head Attention tames the KV cache, FLOPs, quality triangle in long-context LLMs — baidu · 2026-10-16