# AutoCache: Agentic Search for LLM Prefix Cache Compression

> AutoCache uses coding agents to search for compressors tailored to an LLM's prefix cache, including recurrent state. On Qwen3.5-9B RULER-32K, it reached 291.1× KV compression at about 95% retained accuracy, versus 16.0× for KVTC.

- arXiv: https://arxiv.org/abs/2612.03651
- Authors: Chi-Chih Chang, Chien-Yu Lin, Yahya Emara, Ziang Song, Zihao Lin, Xilai Dai, Xuan Kelvin Zou, Kai-Chiang Wu, Carole-Jean Wu, Yang Song, Qifan Wang, Ziheng Jiang, Mohamed S. Abdelfattah
- Published: 2026-12-03
- Topic: Inference & systems
- Visual carousel: https://instaxiv.com/p/2612.03651
- Explanation by InstaXiv, a secondary educational summary. Cite the original paper for exact results. InstaXiv is not affiliated with or endorsed by arXiv or Cornell University.

## Can Qwen3.5-9B's KV cache shrink 291.1× at ~95% retained accuracy?

**291.1×** KV ratio vs KVTC's 16.0×, RULER-32K

## Why cache reuse needs compression

**A cache hit:** A hit reuses a shared prefix's saved model state, skips prefill, and can lower time to first token.

**When storage fills:** 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

![Figure 3](https://cdn.instaxiv.com/figures/2612.03651/figure3.webp)

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. (Figure 3)

## Compression is a constrained search

$$
\begin{gathered}\phi^{\star}=\arg\max_{\phi}\;R(\phi)\\\text{s.t.}\quadAcc(\phi)\ge A_{\min},\qquadB(\phi)\ge B_{\min}\end{gathered}
$$

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(\phi)$: Original bytes divided by all stored bytes
- $Acc(\phi)$: Task accuracy after resuming from reconstructed state
- $B(\phi)$: 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

| Method | KV ratio | RULER Avg. (%) |
| --- | --- | --- |
| Uncompressed | 1.0× | 96.0 |
| KVTC (strongest baseline) | 16.0× | 96.0 |
| **AutoCache (18.2× vs KVTC)** | **291.1×** | **91.6** |

_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

| Method | Best ratio at 20 h |
| --- | --- |
| Plain | 22.7× |
| + Dev eval | 50.9× |
| + Data/weights | 67.6× |
| All | 77.6× |
| **All + ε-greedy (1.5× vs All)** | **116.8×** |

_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

**Leave recurrence raw:** On Qwen3.5-9B RULER-32K, compressing KV but leaving recurrent state uncompressed capped the whole-cache ratio at 19.0×.

**Compress recurrent state too:** 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

![Figure 12](https://cdn.instaxiv.com/figures/2612.03651/figure12.webp)

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. (Figure 12)

## 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.

## Key takeaways

- 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?

## Links

- arXiv: https://arxiv.org/abs/2612.03651
- PDF: https://arxiv.org/pdf/2612.03651

## Citation

```bibtex
@article{chang2026autocache,
  title   = {AutoCache: Agentic Search for LLM Prefix Cache Compression},
  author  = {Chang, Chi-Chih and Lin, Chien-Yu and Emara, Yahya and Song, Ziang and Lin, Zihao and Dai, Xilai and Zou, Xuan Kelvin and Wu, Kai-Chiang and Wu, Carole-Jean and Song, Yang and Wang, Qifan and Jiang, Ziheng and others},
  journal = {arXiv preprint arXiv:2612.03651},
  year    = {2026},
  url     = {https://arxiv.org/abs/2612.03651}
}
```
