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

用于高效视觉-语言推理的 Cross-Self KV 缓存剪枝

Cross-Self KV Cache Pruning for Efficient Vision-Language Inference

The University of Sydney(悉尼大学);School of Computer Science(计算机学院)

Xiaohuan Pei, Tao Huang, Chang Xu

AI总结:

针对视觉-语言模型中 KV 缓存剪枝受模态分布差异影响而误删关键视觉 token 的问题,本文提出免训练的 CSP,通过模态内/模态间注意力分解与 n-softmax 实现高效稳定推理。

摘要:

KV 缓存剪枝已成为一种很有前景的技术,可降低长上下文自回归生成中的内存和计算成本。现有面向视觉-语言模型(VLM)的方法通常依赖大型语言模型(LLM)的自注意力分数来识别并剪枝无关 token。然而,这些方法忽视了模态之间固有的分布差异,往往导致 token 重要性估计不准确,并对关键视觉 token 造成过度剪枝。为解决该问题,我们提出将注意力分数分解为模态内注意力(同一模态内部)和模态间注意力(跨模态),通过独立管理这些不同的注意力类型,实现更精确的 KV 缓存剪枝。此外,我们引入 n-softmax 函数,以抵消剪枝造成的分布偏移,保持注意力分数原本的平滑性并确保稳定性能。我们最终的免训练方法 Cross-Self Pruning(CSP)在与使用完整 KV 缓存的模型相比时取得了具有竞争力的性能,同时显著优于以往的剪枝方法。在涵盖 29 个多模态数据集的基准 MileBench 上进行的大量评估证明了 CSP 的有效性:在对话式具身对话等具有挑战性的任务上实现最高 41% 的性能提升,同时将 KV 缓存预算降低 13.6%。代码可在 https://github.com/TerryPei/CSP 获取。

英文摘要:

KV cache pruning has emerged as a promising technique for reducing memory and computation costs in long-context auto-regressive generation. Existing methods for vision-language models (VLMs) typically rely on self-attention scores from large language models (LLMs) to identify and prune irrelevant tokens. However, these approaches overlook the inherent distributional discrepancies between modalities, often leading to inaccurate token importance estimation and the over-pruning of critical visual tokens. To address this, we propose decomposing attention scores into intra-modality attention (within the same modality) and inter-modality attention (across modalities), enabling more precise KV cache pruning by independently managing these distinct attention types. Additionally, we introduce an n-softmax function to counteract distribution shifts caused by pruning, preserving the original smoothness of attention scores and ensuring stable performance. Our final training-free method, \textbf{C}ross-\textbf{S}elf \textbf{P}runing (CSP), achieves competitive performance compared to models with full KV caches while significantly outperforming previous pruning methods. Extensive evaluations on MileBench, a benchmark encompassing 29 multimodal datasets, demonstrate CSP's effectiveness, achieving up to a 41\% performance improvement on challenging tasks like conversational embodied dialogue while reducing the KV cache budget by 13.6\%. The code is available at https://github.com/TerryPei/CSP

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

↑