通过分层注意力识别视觉关键帧,实现高效视觉-语言模型压缩。
HiPrune: Hierarchical Attention for Efficient Token Pruning in Vision-Language Models
- 基于视觉编码器不同层的注意力差异,分类识别三类视觉令牌。
- 仅用1/3的令牌达到99.3%任务准确率,推理算力降低58.7%。
- 适配高分辨率输入,适合资源受限场景下的视觉-语言模型部署。
视觉-语言模型(VLMs)将图像和视频编码为大量令牌,存在显著冗余与计算开销。尽管已有视觉令牌剪枝方法缓解该问题,但多数方法缺乏对视觉编码器内在特性的理解。本文深入分析视觉编码器,定性与定量证明:中间层更关注图像主体对象,深层则聚焦于富含全局信息的令牌。基于此分层注意力模式,我们提出无需训练、模型无关的令牌剪枝方法HiPrune。HiPrune根据视觉编码器各阶段的注意力分布,将视觉令牌分为三类,以保留不同层级的信息。结合文本令牌相似性,进一步提出提示感知方差机制——HiPrune++,在极低令牌预算下提升指令遵循性能。在四个代表性VLM上广泛实验表明,HiPrune仅用1/3令牌即达99.3%任务准确率,推理浮点运算量减少58.7%;而HiPrune++在仅2/9令牌条件下仍保持99.7%准确率,展现出在高分辨率输入下的强鲁棒性。代码已开源。
原文摘要 · Abstract (English)
Vision-Language Models (VLMs) encode images and videos into abundant tokens, which contain substantial redundancy and computation cost. While visual token pruning mitigates the issue, most existing methods lack insight into the intrinsic property of the vision encoder itself. In this work, we dive into the vision encoder and prove that the middle layers pay more attention to the main objects of the image qualitatively and quantitatively, while the deep layers to tokens with rich global information. Utilizing this Hierarchical attention pattern, we propose HiPrune, a training-free and model-agnostic token Pruning method. HiPrune identifies three types of visual tokens according to their attention in different phases of the vision encoder, which preserves different levels of information. By coupling with the similarity of text tokens, we propose a prompt-aware variance, HiPrune++, which further improves instruction following performance under a very low token budget. Extensive experiments across four representative VLMs show that HiPrune achieves up to 99.3% of task accuracy with only 1/3 of the tokens, while reducing inference FLOPs by 58.7%. HiPrune++ maintains up to 99.7% accuracy with 2/9 tokens, highlighting robustness under high-resolution. Our code is available at https://github.com/Danielement321/HiPrune.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。