Latent Compaction with Test-Time Training
Not on the map. Why?
Abstract (arXiv)
Long contexts enlarge key--value (KV) caches, increasing memory use and attention costs during generation. Compressing these caches must preserve information for unseen questions. We introduce **Latent Compaction**, which learns a compact document-specific cache through test-time training. We initialize cache entries using reconstruction importance, teacher attention, and key-space diversity. Training first fits attention outputs and log-normalizers to those of the full cache, with reconstruction-selected entries held fixed. It then jointly optimizes the entire cache through end-to-end distillation from the full-cache model. Model weights remain frozen throughout, and training uses only generic prompts about the document, without access to downstream questions or answers. Experiments on RULER, LongBench, and Phonebook Lookup demonstrate substantial gains over budget-matched compression baselines. On a RULER, for example, our method achieves 96.7% accuracy at 32× compression, compared with 40.0% for KVZip+. The method also transfers across model scales and families, with retrieval gains on both Qwen3 and MiniCPM5. These results show that treating the KV cache as a neural network and optimizing it with test-time training can preserve retrieval accuracy under aggressive compression. The code is released at https://www.github.com/THUNLP/latent-compaction
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 15 of its 23 references that are in the map. First posted on arXiv 14 Oct 2026.
Builds on
15 of 23 references.
References · 15
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2024KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cachecited by 637
- 2023Adapting Language Models to Compress Contextscited by 356
- 2024Learning to (Learn at Test Time): RNNs with Expressive Hidden Statescited by 355
- 2024Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM Inferencecited by 235
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
- 2023In-context Autoencoder for Context Compression in a Large Language Modelcited by 199
- 2025KVzip: Query-Agnostic KV Cache Compression with Context Reconstructioncited by 95
- 2023Test-Time Training on Nearest Neighbors for Large Language Modelscited by 88
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Fast KV Compaction via Attention Matching
- 2025Compactor: Calibrated Query-Agnostic KV Cache Compression with Approximate Leverage Scores
- 2026Still: Amortized KV Cache Compaction in a Single Forward Pass
- 2024Not All Heads Matter: A Head-Level KV Cache Compression Method with Integrated Retrieval and Reasoning
- 2025Key, Value, Compress: A Systematic Exploration of KV Cache Compression Techniques
- 2026PuzzleKV: Page-Wise Low-Rank Decomposition for KV Cache Compression
- 2024RazorAttention: Efficient KV Cache Compression Through Retrieval Heads
- 2024Training-Free Exponential Context Extension via Cascading KV Cache