English

TransMamba: Fast Universal Architecture Adaption from Transformers to Mamba

Computer Vision and Pattern Recognition 2025-10-10 v2

Abstract

Transformer-based architectures have become the backbone of both uni-modal and multi-modal foundation models, largely due to their scalability via attention mechanisms, resulting in a rich ecosystem of publicly available pre-trained models such as LLaVA, CLIP, and DeiT, etc. In parallel, emerging sub-quadratic architectures like Mamba offer promising efficiency gains by enabling global context modeling with linear complexity. However, training these architectures from scratch remains resource-intensive (e.g., in terms of data and time). Motivated by this challenge, we explore a cross-architecture knowledge transfer paradigm, termed TransMamba, that facilitates the reuse of Transformer pre-trained knowledge. We propose a two-stage framework to accelerate the training of Mamba-based models, ensuring their effectiveness across both uni-modal and multi-modal tasks. The first stage leverages pre-trained Transformer models to initialize critical components of the Mamba architecture. To bridge architectural and dimensional gaps, we develop a selective weight subcloning strategy and a layered initialization scheme that prioritizes the early nn layers. Building on this initialization, the second stage introduces an adaptive multi-directional knowledge distillation method. This mechanism employs layer-wise adaptive scaling factors to align Mamba representations with their Transformer counterparts, while accommodating the scanning order variations inherent to multi-modal Mamba architectures. Despite operating with a reduced training dataset and a more compact model architecture, TransMamba consistently outperforms baseline approaches across diverse mamba-based backbones (e.g., PlainMamba, Vmamba, ViM and VideoMamba) and downstream tasks (e.g., image classification, visual question answering, text-video retrieval and multimodal reasoning). All code and implementation details will be released.

Keywords

Cite

@article{arxiv.2502.15130,
  title  = {TransMamba: Fast Universal Architecture Adaption from Transformers to Mamba},
  author = {Xiuwei Chen and Wentao Hu and Xiao Dong and Sihao Lin and Zisheng Chen and Meng Cao and Yina Zhuang and Jianhua Han and Hang Xu and Xiaodan Liang},
  journal= {arXiv preprint arXiv:2502.15130},
  year   = {2025}
}
R2 v1 2026-06-28T21:52:15.415Z