CodeEditor: Learning to Edit Source Code with Pre-trained Models
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
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2019Energy and Policy Considerations for Deep Learning in NLPcited by 1,242
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
11 more
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2018TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generationcited by 88
- 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
- 2022Using Pre-Trained Models to Boost Code Review Automationcited by 63
- 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
- 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
- 2021Towards Automating Code Review Activitiescited by 54
- 2019On Learning Meaningful Code Changes via Neural Machine Translationcited by 50
- 2018CODIT: Code Editing with Tree-Based Neural Modelscited by 40
- 2021On Multi-Modal Learning of Editing Source Codecited by 25
- 2021Improving Sequence-to-Sequence Pre-training via Sequence Span Rewritingcited by 13
Built on by
Citing papers per year: 2023: 6; 2024: 2; 2025: 2; 2026: 2.
12 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 136
- 2023Can It Edit? Evaluating the Ability of Large Language Models to Follow Code Editing Instructionscited by 46
- 2023Refactoring Programs Using Large Language Models with Few-Shot Examplescited by 27
- 2023AceCoder: Utilizing Existing Code to Enhance Code Generationcited by 25
- 2024Deep Learning Library Testing: Definition, Methods and Challengescited by 4
- 2024Leveraging Reviewer Experience in Code Review Comment Generationcited by 4
- 2025EditLord: Learning Code Transformation Rules for Code Editingcited by 4
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detectioncited by 3
- 2026Learning from 53.6K Real-World Developer Edits of AI-Generated Codecited by 1
- 2025Improving Automated Secure Code Reviews: A Synthetic Dataset for Code Vulnerability Flawscited by 0
- 2026Age Matters: Analyzing Age-Related Discussions in App Reviewscited by 0
- 2026Learning from 53.6K Real-World Developer Edits of AI-Generated Code27 Jul 2026
- 2026Age Matters: Analyzing Age-Related Discussions in App Reviews29 Jan 2026
- 2025Improving Automated Secure Code Reviews: A Synthetic Dataset for Code Vulnerability Flaws22 Apr 2025
- 2025EditLord: Learning Code Transformation Rules for Code Editing10 Mar 2025
- 2024Leveraging Reviewer Experience in Code Review Comment Generation17 Sep 2024
- 2024Deep Learning Library Testing: Definition, Methods and Challenges27 Apr 2024
- 2023Can It Edit? Evaluating the Ability of Large Language Models to Follow Code Editing Instructions11 Dec 2023
- 2023Refactoring Programs Using Large Language Models with Few-Shot Examples20 Nov 2023
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detection26 Aug 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023Structured Chain-of-Thought Prompting for Code Generation11 May 2023
- 2023AceCoder: Utilizing Existing Code to Enhance Code Generation31 Mar 2023