arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.06764cs.CVcs.AIcs.CL
收藏

图像在第2层后仅值1/2个Token:大型视觉-语言模型的即插即用推理加速

An Image is Worth 1/2 Tokens After Layer 2: Plug-and-Play Inference Acceleration for Large Vision-Language Models

Peking University(北京大学);Alibaba Group(阿里巴巴集团)

Liang Chen, Haozhe Zhao, Tianyu Liu, Shuai Bai, Junyang Lin, Chang Zhou, Baobao Chang

AI总结:

本文提出FastV,一种即插即用的LVLM推理加速方法,通过在早期层学习自适应注意力模式并在后续层剪枝视觉Token,大幅降低计算成本且保持性能。

摘要:

在本研究中,我们识别了大型视觉-语言模型(LVLMs)中低效的注意力现象,尤其是在LLaVA-1.5、QwenVL-Chat和Video-LLaVA等知名模型中。我们发现,在流行LVLMs的深层中,对视觉Token的注意力计算效率极低,这表明与文本数据处理相比,需要一种更稀疏的方法。为此,我们提出了FastV,这是一种通用的即插即用方法,旨在通过在早期层学习自适应注意力模式并在后续层中剪枝视觉Token来优化计算效率。我们的评估表明,FastV能够在广泛的图像和视频理解任务中大幅降低计算成本(例如,LLaVA-1.5-13B的FLOPs减少了45%),同时不牺牲性能。FastV的计算效率与性能权衡具有高度可定制性和帕累托最优性。它可以将一个13B参数模型的FLOPs压缩到低于一个7B参数模型的预算,同时仍保持更优的性能。我们相信FastV对于在边缘设备和商业模型中部署LVLMs具有实用价值。代码已发布在https://github.com/pkunlp-icler/FastV。

英文摘要:

In this study, we identify the inefficient attention phenomena in Large Vision-Language Models (LVLMs), notably within prominent models like LLaVA-1.5, QwenVL-Chat and Video-LLaVA. We find out that the attention computation over visual tokens is of extreme inefficiency in the deep layers of popular LVLMs, suggesting a need for a sparser approach compared to textual data handling. To this end, we introduce FastV, a versatile plug-and-play method designed to optimize computational efficiency by learning adaptive attention patterns in early layers and pruning visual tokens in subsequent ones. Our evaluations demonstrate FastV's ability to dramatically reduce computational costs (e.g., a 45 reduction in FLOPs for LLaVA-1.5-13B) without sacrificing performance in a wide range of image and video understanding tasks. The computational efficiency and performance trade-off of FastV are highly customizable and pareto-efficient. It can compress the FLOPs of a 13B-parameter model to achieve a lower budget than that of a 7B-parameter model, while still maintaining superior performance. We believe FastV has practical values for deployment of LVLMs in edge devices and commercial models. Code is released at https://github.com/pkunlp-icler/FastV.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑