arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.00570cs.CLcs.AI
收藏

FreqKV: 频域中的键值压缩用于上下文窗口扩展

FreqKV: Key-Value Compression in Frequency Domain for Context Window Extension

LUMIA Lab, Shanghai Jiao Tong University(上海交通大学LUMIA实验室);Huawei Noah’s Ark Lab(华为诺亚实验室);Shanghai Jiao Tong University(上海交通大学);Shanghai Innovation Institute(上海创新研究院)

Jushi Kai, Yixuan Wang, Boyi Zeng, Haoli Bai, Bo Jiang, Ziwei He, Zhouhan Lin

AI总结:

FreqKV通过频域键值压缩技术,实现长上下文处理,使LLaMA-2-7B的上下文窗口扩展至256K个令牌,同时保持稳定的困惑度。

摘要:

现有用于大型语言模型(LLMs)的键值(KV)缓存压缩方法通常依赖于令牌驱逐,这在长前填充和解码场景中可能会导致关键局部信息的丢失。当超出预训练上下文长度进行外推时,它们在长上下文基准测试中的性能急剧下降。受频域中上下文信息集中在低频成分的观察启发,我们提出了FreqKV,一种无参数且架构无关的方法。它迭代地在频域中压缩增长的KV缓存,使模型能够高效地处理长上下文。在8K长度上进行最小训练,FreqKV将LLaMA-2-7B的上下文窗口扩展到256K个令牌,同时保持稳定的困惑度。在预填充和解码的广泛实验中,FreqKV证明了鲁棒的上下文窗口扩展,并在LLaMA-2和LLaMA-3上一致优于现有KV缓存压缩方法,突显了其在长上下文理解和生成中的有效性。

英文摘要:

Existing key-value (KV) cache compression methods for large language models (LLMs) often rely on token eviction, which risks losing critical local information in both long prefilling and decoding scenarios. When extrapolating beyond the pretrained context length, their performance degrades sharply on long-context benchmarks. Motivated by the observation in the frequency domain that the context information is concentrated in the low-frequency components, we propose FreqKV, a parameter-free and architecture-agnostic approach. It iteratively compresses the increasing KV cache in the frequency domain, allowing models to process lengthy contexts efficiently. With minimal training at 8K length, FreqKV extends the context window of LLaMA-2-7B up to 256K tokens while maintaining stable perplexity. Extensive experiments across prefilling and decoding demonstrate that FreqKV enables robust context window extension and consistently outperforms existing KV cache compression methods on LLaMA-2 and LLaMA-3, highlighting its effectiveness for both understanding and generation in long contexts.

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

↑