Lune

NeurIPS2024Top-tier venue

Demystify Mamba in Vision: A Linear Attention Perspective

Dongchen Han, Ziyi Wang, Zhuofan Xia, Yizeng Han, Yifan Pu, Chunjiang Ge, Jun Song, Shiji Song, Bo Zheng, Gao Huang

Abstract

Mamba is an effective state space model with linear computation complexity. It has recently shown impressive efficiency in dealing with high-resolution inputs across various vision tasks. In this paper, we reveal that the powerful Mamba model shares surprising similarities with linear attention Transformer, which typically underperform conventional Transformer in practice. By exploring the similarities and disparities between the effective Mamba and subpar linear attention Transformer, we provide comprehensive analyses to demystify the key factors behind Mamba's success. Specifically, we reformulate the selective state space model and linear attention within a unified formulation, rephrasing Mamba as a variant of linear attention Transformer with six major distinctions: input gate, forget gate, shortcut, no attention normalization, single-head, and modified block design. For each design, we meticulously analyze its pros and cons, and empirically evaluate its impact on model performance in vision tasks. Interestingly, the results highlight the forget gate and block design as the core contributors to Mamba's success, while the other four designs are less crucial. Based on these findings, we propose a Mamba-Inspired Linear Attention (MILA) model by incorporating the merits of these two key designs into linear attention. The resulting model outperforms various vision Mamba models in both image classification and high-resolution dense prediction tasks, while enjoying parallelizable computation and fast inference speed. Code is available at https://github.com/LeapLabTHU/MLLA.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

49 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Rectifying Magnitude Neglect in Linear Attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Rectifying Magnitude Neglect in Linear Attention cites A ConvNet for the 2020s
  • Rectifying Magnitude Neglect in Linear Attention cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Rectifying Magnitude Neglect in Linear Attention cites Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
  • Rectifying Magnitude Neglect in Linear Attention cites Bridging the Divide: Reconsidering Softmax and Linear Attention
  • A ConvNet for the 2020s cites CutMix: Regularization Strategy to Train Strong Classifiers With Localizable Features
  • A ConvNet for the 2020s cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • A ConvNet for the 2020s cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites CutMix: Regularization Strategy to Train Strong Classifiers With Localizable Features
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
  • ENAT: Rethinking Spatial-temporal Interactions in Token-based Image Synthesis cites Bridging the Divide: Reconsidering Softmax and Linear Attention
  • Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions cites CutMix: Regularization Strategy to Train Strong Classifiers With Localizable Features
  • Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • VSSD: Vision Mamba With Non-Causal State Space Duality cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • VSSD: Vision Mamba With Non-Causal State Space Duality cites A ConvNet for the 2020s
  • VSSD: Vision Mamba With Non-Causal State Space Duality cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • VSSD: Vision Mamba With Non-Causal State Space Duality cites Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
  • Bridging the Divide: Reconsidering Softmax and Linear Attention cites CutMix: Regularization Strategy to Train Strong Classifiers With Localizable Features
  • Bridging the Divide: Reconsidering Softmax and Linear Attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Bridging the Divide: Reconsidering Softmax and Linear Attention cites A ConvNet for the 2020s
  • Bridging the Divide: Reconsidering Softmax and Linear Attention cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Bridging the Divide: Reconsidering Softmax and Linear Attention cites Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions
  • CLEAR: Conv-Like Linearization Revs Pre-Trained Diffusion Transformers Up cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers49

  1. Bridging the Divide: Reconsidering Softmax and Linear AttentionDongchen Han, Yifan Pu, Zhuofan Xia, Yizeng Han et al.NeurIPS 2024 · 69 citations
  2. CLEAR: Conv-Like Linearization Revs Pre-Trained Diffusion Transformers UpSonghua Liu, Zhenxiong Tan, Xinchao WangNeurIPS 2025 · 33 citations
  3. VSSD: Vision Mamba With Non-Causal State Space DualityYuheng Shi, Mingjia Li, Minjing Dong, Chang XuICCV 2025 · 20 citations
  4. ENAT: Rethinking Spatial-temporal Interactions in Token-based Image SynthesisZanlin Ni, Yulin Wang, Renping Zhou, Yizeng Han et al.NeurIPS 2024 · 15 citations
  5. Rectifying Magnitude Neglect in Linear AttentionQihang Fan, Huaibo Huang, Yuang Ai, Ran HeICCV 2025 · 14 citations

Builds on31

  1. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  3. A ConvNet for the 2020sZhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer et al.CVPR 2022 · 6,782 citations
  4. CutMix: Regularization Strategy to Train Strong Classifiers With Localizable FeaturesSangdoo Yun, Dongyoon Han, Sanghyuk Chun, Seong Joon Oh et al.ICCV 2019 · 5,843 citations
  5. Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without ConvolutionsWenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan et al.ICCV 2021 · 4,909 citations

Related papers

  1. MobileMamba: Lightweight Multi-Receptive Visual Mamba NetworkHaoyang He, Jiangning Zhang, Yuxuan Cai, Hongxu Chen et al.CVPR 2025
  2. EfficientVMamba: Atrous Selective Scan for Light Weight Visual MambaXiaohuan Pei, Tao Huang, Chang XuAAAI 2025 · 248 citations
  3. VMamba: Visual State Space ModelYue Liu, Yunjie Tian, Yuzhong Zhao, Hongtian Yu et al.NeurIPS 2024 · 3,199 citations
  4. Mamba-3: Improved Sequence Modeling using State Space PrinciplesAakash Sunil Lahoti, Kevin Y. Li, Berlin Chen, Caitlin Wang et al.ICLR 2026 · 96 citations
  5. The Hidden Attention of Mamba ModelsAmeen Ali, Itamar Zimerman, Lior WolfACL 2025
Dusk over the sea between two cliffs drawn in fine vertical lines