mlsanityData to 14 Oct 2026

Can Transformers Learn to Solve Problems Recursively?

arXiv 2305.14699 ↗First posted 24 May 2023cs.LG cs.AI cs.LOcited by 17

Not on the map. Why?

Abstract (arXiv)

Neural networks have in recent years shown promise for helping software engineers write programs and even formally verify them. While semantic information plays a crucial part in these processes, it remains unclear to what degree popular neural architectures like transformers are capable of modeling that information. This paper examines the behavior of neural networks learning algorithms relevant to programs and formal verification proofs through the lens of mechanistic interpretability, focusing in particular on structural recursion. Structural recursion is at the heart of tasks on which symbolic tools currently outperform neural models, like inferring semantic relations between datatypes and emulating program behavior. We evaluate the ability of transformer models to learn to emulate the behavior of structurally recursive functions from input-output examples. Our evaluation includes empirical and conceptual analyses of the limitations and capabilities of transformer models in approximating these functions, as well as reconstructions of the ``shortcut" algorithms the model learns. By reconstructing these algorithms, we are able to correctly predict 91 percent of failure cases for one of the approximated functions. Our work provides a new foundation for understanding the behavior of neural networks that fail to solve the very tasks they are trained for.

Key facts. Cited by 17 papers in the map (data through 14 Oct 2026). Builds on 33 of its 47 references that are in the map. First posted on arXiv 24 May 2023.

Builds on

33 of 47 references.

References · 33

  1. 2017Attention Is All You Needcited by 60,361
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  4. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  5. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  6. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  7. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  8. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
  9. 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
  10. 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
  11. 2023StarCoder: may the source be with you!cited by 799
  12. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
21 more
  1. 2018Universal Transformerscited by 647
  2. 2019Theoretical Limitations of Self-Attention in Neural Sequence Modelscited by 288
  3. 2022Transformers Learn Shortcuts to Automatacited by 268
  4. 2022Neural Networks and the Chomsky Hierarchycited by 217
  5. 2023SantaCoder: don't reach for the stars!cited by 170
  6. 2023A Toy Model of Universality: Reverse Engineering How Networks Learn Group Operationscited by 144
  7. 2022Practical Program Repair in the Era of Large Pre-trained Language Modelscited by 133
  8. 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
  9. 2023Baldur: Whole-Proof Generation and Repair with Large Language Modelscited by 119
  10. 2019Learning to Prove Theorems via Interacting with Proof Assistantscited by 109
  11. 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 106
  12. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  13. 2022Formal Algorithms for Transformerscited by 72
  14. 2021Inductive logic programming at 30cited by 47
  15. 2019Generating Correctness Proofs with Neural Networkscited by 37
  16. 2021Pointer Value Retrieval: A new benchmark for understanding the limits of neural network generalizationcited by 29
  17. 2022Passport: Improving Automated Formal Verification Using Identifierscited by 19
  18. 2021Elixir: Effective object-oriented program repaircited by 16
  19. 2020Proof Repair across Type Equivalencescited by 8
  20. 2018Evolving Algebras 1993: Lipari Guidecited by 2
  21. 2018Synthesizing Symmetric Lensescited by 2

Built on by

Cited by year

Citing papers per year: 2023: 6; 2024: 4; 2025: 7.

17 papers.

Sort:

By area:

Similar, not cited

Close in wording, no citation either way

  1. 2026Discovering Interpretable Algorithms by Decompiling Transformers to RASP
  2. 2024Interpreting Affine Recurrence Learning in GPT-style Transformers
  3. 2026Towards Verifiable Transformers: Solver-Checkable Circuit Explanations
  4. 2024Validating Mechanistic Interpretations: An Axiomatic Approach
  5. 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)
  6. 2024Circuit Compositions: Exploring Modular Structures in Transformer-Based Language Models
  7. 2023Learning Transformer Programs
  8. 2026Neuro-Symbolic Proof Generation for Scaling Systems Software Verification