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

覆盖驱动的KV缓存淘汰策略用于高效且改进的大语言模型推理

Coverage-Driven KV Cache Eviction for Efficient and Improved Inference of LLM

RBC Borealis(RBC 培生)

Shuvendu Roy, Mengyao Zhai, Hossein Hajimirsadeghi, Golnoosh Samei

AI总结:

针对大语言模型推理中KV缓存内存开销大、现有淘汰策略导致长上下文任务性能下降的问题,提出覆盖感知的K-VEC策略,通过跨头跨层覆盖模块提升token保留,在LongBench上最高提升10.35点。

摘要:

大型语言模型(LLM)在问答和摘要等复杂任务中表现出色,这得益于它们处理长上下文输入的能力。然而,部署LLM成本高昂,不仅因为自注意力的二次复杂度和自回归生成的高计算需求,还因为推理期间存储键值(KV)缓存所需的大量内存开销。为降低内存成本,现有的KV缓存淘汰策略利用注意力中的稀疏性选择性地存储一部分token。虽然减少了内存占用,但这种方法在需要长上下文推理的任务中性能显著下降。我们发现性能下降与唯一token覆盖率的降低有关。此外,我们从理论上证明,覆盖率的降低限制了输入和输出之间的互信息,从而损害了预测准确性。为此,我们引入了K-VEC,一种新颖的覆盖感知KV缓存淘汰策略,在淘汰缓存中的token时优先考虑token覆盖率。K-VEC引入了跨头和跨层覆盖模块,以增强跨注意力头和模型层的token保留,减轻低覆盖率导致的性能下降。在16个LongBench子集上的评估表明,在相同淘汰率和内存约束下,K-VEC相比现有方法最高提升10.35个点。全面评估验证了我们方法的有效性,并展示了其在资源受限环境中高效部署LLM的潜力。

英文摘要:

Large language models (LLMs) excel at complex tasks like question answering and summarization, thanks to their ability to handle long-context inputs. However, deploying LLMs is costly, not only due to the high computational demands of quadratic complexity of self-attention and auto-regressive generation, but also because of the significant memory overhead required for storing the key-value (KV) cache during inference. To reduce the memory cost, existing KV-cache eviction strategies leverage the sparsity in attention to selectively store a subset of tokens. While reducing the memory footprint, such approaches show a considerable drop in performance, especially in tasks that require long-context reasoning. We identify that the drop in performance is linked to a reduction in the coverage of unique tokens. Additionally, we theoretically show that reduced coverage limits the mutual information between inputs and outputs, thereby impairing predictive accuracy. To this end, we introduce K-VEC, a novel coverage-aware KV-cache eviction strategy that prioritizes token coverage while evicting tokens in the cache. K-VEC introduces a cross-head and a cross-layer coverage module to enhance token retention across attention heads and model layers, mitigating performance degradation caused by low coverage. Evaluated on 16 LongBench subsets, K-VEC exhibit up to 10.35 points improvement over the existing methods under the same eviction rate and memory constraint. Comprehensive evaluations validate the effectiveness of our approach and demonstrate its potential for efficient LLM deployment in resource-constrained settings.

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

↑