Lune

NeurIPS2025Top-tier venue

Compositional Reasoning with Transformers, RNNs, and Chain of Thought

Gilad Yehudai, Noah Amsel, Joan Bruna

Abstract

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 treelike 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.

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.

2 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

  • The Expressive Power of Transformers with Chain of Thought cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • The Expressive Power of Transformers with Chain of Thought cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
  • Chain of Thought Empowers Transformers to Solve Inherently Serial Problems cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Chain of Thought Empowers Transformers to Solve Inherently Serial Problems cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
  • How does Chain of Thought decompose complex tasks? cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • How does Chain of Thought decompose complex tasks? cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
  • Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Are Transformers universal approximators of sequence-to-sequence functions?
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. The Coverage Principle: How Pre-Training Enables Post-TrainingFan Chen, Audrey Huang, Noah Golowich, Sadhika Malladi et al.ICLR 2026 · 28 citations
  2. How does Chain of Thought decompose complex tasks?Amrut Nadgir, Vijay Balasubramanian, Pratik ChaudhariICML 2026 · 1 citation

Builds on19

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  2. Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi et al.ICLR 2020 · 481 citations
  3. Towards Revealing the Mystery behind Chain of Thought: A Theoretical PerspectiveGuhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye et al.NeurIPS 2023 · 470 citations
  4. Chain of Thought Empowers Transformers to Solve Inherently Serial ProblemsZhiyuan Liu, Hong Liu, Denny Zhou, Tengyu MaICLR 2024 · 259 citations
  5. The Expressive Power of Transformers with Chain of ThoughtWilliam Merrill, Ashish SabharwalICLR 2024 · 243 citations

Related papers

  1. Chain-of-Thought Provably Enables Learning the (Otherwise) UnlearnableChenxiao Yang, Zhiyuan Li, David WipfICLR 2025
  2. Understanding Transformer Reasoning Capabilities via Graph AlgorithmsClayton Sanford, Bahare Fatemi, Ethan Hall, Anton Tsitsulin et al.NeurIPS 2024 · 84 citations
  3. Dissecting Chain-of-Thought: Compositionality through In-Context Filtering and LearningYingcong Li, Kartik Sreenivasan, Angeliki Giannou, Dimitris Papailiopoulos et al.NeurIPS 2023 · 12 citations
  4. Ehrenfeucht-Haussler Rank and Chain of ThoughtPablo Barceló, Alexander Kozachinskiy, Tomasz SteiferICML 2025
  5. Analyzing the Power of Chain of Thought through Memorization CapabilitiesLijia Yu, Xiao-Shan Gao, Lijun ZhangNeurIPS 2025 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines