Dynamic Neural Program Embedding for Program Repair
By Ke Wang, Ke Wang, Rishabh Singh, Zhendong Su. 2017
144 citations recorded by the source corpus.
Neural program embeddings have shown much promise recently for a variety of program analysis tasks, including program synthesis, program repair, fault localization, etc. However, most existing program embeddings are based on syntactic features of programs, such as raw token sequences or abstract syntax trees. Unlike images and text, a program has an unambiguous semantic meaning that can be difficult to capture by only considering its syntax (i.e. syntactically similar pro- grams can exhibit vastly different run-time behavior), which makes syntax-based program embeddings fundamentally limited. This paper proposes a novel semantic program embedding that is learned from program execution traces. Our key insight is that program states expressed as sequential tuples of live variable values not only captures program semantics more precisely, but also offer a more natural fit for Recurrent Neural Networks to model. We evaluate different syntactic and semantic program embeddings on predicting the types of errors that students make in their submissions to an introductory programming class and two exercises on the CodeHunt education platform. Evaluation results show that our new semantic program embedding significantly outperforms the syntactic program embeddings based on token sequences and abstract syntax trees. In addition, we augment a search-based program repair system with the predictions obtained from our se- mantic embedding, and show that search efficiency is also significantly improved.
Subfields: Information Systems, Software, Code Generation & Program Synthesis, Program Analysis & Verification
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Information Systems
- Percy Liang
- Rishabh Singh
- Michihiro Yasunaga
- Armando Solar-Lezama
- Michael Pradel
- Aditya Kanade
- Dawn Song
- Xinyun Chen
In Software
- Rishabh Singh
- Armando Solar-Lezama
- Percy Liang
- Michihiro Yasunaga
- Dawn Song
- Xinyun Chen
- Michael Pradel
- Aditya Kanade
In Code Generation & Program Synthesis
- Rishabh Singh
- Dawn Song
- Baptiste Rozière
- Armando Solar-Lezama
- Xinyun Chen
- Sumit Gulwani
- Guillaume Lample
- Chang Liu
In Program Analysis & Verification
- Petros Maniatis
- Percy Liang
- Aditya Kanade
- Michihiro Yasunaga
- Xinyun Chen
- Dawn Song
- Rishabh Singh
- Michael Pradel
Citations in the corpus
- Break-It-Fix-It: Unsupervised Learning for Program Repair (2021, background): “As labeled data is costly to prepare, various works study learning code fixers from unlabeled or synthetic data (Pu et al., 2016; Parihar et al., 2017; Ahmed et al., 2018; Pradel & Sen, 2018; Wang et al., 2018; Vasic et al., 2019; Gupta et al., 2019; Hajipour et al., 2019; Hellendoorn et al., 2020).”
- Graph-based, Self-Supervised Program Repair from Diagnostic Feedback (2020, background): “Other works focus on modeling program execution (Wang et al., 2018) or edits (Zhao et al., 2019).”
- Unsupervised Translation of Programming Languages (2020, background): “Another line of work studied the applications of neural networks to code suggestion [2, 11, 34], or error detection [13, 18, 47].”
- SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair (2018, methodology): “[45] considers MOOC but the technique itself is completely different: [45] does”
- DOBF: A Deobfuscation Pre-Training Objective for Programming Languages (2021, methodology): “Machine learning is frequently used on tasks involving programming languages, including code completion [28, 33, 35, 42], bug detection and code repair [15, 38, 46], code summarization [8, 25], clone detection [2, 47, 48], code search [13, 23] and code translation [14, 41].”
- Neural Program Repair by Jointly Learning to Localize and Repair (2019, background): “…2017; Bhatia et al., 2018), program parse trees (Piech et al., 2015; Mou et al., 2016), program traces (Reed & de Freitas, 2015; Cai et al., 2017; Wang et al., 2018), and graphs (Allamanis et al., 2018) have been proposed for a variety of tasks including repair (Devlin et al., 2017b; Allamanis…”
- Teaching Temporal Logics to Neural Networks (2020, background): “Other works focused on recurrent neural networks or graph neural networks for code analysis, e.g. [30,14,5,48,1].”
- Learning Execution through Neural Code Fusion (2019, background): “[43] embed the sequences of values that variables take on during the execution of a program as a dynamic program embedding.”
- Repairing Bugs in Python Assignments Using Large Language Models (2022, background): “In particular, for programming education past research has explored topics including feedback generation [9]– [12], [29], [41], [42] and program repair [20], [36], [43]–[46].”
- Global Relational Models of Source Code (2020, unknown): “, program traces, besides syntactic information (Wang et al., 2018).”
- Teaching Large Language Models to Self-Debug (2023, methodology): “Program repair is an area of research concerned with fixing bugs in code, where several neural network models have been developed to handle different types of bugs (Gupta et al., 2017; Yasunaga & Liang, 2021; Gupta et al., 2020; Wang et al., 2018; Le et al., 2022).”
- NL2Type: Inferring JavaScript Function Types from Natural Language Information (2019, background): “Embeddings can be learned, e.g., from a graph representation of code [51], by randomly walking a control-flow graph [52], by walking an abstract syntax tree [53], or from program executions [54].”
- Learning semantic program embeddings with graph interval neural network (2020, background): “dynamic models) (Wang 2019; Wang et al. 2018; Wang and Su 2020) rather than source code (i.”
- Demystifying GPT Self-Repair for Code Generation (2023, background): “``` palindrome (1221) => [22, 1221] palindrome (34322122) => [22, 212, 343, 22122] palindrome (1001331) => [33, 1001, 1331] palindrome (1294) => "No palindromes found" palindrome ("1221") => "Not valid" ```”
- Improving Neural Program Synthesis with Inferred Execution Traces (2018, methodology): “An example is program execution traces, which have also been used to great effect by prior work [Reed and de Freitas, 2016, Wang et al., 2018].”
- CoCoNuT: combining context-aware neural translation models using ensemble for program repair (2020, methodology): “tasks such as defects prediction [40, 79, 81], source code representation [6, 7, 66, 80], source code summarization [4, 22] source code modeling [5, 11, 26, 83], code clone detection [41, 84], and pro-”
- Execution-Guided Neural Program Synthesis (2018, methodology): “Prior works also consider incorporating syntax constraints and information from program execution to facilitate program synthesis (Devlin et al., 2017b; Wang et al., 2018a; Bunel et al., 2018).”
- Learning to Synthesize Programs as Interpretable and Generalizable Policies (2021, background): “[117] Ke Wang, Rishabh Singh, and Zhendong Su.”