通过搜索最优视觉令牌压缩策略,显著加速多模态大模型且不损失性能。
Accelerating Multimodal Large Language Models by Searching Optimal Vision Token Reduction
- 基于注意力分数排序一致性,逐层贪心搜索最少必要视觉令牌数。
- 在不降性能前提下,推理速度提升超2倍,适用于主流多模态模型。
- 适合追求高效推理的部署场景,尤其对资源受限环境友好。
当前多模态大语言模型(MLLMs)将输入图像编码为视觉令牌并输入语言主干,类似大型语言模型处理文本令牌。然而,随着图像分辨率提高,视觉令牌数量呈平方增长,导致巨大计算开销。本文从两个场景出发:(I) 在不降低性能的前提下减少计算成本;(II) 在给定预算下提升性能。我们发现,除第一层外,各层中视觉令牌按注意力得分排序的顺序高度相似,因此假设关键视觉令牌数量不随深度增加。针对场景(I),提出贪心搜索算法(G-Search),从浅层到深层逐层寻找每层最少保留的视觉令牌数,该方法在假设下可达到最优压缩策略。针对场景(II),基于G-Search结果设计参数化Sigmoid函数(P-Sigmoid),其参数通过贝叶斯优化确定。大量实验表明,该方法能显著加速如LLaVA、InternVL2等主流模型,推理速度提升超过2倍且无性能下降。在预算受限时,相比其他令牌压缩方法表现更优,实现了效率与效果间的更好权衡。
原文摘要 · Abstract (English)
Prevailing Multimodal Large Language Models (MLLMs) encode the input image(s) as vision tokens and feed them into the language backbone, similar to how Large Language Models (LLMs) process the text tokens. However, the number of vision tokens increases quadratically as the image resolutions, leading to huge computational costs. In this paper, we consider improving MLLM's efficiency from two scenarios, (I) Reducing computational cost without degrading the performance. (II) Improving the performance with given budgets. We start with our main finding that the ranking of each vision token sorted by attention scores is similar in each layer except the first layer. Based on it, we assume that the number of essential top vision tokens does not increase along layers. Accordingly, for Scenario I, we propose a greedy search algorithm (G-Search) to find the least number of vision tokens to keep at each layer from the shallow to the deep. Interestingly, G-Search is able to reach the optimal reduction strategy based on our assumption. For Scenario II, based on the reduction strategy from G-Search, we design a parametric sigmoid function (P-Sigmoid) to guide the reduction at each layer of the MLLM, whose parameters are optimized by Bayesian Optimization. Extensive experiments demonstrate that our approach can significantly accelerate those popular MLLMs, e.g. LLaVA, and InternVL2 models, by more than $2 \times$ without performance drops. Our approach also far outperforms other token reduction methods when budgets are limited, achieving a better trade-off between efficiency and effectiveness.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。