Neural Networks for Modeling Source Code Edits
By Rui Zhao, David Bieber, Kevin Swersky, Daniel Tarlow. 2018
12 citations recorded by the source corpus.
Programming languages are emerging as a challenging and interesting domain for machine learning. A core task, which has received significant attention in recent years, is building generative models of source code. However, to our knowledge, previous generative models have always been framed in terms of generating static snapshots of code. In this work, we instead treat source code as a dynamic object and tackle the problem of modeling the edits that software developers make to source code files. This requires extracting intent from previous edits and leveraging it to generate subsequent edits. We develop several neural networks and use synthetic data to test their ability to learn challenging edit patterns that require strong generalization. We then collect and train our models on a large-scale dataset of Google source code, consisting of millions of fine-grained edits from thousands of Python developers. From the modeling perspective, our main conclusion is that a new composition of attentional and pointer network components provides the best overall performance and scalability. From the application perspective, our results provide preliminary evidence of the feasibility of developing tools that learn to predict future edits.
Subfields: Artificial Intelligence, Information Systems, 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 Artificial Intelligence
- Percy Liang
- Uri Alon
- Omer Levy
- Charles Sutton
- Eran Yahav
- Luke S. Zettlemoyer
- Graham Neubig
- Miltiadis Allamanis
In Information Systems
- Uri Alon
- Eran Yahav
- Charles Sutton
- Miltiadis Allamanis
- Percy Liang
- Michael Pradel
- Michihiro Yasunaga
- Omer Levy
In Natural Language Processing
- Uri Alon
- Eran Yahav
- Omer Levy
- Percy Liang
- Charles Sutton
- Miltiadis Allamanis
- Michihiro Yasunaga
- Luke S. Zettlemoyer
In Signal Processing
- Uri Alon
- Eran Yahav
- Omer Levy
- Satish Chandra
- Michihiro Yasunaga
- Charles Sutton
- Roy Sadaka
- Michael Pradel
Citations in the corpus
- 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).”
- TypeWriter: neural type prediction with search-based validation (2019, background): “Beyond type prediction, others have proposed learning-based techniques to find programming errors [25, 27], predict variable and method names [1, 28, 33], suggest how to improve names [19], search code [10, 30], detect clones [36, 40], classify code [24, 39], predict code edits [31, 38, 41], predict”
- Learning to Fix Build Errors with Graph2Diff Neural Networks (2019, background): “Graph2Tocopo is a single abstraction that unifies ideas from many recent works in modelling source code [3, 4, 8, 22, 35, 44].”
- Structural Language Models of Code (2019, background): “…2018; Yu et al., 2018; Iyer et al., 2019), natural-language-to-code (Allamanis et al., 2015; Iyer et al., 2018), and edit-to-code (Yin et al., 2019; Zhao et al., 2019), models must use separate encoders and decoders because of the different modalities of the input (e.g. natural language text) and…”