Latent Compaction with Test-Time Training
Abstract
Domain fit: AI-adjacent · Paper appears method- or tooling-adjacent to AI workflows with partial ecosystem coverage.
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$\times$ 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
Results and benchmarks
Long contexts enlarge key--value (KV) caches, increasing memory use and attention costs during generation.
| Task | Dataset | Metric | Value | Source |
|---|---|---|---|---|
| Retrieval / indexing | Latent Compaction | 4K | 87.75 | paper-derived |
Audit each benchmark finding before selecting an implementation path. Evidence refs map to the disclosure below.
Evidence graph: 2 refs, 1 links.
Utility signals: depth 95/100, grounding 68/100, status medium.
Implementation
No direct implementation yet
Maintained implementation evidence is not confirmed for this paper yet.
Use the implementation status and reproduction sections for the current action plan.
No verified maintained repo yet
There is no verified maintained implementation yet. Use this baseline plan to decide whether to prototype now or defer.
- No direct maintained implementation was found. Use the paper PDF and citation graph to design a baseline reproduction.
- Track assumptions and missing details in an experiment log before coding.
Time to first repro: a few days
Recommendation evidence is currently too limited for a maintained-repo choice. Use Implementation Status and Reproduction Path for a practical baseline plan.
- Estimate is based on paper-only reproduction flow
Compare implementation paths
Compare maintenance quality, reproducibility coverage, and evidence confidence before choosing a reproduction baseline.
- Maintenance
- Active
- Confidence
- Medium
- Reproducibility
- Strong
- Stars
- 2
- Last push
- Oct 15, 2026 (15d)
Matched via arXiv identifier search · Strong overlap with paper title keywords
- No tagged releases
- No Docker setup
- Maintenance
- Active
- Confidence
- Medium
- Reproducibility
- Strong
- Stars
- 0
- Last push
- Oct 22, 2026 (8d)
Matched via arXiv identifier search · Strong overlap with paper title keywords
- No tagged releases
- No Docker setup
Reproduction readiness
No repo
No verified implementation available
- No maintained repository has been identified for this paper. Check adjacent implementations or HF artifacts below.
Hardware requirements
- Expect multi-day setup/compute for meaningful reproduction based on current guidance.
Framework baselines
- Hugging Face Transformers training guide
Modern transformer training baseline.
- PyTorch nn.Transformer docs
Reference transformer building block implementation.
Repositories and ecosystem
Official
No additional official repositories detected.
Community
- thunlp/latent-compactionConfidence: Medium
Code for the paper "Latent Compaction with Test-Time Training"
2 stars · 0 forks · Last push Oct 15, 2026 · MIT license
- tatra-labs/cramConfidence: Medium
Cram a long document into a tiny KV cache: test-time training of compact KV caches. At 8x compression, eviction keeps 5% of phonebook lookups; cram keeps 90%. Implements arXiv:2610.20582.
0 stars · 0 forks · Last push Oct 22, 2026 · MIT license
Hugging Face artifacts
No trustworthy direct or curated related Hugging Face artifacts were found yet. Use targeted searches to quickly locate candidate models, datasets, and demos.
Tip: start with models, then check datasets and spaces if you need evaluation data or demos.
Research context
Tasks
Retrieval / indexing
Methods
Transformer
Domains
Information Retrieval
Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.
Open in HFEPXJump to Paper2Code search queries derived from this paper's research context.