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
- 4-bit Quantization Yields 10%+ Speedup at Compute and Memory Limits — gajesh · 2026-08-02
- Local Open-Weight AI Models Outpace Moore's Law by 4x on Unchanged Hardware — NielsRogge · 2026-08-02
- Rumor: OpenAI is Signing a Compute Deal with SpaceX — chandan1_ · 2026-08-02
- QuixiAI Open-Sources Model-Optimizer: Unified Model Compression and Inference Acceleration — QuixiAI · 2026-08-02
- QuixiCore Open-Sourced: High-Performance AI Kernel Library for Six Hardware Platforms — QuixiAI · 2026-08-02
- Building a 2400W Multi-GPU Workstation: Reliability of Dual PSU Setups — Generic_Name_Here · 2026-08-02