Separations in the Representational Capabilities of Transformers and Recurrent Architectures
Not on the map. Why?
Abstract (arXiv)
Transformer architectures have been widely adopted in foundation models. Due to their high inference costs, there is renewed interest in exploring the potential of efficient recurrent architectures (RNNs). In this paper, we analyze the differences in the representational capabilities of Transformers and RNNs across several tasks of practical relevance, including index lookup, nearest neighbor, recognizing bounded Dyck languages, and string equality. For the tasks considered, our results show separations based on the size of the model required for different architectures. For example, we show that a one-layer Transformer of logarithmic width can perform index lookup, whereas an RNN requires a hidden state of linear size. Conversely, while constant-size RNNs can recognize bounded Dyck languages, we show that one-layer Transformers require a linear size for this task. Furthermore, we show that two-layer Transformers of logarithmic size can perform decision tasks such as string equality or disjointness, whereas both one-layer Transformers and recurrent models require linear size for these tasks. We also show that a log-size two-layer Transformer can implement the nearest neighbor algorithm in its forward pass; on the other hand recurrent models require linear size. Our constructions are based on the existence of N nearly orthogonal vectors in O(log N) dimensional space and our lower bounds are based on reductions from communication complexity problems. We supplement our theoretical results with experiments that highlight the differences in the performance of these architectures on practical-size sequences.
Key facts. Cited by 29 papers in the map (data through 7 Oct 2026). Builds on 42 of its 69 references that are in the map. First posted on arXiv 13 Jun 2024.
Builds on
42 of 69 references.
References · 42
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2023RWKV: Reinventing RNNs for the Transformer Eracited by 814
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
- 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 397
- 2022Diagonal State Spaces are as Effective as Structured State Spacescited by 350
30 more
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
- 2022Transformers Learn Shortcuts to Automatacited by 260
- 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
- 2022The Parallelism Tradeoff: Limitations of Log-Precision Transformerscited by 191
- 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 188
- 2021Thinking Like Transformerscited by 182
- 2016Using Fast Weights to Attend to the Recent Pastcited by 161
- 2023Representational Strengths and Limitations of Transformerscited by 132
- 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
- 2023What Formal Languages Can Transformers Express? A Surveycited by 120
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2023Tracr: Compiled Transformers as a Laboratory for Interpretabilitycited by 99
- 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 92
- 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
- 2024Transformers, parallel computation, and logarithmic depthcited by 75
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
- 2022A Logic for Expressing Log-Precision Transformerscited by 67
- 2023Tighter Bounds on the Expressivity of Transformer Encoderscited by 65
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
- 2020RNNs can generate bounded hierarchical languages with optimal memorycited by 59
- 2020How Can Self-Attention Networks Recognize Dyck-n Languages?cited by 51
- 2019LSTM Networks Can Perform Dynamic Countingcited by 45
- 2019On the Computational Power of RNNscited by 35
- 2019Memory-Augmented Recurrent Neural Networks Can Learn Generalized Dyck Languagescited by 31
- 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
- 2020On the Practical Ability of Recurrent Neural Networks to Recognize Hierarchical Languagescited by 22
Built on by
Citing papers per year: 2024: 4; 2025: 14; 2026: 11.
29 papers.
Sort:
By area:
- 2024Unlocking State-Tracking in Linear RNNs Through Negative Eigenvaluescited by 97
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformerscited by 28
- 2024Training Neural Networks as Recognizers of Formal Languagescited by 23
- 2025Strassen Attention, Split VC Dimension and Compositionality in Transformerscited by 12
- 2025From Markov to Laplace: How Mamba In-Context Learns Markov Chainscited by 9
- 2025Lost in Transmission: When and Why LLMs Fail to Reason Globallycited by 9
- 2025Pause Tokens Strictly Increase the Expressivity of Constant-Depth Transformerscited by 8
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learningcited by 7
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilitiescited by 6
- 2025The Transformer Cookbookcited by 5
- 2024On the Benefits of Rank in Attention Layerscited by 4
17 more
- 2024Lower bounds on transformers with infinite precisioncited by 3
- 2025A completely uniform transformer for paritycited by 3
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More Morecited by 3
- 2026Barriers to Discrete Reasoning with Transformers: A Survey Across Depth, Exactness, and Bandwidthcited by 3
- 2025When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspectivecited by 2
- 2025Fast attention mechanisms: a tale of parallelismcited by 2
- 2025Two Heads Are Better than One: Simulating Large Transformers with Small Onescited by 1
- 2025Hybrid Quantum-Classical Recurrent Neural Networkscited by 1
- 2026Universal computation is intrinsic to language model decodingcited by 1
- 2026A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attentioncited by 1
- 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalizationcited by 1
- 2026Every Bit Counts: A Theoretical Study of Precision-Expressivity Tradeoffs in Quantized Transformerscited by 0
- 2026On the Role of Depth in the Expressivity of RNNscited by 0
- 2026Position: Avoid Overstretching LLMs for every Enterprise Taskcited by 0
- 2026Inference Time Context Sparsity: Illusion or Opportunity?cited by 0
- 2026From Expressivity to Sample Complexity: Narrow Teachers for Transformers via C-RASPcited by 0
- 2026Three Tokens Force Exponential Feature Rank in Nonnegative Kernel Attentioncited by 0
- 2026Three Tokens Force Exponential Feature Rank in Nonnegative Kernel Attention11 Aug 2026
- 2026From Expressivity to Sample Complexity: Narrow Teachers for Transformers via C-RASP13 Jul 2026
- 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalization29 May 2026
- 2026Inference Time Context Sparsity: Illusion or Opportunity?22 May 2026
- 2026Position: Avoid Overstretching LLMs for every Enterprise Task10 May 2026
- 2026On the Role of Depth in the Expressivity of RNNs2 Apr 2026
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learning3 Feb 2026
- 2026Every Bit Counts: A Theoretical Study of Precision-Expressivity Tradeoffs in Quantized Transformers2 Feb 2026
- 2026A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attention2 Feb 2026
- 2026Barriers to Discrete Reasoning with Transformers: A Survey Across Depth, Exactness, and Bandwidth19 Jan 2026
- 2026Universal computation is intrinsic to language model decoding12 Jan 2026
- 2025Hybrid Quantum-Classical Recurrent Neural Networks29 Oct 2025
17 more
- 2025The Transformer Cookbook1 Oct 2025
- 2025Fast attention mechanisms: a tale of parallelism10 Sep 2025
- 2025Two Heads Are Better than One: Simulating Large Transformers with Small Ones13 Jun 2025
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilities27 May 2025
- 2025Pause Tokens Strictly Increase the Expressivity of Constant-Depth Transformers27 May 2025
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformations22 May 2025
- 2025Lost in Transmission: When and Why LLMs Fail to Reason Globally13 May 2025
- 2025When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspective14 Mar 2025
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More More13 Mar 2025
- 2025From Markov to Laplace: How Mamba In-Context Learns Markov Chains14 Feb 2025
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers4 Feb 2025
- 2025Strassen Attention, Split VC Dimension and Compositionality in Transformers31 Jan 2025
- 2025A completely uniform transformer for parity5 Jan 2025
- 2024Lower bounds on transformers with infinite precision28 Dec 2024
- 2024Unlocking State-Tracking in Linear RNNs Through Negative Eigenvalues19 Nov 2024
- 2024Training Neural Networks as Recognizers of Formal Languages11 Nov 2024
- 2024On the Benefits of Rank in Attention Layers23 Jul 2024
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
- 2025Strassen Attention, Split VC Dimension and Compositionality in Transformerscited by 12
- 2025Pause Tokens Strictly Increase the Expressivity of Constant-Depth Transformerscited by 8
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learningcited by 7
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilitiescited by 6
- 2025The Transformer Cookbookcited by 5
- 2024On the Benefits of Rank in Attention Layerscited by 4
- 2024Lower bounds on transformers with infinite precisioncited by 3
- 2025A completely uniform transformer for paritycited by 3
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More Morecited by 3
- 2026Barriers to Discrete Reasoning with Transformers: A Survey Across Depth, Exactness, and Bandwidthcited by 3
- 2025When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspectivecited by 2
12 most cited of 24 All 24 (JSON)
- 2026Three Tokens Force Exponential Feature Rank in Nonnegative Kernel Attention11 Aug 2026
- 2026From Expressivity to Sample Complexity: Narrow Teachers for Transformers via C-RASP13 Jul 2026
- 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalization29 May 2026
- 2026Inference Time Context Sparsity: Illusion or Opportunity?22 May 2026
- 2026Position: Avoid Overstretching LLMs for every Enterprise Task10 May 2026
- 2026On the Role of Depth in the Expressivity of RNNs2 Apr 2026
- 2026Sequential Group Composition: A Window into the Mechanics of Deep Learning3 Feb 2026
- 2026Every Bit Counts: A Theoretical Study of Precision-Expressivity Tradeoffs in Quantized Transformers2 Feb 2026
- 2026A Provable Expressiveness Hierarchy in Hybrid Linear-Full Attention2 Feb 2026
- 2026Barriers to Discrete Reasoning with Transformers: A Survey Across Depth, Exactness, and Bandwidth19 Jan 2026
- 2026Universal computation is intrinsic to language model decoding12 Jan 2026
- 2025Hybrid Quantum-Classical Recurrent Neural Networks29 Oct 2025
12 newest of 24 All 24 (JSON)