ChatPaper.aiChatPaper

画像はレイヤー2の後で1/2トークン相当:大規模視覚言語モデルのためのプラグアンドプレイ推論高速化

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

March 11, 2024
著者: Liang Chen, Haozhe Zhao, Tianyu Liu, Shuai Bai, Junyang Lin, Chang Zhou, Baobao Chang
cs.AI

要旨

本研究では、大規模視覚言語モデル(LVLM)、特にLLaVA-1.5、QwenVL-Chat、Video-LLaVAなどの著名なモデルにおいて、非効率なアテンション現象を特定しました。これらのモデルの深層において、視覚トークンに対するアテンション計算が極めて非効率であることが判明し、テキストデータ処理と比較してより疎なアプローチが必要であることが示唆されました。これに対処するため、我々はFastVを提案します。FastVは、初期層で適応的なアテンションパターンを学習し、後続層で視覚トークンを刈り込むことで計算効率を最適化する汎用のプラグアンドプレイ手法です。評価の結果、FastVは幅広い画像および映像理解タスクにおいて性能を犠牲にすることなく、計算コストを劇的に削減できることが示されました(例:LLaVA-1.5-13BのFLOPsを45%削減)。FastVの計算効率と性能のトレードオフは高度にカスタマイズ可能であり、パレート効率的です。13BパラメータモデルのFLOPsを7Bパラメータモデルよりも低い予算に圧縮しつつ、優れた性能を維持することができます。我々は、FastVがエッジデバイスや商用モデルにおけるLVLMの展開に実用的な価値を持つと信じています。コードはhttps://github.com/pkunlp-icler/FastVで公開されています。
English
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.

Summary

AI-Generated Summary

PDF292December 15, 2024