arrow
Return

Directional Diffusion-Style Code Editing Pre-Training

delete
delete0
PRE
AI
Q
Qingyuan Liang
Z
Zeyu Sun
Q
Qihao Zhu
J
Junhao Hu
Y
Yifan Zhao
Y
Yizhou Chen
M
Mingxuan Zhu
G
Guoqing Wang
L
Lu Zhang
DOI:10.1109/TSE.2025.3592841delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code pre-trained models have shown promising effectiveness in various software engineering tasks. Among these tasks, many tasks are related to software evolution and/or code editing. However, existing code pre-trained models often overlook the real-world code editing data and the evolutionary nature of the editing process. In this paper, to simulate the step-by-step code editing process of human developers, we propose DivoT5, a pre-trained model based on directional diffusion at the data level. In DivoT5, we adopt two categories of pre-training tasks. The first category is mask and denoising tasks augmented with a diffusion direction representing code evolution. That is, we first apply a noising process to the code snippets before evolution, and then ask the pre-training process to restore the snippets with noise into the code snippets after evolution. The second category is tasks aiming to reinforce the evolutionary direction. That is, we first generate various intermediate versions for each pair of snippets before and after evolution, and then ask the pre-training process to transform the intermediate versions into the snippet after evolution for each pair. We evaluate DivoT5 for two code-editing scenarios (including a number of tasks) and one non-editing scenario using four downstream tasks. For each downstream task, we fine-tune the pre-trained DivoT5 on multiple corresponding datasets and evaluate its effectiveness across diverse scenarios Our experimental results show that ivoT5 achieves state-of-the-art (SOTA) performance on most tasks in comparison to models of the same scale (220M), large-scale (770M, 6.7B) models in fine-tuning, and billion-scale (6.7B, 8B, ChatGPT) instruct models in few-shot settings. For one code-editing task (i.e., CodeReview in NL-based CodeRefinement task), DivoT5 pre-trained on top of CodeT5-small (60M) can even outperform CodeT5-base (220M) and other pre-trained models with 220M parameters except for DivoT5 pre-trained on top of CodeT5-base (220M).
Keywords:
Pre-training
code editing
software evolution
CODEEDITOR: Learning to Edit Source Code with Pre-trained Models
err2023-09-30
err15
errOAAI
errLi, Jia; Li, Ge; Li, Zhuo; Jin, Zhi; Hu, Xing; Zhang, Kechi; Fu, Zhiyi
errShare
errSave
RAPID: Zero-Shot Domain Adaptation for Code Search with Pre-Trained Models
err2024-06-03
err2
errOAAI
errFan, Guodong; Chen, Shizhan; Gao, Cuiyun; Xiao, Jianmao; Zhang, Tao; Feng, Zhiyong
errShare
errSave
PTM-APIRec: Leveraging Pre-trained Models of Source Code in API Recommendation
err2024-03-15
err1
PREAI
errLi, Zhihao; Li, Chuanyi; Tang, Ze; Huang, Wanhong; Ge, Jidong; Luo, Bin; Ng, Vincent; Wang, Ting; Hu, Yucheng; Zhang, Xiaopeng
errShare
errSave
Improving Source Code Pre-Training via Type-Specific Masking
err2025-02-20
err0
errOAAI
errZou, WT; Li, Q; Li, CY; Ge, JD; Chen, X; Huang, LG; Luo, B
errShare
errSave
errShare
errSave
Exploring and improving knowledge distillation for pre-trained code models
err2026-05-23
err0
PREAI
errWeifeng Sun; Ruifeng Wu; Hongyan Li; Ying Fu; Min Yu; Meng Yan
errShare
errSave

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
3.0K
Citations:
1.3W

Organization

Peking University cover
Peking University
Scholars:
9.2K
Papers: 2.8K
Citations: 7.1W
I
Institute of Software
Scholars:
1
Papers: 2
Citations: 5
Cited Papers

Cited Papers

No cited papers available