Dynamically Relative Position Encoding-Based Transformer for Automatic Code Edit
Adapting Deep Learning (DL) techniques to automate non-trivial 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 s...
Gespeichert in:
Veröffentlicht in: | arXiv.org 2022-07 |
---|---|
Hauptverfasser: | , , , , , , |
Format: | Artikel |
Sprache: | eng |
Schlagworte: | |
Online-Zugang: | Volltext |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
container_end_page | |
---|---|
container_issue | |
container_start_page | |
container_title | arXiv.org |
container_volume | |
creator | Shiyi Qi Li, Yaoxian Gao, Cuiyun Su, Xiaohong Gao, Shuzheng Zheng, Zibin Liu, Chuanyi |
description | Adapting Deep Learning (DL) techniques to automate non-trivial 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 are limited in accurately predicting code changes. In this work, we design a Transformer-based approach, considering that 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 paper, DTrans is designed with dynamically relative position encoding in the multi-head attention of 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. |
format | Article |
fullrecord | <record><control><sourceid>proquest</sourceid><recordid>TN_cdi_proquest_journals_2670359781</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>2670359781</sourcerecordid><originalsourceid>FETCH-proquest_journals_26703597813</originalsourceid><addsrcrecordid>eNqNjkELgjAYhkcQJOV_-KCzMLdMO5YZHSW8y3AzJrqvthn479uhH9DpObzPC8-KRIzzNCkOjG1I7NxAKWXHnGUZj0h9XYyYdCfGcYGHGoXXHwU1Ou01GqhMh1KbZ3IRTklorDCuRzspCwFwnj1O4dJBiVJBJbXfkXUvRqfiH7dkf6ua8p68LL5n5Xw74GxNmNoQQXl2youU_2d9AWz-PvI</addsrcrecordid><sourcetype>Aggregation Database</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype><pqid>2670359781</pqid></control><display><type>article</type><title>Dynamically Relative Position Encoding-Based Transformer for Automatic Code Edit</title><source>Free E- Journals</source><creator>Shiyi Qi ; Li, Yaoxian ; Gao, Cuiyun ; Su, Xiaohong ; Gao, Shuzheng ; Zheng, Zibin ; Liu, Chuanyi</creator><creatorcontrib>Shiyi Qi ; Li, Yaoxian ; Gao, Cuiyun ; Su, Xiaohong ; Gao, Shuzheng ; Zheng, Zibin ; Liu, Chuanyi</creatorcontrib><description>Adapting Deep Learning (DL) techniques to automate non-trivial 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 are limited in accurately predicting code changes. In this work, we design a Transformer-based approach, considering that 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 paper, DTrans is designed with dynamically relative position encoding in the multi-head attention of 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.</description><identifier>EISSN: 2331-8422</identifier><language>eng</language><publisher>Ithaca: Cornell University Library, arXiv.org</publisher><subject>Datasets ; Deep learning ; Machine translation ; Transformers</subject><ispartof>arXiv.org, 2022-07</ispartof><rights>2022. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>780,784</link.rule.ids></links><search><creatorcontrib>Shiyi Qi</creatorcontrib><creatorcontrib>Li, Yaoxian</creatorcontrib><creatorcontrib>Gao, Cuiyun</creatorcontrib><creatorcontrib>Su, Xiaohong</creatorcontrib><creatorcontrib>Gao, Shuzheng</creatorcontrib><creatorcontrib>Zheng, Zibin</creatorcontrib><creatorcontrib>Liu, Chuanyi</creatorcontrib><title>Dynamically Relative Position Encoding-Based Transformer for Automatic Code Edit</title><title>arXiv.org</title><description>Adapting Deep Learning (DL) techniques to automate non-trivial 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 are limited in accurately predicting code changes. In this work, we design a Transformer-based approach, considering that 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 paper, DTrans is designed with dynamically relative position encoding in the multi-head attention of 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.</description><subject>Datasets</subject><subject>Deep learning</subject><subject>Machine translation</subject><subject>Transformers</subject><issn>2331-8422</issn><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2022</creationdate><recordtype>article</recordtype><sourceid>ABUWG</sourceid><sourceid>AFKRA</sourceid><sourceid>AZQEC</sourceid><sourceid>BENPR</sourceid><sourceid>CCPQU</sourceid><sourceid>DWQXO</sourceid><recordid>eNqNjkELgjAYhkcQJOV_-KCzMLdMO5YZHSW8y3AzJrqvthn479uhH9DpObzPC8-KRIzzNCkOjG1I7NxAKWXHnGUZj0h9XYyYdCfGcYGHGoXXHwU1Ou01GqhMh1KbZ3IRTklorDCuRzspCwFwnj1O4dJBiVJBJbXfkXUvRqfiH7dkf6ua8p68LL5n5Xw74GxNmNoQQXl2youU_2d9AWz-PvI</recordid><startdate>20220731</startdate><enddate>20220731</enddate><creator>Shiyi Qi</creator><creator>Li, Yaoxian</creator><creator>Gao, Cuiyun</creator><creator>Su, Xiaohong</creator><creator>Gao, Shuzheng</creator><creator>Zheng, Zibin</creator><creator>Liu, Chuanyi</creator><general>Cornell University Library, arXiv.org</general><scope>8FE</scope><scope>8FG</scope><scope>ABJCF</scope><scope>ABUWG</scope><scope>AFKRA</scope><scope>AZQEC</scope><scope>BENPR</scope><scope>BGLVJ</scope><scope>CCPQU</scope><scope>DWQXO</scope><scope>HCIFZ</scope><scope>L6V</scope><scope>M7S</scope><scope>PIMPY</scope><scope>PQEST</scope><scope>PQQKQ</scope><scope>PQUKI</scope><scope>PRINS</scope><scope>PTHSS</scope></search><sort><creationdate>20220731</creationdate><title>Dynamically Relative Position Encoding-Based Transformer for Automatic Code Edit</title><author>Shiyi Qi ; Li, Yaoxian ; Gao, Cuiyun ; Su, Xiaohong ; Gao, Shuzheng ; Zheng, Zibin ; Liu, Chuanyi</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-proquest_journals_26703597813</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2022</creationdate><topic>Datasets</topic><topic>Deep learning</topic><topic>Machine translation</topic><topic>Transformers</topic><toplevel>online_resources</toplevel><creatorcontrib>Shiyi Qi</creatorcontrib><creatorcontrib>Li, Yaoxian</creatorcontrib><creatorcontrib>Gao, Cuiyun</creatorcontrib><creatorcontrib>Su, Xiaohong</creatorcontrib><creatorcontrib>Gao, Shuzheng</creatorcontrib><creatorcontrib>Zheng, Zibin</creatorcontrib><creatorcontrib>Liu, Chuanyi</creatorcontrib><collection>ProQuest SciTech Collection</collection><collection>ProQuest Technology Collection</collection><collection>Materials Science & Engineering Collection</collection><collection>ProQuest Central (Alumni Edition)</collection><collection>ProQuest Central UK/Ireland</collection><collection>ProQuest Central Essentials</collection><collection>ProQuest Central</collection><collection>Technology Collection</collection><collection>ProQuest One Community College</collection><collection>ProQuest Central Korea</collection><collection>SciTech Premium Collection</collection><collection>ProQuest Engineering Collection</collection><collection>Engineering Database</collection><collection>Publicly Available Content Database</collection><collection>ProQuest One Academic Eastern Edition (DO NOT USE)</collection><collection>ProQuest One Academic</collection><collection>ProQuest One Academic UKI Edition</collection><collection>ProQuest Central China</collection><collection>Engineering Collection</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext</fulltext></delivery><addata><au>Shiyi Qi</au><au>Li, Yaoxian</au><au>Gao, Cuiyun</au><au>Su, Xiaohong</au><au>Gao, Shuzheng</au><au>Zheng, Zibin</au><au>Liu, Chuanyi</au><format>book</format><genre>document</genre><ristype>GEN</ristype><atitle>Dynamically Relative Position Encoding-Based Transformer for Automatic Code Edit</atitle><jtitle>arXiv.org</jtitle><date>2022-07-31</date><risdate>2022</risdate><eissn>2331-8422</eissn><abstract>Adapting Deep Learning (DL) techniques to automate non-trivial 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 are limited in accurately predicting code changes. In this work, we design a Transformer-based approach, considering that 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 paper, DTrans is designed with dynamically relative position encoding in the multi-head attention of 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.</abstract><cop>Ithaca</cop><pub>Cornell University Library, arXiv.org</pub><oa>free_for_read</oa></addata></record> |
fulltext | fulltext |
identifier | EISSN: 2331-8422 |
ispartof | arXiv.org, 2022-07 |
issn | 2331-8422 |
language | eng |
recordid | cdi_proquest_journals_2670359781 |
source | Free E- Journals |
subjects | Datasets Deep learning Machine translation Transformers |
title | Dynamically Relative Position Encoding-Based Transformer for Automatic Code Edit |
url | https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-06T00%3A14%3A26IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-proquest&rft_val_fmt=info:ofi/fmt:kev:mtx:book&rft.genre=document&rft.atitle=Dynamically%20Relative%20Position%20Encoding-Based%20Transformer%20for%20Automatic%20Code%20Edit&rft.jtitle=arXiv.org&rft.au=Shiyi%20Qi&rft.date=2022-07-31&rft.eissn=2331-8422&rft_id=info:doi/&rft_dat=%3Cproquest%3E2670359781%3C/proquest%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_pqid=2670359781&rft_id=info:pmid/&rfr_iscdi=true |