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

自适应质量分段KV压缩用于长上下文推理

Adaptive Mass-Segmented KV Compression for Long-Context Reasoning

Shanghai Jiao Tong University(上海交通大学);Institute of Digital Twin, Eastern Institute of Technology(数字孪生研究院,东部技术研究所)

Junzhe Yang, Xiaoyu Shen

AI总结:

提出自适应质量分段(AMS)KV压缩框架,通过区域感知配额分配替代全局Top-k选择,防止推理块被过度驱逐,从而保持逻辑连贯性。

摘要:

键值(KV)缓存的线性增长是长文本LLM推理中的关键瓶颈。现有的KV压缩方法通过基于重要性分数驱逐令牌来缓解这一问题。然而,我们表明它们依赖全局Top-k选择会触发区域擦除:连续推理块的严重驱逐破坏了逻辑连贯性。为解决此问题,我们提出自适应质量分段(AMS)KV压缩框架,该框架将范式从令牌级竞争转变为区域感知配额分配。AMS根据注意力质量的空间分布自适应地划分KV缓存,确保结构上重要的推理段获得有保障的内存配额。为在迭代解码过程中保持稳定性,引入了基于EMA的平滑机制以防止分段边界的抖动。关键的是,AMS是一个通用的即插即用层,与现有评分器正交。它可以无缝集成到代表性方法中,如TOVA、Expected Attention、KeyDiff、R-KV和TriAttention。AMS还与现代分页KV服务框架(如vLLM)系统兼容,支持高效的收集和压缩KV执行,而不引入额外的稳态注意力开销。在多种任务上的大量实验,包括数学推理(MATH500、AIME、GSM8K)、代码补全、开放域问答和稀疏检索,表明AMS持续减轻结构碎片化并提升模型性能。

英文摘要:

The linear growth of the Key-Value (KV) cache is a critical bottleneck in long-form LLM inference. Existing KV compression methods mitigate this by evicting tokens based on importance scores. However, we show that their reliance on global Top-k selection triggers Region Wipe-out: the severe eviction of contiguous reasoning blocks that derails logical coherence. To address this, we propose Adaptive Mass-Segmented (AMS) KV Compression, a framework that shifts the paradigm from token-level competition to region-aware quota allocation. AMS adaptively partitions the KV cache based on the spatial distribution of attention mass, ensuring structurally vital reasoning segments receive guaranteed memory quotas. To ensure stability during iterative decoding, an EMA-based smoothing mechanism is incorporated to prevent jitter in segment boundaries. Crucially, AMS is a universal plug-and-play layer that is orthogonal to existing scorers. It can be seamlessly integrated into representative methods such as TOVA, Expected Attention, KeyDiff, R-KV and TriAttention. AMS is also system-compatible with modern paged-KV serving frameworks such as vLLM, supporting efficient gather-and-compact KV execution without introducing additional steady-state attention overhead. Extensive experiments across a diverse suite of tasks, including mathematical reasoning (MATH500, AIME, GSM8K), code completion, open-domain QA, and sparse retrieval, demonstrate that AMS consistently mitigates structural fragmentation and boosts model performance.

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

↑