Neural Execution Engines: Learning to Execute Subroutines
Not on the map. Why?
Abstract (arXiv)
A significant effort has been made to train neural networks that replicate algorithmic reasoning, but they often fail to learn the abstract concepts underlying these algorithms. This is evidenced by their inability to generalize to data distributions that are outside of their restricted training sets, namely larger inputs and unseen data. We study these generalization issues at the level of numerical subroutines that comprise common algorithms like sorting, shortest paths, and minimum spanning trees. First, we observe that transformer-based sequence-to-sequence models can learn subroutines like sorting a list of numbers, but their performance rapidly degrades as the length of lists grows beyond those found in the training set. We demonstrate that this is due to attention weights that lose fidelity with longer sequences, particularly when the input numbers are numerically similar. To address the issue, we propose a learned conditional masking mechanism, which enables the model to strongly generalize far outside of its training range with near-perfect accuracy on a variety of algorithms. Second, to generalize to unseen data, we show that encoding numbers with a binary representation leads to embeddings with rich structure once trained on downstream tasks like addition or multiplication. This allows the embedding to handle missing data by faithfully interpolating numbers not seen during training.
Key facts. Cited by 36 papers in the map (data through 14 Oct 2026). First posted on arXiv 15 Jun 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 9; 2022: 9; 2023: 7; 2024: 5; 2025: 4; 2026: 2.
36 papers.
Sort:
By area:
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gaugescited by 1,167
- 2021Two Sides of the Same Coin: Heterophily and Oversmoothing in Graph Convolutional Neural Networkscited by 182
- 2022Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networkscited by 129
- 2022Teaching Algorithmic Reasoning via In-context Learningcited by 112
- 2022The CLRS Algorithmic Reasoning Benchmarkcited by 106
- 2021Learning to Synthesize Programs as Interpretable and Generalizable Policiescited by 59
- 2024Softmax is not Enough (for Sharp Size Generalisation)cited by 46
- 2021Latent Execution for Neural Program Synthesiscited by 35
- 2023Code Execution with Pre-trained Language Modelscited by 34
- 2022Towards Better Out-of-Distribution Generalization of Neural Algorithmic Reasoning Taskscited by 30
- 2024Simulation of Graph Algorithms with Looped Transformerscited by 30
24 more
- 2021How to transfer algorithmic reasoning knowledge to learn new algorithms?cited by 22
- 2022Neural Approximation of Graph Topological Featurescited by 17
- 2022Reducing Collision Checking for Sampling-Based Motion Planning Using Graph Neural Networkscited by 17
- 2023Neural Algorithmic Reasoning Without Intermediate Supervisioncited by 17
- 2022Neural Set Function Extensions: Learning with Discrete Functions in High Dimensionscited by 14
- 2021Persistent Message Passingcited by 13
- 2022Learnable Commutative Monoids for Graph Neural Networkscited by 13
- 2021Algorithmic Concept-based Explainable Reasoningcited by 12
- 2024On the Markov Property of Neural Algorithmic Reasoning: Analyses and Methodscited by 11
- 2024Discrete Neural Algorithmic Reasoningcited by 9
- 2023Latent Space Representations of Neural Algorithmic Reasonerscited by 7
- 2024Enhancing Size Generalization in Graph Neural Networks through Disentangled Representation Learningcited by 7
- 2023Parallel Algorithms Align with Neural Executioncited by 6
- 2023Infusing Lattice Symmetry Priors in Attention Mechanisms for Sample-Efficient Abstract Geometric Reasoningcited by 4
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encodingcited by 4
- 2025Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spacescited by 4
- 2023Tackling Size Generalization of Graph Neural Networks on Biological Data from a Spectral Perspectivecited by 3
- 2025SURGE: On the Potential of Large Language Models as General-Purpose Surrogate Code Executorscited by 3
- 2025Programming by Backprop: An Instruction is Worth 100 Examples When Finetuning LLMscited by 2
- 2021Meta-Learning an Inference Algorithm for Probabilistic Programscited by 1
- 2021State-Space Constraints Can Improve the Generalisation of the Differentiable Neural Computer to Input Sequences With Unseen Lengthcited by 1
- 2023Neuro-Symbolic Execution of Generic Source Codecited by 1
- 2026From Shortcut Learning to Discrete Neural Insertion Sortcited by 1
- 2026Is Code Better Than Language for Algorithmic Reasoningcited by 0
- 2026From Shortcut Learning to Discrete Neural Insertion Sort25 Sep 2026
- 2026Is Code Better Than Language for Algorithmic Reasoning14 Jun 2026
- 2025Programming by Backprop: An Instruction is Worth 100 Examples When Finetuning LLMs23 Jun 2025
- 2025Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spaces23 May 2025
- 2025SURGE: On the Potential of Large Language Models as General-Purpose Surrogate Code Executors16 Feb 2025
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding1 Jan 2025
- 2024Softmax is not Enough (for Sharp Size Generalisation)1 Oct 2024
- 2024Enhancing Size Generalization in Graph Neural Networks through Disentangled Representation Learning7 Jun 2024
- 2024On the Markov Property of Neural Algorithmic Reasoning: Analyses and Methods7 Mar 2024
- 2024Discrete Neural Algorithmic Reasoning18 Feb 2024
- 2024Simulation of Graph Algorithms with Looped Transformers2 Feb 2024
- 2023Latent Space Representations of Neural Algorithmic Reasoners17 Jul 2023
24 more
- 2023Parallel Algorithms Align with Neural Execution8 Jul 2023
- 2023Neural Algorithmic Reasoning Without Intermediate Supervision23 Jun 2023
- 2023Infusing Lattice Symmetry Priors in Attention Mechanisms for Sample-Efficient Abstract Geometric Reasoning5 Jun 2023
- 2023Tackling Size Generalization of Graph Neural Networks on Biological Data from a Spectral Perspective24 May 2023
- 2023Code Execution with Pre-trained Language Models8 May 2023
- 2023Neuro-Symbolic Execution of Generic Source Code23 Mar 2023
- 2022Learnable Commutative Monoids for Graph Neural Networks16 Dec 2022
- 2022Teaching Algorithmic Reasoning via In-context Learning15 Nov 2022
- 2022Towards Better Out-of-Distribution Generalization of Neural Algorithmic Reasoning Tasks1 Nov 2022
- 2022Reducing Collision Checking for Sampling-Based Motion Planning Using Graph Neural Networks17 Oct 2022
- 2022Neural Set Function Extensions: Learning with Discrete Functions in High Dimensions8 Aug 2022
- 2022Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networks27 Jul 2022
- 2022The CLRS Algorithmic Reasoning Benchmark31 May 2022
- 2022Neural Approximation of Graph Topological Features28 Jan 2022
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Models28 Jan 2022
- 2021How to transfer algorithmic reasoning knowledge to learn new algorithms?26 Oct 2021
- 2021State-Space Constraints Can Improve the Generalisation of the Differentiable Neural Computer to Input Sequences With Unseen Length18 Oct 2021
- 2021Learning to Synthesize Programs as Interpretable and Generalizable Policies31 Aug 2021
- 2021Algorithmic Concept-based Explainable Reasoning15 Jul 2021
- 2021Latent Execution for Neural Program Synthesis29 Jun 2021
- 2021Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gauges27 Apr 2021
- 2021Persistent Message Passing1 Mar 2021
- 2021Meta-Learning an Inference Algorithm for Probabilistic Programs1 Mar 2021
- 2021Two Sides of the Same Coin: Heterophily and Oversmoothing in Graph Convolutional Neural Networks12 Feb 2021
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2022Teaching Algorithmic Reasoning via In-context Learningcited by 112
- 2023Infusing Lattice Symmetry Priors in Attention Mechanisms for Sample-Efficient Abstract Geometric Reasoningcited by 4
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encodingcited by 4
- 2026Is Code Better Than Language for Algorithmic Reasoningcited by 0
- 2026Is Code Better Than Language for Algorithmic Reasoning14 Jun 2026
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding1 Jan 2025
- 2023Infusing Lattice Symmetry Priors in Attention Mechanisms for Sample-Efficient Abstract Geometric Reasoning5 Jun 2023
- 2022Teaching Algorithmic Reasoning via In-context Learning15 Nov 2022
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Models28 Jan 2022
- 2021Geometric Deep Learning: Grids, Groups, Graphs, Geodesics, and Gaugescited by 1,167
- 2021Two Sides of the Same Coin: Heterophily and Oversmoothing in Graph Convolutional Neural Networkscited by 182
- 2022Toward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networkscited by 129
- 2022The CLRS Algorithmic Reasoning Benchmarkcited by 106
- 2021Learning to Synthesize Programs as Interpretable and Generalizable Policiescited by 59
- 2024Softmax is not Enough (for Sharp Size Generalisation)cited by 46
- 2021Latent Execution for Neural Program Synthesiscited by 35
- 2023Code Execution with Pre-trained Language Modelscited by 34
- 2022Towards Better Out-of-Distribution Generalization of Neural Algorithmic Reasoning Taskscited by 30
- 2024Simulation of Graph Algorithms with Looped Transformerscited by 30
- 2021How to transfer algorithmic reasoning knowledge to learn new algorithms?cited by 22
- 2022Neural Approximation of Graph Topological Featurescited by 17
12 most cited of 31 All 31 (JSON)
- 2026From Shortcut Learning to Discrete Neural Insertion Sort25 Sep 2026
- 2025Programming by Backprop: An Instruction is Worth 100 Examples When Finetuning LLMs23 Jun 2025
- 2025Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spaces23 May 2025
- 2025SURGE: On the Potential of Large Language Models as General-Purpose Surrogate Code Executors16 Feb 2025
- 2024Softmax is not Enough (for Sharp Size Generalisation)1 Oct 2024
- 2024Enhancing Size Generalization in Graph Neural Networks through Disentangled Representation Learning7 Jun 2024
- 2024On the Markov Property of Neural Algorithmic Reasoning: Analyses and Methods7 Mar 2024
- 2024Discrete Neural Algorithmic Reasoning18 Feb 2024
- 2024Simulation of Graph Algorithms with Looped Transformers2 Feb 2024
- 2023Latent Space Representations of Neural Algorithmic Reasoners17 Jul 2023
- 2023Parallel Algorithms Align with Neural Execution8 Jul 2023
- 2023Neural Algorithmic Reasoning Without Intermediate Supervision23 Jun 2023
12 newest of 31 All 31 (JSON)