mlsanityData to 7 Oct 2026

CodeEditor: Learning to Edit Source Code with Pre-trained Models

arXiv 2210.17040 ↗First posted 31 Oct 2022cs.SE cs.AIcited by 12

Not on the map. Why?

Abstract (arXiv)

Developers often perform repetitive code editing activities for various reasons (e.g., code refactoring) during software development. Pre-trained code editing models have achieved the state-of-the-art (SOTA) results. Pre-trained models are first pre-trained with pre-training tasks and fine-tuned with the code editing task. Existing pre-training tasks mainly are code infilling tasks (e.g., masked language modeling), which are derived from the natural language processing field and are not designed for automatic code editing. This paper proposes a novel pre-training task specialized in code editing and presents an effective pre-trained code editing model named CodeEditor. Our pre-training task further improves the performance and generalization ability of code editing models. Specifically, we collect lots of real-world code snippets as the ground truth and use a powerful generator to rewrite them into mutated versions. Then, we pre-train our CodeEditor to edit mutated versions into the corresponding ground truth, to learn edit patterns. We conduct experiments on four code editing datasets and evaluate the pre-trained CodeEditor in three settings. (1) In the fine-tuning setting, we train the pre-trained CodeEditor with four datasets and evaluate it on the test data. CodeEditor outperforms the SOTA baselines by 15%, 25.5%, and 9.4% and 26.6% on four datasets. (2) In the few-shot setting, we train the pre-trained CodeEditor with limited data and evaluate it on the test data. CodeEditor substantially performs better than all baselines. (3) In the zero-shot setting, CodeEditor correctly edits 1,113 programs while the SOTA baselines can not work.

Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 23 of its 41 references that are in the map. First posted on arXiv 31 Oct 2022.

Builds on

23 of 41 references.

References · 23

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  5. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  6. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  7. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  8. 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,242
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  10. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  11. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  12. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
11 more
  1. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  2. 2018TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generationcited by 88
  3. 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
  4. 2022Using Pre-Trained Models to Boost Code Review Automationcited by 63
  5. 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
  6. 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
  7. 2021Towards Automating Code Review Activitiescited by 54
  8. 2019On Learning Meaningful Code Changes via Neural Machine Translationcited by 50
  9. 2018CODIT: Code Editing with Tree-Based Neural Modelscited by 40
  10. 2021On Multi-Modal Learning of Editing Source Codecited by 25
  11. 2021Improving Sequence-to-Sequence Pre-training via Sequence Span Rewritingcited by 13

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 6; 2024: 2; 2025: 2; 2026: 2.

12 papers.