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

William L. Tong, Aryo Lotfi, Emmanuel Abbe, Kostas Vaggelakos, Vishnu Banna +4 more
9/15/2026
cs.LGcs.AI

No confident code implementation found for this paper.

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 on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{tong2026importance,
  title  = {On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models},
  author = {William L. Tong and Aryo Lotfi and Emmanuel Abbe and Kostas Vaggelakos and Vishnu Banna and Etai Littwin and Josh Susskind and Cengiz Pehlevan and Eran Malach},
  year   = {2026},
  eprint = {2609.16540},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.16540v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.16540.svg)](https://codeofpaper.com/paper/2609.16540)

Discussion