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

通过注意力匹配实现快速KV压缩

Fast KV Compaction via Attention Matching

Massachusetts Institute of Technology(麻省理工学院)

Adam Zweiger, Xinghong Fu, Han Guo, Yoon Kim

AI总结:

提出通过注意力匹配在潜在空间快速压缩键值缓存的方法,以保持注意力输出并实现高达50倍压缩且质量损失小。

摘要:

将语言模型扩展到长上下文通常受到键值(KV)缓存大小的瓶颈限制。在实际部署中,长上下文通常通过摘要化在令牌空间中进行压缩管理。然而,摘要化可能高度有损,严重损害下游性能。最近关于Cartridges的工作表明,可以在潜在空间中训练高度紧凑的KV缓存,以紧密匹配全上下文性能,但代价是缓慢且昂贵的端到端优化。本文描述了一种通过注意力匹配在潜在空间中快速上下文压缩的方法,该方法构建紧凑的键和值以再现注意力输出并在每个KV头级别保持注意力质量。我们表明,该公式自然分解为简单的子问题,其中一些子问题允许高效的闭式解。在此框架内,我们开发了一系列方法,显著推动了压缩时间与质量的帕累托前沿,在某些数据集上实现了高达50倍的压缩,且几乎没有质量损失。

英文摘要:

Scaling language models to long contexts is often bottlenecked by the size of the key-value (KV) cache. In deployed settings, long contexts are typically managed through compaction in token space via summarization. However, summarization can be highly lossy, substantially harming downstream performance. Recent work on Cartridges has shown that it is possible to train highly compact KV caches in latent space that closely match full-context performance, but at the cost of slow and expensive end-to-end optimization. This work describes an approach for fast context compaction in latent space through Attention Matching, which constructs compact keys and values to reproduce attention outputs and preserve attention mass at a per-KV-head level. We show that this formulation naturally decomposes into simple subproblems, some of which admit efficient closed-form solutions. Within this framework, we develop a family of methods that significantly push the Pareto frontier of compaction time versus quality, achieving up to 50x compaction in seconds on some datasets with little quality loss.

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

↑