Can Transformers Learn to Solve Problems Recursively?
Shizhuo Dylan Zhang, Curt Tigges, Stella Biderman, Maxim Raginsky,, Talia Ringer

TL;DR
This paper investigates whether transformer neural networks can learn to emulate structurally recursive functions, revealing their capabilities and limitations in modeling semantic and recursive structures crucial for formal verification.
Contribution
It provides the first detailed analysis of transformers' ability to learn recursive functions, including empirical evaluation and reconstruction of learned algorithms, highlighting their strengths and weaknesses.
Findings
Transformers correctly predict 91% of failure cases in recursive function approximation.
Empirical and conceptual analysis of transformer limitations in modeling recursion.
Reconstruction of learned algorithms offers insights into neural network behavior.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdversarial Robustness in Machine Learning · Software Engineering Research · Explainable Artificial Intelligence (XAI)
Methodsfail
