Abstract
Multimodal Large Language Models (MLLMs) have achieved remarkable success but are constrained by the quadratic computational complexity of the Transformer architecture. This paper introduces mmMamba, a framework that distills knowledge from high-performing Transformers into linear-complexity State Space Models (SSMs). Utilizing a novel three-stage distillation process and a parameter inheritance strategy, mmMamba achieves up to a 20.6x speedup and 75.8% memory reduction for long sequences. Our results show that mmMamba maintains competitive performance across various vision-language benchmarks, offering a scalable solution for efficient multimodal deployment.
Introduction
The current generation of Multimodal Large Language Models (MLLMs) relies heavily on the Transformer architecture. While powerful, the self-attention mechanism imposes a "quadratic tax," where computational and memory requirements grow at $O(N^2)$ with sequence length. This scaling behavior limits the practical use of MLLMs for high-resolution images, long-form video, and complex reasoning tasks, especially on resource-constrained edge devices.
Recent advances in State Space Models (SSMs), such as Mamba, offer linear complexity $O(N)$. However, training these models from scratch requires massive datasets. mmMamba addresses this "cold start" problem by "linearizing" existing, pre-trained decoder-only Transformers through a structured distillation process.
Methodology: Quadratic to Linear Distillation
The core of mmMamba is a "Quadratic to Linear" distillation recipe that migrates knowledge from a Transformer teacher (HoVLE) to a Mamba-2 student.
Parameter Inheritance (Seeding)
Rather than random initialization, mmMamba leverages the mathematical parallels between Attention and Mamba-2's SSM. Projection weights ($W_Q, W_K, W_V$) are directly inherited from the teacher. New SSM-specific parameters are initialized to mimic identity behavior, providing the student with a pre-trained foundation.
Three-Stage Progressive Distillation
- Layer-wise SSM Training: New SSM parameters are trained using MSE loss to align student layer outputs with the teacher.
- Layer-wise Full Training: All parameters in the Mamba block are unfrozen to refine internal dynamics.
- End-to-End Fine-tuning: The model is optimized using KL-Divergence on final logits to ensure conversational and multimodal logic consistency.
Architectural Variants
We explore two primary configurations:
- mmMamba-linear: A pure linear model where every Transformer layer is replaced by a Mamba-2 layer.
- mmMamba-hybrid: A model that interleaves Transformer layers (to retain high-order reasoning) with Mamba-2 layers (for efficiency).
Experimental Results
The models were trained on the SOLO supervised fine-tuning (SFT) dataset (1.7M samples) and evaluated across nine benchmarks, including MME, POPE, and GQA.
Efficiency Gains
The efficiency benefits of mmMamba scale dramatically with sequence length. At a context of 103K tokens, mmMamba-linear is 20.6x faster than the teacher model and utilizes 75.8% less GPU memory. While the teacher model encounters Out-of-Memory (OOM) errors at 128K tokens, mmMamba continues to operate with stable latency.
Benchmark Performance
Despite its efficiency, mmMamba-linear outperforms larger models like EVE-7B on the majority of benchmarks. The hybrid variant further closes the performance gap with the teacher model, significantly outperforming other linear-complexity models such as Cobra and VisualRWKV.
Conclusion
mmMamba demonstrates that the computational barriers of multimodal Transformers can be overcome through targeted distillation into State Space Models. By inheriting parameters and employing a progressive training strategy, we achieve massive efficiency gains without sacrificing the reasoning capabilities of large-scale pre-trained models. Future work will focus on scaling this approach to larger parameter counts and optimizing hybrid layer placement.
Summary updated