arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.20582cs.CLcs.LG
收藏

结合测试时训练的潜在压缩技术

Latent Compaction with Test-Time Training

Tsinghua University(清华大学)

Yingfa Chen, Xingyu Shen, Chaojun Xiao, Xu Han

AI总结:

该研究针对长上下文 KV 缓存压缩问题,提出 Latent Compaction 方法,通过测试时训练优化缓存,在多数据集上较基线取得显著准确率提升,且可跨模型迁移。

摘要:

长上下文会增大键值(KV)缓存,增加生成过程中的内存使用和注意力成本。压缩这些缓存必须保留针对未见过问题的信息。我们提出**潜在压缩(Latent Compaction)**,该技术通过测试时训练学习特定文档的紧凑缓存。我们利用重建重要性、教师注意力和键空间多样性初始化缓存条目。训练首先使注意力输出和对数归一化器拟合全缓存的对应值,同时保持重建选中的条目固定;随后通过全缓存模型的端到端蒸馏联合优化整个缓存。整个过程中模型权重保持冻结,训练仅使用关于文档的通用提示,无需访问下游问题或答案。在 RULER、LongBench 和 Phonebook Lookup 上的实验表明,与预算匹配的压缩基线相比,该方法取得了显著提升。例如在 RULER 上,我们的方法在 32× 压缩率下达到 96.7% 的准确率,而 KVZip+ 仅为 40.0%。该方法还可跨模型规模和家族迁移,在 Qwen3 和 MiniCPM5 上均实现了检索增益。这些结果表明,将 KV 缓存视为神经网络并通过测试时训练优化,可在激进压缩下保留检索准确率。代码已发布在此 https URL

英文摘要:

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

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑