Dynamically Relative Position Encoding-Based Transformer for Automatic Code Edit

计算机科学 重构代码 人工智能 源代码 源代码行 变压器 机器学习 编码(集合论) 机器翻译 数据挖掘 程序设计语言 软件 量子力学 物理 电压 集合(抽象数据类型)
作者
Shiyi Qi,Yaoxian Li,Cuiyun Gao,Xiaohong Su,Shuzheng Gao,Zibin Zheng,Chuanyi Liu
出处
期刊:IEEE Transactions on Reliability [Institute of Electrical and Electronics Engineers]
卷期号:72 (3): 1147-1160 被引量:7
标识
DOI:10.1109/tr.2022.3194370
摘要

Adapting deep learning (DL) techniques to automate nontrivial coding activities, such as code documentation and defect detection, has been intensively studied recently. Learning to predict code changes is one of the popular and essential investigations. Prior studies have shown that DL techniques, such as neural machine translation (NMT), can benefit meaningful code changes, including bug fixing and code refactoring. However, NMT models may encounter bottleneck when modeling long sequences; thus, they are limited in accurately predicting code changes. In this article, we design a Transformer-based approach, considering that the Transformer has proven effective in capturing long-term dependencies. Specifically, we propose a novel model named DTrans. For better incorporating the local structure of code, i.e., statement-level information in this article, DTrans is designed with dynamically relative position encoding in the multihead attention of the Transformer. Experiments on benchmark datasets demonstrate that DTrans can more accurately generate patches than the state-of-the-art methods, increasing the performance by at least 5.45–46.57% in terms of the exact match metric on different datasets. Moreover, DTrans can locate the lines to change with 1.75–24.21% higher accuracy than the existing methods.

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
PDF的下载单位、IP信息已删除 (2025-6-4)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
vetXue发布了新的文献求助10
1秒前
2秒前
Vivian完成签到,获得积分20
2秒前
白色花海完成签到,获得积分10
2秒前
iveuplife发布了新的文献求助10
3秒前
3秒前
4秒前
文静完成签到,获得积分10
5秒前
0℃完成签到,获得积分20
5秒前
哈哈发布了新的文献求助10
6秒前
Young完成签到,获得积分10
6秒前
量子星尘发布了新的文献求助10
6秒前
魔法师完成签到,获得积分0
6秒前
拼搏尔风完成签到,获得积分10
6秒前
7秒前
7秒前
小蘑菇应助dawei采纳,获得10
7秒前
7秒前
8秒前
大个应助66采纳,获得10
8秒前
勿明应助游大侠采纳,获得30
9秒前
高小h发布了新的文献求助10
9秒前
9秒前
满意的柏柳完成签到,获得积分10
9秒前
迷你的小甜瓜完成签到,获得积分10
9秒前
Hello应助刘迎采纳,获得10
10秒前
guoduan完成签到,获得积分10
10秒前
10秒前
ye完成签到,获得积分10
10秒前
务实白开水完成签到 ,获得积分10
11秒前
11秒前
两碗牛又面完成签到,获得积分10
11秒前
12秒前
陌陌完成签到,获得积分10
12秒前
侯谋完成签到,获得积分10
13秒前
舒服的远望完成签到,获得积分10
13秒前
KhalilHao发布了新的文献求助10
13秒前
科研人员发布了新的文献求助60
13秒前
14秒前
小蓝完成签到,获得积分10
14秒前
高分求助中
The Oxford Encyclopedia of the History of Modern Psychology 2000
Chinesen in Europa – Europäer in China: Journalisten, Spione, Studenten 1200
Deutsche in China 1920-1950 1200
Applied Survey Data Analysis (第三版, 2025) 850
Mineral Deposits of Africa (1907-2023): Foundation for Future Exploration 800
Electron microscopy study of magnesium hydride (MgH2) for Hydrogen Storage 800
Learning to Listen, Listening to Learn 570
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 物理 生物化学 纳米技术 计算机科学 化学工程 内科学 复合材料 物理化学 电极 遗传学 量子力学 基因 冶金 催化作用
热门帖子
关注 科研通微信公众号,转发送积分 3873370
求助须知:如何正确求助?哪些是违规求助? 3415602
关于积分的说明 10695179
捐赠科研通 3139870
什么是DOI,文献DOI怎么找? 1732411
邀请新用户注册赠送积分活动 835401
科研通“疑难数据库(出版商)”最低求助积分说明 781963