Skip to content

On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models

Sep 2026 · 0 citations · 45 references
Computer Science

TL;DR

It is shown 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, and that gating is often beneficial for improving generalization to long sequence lengths.

Abstract

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.

View source

Similar papers

#machine learning Preprint Sep 2026

Reinforcement Learning with Complex (valued) Memories

Partially observable environments pose a fundamental challenge in deep reinforcement learning, requiring agents to compress temporal information from observations and maintain a memory to make effective decisions. While there exist many approaches ranging from gated recurrence to attention mechanisms and model-based RL...

Sathya Kamesh Bhethanabhotla, Efstratios Gavves, André Biedenkapp · 0 citations
#artificial intelligence Preprint Sep 2026

The Attention Within: Consensus Dynamics in Selective State Space Models

Selective state space models (SSMs) have recently emerged as a compelling alternative to transformers, combining competitive performance with substantially improved inference efficiency. At each SSM layer, a sequence of hidden states are propagated by a recurrence, mixing information of different tokens. Despite using...

João Pedro Silvestre, Álvaro Rodríguez Abella, Paulo Tabuada · 1 citation
#machine learning Preprint Sep 2026

Theory on Attention Dynamics for Out-of-Distribution In-Context Learning

This work characterize the OOD error under the input distribution shift through the interplay between the dynamics of the so-called $\alpha$-type and $\beta$-type attention weights, which represent the transformer's confidence in identifying the correct and incorrect features, respectively.

Jun-Ze Deng, Daouda Sow, Sen-Fon Lin et al. · 0 citations
#artificial intelligence Preprint Oct 2026

How Learning Governs Unlearning across the Memorization-Generalization Spectrum

While unlearning seeks to negate undesired capabilities acquired through learning, little research has examined how the way models learn shapes their subsequent unlearning. In this paper, we investigate this connection from the perspectives of memorization and generalization, the two most representative yet competing s...

Hwiyeong Lee, H. Lim, Ingyu Bang et al. · 0 citations
#artificial intelligence Preprint Sep 2026

Learning Under Forgetting: Statistical Support-Selective Retention in Stochastic Training Dynamics

Prior work has shown that neural networks exhibit implicit biases toward low-complexity structure (e.g., spectral bias), memorization dynamics, and compression-like effects during training, but a unified dynamical account of selective retention remains incomplete. We propose Repeated Reinforcement with Persistent Forge...

Fu-Jie Gao, Zu-Yue Zhang, Gang Sun · 0 citations
#natural language process... Preprint Sep 2026

Complementary Roles of Activation and Parametric Memory in Few-Shot Learning

At test time, large language models (LLMs) can encode historical information in activation memory (i.e., KV caches) and parametric memory (i.e., updated parameters). While activation memory is generally considered effective for factual recall and parametric memory for learning new tasks, their interplay remains unclear...

Miao-He Niu, Run-Song Zhao, Xin-Yu Liu et al. · 0 citations

Related blog posts

MIT News · Artificial Intelligence Sep 29, 2026

Who we become when we talk to machines

Professor Sherry Turkle’s new book, “Artificial Intimacy,” offers a withering critique of chatbots and the antisocial dynamics she believes they encourage.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.