On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models
Not on the map. Why?
Abstract (arXiv)
State Space Models (SSMs) have emerged as a compelling alternative to Transformers, enabling sequence modeling with constant memory and linear compute. Although SSMs exhibit reasonable performance and favorable computational characteristics, they continue to lag behind Transformers on tasks that require in-context learning and precise retrieval, slowing their adoption for large-scale language modeling. In this work, we demonstrate that both the success and failure of SSMs in these domains can be explained by studying the role of the gating mechanism, a prevalent component in modern recurrent networks. Specifically, we show through theory and experiments that this gating mechanism causes SSMs to first learn an in-weights "memorization" solution, while delaying, or even preventing, convergence to a correct in-context learning solution. Importantly, this happens even in cases where there are no fundamental limitations due to the architecture or its memory capacity. On the other hand, we find that gating is often beneficial for improving generalization to long sequence lengths. Our results illuminate the crucial role of the gating mechanism in shaping both the training dynamics and generalization of SSMs, and provide a basis for understanding and improving linear-time models.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 36 of its 45 references that are in the map. First posted on arXiv 15 Sep 2026.
Builds on
36 of 45 references.
References · 36
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,880
- 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,283
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
- 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
- 2024Gated Delta Networks: Improving Mamba2 with Delta Rulecited by 483
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
24 more
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
- 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 188
- 2024An Empirical Study of Mamba-based Language Modelscited by 177
- 2024Nemotron-CC: Transforming Common Crawl into a Refined Long-Horizon Pretraining Datasetcited by 153
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Taskscited by 104
- 2025NVIDIA Nemotron Nano 2: An Accurate and Efficient Hybrid Mamba-Transformer Reasoning Modelcited by 94
- 2024Asymptotic theory of in-context learning by linear attentioncited by 54
- 2025NVIDIA Nemotron 3: Efficient and Open Intelligencecited by 54
- 2024Is Mamba Capable of In-Context Learning?cited by 45
- 2024DeciMamba: Exploring the Length Extrapolation Potential of Mambacited by 45
- 2025Understanding and Improving Length Generalization in Recurrent Modelscited by 19
- 2024Understanding and Mitigating Bottlenecks of State Space Models through the Lens of Recency and Over-smoothingcited by 17
- 2024Mimetic Initialization Helps State Space Models Learn to Recallcited by 15
- 2025Mamba Modulation: On the Length Generalization of Mambacited by 13
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2024Exploring the Limitations of Mamba in COPY and CoT Reasoningcited by 6
- 2025Understanding Input Selectivity in Mamba: Impact on Approximation Power, Memorization, and Associative Recall Capacitycited by 6
- 2025Overcoming Long-Context Limitations of State-Space Models via Context-Dependent Sparse Attentioncited by 5
- 2025MemMamba: Rethinking Memory Patterns in State Space Modelcited by 3
- 2025To Infinity and Beyond: Tool-Use Unlocks Length Generalization in State Space Modelscited by 3
- 2024Revealing and Mitigating the Local Pattern Shortcuts of Mambacited by 2
- 2026On the Recall Scaling Laws in Mamba: A Theoretical and Mechanistic Study via Hashingcited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Mathematical Formalism for Memory Compression in Selective State Space Models
- 2025Memory Determines Learning Direction: A Theory of Gradient-Based Optimization in State Space Models
- 2023State space models can express n-gram languages
- 2024State Soup: In-Context Skill Learning, Retrieval and Mixing
- 2025Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free
- 2024Birdie: Advancing State Space Models with Reward-Driven Objectives and Curricula
- 2024Longhorn: State Space Models are Amortized Online Learners
- 2026RunningTensor: Generalizing Linear Attention to Higher-Order Recurrent States