mlsanityData to 14 Oct 2026

Transformers Struggle to Learn to Search

arXiv 2412.04703 ↗First posted 6 Dec 2024cs.CL cs.AI cs.LGcited by 19

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

  1. 2020Scaling Laws for Neural Language Modelscited by 6,586
  2. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  3. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  4. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
  5. 2022Training Compute-Optimal Large Language Modelscited by 3,019
  6. 2022Emergent Abilities of Large Language Modelscited by 2,512
  7. 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
  8. 2023Reasoning with Language Model is Planning with World Modelcited by 861
  9. 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 523
  10. 2020Scaling Laws for Autoregressive Generative Modelingcited by 522
  11. 2021Causal Abstractions of Neural Networkscited by 422
  12. 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 359
27 more
  1. 2022Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thoughtcited by 337
  2. 2022Selection-Inference: Exploiting Large Language Models for Interpretable Logical Reasoningcited by 334
  3. 2023Sophia: A Scalable Stochastic Second-order Optimizer for Language Model Pre-trainingcited by 265
  4. 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 263
  5. 2023Can Language Models Solve Graph Problems in Natural Language?cited by 252
  6. 2024How to use and interpret activation patchingcited by 214
  7. 2020Causal Mediation Analysis for Interpreting Neural NLP: The Case of Gender Biascited by 191
  8. 2024LLMs Can't Plan, But Can Help Planning in LLM-Modulo Frameworkscited by 179
  9. 2024Do Large Language Models Latently Perform Multi-Hop Reasoning?cited by 169
  10. 2024The pitfalls of next-token predictioncited by 160
  11. 2024Stream of Search (SoS): Learning to Search in Languagecited by 145
  12. 2022Broken Neural Scaling Lawscited by 109
  13. 2024Understanding Emergent Abilities of Language Models from the Loss Perspectivecited by 94
  14. 2022On the Paradox of Learning to Reason from Datacited by 93
  15. 2023A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysiscited by 89
  16. 2023NPHardEval: Dynamic Benchmark on Reasoning Ability of Large Language Models via Complexity Classescited by 79
  17. 2024Transformers, parallel computation, and logarithmic depthcited by 79
  18. 2024Understanding Transformer Reasoning Capabilities via Graph Algorithmscited by 67
  19. 2022LAMBADA: Backward Chaining for Automated Reasoning in Natural Languagecited by 66
  20. 2023Towards a Mechanistic Interpretation of Multi-Step Reasoning Capabilities of Language Modelscited by 50
  21. 2024Amortized Planning with Large-Scale Transformers: A Case Study on Chesscited by 49
  22. 2024A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Taskcited by 49
  23. 2024Can LLM Graph Reasoning Generalize beyond Pattern Memorization?cited by 47
  24. 2024Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzlescited by 38
  25. 2024Evidence of Learned Look-Ahead in a Chess-Playing Neural Networkcited by 34
  26. 2024Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inferencecited by 29
  27. 2024MANGO: A Benchmark for Evaluating Mapping and Navigation Abilities of Large Language Modelscited by 9

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 10; 2026: 9.

19 papers.

Sort:

By area:

  1. 2025BIG-Bench Extra Hardcited by 125
  2. 2025In-Context Algebracited by 5
  3. 2026Transferability for General Reasoning: An Automated Curriculum for Multi-Domain RLVRcited by 5
  4. 2025The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architecturescited by 4
  5. 2025Are Language Models Efficient Reasoners? A Perspective from Logic Programmingcited by 4
  6. 2026Discrete Diffusion Models Exploit Asymmetry to Solve Lookahead Planning Taskscited by 4
  7. 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More Morecited by 3
  8. 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
  9. 2025Uncovering Graph Reasoning in Decoder-only Transformers with Circuit Tracingcited by 3
  10. 2026The Depth Ceiling: On the Limits of Large Language Models in Discovering Latent Planningcited by 2
  11. 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)cited by 1
  12. 2025Learning Model Successorscited by 0
7 more
  1. 2025Transformers Can Learn Connectivity in Some Graphs but Not Otherscited by 0
  2. 2025GraphGhost: Tracing Structures Behind Large Language Modelscited by 0
  3. 2026When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compressioncited by 0
  4. 2026Inductive Generalization for Robotic Manipulationcited by 0
  5. 2026GTA: Graph Theory Agent and Benchmark for Algorithmic Graph Reasoning with LLMscited by 0
  6. 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes Itcited by 0
  7. 2026Conditional Transfer from Controlled Pretraining Mixtures to Codecited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2024Let's Think Dot by Dot: Hidden Computation in Transformer Language Models
  2. 2024Do Efficient Transformers Really Save Computation?
  3. 2025A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformers
  4. 2026Sparse Token Routing in Efficient Transformers
  5. 2024Beyond A*: Better Planning with Transformers via Search Dynamics Bootstrapping
  6. 2026Mixture of Chapters: Scaling Learnt Memory in Transformers
  7. 2026Grounding latent algorithm routing in transformer reasoning
  8. 2024Finding Transformer Circuits with Edge Pruning