Copy That! Editing Sequences by Copying Spans
Sheena Panthaplackel, Miltiadis Allamanis, Marc Brockschmidt
Abstract
Neural sequence-to-sequence models are finding increasing use in editing of documents, for example in correcting a text document or repairing source code. In this paper, we argue that common seq2seq models (with a facility to copy single tokens) are not a natural fit for such tasks, as they have to explicitly copy each unchanged token. We present an extension of seq2seq models capable of copying entire spans of the input to the output in one step, greatly reducing the number of decisions required during inference. This extension means that there are now many ways of generating the same output, which we handle by deriving a new objective for training and a variation of beam search for inference that explicitly handles this problem. In our experiments on a range of editing tasks of natural language and source code, we show that our new model consistently outperforms simpler baselines.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 414cb779-14d8-4209-ab9a-59372a3f4df0Cited by top-tier papers7
- SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code RepresentationsChangan Niu, Chuanyi Li, Vincent Ng, Jidong Ge et al.ICSE 2022 · 99 citations
- CoditT5: Pretraining for Source Code and Natural Language EditingJiyang Zhang, Sheena Panthaplackel, Pengyu Nie, Junyi Jessy Li et al.ASE 2022 · 81 citations
- A Deep Dive into Large Language Models for Automated Bug Localization and RepairSoneya Binta Hossain, Nan Jiang, Qiang Zhou, Xiaopeng Li et al.FSE 2024 · 60 citations
- Sequence-to-Sequence Learning with Latent Neural GrammarsYoon KimNeurIPS 2021 · 44 citations
- Learning Structural Edits via Incremental Tree TransformationsZiyu Yao, Frank F. Xu, Pengcheng Yin, Huan Sun et al.ICLR 2021 · 32 citations
Related papers
- Seq2Edits: Sequence Transduction Using Span-level Edit OperationsFelix Stahlberg, Shankar KumarEMNLP 2020 · 1 citation
- Sequence-to-Action: Grammatical Error Correction with Action Guided Sequence GenerationJiquan Li, Junliang Guo, Yongxin Zhu, Xin Sheng et al.AAAI 2022 · 29 citations
- Improving Sequence-to-Sequence Pre-training via Sequence Span RewritingWangchunshu Zhou, Tao Ge, Canwen Xu, Ke Xu et al.EMNLP 2021 · 9 citations
- Non-autoregressive Text Editing with Copy-aware Latent AlignmentsYu Zhang, Yue Zhang, Leyang Cui, Guohong FuEMNLP 2023 · 2 citations
- Incomplete Utterance Rewriting as Semantic SegmentationQian Liu, Bei Chen, Jian-Guang Lou, Bin Zhou et al.EMNLP 2020 · 51 citations
