mlsanityData to 7 Oct 2026

Compositional Reasoning with Transformers, RNNs, and Chain of Thought

arXiv 2503.01544 ↗First posted 3 Mar 2025cs.LG cs.AI cs.CLcited by 6

On the map: LLM reasoning → Prompting and chain-of-thought reasoning

Abstract (arXiv)

It is well understood that different neural network architectures are suited to different tasks, but is there always a single best architecture for a given task? We compare the expressive power of transformers, RNNs, and transformers with chain of thought tokens on a simple and natural class of tasks we term Compositional Reasoning Questions (CRQ). This family captures multi-step problems with tree-like compositional structure, such as evaluating Boolean formulas. We prove that under standard hardness assumptions, none of these three architectures is capable of solving CRQs unless some hyperparameter (depth, embedding dimension, and number of chain of thought tokens, respectively) grows with the size of the input. We then provide constructions for solving CRQs with each architecture. For transformers, our construction uses depth that is logarithmic in the problem size. For RNNs, logarithmic embedding dimension is necessary and sufficient, so long as the inputs are provided in a certain order. For transformers with chain of thought, our construction uses n CoT tokens for input size n. These results show that, while CRQs are inherently hard, there are several different ways for language models to overcome this hardness. Even for a single class of problems, each architecture has strengths and weaknesses, and none is strictly better than the others.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in Prompting and chain-of-thought reasoning, one of 17 directions in LLM reasoning. Builds on 30 of its 47 references that are in the map. First posted on arXiv 3 Mar 2025.

Builds on

30 of 47 references.

Closest ancestors · 6

Same direction, newest first

  1. 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers4 Feb
  2. 2024Understanding Transformer Reasoning Capabilities via Graph Algorithms28 May
  3. 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problems20 Feb
  4. 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective24 May
  5. 2022A Logic for Expressing Log-Precision Transformers6 Oct
  6. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Models28 Jan

Other references · 24

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  3. 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
  4. 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
  5. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
  6. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 286
  7. 2022Transformers Learn Shortcuts to Automatacited by 260
  8. 2023Looped Transformers as Programmable Computerscited by 224
  9. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
  10. 2022The Parallelism Tradeoff: Limitations of Log-Precision Transformerscited by 191
  11. 2024The Illusion of State in State-Space Modelscited by 181
  12. 2019CLUTRR: A Diagnostic Benchmark for Inductive Reasoning from Textcited by 155
12 more
  1. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
  2. 2023Representational Strengths and Limitations of Transformerscited by 132
  3. 2023What Formal Languages Can Transformers Express? A Surveycited by 120
  4. 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
  5. 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 92
  6. 2020A Formal Hierarchy of RNN Architecturescited by 61
  7. 2019Sequential Neural Networks as Automatacited by 54
  8. 2017Depth Separation for Neural Networkscited by 46
  9. 2024Theoretical limitations of multi-layer Transformercited by 43
  10. 2019On the Computational Power of RNNscited by 35
  11. 2024When Can Transformers Count to n?cited by 22
  12. 2024On the Benefits of Rank in Attention Layerscited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 5.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Transformers Provably Solve Parity Efficiently with Chain of Thought
  2. 2023Do Deep Neural Networks Capture Compositionality in Arithmetic Reasoning?
  3. 2025Analyzing the Power of Chain of Thought through Memorization Capabilities
  4. 2026Thinking Deeper, Not Longer: Memory-Efficient Test-Time Reasoning with Depth-Recurrent Transformers for Compositional Generalization
  5. 2026Compositional Neuro-Symbolic Reasoning
  6. 2025Latent Chain-of-Thought? Decoding the Depth-Recurrent Transformer
  7. 2023Dissecting Chain-of-Thought: Compositionality through In-Context Filtering and Learning
  8. 2025To CoT or To Loop? A Formal Comparison Between Chain-of-Thought and Looped Transformers