arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.05971cs.LG
收藏

训练用于KV缓存压缩性的Transformer

Training Transformers for KV Cache Compressibility

University of Oxford(牛津大学);Technion – Israel Institute of Technology(技术ion理工学院);AITHYRA;NVIDIA

Yoav Gelberg, Yam Eitan, Michael Bronstein, Yarin Gal, Haggai Maron

AI总结:

本文提出KV-CAT训练方法,通过训练时的KV稀疏化策略,引导模型学习可压缩的表示,提升下游压缩方法的质量-预算权衡。

摘要:

长上下文语言建模日益受到键值(KV)缓存的限制,其内存和解码时间访问成本与前缀长度线性增长。这一瓶颈推动了多种上下文压缩方法的发展,从基于token的摘要到最近的优化型KV压缩方法。这些事后方法在固定预训练模型的KV缓存上操作,其有效性受限于模型内部表示的压缩能力。本文正式化了KV压缩性的概念,证明其是学习到的表示属性,而非上下文本身。我们证明几乎任何序列到向量函数均可具有高度可压缩和本质上不可压缩的Transformer实现,强调需要在训练期间引导Transformer学习可压缩的表示。受此启发,我们提出KV-Compression Aware Training(KV-CAT),一种持续预训练过程,激励可压缩表示的出现。我们引入一种训练时的KV稀疏化策略,在训练期间掩码KV槽位。这迫使模型使用更少的KV槽位,并鼓励其学习适合事后压缩的表示。实证表明,KV-CAT在检索、长上下文问答和基于压缩前缀延续的困惑度评估中,提升了下游压缩方法的质量-预算权衡。

英文摘要:

Long-context language modeling is increasingly constrained by the Key-Value (KV) cache, whose memory and decode-time access costs scale linearly with the prefix length. This bottleneck has motivated a range of context-compression methods, from token-level summarization to recent optimization-based KV compression methods. These post-hoc methods operate on the KV cache of a fixed pretrained model, so their effectiveness is fundamentally limited by how well the model's internal representations can be compressed. In this work, we formalize the notion of KV compressibility and show that it is a property of the learned representations, rather than of the context alone. We prove that almost any sequence-to-vector function admits both highly compressible and inherently non-compressible transformer implementations, highlighting the need to guide transformers toward compressible representations during training. Motivated by this, we propose KV-Compression Aware Training (KV-CAT), a continued pretraining procedure that incentivizes the emergence of compressible representations. We introduce a train-time KV sparsification policy that masks KV slots during training. This forces the model to use fewer KV slots and encourages it to learn representations amenable to post-hoc compression. Empirically, we show that KV-CAT improves the quality-budget tradeoff of downstream compression methods across retrieval, long-context question answering, and perplexity-based evaluation of compressed-prefix continuation.

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

↑