AutoCache: Agentic Search for LLM Prefix Cache Compression
Chang et al. in Inference & systems
Can Qwen3.5-9B's KV cache shrink 291.1× at ~95% retained accuracy?
AutoCache: Agentic Search for LLM Prefix Cache Compression
Why cache reuse needs compression
A hit reuses a shared prefix's saved model state, skips prefill, and can lower time to first token.
Finite memory forces eviction and later recomputation. AutoCache searches for model- and workload-specific compressors to fit more reusable state in the same budget.
The search designs the compressor

Agents implement and locally test compress()/decompress(), with limited development feedback. The controller independently measures restore bandwidth and validation accuracy, logs results, and steers exploration versus refinement.
Compression is a constrained search
The search maximizes original-to-stored size while keeping restored task accuracy and restore bandwidth above their floors, set to 10 GB/s in every campaign.
- R(ϕ)
- Original bytes divided by all stored bytes
- Acc(ϕ)
- Task accuracy after resuming from reconstructed state
- B(ϕ)
- Original bytes restored per unit of decompression time
One Qwen recipe stacks complementary savings
- 1
Join all layers
One basis across Qwen3.5-9B's eight full-attention layers' keys/values gave 86.5% RULER average accuracy at 16×, versus xKV's 46.7%; the rest was fixed.
- 2
Balance scale and key norms
Centering/scaling lifted accuracy to 92.0%; adding key-norm restoration reached 95.5%, still at 16×.
- 3
Predict and code
Predict each token's coefficients from two predecessors and two earlier matches; quantize residuals and entropy-code frequent small integers.
- 4
Patch and factor state
Patch high-error tokens; represent recurrent state separately in low-rank form.
Compare with the strongest KV baseline
Qwen3.5-9B RULER-32K held-out test; KV ratio includes overhead. Macro accuracy: 91.6 vs 96.0 uncompressed (about 95% retained).
Model access, feedback, and exploration all help
Qwen3.5-9B RULER-32K; 10 iterations (~20 h). Plain lacks both; +Dev and +Data/weights add one each; All has both; ε-greedy assigns parents.
Once KV shrinks, the rest can bottleneck
On Qwen3.5-9B RULER-32K, compressing KV but leaving recurrent state uncompressed capped the whole-cache ratio at 19.0×.
Joint compression raised the whole-cache ratio to 222.6× at comparable accuracy. The convolution state remains lossless, so the total-cache ratio stays below KV-only.
A small uncompressed component can dominate after KV shrinks.
Cache error flagged the needle in one case

Compare the error trace with patched-token text below. Patch selection uses cache reconstruction error only; in one RULER single-needle example, it covered 20 of 23 needle tokens while patching 72 of 30,720 overall.
What these results don't yet establish
Synthetic shortcut
In one RULER single-needle example, cache statistics flagged the needle; the authors warn this exposes a weakness in synthetic long-context evaluation.
Cross-workload scope
At ~95% retained accuracy, AutoCache beat the strongest baseline on all eight model-task pairs across four models at 32K; MRCR was harder to compress than RULER.
End-to-end TTFT
A 10 GB/s restore floor is enforced, but AutoCache's effect on real-trace cache-hit rate and end-to-end TTFT is not reported.
Lossless tail
In Qwen3.5-9B's top-RULER compressor, convolution state stays lossless: 0.1% of original bytes but 25% of stored bytes.
Why it matters
- Once KV shrinks, recurrent or losslessly stored state can set the cache's remaining size.
- For capacity-bound serving, co-design compression across KV and recurrent or sliding-window state, with quality and restore-bandwidth floors.
- Can these recipes raise cache-hit rates and lower TTFT on real traces beyond the two 32K benchmarks?
11 slides, 3 min
2 days ago