Skip to main content
QUICK REVIEW

[论文解读] Beyond Text-Visual Attention: Exploiting Visual Cues for Effective Token Pruning in VLMs

Qizhe Zhang, Aosong Cheng|arXiv (Cornell University)|Dec 2, 2024
Retinal Imaging and AnalysisMedicine被引用 3
一句话总结

该论文提出FasterVLM,一种无需训练的视觉标记剪枝方法,通过利用视觉编码器中[CLS]标记的注意力机制,而非依赖大语言模型中不准确的图文交叉注意力,来提升视觉语言模型的推理效率。通过早期剪枝不重要的视觉标记,FasterVLM在保留LLaVA-1.5-7B模型90%性能的同时,实现95%的标记减少,显著优于现有方法在高剪枝比例下的表现。

ABSTRACT

Large vision-language models (LVLMs) generally contain significantly more visual tokens than their textual counterparts, resulting in a considerable computational burden. Recent efforts have been made to tackle this issue by pruning visual tokens early within the language model. Most existing works use attention scores between text and visual tokens to assess the importance of visual tokens. However, in this study, we first analyze the text-visual attention in the language model and find that this score is not an ideal indicator for token pruning. Based on the analysis, We propose VisPruner, a plug-and-play method that utilizes visual cues for more effective token pruning in LVLMs. Specifically, we first use visual attention to select a limited number of significant tokens. Then, we remove duplicate tokens from the remaining ones based on their similarity. By retaining diverse tokens alongside the initially selected important tokens, we maximally preserve the visual information of the input image. Experimental results demonstrate that our VisPruner sustains strong performance across various VLM architectures and reduction ratios, significantly outperforming existing methods based on text-visual attention. Notably, without any training, VisPruner can reduce the FLOPs of LLaVA-1.5-7B by 91% and inference latency by 75%, while maintaining comparable performance. Our code is available at https://github.com/Theia-4869/VisPruner.

研究动机与目标

  • 为解决当前视觉语言模型因过多视觉标记导致的推理效率低下问题,这些标记在推理过程中增加了计算开销。
  • 识别现有基于图文注意力的剪枝方法在高剪枝比例下性能下降的根本原因。
  • 通过利用视觉编码器中[CLS]标记的注意力机制,开发一种更准确、无需训练的视觉标记剪枝方法。
  • 通过在视觉标记进入大语言模型前进行剪枝,确保与FlashAttention的兼容性,从而最大化推理速度。
  • 在多种视觉语言模型架构(包括LLaVA-1.5、LLaVA-NeXT和Video-LLaVA)上展示方法的泛化能力。

提出的方法

  • FasterVLM利用视觉编码器中[CLS]标记与图像标记之间的注意力权重来评估视觉标记的重要性,其准确性高于大语言模型中的图文注意力。
  • 在视觉标记被大语言模型处理前,剪枝[CLS]注意力分数最低的视觉标记,从而在流水线早期消除冗余计算。
  • 该方法无需训练,完全在视觉编码器内运行,因此与FlashAttention等优化注意力机制兼容。
  • 该方法避免了大语言模型中基于图文注意力固有的注意力偏移和分散问题,这些问题会导致标记重要性与实际任务相关性错位。
  • 剪枝基于视觉编码器中的全局注意力机制,提供更集中且可靠的标记重要性评分。
  • 该方法已应用于多种视觉语言模型,包括LLaVA-1.5、LLaVA-NeXT和Video-LLaVA,证明了其广泛适用性。

实验结果

研究问题

  • RQ1为何现有基于图文注意力的剪枝方法在高标记剪枝比例下性能显著下降?
  • RQ2[CLS]标记在视觉编码器中的注意力能否作为比大语言模型中基于图文注意力更准确、更稳定的视觉标记重要性指标?
  • RQ3基于[CLS]注意力剪枝视觉标记是否能在视觉语言模型推理中实现更优的性能与效率权衡?
  • RQ4该方法是否可普遍应用于不同视觉语言模型架构而无需微调?
  • RQ5当与FlashAttention集成时,该方法在效率和准确性方面表现如何?

主要发现

  • FasterVLM在保留原始LLaVA-1.5-7B模型90%性能的同时,实现了95%的视觉标记减少,显著优于现有方法在高剪枝比例下的表现。
  • 在10项基准测试中,FasterVLM在9项任务上优于其他方法,在剩余1项任务上表现相当,剪枝比例为90%。
  • 在LLaVA-1.5-7B上,FasterVLM在95%的标记剪枝比例下保持89.28%的平均准确率,而使用FlashAttention的FastV仅达到67.22%。
  • 与基线方法相比,该方法将FLOPs减少高达88%,推理时间减少高达77%,且内存开销极低。
  • 消融实验表明,[CLS]注意力更集中,且不易出现注意力偏移,相比大语言模型中的图文注意力更具优势。
  • 通过在大语言模型处理前完成剪枝,FasterVLM实现了与FlashAttention的兼容,推理速度优于在大语言模型内部进行剪枝的方法。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。