arXiv:2412.00876cs.CVcs.AI2024-12ICLR被引 62

动态压缩视觉语言上下文,显著降低多模态大模型推理开销

Dynamic-LLaVA: Efficient Multimodal Large Language Models via Dynamic Vision-language Context Sparsification

  • 根据推理阶段动态调整视觉-语言上下文冗余度
  • 预填充阶段计算量减少约75%,解码阶段节省超50%显存
  • 适合追求高效推理的多模态模型部署与应用

多模态大语言模型(MLLMs)在视觉理解、推理和交互方面取得了显著进展。然而,随着生成过程推进,解码阶段的计算与内存消耗持续上升,影响了模型效率。现有方法虽尝试减少视觉上下文冗余以提升效率,但其在预填充阶段的优势在解码阶段逐渐减弱。为此,本文提出动态视觉-语言上下文稀疏化框架 Dynamic-LLaVA,该框架在预填充阶段动态减少视觉上下文冗余,并在解码阶段降低语言上下文的内存与计算开销。Dynamic-LLaVA 为不同推理模式(预填充、带/不带 KV 缓存解码)设计了定制化稀疏推理方案,实现 MLLMs 的高效推理。实验表明,预填充阶段计算量减少约75%;在整个生成过程中,无 KV 缓存时计算量减少约50%,有 KV 缓存时显存占用降低约50%。大量实验还显示,相较于全上下文基线,Dynamic-LLaVA 在保持甚至提升理解与生成能力的同时实现高效推理。代码已开源:https://github.com/Osilly/dynamic_llava。

原文摘要 · Abstract (English)

Multimodal Large Language Models (MLLMs) have achieved remarkable success in vision understanding, reasoning, and interaction. However, the inference computation and memory increase progressively with the generation of output tokens during decoding, directly affecting the efficacy of MLLMs. Existing methods attempt to reduce the vision context redundancy to achieve efficient MLLMs. Unfortunately, the efficiency benefits of the vision context reduction in the prefill stage gradually diminish during the decoding stage. To address this problem, we proposed a dynamic vision-language context sparsification framework Dynamic-LLaVA, which dynamically reduces the redundancy of vision context in the prefill stage and decreases the memory and computation overhead of the generated language context during decoding. Dynamic-LLaVA designs a tailored sparsification inference scheme for different inference modes, i.e., prefill, decoding with and without KV cache, to achieve efficient inference of MLLMs. In practice, Dynamic-LLaVA can reduce computation consumption by $\sim$75\% in the prefill stage. Meanwhile, throughout the entire generation process of MLLMs, Dynamic-LLaVA reduces the $\sim$50\% computation consumption under decoding without KV cache, while saving $\sim$50\% GPU memory overhead when decoding with KV cache, due to the vision-language context sparsification. Extensive experiments also demonstrate that Dynamic-LLaVA achieves efficient inference for MLLMs with negligible understanding and generation ability degradation or even performance gains compared to the full-context inference baselines. Code is available at https://github.com/Osilly/dynamic_llava .

多模态模型推理优化上下文压缩

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