让多模态大模型推理快两倍以上,关键在于分开处理图文信息。
Speculative Decoding Reimagined for Multimodal Large Language Models
- 分离图文处理,针对不同特性设计草案模型
- 分两阶段训练,先学语言再学视觉理解
- 在多个基准上提速2.29至2.46倍,适合加速多模态应用
本文提出多模态推测解码(MSD),以加速多模态大语言模型(MLLM)的推理。尽管推测解码在纯文本大模型中已证明可显著提速且不损失精度,但现有方法在多模态场景中效果不佳。通过分析MLLM特性,我们提炼出两大设计原则:(1) 文本与视觉标记具有本质差异,草案模型需分别处理;(2) 草案模型需兼具语言建模与视觉感知能力。为此,MSD将文本与视觉令牌在草案模型中解耦处理,并采用两阶段训练策略:第一阶段在仅含文本的指令微调数据集上训练以增强语言建模能力;第二阶段逐步引入多模态数据以提升视觉感知能力。实验表明,MSD在多模态基准上使LLaVA-1.5-7B推理速度提升最高达2.29倍,LLaVA-1.5-13B最高达2.46倍,验证了其有效性。代码已开源。
原文摘要 · Abstract (English)
This paper introduces Multimodal Speculative Decoding (MSD) to accelerate Multimodal Large Language Models (MLLMs) inference. Speculative decoding has been shown to accelerate Large Language Models (LLMs) without sacrificing accuracy. However, current speculative decoding methods for MLLMs fail to achieve the same speedup as they do for LLMs. To address this, we reimagine speculative decoding specifically for MLLMs. Our analysis of MLLM characteristics reveals two key design principles for MSD: (1) Text and visual tokens have fundamentally different characteristics and need to be processed separately during drafting. (2) Both language modeling ability and visual perception capability are crucial for the draft model. For the first principle, MSD decouples text and visual tokens in the draft model, allowing each to be handled based on its own characteristics. For the second principle, MSD uses a two-stage training strategy: In stage one, the draft model is trained on text-only instruction-tuning datasets to improve its language modeling ability. In stage two, MSD gradually introduces multimodal data to enhance the visual perception capability of the draft model. Experiments show that MSD boosts inference speed by up to $2.29\times$ for LLaVA-1.5-7B and up to $2.46\times$ for LLaVA-1.5-13B on multimodal benchmarks, demonstrating its effectiveness. Our code is available at https://github.com/Lyn-Lucy/MSD.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。