Learning to Execute Programs with Instruction Pointer Attention Graph Neural Networks
David Bieber, Charles Sutton, Hugo Larochelle, Daniel Tarlow
Abstract
Graph neural networks (GNNs) have emerged as a powerful tool for learning software engineering tasks including code completion, bug finding, and program repair. They benefit from leveraging program structure like control flow graphs, but they are not well-suited to tasks like program execution that require far more sequential reasoning steps than number of GNN propagation steps. Recurrent neural networks (RNNs), on the other hand, are well-suited to long sequential chains of reasoning, but they do not naturally incorporate program structure and generally perform worse on the above tasks. Our aim is to achieve the best of both worlds, and we do so by introducing a novel GNN architecture, the Instruction Pointer Attention Graph Neural Networks (IPA-GNN), which achieves improved systematic generalization on the task of learning to execute programs using control flow graphs. The model arises by considering RNNs operating on program traces with branch decisions as latent variables. The IPA-GNN can be seen either as a continuous relaxation of the RNN model or as a GNN variant more tailored to execution. To test the models, we propose evaluating systematic generalization on learning to execute using control flow graphs, which tests sequential reasoning and use of program structure. More practically, we evaluate these models on the task of learning to execute partial programs, as might arise if using the model as a heuristic function in program synthesis. Results show that the IPA-GNN outperforms a variety of RNN and GNN baselines on both tasks.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ed374211-aa2c-4912-9153-3d4540e28544Cited by top-tier papers22
- Can Large Language Models Reason about Program Invariants?Kexin Pei, David Bieber, Kensen Shi, Charles Sutton et al.ICML 2023 · 128 citations
- NExT: Teaching Large Language Models to Reason about Code ExecutionAnsong Ni, Miltiadis Allamanis, Arman Cohan, Yinlin Deng et al.ICML 2024 · 73 citations
- Latent Execution for Neural Program Synthesis Beyond Domain-Specific LanguagesXinyun Chen, Dawn Song, Yuandong TianNeurIPS 2021 · 56 citations
- Learning Semantic Representations to Verify Hardware DesignsShobha Vasudevan, Wenjie Jiang, David Bieber, Rishabh Singh et al.NeurIPS 2021 · 38 citations
- Efficient and Scalable Graph Generation through Iterative Local ExpansionAndreas Bergmeister, Karolis Martinkus, Nathanaël Perraudin, Roger WattenhoferICLR 2024 · 38 citations
Builds on4
- Global Relational Models of Source CodeVincent J. Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis et al.ICLR 2020 · 252 citations
- Hoppity: Learning Graph Transformations to Detect and Fix Bugs in ProgramsElizabeth Dinella, Hanjun Dai, Ziyang Li, Mayur Naik et al.ICLR 2020 · 212 citations
- LambdaNet: Probabilistic Type Inference using Graph Neural NetworksJiayi Wei, Maruth Goyal, Greg Durrett, Isil DilligICLR 2020 · 119 citations
- Learning Execution through Neural Code fusionZhan Shi, Kevin Swersky, Daniel Tarlow, Parthasarathy Ranganathan et al.ICLR 2020 · 32 citations
Related papers
- Directed Acyclic Graph Neural NetworksVeronika Thost, Jie ChenICLR 2021 · 134 citations
- Augmenting Recurrent Graph Neural Networks with a CacheGuixiang Ma, Vy A. Vo, Theodore L. Willke, Nesreen K. AhmedKDD 2023 · 4 citations
- Pointer Graph NetworksPetar Velickovic, Lars Buesing, Matthew C. Overlan, Razvan Pascanu et al.NeurIPS 2020 · 78 citations
- Deep Equilibrium Algorithmic ReasoningDobrik Georgiev, Joseph Wilson, Davide Buffelli, Pietro LióNeurIPS 2024 · 7 citations
- Bridging the Gaps between Graph Neural Networks and Data-Flow Analysis: The Closer, the BetterQingchen Yu, Xin Liu, Qingguo Zhou, Chunming WuISSTA 2025
