arXiv:2412.20105cs.CV2024-12中稿 · AAAI被引 26

通过空间时间视觉令牌裁剪,让多模态大模型推理快一倍且省内存。

ST$^3$: Accelerating Multimodal Large Language Model by Spatial-Temporal Visual Token Trimming

  • 动态裁剪冗余视觉令牌,分层逐步去除不重要的视觉信息。
  • 推理速度提升约2倍,仅需原模型30%的键值缓存内存。
  • 无需重新训练,可直接部署到现有多模态大模型中使用。

多模态大语言模型(MLLM)通过融合视觉与文本信息增强感知能力,但处理海量视觉令牌带来巨大计算开销。现有对MLLM注意力机制的研究较为浅显,导致粗粒度的令牌裁剪策略难以在速度与精度间取得良好平衡。本文以LLaVA为例,深入分析其注意力机制,发现解码过程中存在大量冗余视觉令牌及部分注意力计算。基于此,提出空间-时间视觉令牌裁剪(ST³)框架,无需重训练即可加速推理。ST³包含两个核心组件:1)渐进式视觉令牌修剪(PVTP),逐层剔除低关注度的视觉令牌;2)视觉令牌退火(VTA),随生成文本增长动态减少每层视觉令牌数量。该方法实现约2倍加速,键值缓存内存降至原模型的30%左右,同时在多个数据集上保持一致性能。关键优势在于可无缝集成至已有预训练的MLLM中,提供即插即用的高效推理方案。

原文摘要 · Abstract (English)

Multimodal large language models (MLLMs) enhance their perceptual capabilities by integrating visual and textual information. However, processing the massive number of visual tokens incurs a significant computational cost. Existing analysis of the MLLM attention mechanisms remains shallow, leading to coarse-grain token pruning strategies that fail to effectively balance speed and accuracy. In this paper, we conduct a comprehensive investigation of MLLM attention mechanisms with LLaVA. We find that numerous visual tokens and partial attention computations are redundant during the decoding process. Based on this insight, we propose Spatial-Temporal Visual Token Trimming ($\textbf{ST}^{3}$), a framework designed to accelerate MLLM inference without retraining. $\textbf{ST}^{3}$ consists of two primary components: 1) Progressive Visual Token Pruning (\textbf{PVTP}), which eliminates inattentive visual tokens across layers, and 2) Visual Token Annealing (\textbf{VTA}), which dynamically reduces the number of visual tokens in each layer as the generated tokens grow. Together, these techniques deliver around $\mathbf{2\times}$ faster inference with only about $\mathbf{30\%}$ KV cache memory compared to the original LLaVA, while maintaining consistent performance across various datasets. Crucially, $\textbf{ST}^{3}$ can be seamlessly integrated into existing pre-trained MLLMs, providing a plug-and-play solution for efficient inference.

多模态推理加速令牌修剪LLaVA

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。