Lune

ICML2024Top-tier venue

Can Mamba Learn How To Learn? A Comparative Study on In-Context Learning Tasks

Jongho Park, Jaeseung Park, Zheyang Xiong, Nayoung Lee, Jaewoong Cho, Samet Oymak, Kangwook Lee, Dimitris Papailiopoulos

Abstract

State-space models (SSMs), such as Mamba (Gu & Dao, 2023) , have been proposed as alternatives to Transformer networks in language modeling, by incorporating gating, convolutions, and input-dependent token selection to mitigate the quadratic cost of multi-head attention. Although SSMs exhibit competitive performance, their in-context learning (ICL) capabilities, a remarkable emergent property of modern language models that enables task execution without parameter optimization, remain underexplored compared to Transformers. In this study, we evaluate the ICL performance of SSMs, focusing on Mamba, against Transformer models across various tasks. Our results show that SSMs perform comparably to Transformers in standard regression ICL tasks, while outperforming them in tasks like sparse parity learning. However, SSMs fall short in tasks involving non-standard retrieval functionality. To address these limitations, we introduce a hybrid model, MambaFormer, that combines Mamba with attention blocks, surpassing individual models in tasks where they struggle independently. Our findings suggest that hybrid architectures offer promising avenues for enhancing ICL in language models.

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.

40 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

  • Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyond cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyond cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyond cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyond cites Language Models are Few-Shot Learners
  • Efficiently Modeling Long Sequences with Structured State Spaces cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Affirm: Interactive Mamba with Adaptive Fourier Filters for Long-term Time Series Forecasting cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • An Explanation of In-context Learning as Implicit Bayesian Inference cites Language Models are Few-Shot Learners
  • MetaFormer is Actually What You Need for Vision cites Language Models are Few-Shot Learners
  • Repeat After Me: Transformers are Better than State Space Models at Copying cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Repeat After Me: Transformers are Better than State Space Models at Copying cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Repeat After Me: Transformers are Better than State Space Models at Copying cites Language Models are Few-Shot Learners
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Language Models are Few-Shot Learners
  • Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality cites Repeat After Me: Transformers are Better than State Space Models at Copying
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers40

  1. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
  2. Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen et al.NeurIPS 2024 · 412 citations
  3. Repeat After Me: Transformers are Better than State Space Models at CopyingSamy Jelassi, David Brandfonbrener, Sham M. Kakade, Eran MalachICML 2024 · 176 citations
  4. Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and BeyondYingcong Li, Ankit Singh Rawat, Samet OymakNeurIPS 2024 · 24 citations
  5. Affirm: Interactive Mamba with Adaptive Fourier Filters for Long-term Time Series ForecastingYuhan Wu, Xiyu Meng, Huajin Hu, Junru Zhang et al.AAAI 2025 · 24 citations

Builds on35

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 citations
  3. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  4. MetaFormer is Actually What You Need for VisionWeihao Yu, Mi Luo, Pan Zhou, Chenyang Si et al.CVPR 2022 · 1,114 citations
  5. An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations

Related papers

  1. Trained Mamba Emulates Online Gradient Descent in In-Context Linear RegressionJiarui Jiang, Wei Huang, Miao Zhang, Taiji Suzuki et al.NeurIPS 2025 · 2 citations
  2. From Markov to Laplace: How Mamba In-Context Learns Markov ChainsMarco Bondaschi, Nived Rajaraman, Xiuying Wei, Razvan Pascanu et al.ICLR 2026 · 10 citations
  3. Understanding In-Context Learning Beyond Transformers: An Investigation of State Space and Hybrid ArchitecturesShenran Wang, Timothy Tin-Long Tse, Jian ZhuACL Findings 2026
  4. Understanding Input Selectivity in Mamba: Impact on Approximation Power, Memorization, and Associative Recall CapacityNingyuan Teresa Huang, Miguel Sarabia, Abhinav Moudgil, Pau Rodríguez et al.ICML 2025
  5. TransMamba: A Sequence-Level Hybrid Transformer-Mamba Language ModelYixing Li, Ruobing Xie, Zhen Yang, Xingwu Sun et al.AAAI 2026 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines