Paper Reading AI Learner

TransMamba: Fast Universal Architecture Adaption from Transformers to Mamba

2025-02-21 01:22:01
Xiuwei Chen, Sihao Lin, Xiao Dong, Zisheng Chen, Meng Cao, Jianhua Han, Hang Xu, Xiaodan Liang

Abstract

Transformers have been favored in both uni-modal and multi-modal foundation models for their flexible scalability in attention modules. Consequently, a number of pre-trained Transformer models, e.g., LLaVA, CLIP, and DEIT, are publicly available. Recent research has introduced subquadratic architectures like Mamba, which enables global awareness with linear complexity. Nevertheless, training specialized subquadratic architectures from scratch for certain tasks is both resource-intensive and time-consuming. As a motivator, we explore cross-architecture training to transfer the ready knowledge in existing Transformer models to alternative architecture Mamba, termed TransMamba. Our approach employs a two-stage strategy to expedite training new Mamba models, ensuring effectiveness in across uni-modal and cross-modal tasks. Concerning architecture disparities, we project the intermediate features into an aligned latent space before transferring knowledge. On top of that, a Weight Subcloning and Adaptive Bidirectional distillation method (WSAB) is introduced for knowledge transfer without limitations on varying layer counts. For cross-modal learning, we propose a cross-Mamba module that integrates language awareness into Mamba's visual features, enhancing the cross-modal interaction capabilities of Mamba architecture. Despite using less than 75% of the training data typically required for training from scratch, TransMamba boasts substantially stronger performance across various network architectures and downstream tasks, including image classification, visual question answering, and text-video retrieval. The code will be publicly available.

Abstract (translated)

Transformer模型因其在注意力模块中的灵活可扩展性而在单模态和多模态基础模型中受到青睐。因此,已经有许多预训练的Transformer模型公开可用,如LLaVA、CLIP和DEIT等。最近的研究引入了次二次架构(例如Mamba),这种架构能够以线性复杂度实现全局感知能力。然而,从头开始专门为某些任务训练此类次二次架构既耗时又耗费资源。 为此动机,我们探索了一种跨架构训练方法,将现有Transformer模型中的知识转移到替代架构Mamba上,并将其命名为TransMamba。我们的方法采用两阶段策略来加速新的Mamba模型的训练过程,在单模态和跨模态任务中都能保证有效性。针对架构差异,我们在转移知识之前将中间特征投影到对齐的潜在空间内。在此基础上,我们引入了一种无限制层计数的知识传输方法——权重子克隆与自适应双向蒸馏法(WSAB)。此外,为了增强Mamba架构在跨模态任务中的交互能力,我们提出了一种交叉Mamba模块,该模块将语言感知整合到Mamba的视觉特征中。 尽管训练TransMamba使用的数据量不到从头开始训练所需的75%,但其在各种网络架构和下游任务(包括图像分类、视觉问答以及文本-视频检索)中的表现依然显著优于其他模型。我们将公开提供相应的代码。

URL

https://arxiv.org/abs/2502.15130

PDF

https://arxiv.org/pdf/2502.15130.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot