Generating bug-fixes using pretrained transformers
By Dawn Drain, Chen Wu, Alexey Svyatkovskiy, Neel Sundaresan. 2021
60 citations recorded by the source corpus.
Detecting and fixing bugs are two of the most important yet frustrating parts of the software development cycle. Existing bug detection tools are based mainly on static analyzers, which rely on mathematical logic and symbolic reasoning about the program execution to detect common types of bugs. Fixing bugs is typically left out to the developer. In this work we introduce DeepDebug: a data-driven program repair approach which learns to detect and fix bugs in Java methods mined from real-world GitHub repositories. We frame bug-patching as a sequence-to-sequence learning task consisting of two steps: (i) denoising pretraining, and (ii) supervised finetuning on the target translation task. We show that pretraining on source code programs improves the number of patches found by 33% as compared to supervised training from scratch, while domain-adaptive pretraining from natural language to code further improves the accuracy by another 32%. We refine the standard accuracy evaluation metric into non-deletion and deletion-only fixes, and show that our best model generates 75% more non-deletion fixes than the previous state of the art. In contrast to prior work, we attain our best results when generating raw code, as opposed to working with abstracted code that tends to only benefit smaller capacity models. Finally, we observe a subtle improvement from adding syntax embeddings along with the standard positional embeddings, as well as with adding an auxiliary task to predict each token's syntactic class. Despite focusing on Java, our approach is language agnostic, requiring only a general-purpose parser such as tree-sitter.
Subfields: Information Systems, Software, Natural Language Processing, Signal 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
- Neel Sundaresan
- Alexey Svyatkovskiy
- Yanqiao Zhu
- Yichen Xu
- Colin B. Clement
- Ramesh Karri
- Hammond A. Pearce
- Michele Tufano
In Software
- Neel Sundaresan
- Alexey Svyatkovskiy
- Colin B. Clement
- Yanqiao Zhu
- Yichen Xu
- Michele Tufano
- Shuai Lu
- Brendan Dolan-Gavitt
In Natural Language Processing
- Lukasz Kaiser
- Ilya Sutskever
- Alec Radford
- Kyunghyun Cho
- Quoc V. Le
- Wojciech Zaremba
- Neel Sundaresan
- Mohit Bansal
In Signal Processing
- Heewoo Jun
- Ilya Sutskever
- Wojciech Zaremba
- Mark Chen
- Pamela Mishkin
- Brendan Dolan-Gavitt
- Harrison Edwards
- Neel Sundaresan
Citations in the corpus
- Evaluating Large Language Models Trained on Code (2021, background): “More recent works (Tufano et al., 2019; Drain et al., 2021) considered bug-fixing as neural machine translation from buggy to correct programs.”
- InferFix: End-to-End Program Repair with LLMs (2023, methodology): “While also utilizing neural machine translation, DeepDebug [10] leverage extensive self-supervised pretraining to improve upon the prior art.”
- Training and Evaluating a Jupyter Notebook Data Science Assistant (2022, background): “…code completion (Svyatkovskiy et al. 2020, 2019; Raychev, Vechev, and Yahav 2014; Bruch, Monperrus, and Mezini 2009), code search (Husain et al. 2019; Feng et al. 2020), bug fixing (Drain et al. 2021) and Copyright © 2022, Association for the Advancement of Artificial Intelligence (www.aaai.org).”
- A Survey on Pretrained Language Models for Neural Code Intelligence (2022, background): “Code refinement (Tufano et al., 2019; Drain et al., 2021) aims to fix bugs in the given code snippet and output a bug-free one.”
- Examining Zero-Shot Vulnerability Repair with Large Language Models (2021, methodology): “DeepDebug [16] requires the curation of bug/patch datasets and formulates the goal of predicting humandesigned patches.”