Lune

ICML2024Top-tier venue

Repeat After Me: Transformers are Better than State Space Models at Copying

Samy Jelassi, David Brandfonbrener, Sham M. Kakade, Eran Malach

Abstract

Transformers are the dominant architecture for sequence modeling, but there is growing interest in models that use a fixed-size latent state that does not depend on the sequence length, which we refer to as "generalized state space models" (GSSMs). In this paper we show that while GSSMs are promising in terms of inference-time efficiency, they are limited compared to transformer models on tasks that require copying from the input context. We start with a theoretical analysis of the simple task of string copying and prove that a two layer transformer can copy strings of exponential length while GSSMs are fundamentally limited by their fixed-size latent state. Empirically, we find that transformers outperform GSSMs in terms of efficiency and generalization on synthetic tasks that require copying the context. Finally, we evaluate pretrained large language models and find that transformer models dramatically outperform state space models at copying and retrieving information from context. Taken together, these results suggest a fundamental gap between transformers and GSSMs on tasks of practical interest.

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.

88 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

  • Theoretical Foundations of Deep Selective State-Space Models cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Efficiently Modeling Long Sequences with Structured State Spaces
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Language Models are Few-Shot Learners
  • Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling 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
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
  • 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 Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling
  • 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
  • TTT3R: 3D Reconstruction as Test-Time Training cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • TTT3R: 3D Reconstruction as Test-Time Training cites Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers88

  1. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
  2. TTT3R: 3D Reconstruction as Test-Time TrainingXingyu Chen, Yue Chen, Yuliang Xiu, Andreas Geiger et al.ICLR 2026 · 139 citations
  3. Theoretical Foundations of Deep Selective State-Space ModelsNicola Muca Cirone, Antonio Orvieto, Benjamin Walker, Cristopher Salvi et al.NeurIPS 2024 · 97 citations
  4. Gated Slot Attention for Efficient Linear-Time Sequence ModelingYu Zhang, Songlin Yang, Rui-Jie Zhu, Yue Zhang et al.NeurIPS 2024 · 93 citations
  5. Hydra: Bidirectional State Space Models Through Generalized Matrix MixersSukjun Hwang, Aakash Sunil Lahoti, Ratish Puduppully, Tri Dao et al.NeurIPS 2024 · 54 citations

Builds on20

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  3. Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 citations
  4. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  5. Pythia: A Suite for Analyzing Large Language Models Across Training and ScalingStella Biderman, Hailey Schoelkopf, Quentin Gregory Anthony, Herbie Bradley et al.ICML 2023 · 1,822 citations

Related papers

  1. To Infinity and Beyond: Tool-Use Unlocks Length Generalization in State Space ModelsEran Malach, Omid Saremi, Sinead Williamson, Arwen Bradley et al.ICLR 2026 · 3 citations
  2. The Expressivity Limits of TransformersMaxime Meyer, Mario Michelessa, Caroline Chaux, Vincent TanICML 2026
  3. Expressivity-Efficiency Tradeoffs for Hybrid Sequence ModelsJohn Cooper, Mingchen Ma, Ilias Diakonikolas, Frederic SalaICML 2026
  4. Scaling up the State Size of RNN LLMs for Long-Context ScenariosKai Liu, Jianfei Gao, Kai ChenACL 2025 · 1 citation
  5. On the "Induction Bias" in Sequence ModelsMohammadReza Ebrahimi, Michaël Defferrard, Sunny Panchal, Roland MemisevicICML 2026 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines