Semantic Code Repair using Neuro-Symbolic Transformation Networks
By Jacob Devlin, Jonathan Uesato, Rishabh Singh, Pushmeet Kohli. 2017
53 citations recorded by the source corpus.
We study the problem of semantic code repair, which can be broadly defined as automatically fixing non-syntactic bugs in source code. The majority of past work in semantic code repair assumed access to unit tests against which candidate repairs could be validated. In contrast, the goal here is to develop a strong statistical model to accurately predict both bug locations and exact fixes without access to information about the intended correct behavior of the program. Achieving such a goal requires a robust contextual repair model, which we train on a large corpus of real-world source code that has been augmented with synthetically injected bugs. Our framework adopts a two-stage approach where first a large set of repair candidates are generated by rule-based processors, and then these candidates are scored by a statistical model using a novel neural network architecture which we refer to as Share, Specialize, and Compete. Specifically, the architecture (1) generates a shared encoding of the source code using an RNN over the abstract syntax tree, (2) scores each candidate repair using specialized network modules, and (3) then normalizes these scores together so they can compete against one another in comparable probability space. We evaluate our model on a real-world test set gathered from GitHub containing four common categories of bugs. Our model is able to predict the exact correct repair 41\% of the time with a single guess, compared to 13\% accuracy for an attentional sequence-to-sequence model.
Subfields: Information Systems, Software, Natural Language Processing
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
- Petros Maniatis
- Aditya Kanade
- Rishabh Singh
- Pushmeet Kohli
- David Bieber
- Neel Sundaresan
- Alexey Svyatkovskiy
In Software
- Rishabh Singh
- Pushmeet Kohli
- Aditya Kanade
- Neel Sundaresan
- Percy Liang
- Jacob A. Harer
- Alexey Svyatkovskiy
- Peter Chin
In Natural Language Processing
- Percy Liang
- Mohit Bansal
- Graham Neubig
- Jianfeng Gao
- Christopher D. Manning
- Kyunghyun Cho
- Quoc V. Le
- Richard Socher
Citations in the corpus
- SPoC: Search-based Pseudocode to Code (2019, background): “Many recent work that uses neural models to localize errors has focused on localizing and correcting syntax errors [12] or a class of well-defined semantic errors such as variable misuse and variable replace [1, 7, 25].”
- Relational inductive biases, deep learning, and graph networks (2018, background): “…vector representations to capture rich semantic content in text (Mikolov et al., 2013; Pennington et al., 2014), graphs (Narayanan et al., 2016, 2017), algebraic and logical expressions (Allamanis et al., 2017; Evans et al., 2018), and programs (Devlin et al., 2017; Chen et al., 2018b).”
- Neural Program Repair by Jointly Learning to Localize and Repair (2019, background): “…& 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 et al., 2018), optimization (Bunel et al., 2017), and synthesis (Parisotto et al., 2017; Devlin et al., 2017a).”
- Getafix: learning to fix bugs automatically (2019, methodology): “ delegate parts of or the entire fix generation task to a neural network. SSC combines a set of manually written generators of fix candidates with learned models that decide which candidate to apply [Devlin et al. 2017]. Sarfgen uses embeddings of code to formulate repair as a search for a similar r”
- Tree-Transformer: A Transformer-Based Method for Correction of Tree-Structured Data (2019, methodology): “Devlin et al. [26] generate repairs with a rule-based method and then rank them using a neural network.”
- Generating bug-fixes using pretrained transformers (2021, methodology): “Devlin et al. (Devlin et al., 2017) train an RNN on Python to fix incorrect comparison operators, the mistaken use of “is” vs. “is not”, variable misuse, and forgotten “self” accessors.”
- Learning to Repair Software Vulnerabilities with Generative Adversarial Networks (2018, methodology): “[14] avoid the need for test cases by generating repairs with a rule based method and then ranking them using a neural network.”
- Deep reinforcement learning with relational inductive biases (2018, background): “, 2018), learned approaches for inducing compositional programs (Reed & De Freitas, 2015; Parisotto et al., 2017; Allamanis et al., 2017; Devlin et al., 2017) and reasoning about structured data (Neelakantan et al.”