Neural Edit Completion
By Shaked Brody, Uri Alon, Eran Yahav. 2020
7 citations recorded by the source corpus.
We address the problem of predicting edit completions based on a learned model that was trained on past edits. Given a code snippet that is partially edited, our goal is to predict a completion of the edit for the rest of the snippet. We refer to this task as the EditCompletion task and present a novel approach for tackling it. The main idea is to directly represent structural edits. This allows us to model the likelihood of the edit itself, rather than learning the likelihood of the edited code. We represent an edit operation as a path in the program's Abstract Syntax Tree (AST), originating from the source of the edit to the target of the edit. Using this representation, we present a powerful and lightweight neural model for the EditCompletion task. We conduct a thorough evaluation, comparing our approach to a variety of representation and modeling approaches that are driven by multiple strong models such as LSTMs, Transformers, and neural CRFs. Our experiments show that our model achieves 28% relative gain over state-of-the-art sequential models and 2$\times$ higher accuracy than syntactic models that learn to generate the edited code instead of modeling the edits directly. We make our code, dataset, and trained models publicly available.
Subfields: 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 Natural Language Processing
Citations in the corpus
- You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completion (2020, background): “ty analysis, and spam detection. Neural code models. Neural methods for code processing are rapidly improving. They support tasks such as extracting code semantics [2,4], and code and edit completion [3,10,21,57], with several commercial products adopting these techniques [11,16]. Prior research on ”
- Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks (2021, background): “code mutants [15], automatic generation of assert statements [16], and code completion [17]–[21].”
- Structural Language Models of Code (2019, background): “Ablation acc@1 acc@5 tree@1 tree@5 Paths → Seq The superiority of our model over GNN →NAG may also be related to the GNN bottleneck (Alon & Yahav, 2020), which hinders GNNs from propagating long-range messages.”