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, Etai Littwin, Josh Susskind, Cengiz Pehlevan, Eran Malach
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.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI
- Comments
- 25 pages, 5 figures
Related papers
Long-Context Demonstration Selection Using State Space Models
Shared title terminologycs.LGZiniu Zhang, Zhenshuo Zhang, Ruoxuan Xiong et al.
Large Language Models Develop Belief State Geometry In-Context
Shared title terminologycs.LGDaniel Balcells, Andrew Jun Lee, Chirag Rastogi et al.
What Does Layer-Importance Reveal About Transformers and State-Space Models?
Shared title terminologycs.LGIstabrak Abbes, Nizar Islah, Irina Rish et al.
Compressing Gated DeltaNet States with a Shared Value Basis and an Adaptive Residual
Shared title terminologycs.LGIvan Krivorotov, Egor Maximov, Aleksei Merkelov et al.
FIMOSS: Fair In-Context Learning via Multi-Objective Subset Selection
Shared title terminologycs.LGManish Chandra, Debasis Ganguly, Iadh Ounis
ContextWorld: Benchmarking In-Context Dynamics Adaptation in Latent World Models
Shared title terminologycs.LGGuo An, Yuhao Yan, Zijing Wu et al.