通过压缩视觉-文本相关性的键值缓存,显著提升大模型推理速度。
AirCache: Activating Inter-modal Relevancy KV Cache Compression for Efficient Large Vision-Language Model Inference
- 基于视觉与文本的跨模态相关性,动态筛选重要视觉缓存。
- 仅保留10%视觉缓存,推理延迟降低29%至66%。
- 适合需要高效推理的多模态大模型应用部署。
大型视觉语言模型(LVLMs)因强大的推理与泛化能力备受关注,但处理大量视觉标记并生成长上下文输出带来巨大计算开销,导致键值(KV)缓存占用过高。为解决这一瓶颈,我们提出AirCache,一种新型的KV缓存压缩方法。通过系统分析LVLM注意力机制中视觉与文本标记间的相关性,实证发现缓存中的视觉标记存在显著冗余。通过有策略地剔除这些冗余标记,可在保持模型性能的同时大幅提升上下文生成速度。受此启发,我们设计了一个精英观察窗口,用于评估视觉组件在缓存中的重要性,强化跨模态关联建模与多视角一致性。同时,提出自适应分层预算分配策略,利用标记重要性分布的差异性与偏斜特征,在性能上优于均匀分配。在多个LVLM和基准测试上的全面评估表明,该方法在仅保留10%视觉KV缓存的情况下,仍可达到与完整缓存相当的性能,解码延迟降低29%至66%,且缓存保留率越低,相对优势越明显。
原文摘要 · Abstract (English)
Recent advancements in Large Visual Language Models (LVLMs) have gained significant attention due to their remarkable reasoning capabilities and proficiency in generalization. However, processing a large number of visual tokens and generating long-context outputs impose substantial computational overhead, leading to excessive demands for key-value (KV) cache. To address this critical bottleneck, we propose AirCache, a novel KV cache compression method aimed at accelerating LVLMs inference. This work systematically investigates the correlations between visual and textual tokens within the attention mechanisms of LVLMs. Our empirical analysis reveals considerable redundancy in cached visual tokens, wherein strategically eliminating these tokens preserves model performance while significantly accelerating context generation. Inspired by these findings, we introduce an elite observation window for assessing the importance of visual components in the KV cache, focusing on stable inter-modal relevancy modeling with enhanced multi-perspective consistency. Additionally, we develop an adaptive layer-wise budget allocation strategy that capitalizes on the strength and skewness of token importance distribution, showcasing superior efficiency compared to uniform allocation. Comprehensive evaluations across multiple LVLMs and benchmarks demonstrate that our method achieves comparable performance to the full cache while retaining only 10% of visual KV cache, thereby reducing decoding latency by 29% to 66% across various batch size and prompt length of inputs. Notably, as cache retention rates decrease, our method exhibits increasing performance advantages over existing approaches.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。