paper-with-me

Papers

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

2022-10-31 · Jia Li, Ge Li, Zhuo Li, Zhi Jin, Xing Hu, Kechi Zhang, Zhiyi Fu

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.

📄 PDF Abstract BibTeX arXiv:2210.17040

Code (1)

lj2lijia/codeeditor 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingMasked Language Modeling

Similar Papers 제목 키워드 기반

CodeEditorBench: Evaluating Code Editing Capability of Large Language Models

2024-04-04 · Jiawei Guo, Ziming Li, Xueling Liu, Kaijing Ma 외

Large Language Models (LLMs) for code are rapidly evolving, with code editing emerging as a critical capability. We introduce CodeEditorBench, an evaluation framework designed to rigorously assess the performance of LLMs…

Code Generation

CoditT5: Pretraining for Source Code and Natural Language Editing

2022-08-10 · Jiyang Zhang, Sheena Panthaplackel, Pengyu Nie, Junyi Jessy Li 외

Pretrained language models have been shown to be effective in many software-related generation tasks; however, they are not well-suited for editing tasks as they are not designed to reason about edits. To address this, w…

Bug fixingLanguage ModelingLanguage ModellingLarge Language Model+1

Source Prompt Disentangled Inversion for Boosting Image Editability with Diffusion Models

2024-03-17 · Ruibin Li, Ruihuang Li, Song Guo, Lei Zhang

Text-driven diffusion models have significantly advanced the image editing performance by using text prompts as inputs. One crucial step in text-driven image editing is to invert the original image into a latent noise co…

Image Generation

A Structural Model for Contextual Code Changes

2020-05-27 · Shaked Brody, Uri Alon, Eran Yahav

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 o…

EditCompletionmodel

WikiAtomicEdits: A Multilingual Corpus of Wikipedia Edits for Modeling Language and Discourse

2018-08-28 · EMNLP 2018 10 · Manaal Faruqui, Ellie Pavlick, Ian Tenney, Dipanjan Das

We release a corpus of 43 million atomic edits across 8 languages. These edits are mined from Wikipedia edit history and consist of instances in which a human editor has inserted a single contiguous phrase into, or delet…

Representation LearningSentence