Learning Structural Edits via Incremental Tree Transformations

Ziyu Yao, Frank F. Xu, Pengcheng Yin, Huan Sun, Graham Neubig
1/28/2021
cs.LGcs.SE

Official code: neulab/incremental_tree_edit (41 stars, Python, MIT, last commit 2021-06-20).

Abstract

While most neural generative models generate outputs in a single pass, the human creative process is usually one of iterative building and refinement. Recent work has proposed models of editing processes, but these mostly focus on editing sequential data and/or only model a single editing pass.

Show full abstract

In this paper, we present a generic model for incremental editing of structured data (i.e., "structural edits"). Particularly, we focus on tree-structured data, taking abstract syntax trees of computer programs as our canonical example. Our editor learns to iteratively generate tree edits (e.g., deleting or adding a subtree) and applies them to the partially edited data, thereby the entire editing process can be formulated as consecutive, incremental tree transformations. To show the unique benefits of modeling tree edits directly, we further propose a novel edit encoder for learning to represent edits, as well as an imitation learning method that allows the editor to be more robust. We evaluate our proposed editor on two source code edit datasets, where results show that, with the proposed edit encoder, our editor significantly improves accuracy over previous approaches that generate the edited program directly in one pass. Finally, we demonstrate that training our editor to imitate experts and correct its mistakes dynamically can further improve its performance.

View on arXivView PDF

Code Implementations(1)

MIT

Code for "Learning Structural Edits via Incremental Tree Transformations" (ICLR'21)

413Python, ShellJan 22, 20215 years agoMIT

Similar Papers

Cite this paper

@article{yao2021learning,
  title  = {Learning Structural Edits via Incremental Tree Transformations},
  author = {Ziyu Yao and Frank F. Xu and Pengcheng Yin and Huan Sun and Graham Neubig},
  year   = {2021},
  eprint = {2101.12087},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.12087}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2101.12087.svg)](https://codeofpaper.com/paper/2101.12087)

Discussion