arrow
返回

StructCoder: Structure-Aware Transformer for Code Generation

StructCoder: 用于代码生成的结构感知转换器

delete2024-01-12
delete10
delete
OA
AI
S
Sindhu Tipirneni *
M
Ming Zhu
C
Chandan K. Reddy
DOI:10.1145/3636430delete
delete原文链接
delete分享
delete收藏
摘要

摘要

En 中文
There has been a recent surge of interest in automating software engineering tasks using deep learning. This article addresses the problem of code generation, in which the goal is to generate target code given source code in a different language or a natural language description. Most state-of-the-art deep learning models for code generation use training strategies primarily designed for natural language. However, understanding and generating code requires a more rigorous comprehension of the code syntax and semantics. With this motivation, we develop an encoder-decoder Transformer model in which both the encoder and decoder are explicitly trained to recognize the syntax and dataflow in the source and target codes, respectively. We not only make the encoder structure aware by leveraging the source code's syntax tree and dataflow graph, but we also support the decoder in preserving the syntax and dataflow of the target code by introducing two novel auxiliary tasks: Abstract Syntax Tree (AST) path prediction and dataflow prediction. To the best of our knowledge, this is the first work to introduce a structure-aware Transformer decoder that models both syntax and dataflow to enhance the quality of generated code. The proposed StructCoder model achieves state-ofthe-art performance on code translation and text-to-code generation tasks in the CodeXGLUE benchmark and improves over baselines of similar size on the APPS code generation benchmark. Our code is publicly available at https://github.com/reddy- lab-code- research/StructCoder/.
Keyword:
Deep learning
language models
code generation
Transformer
SeTransformer: A Transformer-Based Code Semantic Parser for Code Comment Generation
err2023-03-01
err22
PREAI
errLi, Zheng; Wu, Yonghao; Peng, Bin; Chen, Xiang; Sun, Zeyu; Liu, Yong; Paul, Doyle
err分享
err收藏

期刊

ACM Transactions on Knowledge Discovery from Data 封面图
ACM Transactions on Knowledge Discovery from Data
IF:
4.8
论文数:
1.3K
被引数:
5.5K

机构

暂无机构信息
引用论文

引用论文

Caveolin-1 and -2 regulate cell motility in castration-resistant prostate cancer
err2018-10-01
err0
errOAAI
errToyoharu Kamibeppu; Koji Yamasaki; Kozue Nakahara; Takahiro Nagai; Naoki Terada; Hiromasa Tsukino; Shoichiro Mukai; Toshiyuki Kamoto
err分享
err收藏
err
IF0
err
err0
PREAI
err
err分享
err收藏
Capsaicin
err1876-01-01
err0
PREAI
errI. C. Thresh
err分享
err收藏
err分享
err收藏
The HadGEM2-ES implementation of CMIP5 centennial simulationsCMIP5百年模拟的HadGEM2-ES实现
err
IF0
err2011-03-31
err0
errOAAI
errC. D. Jones; J. K. Hughes; N. Bellouin; S. C. Hardiman; G. S. Jones; J. Knight; S. Liddicoat; F. M. O'Connor; R. J. Andres; C. Bell; K.-O. Boo; A. Bozzo; N. Butchart; P. Cadule; K. D. Corbin; M. Doutriaux-Boucher; P. Friedlingstein; J. Gornall; L. Gray; P. R. Halloran; G. Hurtt; W. Ingram; J.-F. Lamarque; R. M. Law; M. Meinshausen; S. Osprey; E. J. Palin; L. Parsons Chini; T. Raddatz; M. Sanderson; A. A. Sellar; A. Schurer; P. Valdes; N. Wood; S. Woodward; M. Yoshioka; M. Zerroukat
err分享
err收藏
学者 查看更多内容