将大模型蒸馏为线性复杂度的多模态架构,大幅提速降存。
Multimodal Mamba: Decoder-only Multimodal State Space Model via Quadratic to Linear Distillation
- 从Transformer蒸馏出Mamba结构,无需预训练视觉编码器
- 在10.3万词长序列下实现20.6倍加速与75.8%显存降低
- 支持混合架构,适合需高效部署的多模态应用
现有多模态大模型虽表现优异,但面临二次复杂度计算、键值缓存需求高及依赖独立视觉编码器等部署难题。我们提出mmMamba,通过中等算力资源对已有decoder-only MLLMs进行渐进式蒸馏,构建原生线性复杂度的多模态状态空间模型。该方法可直接将训练好的Transformer模型转为线性复杂度架构,无需预训练基于RNN的LLM或视觉编码器。我们提出一种从Transformer中提取Mamba的种子策略和三阶段蒸馏方案,有效迁移知识并保留多模态能力。同时支持灵活混合架构,实现效率与性能的可调平衡。从基于Transformer的HoVLE蒸馏出的mmMamba-linear在性能上媲美现有线性和二次复杂度视觉语言模型;mmMamba-hybrid进一步显著提升性能,接近原始HoVLE水平。在103,000个词元长度下,mmMamba-linear相比HoVLE实现20.6倍加速和75.8%显存减少,mmMamba-hybrid则实现13.5倍加速与60.2%内存节省。代码与模型已开源于https://github.com/hustvl/mmMamba。
原文摘要 · Abstract (English)
Recent Multimodal Large Language Models (MLLMs) have achieved remarkable performance but face deployment challenges due to their quadratic computational complexity, growing Key-Value cache requirements, and reliance on separate vision encoders. We propose mmMamba, a framework for developing linear-complexity native multimodal state space models through progressive distillation from existing MLLMs using moderate academic computational resources. Our approach enables the direct conversion of trained decoder-only MLLMs to linear-complexity architectures without requiring pre-trained RNN-based LLM or vision encoders. We propose an seeding strategy to carve Mamba from trained Transformer and a three-stage distillation recipe, which can effectively transfer the knowledge from Transformer to Mamba while preserving multimodal capabilities. Our method also supports flexible hybrid architectures that combine Transformer and Mamba layers for customizable efficiency-performance trade-offs. Distilled from the Transformer-based decoder-only HoVLE, mmMamba-linear achieves competitive performance against existing linear and quadratic-complexity VLMs, while mmMamba-hybrid further improves performance significantly, approaching HoVLE's capabilities. At 103K tokens, mmMamba-linear demonstrates 20.6$\times$ speedup and 75.8% GPU memory reduction compared to HoVLE, while mmMamba-hybrid achieves 13.5$\times$ speedup and 60.2% memory savings. Code and models are released at https://github.com/hustvl/mmMamba
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。