Transformers Struggle to Learn to Search
Not on the map. Why?
Abstract (arXiv)
Search is an ability foundational in many important tasks, and recent studies have shown that large language models (LLMs) struggle to perform search robustly. It is unknown whether this inability is due to a lack of data, insufficient model parameters, or fundamental limitations of the transformer architecture. In this work, we use the foundational graph connectivity problem as a testbed to generate effectively limitless high-coverage data to train small transformers and test whether they can learn to perform search. We find that, when given the right training distribution, the transformer is able to learn to search. We analyze the algorithm that the transformer has learned through a novel mechanistic interpretability technique that enables us to extract the computation graph from the trained model. We find that transformers perform search at every vertex in parallel: For each vertex in the input graph, transformers compute the set of vertices reachable from that vertex. Each layer then progressively expands these sets, allowing the model to search over a number of vertices exponential in nlayers. However, we find that as the input graph size increases, the transformer has greater difficulty in learning the task. This difficulty is not resolved even as the number of parameters is increased, suggesting that increasing model scale will not lead to robust search abilities. We also find that performing search in-context (i.e., chain-of-thought) does not resolve this inability to learn to search on larger graphs.
Key facts. Cited by 19 papers in the map (data through 14 Oct 2026). Builds on 39 of its 51 references that are in the map. First posted on arXiv 6 Dec 2024.
Builds on
39 of 51 references.
References · 39
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
- 2023Reasoning with Language Model is Planning with World Modelcited by 861
- 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 523
- 2020Scaling Laws for Autoregressive Generative Modelingcited by 522
- 2021Causal Abstractions of Neural Networkscited by 422
- 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 359
27 more
- 2022Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thoughtcited by 337
- 2022Selection-Inference: Exploiting Large Language Models for Interpretable Logical Reasoningcited by 334
- 2023Sophia: A Scalable Stochastic Second-order Optimizer for Language Model Pre-trainingcited by 265
- 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 263
- 2023Can Language Models Solve Graph Problems in Natural Language?cited by 252
- 2024How to use and interpret activation patchingcited by 214
- 2020Causal Mediation Analysis for Interpreting Neural NLP: The Case of Gender Biascited by 191
- 2024LLMs Can't Plan, But Can Help Planning in LLM-Modulo Frameworkscited by 179
- 2024Do Large Language Models Latently Perform Multi-Hop Reasoning?cited by 169
- 2024The pitfalls of next-token predictioncited by 160
- 2024Stream of Search (SoS): Learning to Search in Languagecited by 145
- 2022Broken Neural Scaling Lawscited by 109
- 2024Understanding Emergent Abilities of Language Models from the Loss Perspectivecited by 94
- 2022On the Paradox of Learning to Reason from Datacited by 93
- 2023A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysiscited by 89
- 2023NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classescited by 79
- 2024Transformers, parallel computation, and logarithmic depthcited by 79
- 2024Understanding Transformer Reasoning Capabilities via Graph Algorithmscited by 67
- 2022LAMBADA: Backward Chaining for Automated Reasoning in Natural Languagecited by 66
- 2023Towards a Mechanistic Interpretation of Multi-Step Reasoning Capabilities of Language Modelscited by 50
- 2024Amortized Planning with Large-Scale Transformers: A Case Study on Chesscited by 49
- 2024A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Taskcited by 49
- 2024Can LLM Graph Reasoning Generalize beyond Pattern Memorization?cited by 47
- 2024Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzlescited by 38
- 2024Evidence of Learned Look-Ahead in a Chess-Playing Neural Networkcited by 34
- 2024Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inferencecited by 29
- 2024MANGO: A Benchmark for Evaluating Mapping and Navigation Abilities of Large Language Modelscited by 9
Built on by
Citing papers per year: 2025: 10; 2026: 9.
19 papers.
Sort:
By area:
- 2025BIG-Bench Extra Hardcited by 125
- 2025In-Context Algebracited by 5
- 2026Transferability for General Reasoning: An Automated Curriculum for Multi-Domain RLVRcited by 5
- 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architecturescited by 4
- 2025Are Language Models Efficient Reasoners? A Perspective from Logic Programmingcited by 4
- 2026Discrete Diffusion Models Exploit Asymmetry to Solve Lookahead Planning Taskscited by 4
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More Morecited by 3
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
- 2025Uncovering Graph Reasoning in Decoder-only Transformers with Circuit Tracingcited by 3
- 2026The Depth Ceiling: On the Limits of Large Language Models in Discovering Latent Planningcited by 2
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)cited by 1
- 2025Learning Model Successorscited by 0
7 more
- 2025Transformers Can Learn Connectivity in Some Graphs but Not Otherscited by 0
- 2025GraphGhost: Tracing Structures Behind Large Language Modelscited by 0
- 2026When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compressioncited by 0
- 2026Inductive Generalization for Robotic Manipulationcited by 0
- 2026GTA: Graph Theory Agent and Benchmark for Algorithmic Graph Reasoning with LLMscited by 0
- 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes Itcited by 0
- 2026Conditional Transfer from Controlled Pretraining Mixtures to Codecited by 0
- 2026Conditional Transfer from Controlled Pretraining Mixtures to Code8 Oct 2026
- 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes It29 Sep 2026
- 2026GTA: Graph Theory Agent and Benchmark for Algorithmic Graph Reasoning with LLMs10 Sep 2026
- 2026Transferability for General Reasoning: An Automated Curriculum for Multi-Domain RLVR23 Jun 2026
- 2026Inductive Generalization for Robotic Manipulation19 Jun 2026
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)28 Apr 2026
- 2026The Depth Ceiling: On the Limits of Large Language Models in Discovering Latent Planning7 Apr 2026
- 2026When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compression4 Apr 2026
- 2026Discrete Diffusion Models Exploit Asymmetry to Solve Lookahead Planning Tasks23 Feb 2026
- 2025In-Context Algebra18 Dec 2025
- 2025Are Language Models Efficient Reasoners? A Perspective from Logic Programming29 Oct 2025
- 2025GraphGhost: Tracing Structures Behind Large Language Models7 Oct 2025
7 more
- 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures6 Oct 2025
- 2025Transformers Can Learn Connectivity in Some Graphs but Not Others26 Sep 2025
- 2025Uncovering Graph Reasoning in Decoder-only Transformers with Circuit Tracing24 Sep 2025
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasoner17 Jul 2025
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More More13 Mar 2025
- 2025BIG-Bench Extra Hard26 Feb 2025
- 2025Learning Model Successors31 Jan 2025
- 2025BIG-Bench Extra Hardcited by 125
- 2025Are Language Models Efficient Reasoners? A Perspective from Logic Programmingcited by 4
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
- 2025Uncovering Graph Reasoning in Decoder-only Transformers with Circuit Tracingcited by 3
- 2026The Depth Ceiling: On the Limits of Large Language Models in Discovering Latent Planningcited by 2
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)cited by 1
- 2025Transformers Can Learn Connectivity in Some Graphs but Not Otherscited by 0
- 2025GraphGhost: Tracing Structures Behind Large Language Modelscited by 0
- 2026When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compressioncited by 0
- 2026GTA: Graph Theory Agent and Benchmark for Algorithmic Graph Reasoning with LLMscited by 0
- 2026GTA: Graph Theory Agent and Benchmark for Algorithmic Graph Reasoning with LLMs10 Sep 2026
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)28 Apr 2026
- 2026The Depth Ceiling: On the Limits of Large Language Models in Discovering Latent Planning7 Apr 2026
- 2026When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compression4 Apr 2026
- 2025Are Language Models Efficient Reasoners? A Perspective from Logic Programming29 Oct 2025
- 2025GraphGhost: Tracing Structures Behind Large Language Models7 Oct 2025
- 2025Transformers Can Learn Connectivity in Some Graphs but Not Others26 Sep 2025
- 2025Uncovering Graph Reasoning in Decoder-only Transformers with Circuit Tracing24 Sep 2025
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasoner17 Jul 2025
- 2025BIG-Bench Extra Hard26 Feb 2025
- 2025In-Context Algebracited by 5
- 2026Transferability for General Reasoning: An Automated Curriculum for Multi-Domain RLVRcited by 5
- 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architecturescited by 4
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More Morecited by 3
- 2025Learning Model Successorscited by 0
- 2026Inductive Generalization for Robotic Manipulationcited by 0
- 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes Itcited by 0
- 2026Conditional Transfer from Controlled Pretraining Mixtures to Codecited by 0
- 2026Conditional Transfer from Controlled Pretraining Mixtures to Code8 Oct 2026
- 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes It29 Sep 2026
- 2026Transferability for General Reasoning: An Automated Curriculum for Multi-Domain RLVR23 Jun 2026
- 2026Inductive Generalization for Robotic Manipulation19 Jun 2026
- 2025In-Context Algebra18 Dec 2025
- 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures6 Oct 2025
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More More13 Mar 2025
- 2025Learning Model Successors31 Jan 2025
Similar, not cited
Close in wording, no citation either way
- 2024Let's Think Dot by Dot: Hidden Computation in Transformer Language Models
- 2024Do Efficient Transformers Really Save Computation?
- 2025A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformers
- 2026Sparse Token Routing in Efficient Transformers
- 2024Beyond A*: Better Planning with Transformers via Search Dynamics Bootstrapping
- 2026Mixture of Chapters: Scaling Learnt Memory in Transformers
- 2026Grounding latent algorithm routing in transformer reasoning
- 2024Finding Transformer Circuits with Edge Pruning