通过分层删减视觉冗余,显著提升大模型训练与推理效率。
PyramidDrop: Accelerating Your Large Vision-Language Models via Pyramid Visual Redundancy Reduction
- 分阶段逐步丢弃深层视觉令牌,构建金字塔式压缩结构。
- 在LLaVA-NeXT上实现40%训练提速与55%推理算力降低。
- 无需重训练即可部署,适合追求高效推理的落地场景。
在大型视觉语言模型(LVLMs)中,图像输入携带丰富信息,但单张图像可能需数百甚至上千个标记表示。随着图像分辨率上升,计算开销呈二次增长,严重制约训练与推理效率。现有方法在早期阶段减少图像标记,但导致关键信息丢失,损害模型性能。我们通过实证发现:浅层所有视觉标记均必要,而深层标记冗余逐渐增加。为此提出PyramidDrop策略,在模型各阶段末端按预设比例丢弃部分图像标记,形成分层金字塔结构。丢弃基于轻量级相似性计算,时间开销极低。大量实验表明,PyramidDrop使LLaVA-NeXT训练时间减少40%,推理浮点运算量降低55%,且性能几乎无损。该方法还可作为即插即用的推理加速器,无需训练,效果优于同类方案。代码已开源。
原文摘要 · Abstract (English)
In large vision-language models (LVLMs), images serve as inputs that carry a wealth of information. As the idiom "A picture is worth a thousand words" implies, representing a single image in current LVLMs can require hundreds or even thousands of tokens. This results in significant computational costs, which grow quadratically as input image resolution increases, thereby severely impacting the efficiency of both training and inference. Previous approaches have attempted to reduce the number of image tokens either before or within the early layers of LVLMs. However, these strategies inevitably result in the loss of crucial image information, ultimately diminishing model performance. To address this challenge, we conduct an empirical study revealing that all visual tokens are necessary for LVLMs in the shallow layers, and token redundancy progressively increases in the deeper layers of the model. To this end, we propose PyramidDrop, a visual redundancy reduction strategy for LVLMs to boost their efficiency in both training and inference with neglectable performance loss. Specifically, we partition the LVLM into several stages and drop part of the image tokens at the end of each stage with a pre-defined ratio, creating pyramid-like visual tokens across model layers. The dropping is based on a lightweight similarity calculation with a negligible time overhead. Extensive experiments demonstrate that PyramidDrop can achieve a 40% training time and 55% inference FLOPs acceleration of LLaVA-NeXT with comparable performance. Besides, the PyramidDrop could also serve as a plug-and-play strategy for inference acceleration without training, with better performance and lower inference cost than counterparts. Code is available at https://github.com/Cooperx521/PyramidDrop.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。