Sparse KV-cache index for long-context decoding: 3.2% bytes read at 1M tokens

Simpli-curious · reddit · 2026-11-25

A developer shared a sparse-attention KV-cache index for long-context decoding that reads only a small exact portion of the cache per step and estimates the rest, with cheap incremental insertion and no rebuilds. Results using real Qwen2.5 Q/K/V (CPU): at 32k on Qwen2.5-1.5B with budget 256, error 0.083, needle recall 0.96, 5.2% bytes read—beating Quest (0.337/0.66) and a RetroInfer-style reimplementation (0.154/0.94). At 1M tokens on Qwen2.5-0.5B-Instruct with budget 2048: error 0.145 vs 0.344 (RetroInfer-style) and 0.556 (Quest); 3.2% bytes read at 1M vs 6.5%. Full attention reads 256MB per step at 1M vs 8.3MB for this method; insertion cost stays flat (30–40µs/key in numpy). Author-listed limitations: small models only, no GPU kernel timings yet, baselines are reimplementations, and the 0.5B model fails needle tests beyond 16k–64k even with full attention. Seeking advice on end-to-end evals (RULER/LongBench) and a long-context model that fits 24GB for real 128k–1M tests.

Original post →

More from Infra

Infra channel →