2024-12-06 · 进阶 · 机器学习 · 自然语言处理

p-MoD: Building Mixture-of-Depths MLLMs via Progressive Ratio Decay

该论文提出了一种名为p-MoD的混合深度MLLM构建方法,通过渐进性比率衰减策略和改进的MoD模块,显著提升了MLLM的效率和性能。

更新于 2024-12-06。作者:Jun Zhang、Desen Meng、Ji Qi、Zhenpeng Huang、Tao Wu、Limin Wang。

中文摘要

尽管多模态大型语言模型(MLLMs)在众多任务中表现出色,但其庞大的训练和推理成本阻碍了其进步。大部分计算都来自于由transformer解码器处理的庞大视觉token量。在本文中,我们提出通过利用混合深度(MoD)机制来构建高效的MLLMs,其中每个transformer解码器层都选择必要的视觉token进行处理,同时跳过冗余的token。然而,将MoD整合到MLLMs中并非易事。为了解决训练和推理的稳定性以及有限的训练数据带来的挑战,我们对MoD模块进行了两项新颖的设计:tanh门控权重归一化(TanhNorm)和对称token重新加权(STRing)。此外,我们观察到视觉token在深层中表现出更高的冗余性,因此设计了渐进式比率衰减(PRD)策略,该策略通过移位余弦计划逐层逐渐减少token保留比率。这一关键设计充分发挥了MoD的潜力,显著提高了我们模型的高效性和性能。为了验证我们方法的有效性,我们在14个基准上对两种基线模型进行了广泛的实验。我们的模型p-MoD在推理时仅占用55.6%的TFLOPs和53.8%的KV缓存存储,在训练时仅占用77.7%的GPU小时,其性能与基线模型相当,甚至更优。

英文摘要

Despite the remarkable performance of multimodal large language models (MLLMs) across diverse tasks, the substantial training and inference costs impede their advancement. The majority of computation stems from the overwhelming volume of vision tokens processed by the transformer decoder. In this paper, we propose to build efficient MLLMs by leveraging the Mixture-of-Depths (MoD) mechanism, where each transformer decoder layer selects essential vision tokens to process while skipping redundant ones. However, integrating MoD into MLLMs is non-trivial. To address the challenges of training and inference stability as well as limited training data, we adapt the MoD module with two novel designs: tanh-gated weight normalization (TanhNorm) and symmetric token reweighting (STRing). Moreover, we observe that vision tokens exhibit higher redundancy in deeper layer and thus design a progressive ratio decay (PRD) strategy, which gradually reduces the token retention ratio layer by layer, employing a shifted cosine schedule. This crucial design fully unleashes the potential of MoD, significantly boosting the efficiency and performance of our models. To validate the effectiveness of our approach, we conduct extensive experiments with two baseline models across 14 benchmarks. Our model, p-MoD, matches or even surpasses the performance of the baseline models, with only 55.6% TFLOPs and 53.8% KV cache storage during inference, and 77.7% GPU hours during training.

解读

一句话总结

该论文提出了一种名为p-MoD的混合深度MLLM构建方法,通过渐进性比率衰减策略和改进的MoD模块,显著提升了MLLM的效率和性能。

问题1:这篇论文想要解决什么具体问题?

• 问题背景:多模态大型语言模型(MLLMs)在视觉-语言理解任务中表现出色,但其训练和推理成本高昂,限制了其发展。 • 现有方案不足:现有的压缩视觉token的方法在解码器之前进行,忽略了LLMs自身压缩视觉token的能力。 • 研究目标:通过优化MLLMs的解码器层计算效率,设计更高效的MLLM架构,同时保持性能。

问题2:论文的核心创新点是什么?

• 技术创新:引入了渐进性比率衰减(PRD)策略和改进的MoD模块,包括tanh-gated weight normalization(TanhNorm)和symmetric token reweighting(STRing)。 • 方法改进:将MoD机制应用于MLLMs,通过选择重要的视觉token进行处理,跳过冗余的token。 • 优势:与基线模型相比,p-MoD在保持性能的同时,显著降低了推理和训练成本。

问题3:实验结果如何验证了方法的有效性?

• 关键实验:在14个基准测试中,使用p-MoD的模型与基线模型相比,在推理时TFLOPs降低了44.4%,KV cache存储减少了53.8%,训练时GPU小时数减少了77.7%。 • 性能提升:在多个基准测试中,p-MoD模型的表现与基线模型相当甚至更好。 • 对比结果:与基于注意力分数的剪枝方法相比,p-MoD在效率和性能上都表现更优。

问题4:这个研究的实际应用价值是什么?

• 应用场景:适用于需要高效处理大量视觉token的视觉-语言理解任务。 • 实施建议:将p-MoD应用于实际任务时,可根据具体需求调整参数以平衡性能和效率。 • 局限与展望:目前p-MoD仅在单图像理解任务上进行实验,未来可以探索其在多图像、长视频等任务中的应用。

来源