Saved in:
Bibliographic Details
Main Authors: Li, Yixing, Xie, Ruobing, Yang, Zhen, Sun, Xingwu, Li, Shuaipeng, Han, Weidong, Kang, Zhanhui, Cheng, Yu, Xu, Chengzhong, Wang, Di, Jiang, Jie
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2503.24067
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915711792709632
author Li, Yixing
Xie, Ruobing
Yang, Zhen
Sun, Xingwu
Li, Shuaipeng
Han, Weidong
Kang, Zhanhui
Cheng, Yu
Xu, Chengzhong
Wang, Di
Jiang, Jie
author_facet Li, Yixing
Xie, Ruobing
Yang, Zhen
Sun, Xingwu
Li, Shuaipeng
Han, Weidong
Kang, Zhanhui
Cheng, Yu
Xu, Chengzhong
Wang, Di
Jiang, Jie
contents Transformers are the cornerstone of modern large language models, but their quadratic computational complexity limits efficiency in long-sequence processing. Recent advancements in Mamba, a state space model (SSM) with linear complexity, offer promising efficiency gains but suffer from unstable contextual learning and multitask generalization. Some works conduct layer-level hybrid structures that combine Transformer and Mamba layers, aiming to make full use of both advantages. This paper proposes TransMamba, a novel sequence-level hybrid framework that unifies Transformer and Mamba through shared parameter matrices (QKV and CBx), and thus could dynamically switch between attention and SSM mechanisms at different token lengths and layers. We design the Memory Converter to bridge Transformer and Mamba by converting attention outputs into SSM-compatible states, ensuring seamless information flow at TransPoints where the transformation happens. The TransPoint scheduling is also thoroughly explored for balancing effectiveness and efficiency. We conducted extensive experiments demonstrating that TransMamba achieves superior training efficiency and performance compared to single and hybrid baselines, and validated the deeper consistency between Transformer and Mamba paradigms at sequence level, offering a scalable solution for next-generation language modeling. Code and data are available at https://github.com/Yixing-Li/TransMamba
format Preprint
id arxiv_https___arxiv_org_abs_2503_24067
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle TransMamba: A Sequence-Level Hybrid Transformer-Mamba Language Model
Li, Yixing
Xie, Ruobing
Yang, Zhen
Sun, Xingwu
Li, Shuaipeng
Han, Weidong
Kang, Zhanhui
Cheng, Yu
Xu, Chengzhong
Wang, Di
Jiang, Jie
Machine Learning
Transformers are the cornerstone of modern large language models, but their quadratic computational complexity limits efficiency in long-sequence processing. Recent advancements in Mamba, a state space model (SSM) with linear complexity, offer promising efficiency gains but suffer from unstable contextual learning and multitask generalization. Some works conduct layer-level hybrid structures that combine Transformer and Mamba layers, aiming to make full use of both advantages. This paper proposes TransMamba, a novel sequence-level hybrid framework that unifies Transformer and Mamba through shared parameter matrices (QKV and CBx), and thus could dynamically switch between attention and SSM mechanisms at different token lengths and layers. We design the Memory Converter to bridge Transformer and Mamba by converting attention outputs into SSM-compatible states, ensuring seamless information flow at TransPoints where the transformation happens. The TransPoint scheduling is also thoroughly explored for balancing effectiveness and efficiency. We conducted extensive experiments demonstrating that TransMamba achieves superior training efficiency and performance compared to single and hybrid baselines, and validated the deeper consistency between Transformer and Mamba paradigms at sequence level, offering a scalable solution for next-generation language modeling. Code and data are available at https://github.com/Yixing-Li/TransMamba
title TransMamba: A Sequence-Level Hybrid Transformer-Mamba Language Model
topic Machine Learning
url https://arxiv.org/abs/2503.24067