Skip to main content
QUICK REVIEW

[论文解读] LLaVA-PruMerge: Adaptive Token Reduction for Efficient Large Multimodal Models

Yuzhang Shang, Mu Cai|arXiv (Cornell University)|Mar 22, 2024
Topic Modeling被引用 5
一句话总结

本论文提出 PruMerge,一种自适应视觉令牌约简方法,可在保持性能的前提下裁剪视觉令牌,使得平均仅用约 6.9% 的令牌即可获得类似结果。

ABSTRACT

Large Multimodal Models (LMMs) have shown significant visual reasoning capabilities by connecting a visual encoder and a large language model. LMMs typically take in a fixed and large amount of visual tokens, such as the penultimate layer features in the CLIP visual encoder, as the prefix content. Recent LMMs incorporate more complex visual inputs, such as high-resolution images and videos, which further increases the number of visual tokens significantly. However, due to the inherent design of the Transformer architecture, the computational costs of these models tend to increase quadratically with the number of input tokens. To tackle this problem, we explore a token reduction mechanism that identifies significant spatial redundancy among visual tokens. In response, we propose PruMerge, a novel adaptive visual token reduction strategy that significantly reduces the number of visual tokens without compromising the performance of LMMs. Specifically, to metric the importance of each token, we exploit the sparsity observed in the visual encoder, characterized by the sparse distribution of attention scores between the class token and visual tokens. This sparsity enables us to dynamically select the most crucial visual tokens to retain. Subsequently, we cluster the selected (unpruned) tokens based on their key similarity and merge them with the unpruned tokens, effectively supplementing and enhancing their informational content. Empirically, when applied to LLaVA-1.5, our approach can compress the visual tokens by 14 times on average, and achieve comparable performance across diverse visual question-answering and reasoning tasks. Code and checkpoints are at https://llava-prumerge.github.io/.

研究动机与目标

  • 解决由于长视觉令牌序列导致的 LMM 高计算成本。
  • 开发一种自适应令牌减少机制,根据图像内容选择信息量高的令牌。
  • 在显著减少令牌数量的同时,保持模型在视觉问答和推理任务上的性能。
  • 引入令牌合并策略,以补充被裁剪令牌所带来的信息。
  • 展示对 LLaVA-1.5 的即插即用适用性,无需大量重新训练。

提出的方法

  • 通过使用类别令牌对空间令牌的注意力分布,利用基于异常值(IQR)的选择来识别重要的视觉令牌。
  • 基于对 [CLS] 令牌的注意力,将令牌自适应裁剪到目标 m << n。
  • 使用 k 近邻对选定的令牌进行聚类,并通过加权平均更新聚类中心(Token Supplement)。
  • 利用 K 的点积相似度将被裁剪的令牌并入相似聚类,以丰富保留的令牌信息。
  • 可选地对大语言模型进行微调(LoRA),以更好地适应降令牌 regime。
  • 提供一个 PruMerge+ 版本,添加对额外令牌的空间均匀采样以稳定性能。

实验结果

研究问题

  • RQ1在多样化的 VQA 与推理基准上,减少视觉令牌是否能保持性能?
  • RQ2在不产生显著退化的前提下,可以实现多少令牌的减少?
  • RQ3自适应令牌选择是否在各任务上优于固定或均匀采样策略?
  • RQ4对被裁剪令牌进行合并是否可以缓解因过度裁剪而导致的信息损失?

主要发现

方法LLMRes.PTITVQA v2SQA IVQA TPOPEMMEMMB
BLIP-2Vicuna-13B224129M-41.06142.585.31293.8-
InstructBLIPVicuna-7B224129M1.2M-60.550.1--36
InstructBLIPVicuna-13B224129M1.2M-63.150.778.91212.8-
ShikraVicuna-13B224600K5.5M77.4----58.8
IDEFICS-9BLLaMA-7B224353M1M50.9-25.9--48.2
IDEFICS-80BLLaMA-65B224353M1M60.0-30.9--54.5
Qwen-VLQwen-7B4481.4B50M78.867.163.8--38.2
Qwen-VL-ChatQwen-7B4481.4B50M78.268.261.5-1487.560.6
LLaVA-1.5Vicuna-7B336558K665K78.566.858.285.91510.764.3
LLaVA-1.5 + PruMergeVicuna-7B336558K665K72.068.556.076.31350.360.9
LLaVA-1.5Vicuna-13B336558K665K80.071.661.385.91531.367.7
LLaVA-1.5 + PruMergeVicuna-13B336558K665K72.871.058.478.51428.262.3
LLaVA-1.5 + PruMerge +Vicuna-13B336558K665K77.871.058.684.41485.565.7
  • 将 PruMerge 应用于 LLaVA-1.5 时,视觉令牌降至约 5.5%(平均约 32 个令牌),且保持了可比的性能。
  • 在六个基准测试中,LLaVA-PruMerge 与原始 LLaVA-1.5 相比具有竞争力的结果,并优于一些基线(如 BLIP-2、InstructBLIP)。
  • PruMerge+ 通过扩展令牌选择范围和空间抽样,进一步降低令牌数量(约 4x),且几乎不损失性能。
  • 效率分析显示显著降低 FLOP/内存开销;例如在 ViT-7B/INT4 情况下,使用 PruMerge 时预填充成本和总成本显著下降。
  • 通过微调训练可进一步提升结果,在 ScienceQA、TextVQA、POPE 与 MME 等任务上表现更好。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。