中文版 | English
题名

Two Birds with One Stone: Boosting Code Generation and Code Search via a Generative Adversarial Network

作者
通讯作者Wen,Ming; Liu,Yepang
发表日期
2023-10-16
DOI
发表期刊
EISSN
2475-1421
卷号7期号:OOPSLA2
摘要

Automatically transforming developers' natural language descriptions into source code has been a longstanding goal in software engineering research. Two types of approaches have been proposed in the literature to achieve this: code generation, which involves generating a new code snippet, and code search, which involves reusing existing code. However, despite existing efforts, the effectiveness of the state-of-the-art techniques remains limited. To seek for further advancement, our insight is that code generation and code search can help overcome the limitation of each other: the code generator can benefit from feedback on the quality of its generated code, which can be provided by the code searcher, while the code searcher can benefit from the additional training data augmented by the code generator to better understand code semantics. Drawing on this insight, we propose a novel approach that combines code generation and code search techniques using a generative adversarial network (GAN), enabling mutual improvement through the adversarial training. Specifically, we treat code generation and code search as the generator and discriminator in the GAN framework, respectively, and incorporate several customized designs for our tasks. We evaluate our approach in eight different settings, and consistently observe significant performance improvements for both code generation and code search. For instance, when using NatGen, a state-of-the-art code generator, as the generator and GraphCodeBERT, a state-of-the-art code searcher, as the discriminator, we achieve a 32% increase in CodeBLEU score for code generation, and a 12% increase in mean reciprocal rank for code search on a large-scale Python dataset, compared to their original performances.

关键词
相关链接[Scopus记录]
收录类别
EI ; ESCI
语种
英语
学校署名
通讯
资助项目
National Key R&D Program of China[2022YFA1005101] ; National Natural Science Foundation of China["61932021","62002125","62272072"] ; Young Elite Scientists Sponsorship Program by CAST[2021QNRC001]
WOS研究方向
Computer Science
WOS类目
Computer Science, Software Engineering
WOS记录号
WOS:001087279100019
出版者
EI入藏号
20234414978511
EI主题词
Codes (Symbols) ; Large Dataset ; Network Coding ; Semantics ; Software Engineering
EI分类号
Information Theory And Signal Processing:716.1 ; Computer Programming:723.1 ; Data Processing And Image Processing:723.2 ; Artificial Intelligence:723.4
Scopus记录号
2-s2.0-85174919482
来源库
Scopus
引用统计
被引频次[WOS]:4
成果类型期刊论文
条目标识符http://sustech.caswiz.com/handle/2SGJ60CL/602354
专题工学院_计算机科学与工程系
作者单位
1.Key Laboratory of Software Engineering for Complex Systems,College of Computer,National University of Defense Technology,Changsha,China
2.Singapore Management University,Singapore,Singapore
3.School of Cyber Science and Engineering,Huazhong University of Science and Technology,Wuhan,China
4.Research Institute of Trustworthy Autonoumous Systems,Department of Computer Science and Engineering,Southern University of Science and Technology,Shenzhen,China
5.Chongqing University,Chongqing,China
通讯作者单位计算机科学与工程系
推荐引用方式
GB/T 7714
Wang,Shangwen,Lin,Bo,Sun,Zhensu,et al. Two Birds with One Stone: Boosting Code Generation and Code Search via a Generative Adversarial Network[J]. Proceedings of the ACM on Programming Languages,2023,7(OOPSLA2).
APA
Wang,Shangwen.,Lin,Bo.,Sun,Zhensu.,Wen,Ming.,Liu,Yepang.,...&Mao,Xiaoguang.(2023).Two Birds with One Stone: Boosting Code Generation and Code Search via a Generative Adversarial Network.Proceedings of the ACM on Programming Languages,7(OOPSLA2).
MLA
Wang,Shangwen,et al."Two Birds with One Stone: Boosting Code Generation and Code Search via a Generative Adversarial Network".Proceedings of the ACM on Programming Languages 7.OOPSLA2(2023).
条目包含的文件
条目无相关文件。
个性服务
原文链接
推荐该条目
保存到收藏夹
查看访问统计
导出为Endnote文件
导出为Excel格式
导出为Csv格式
Altmetrics Score
谷歌学术
谷歌学术中相似的文章
[Wang,Shangwen]的文章
[Lin,Bo]的文章
[Sun,Zhensu]的文章
百度学术
百度学术中相似的文章
[Wang,Shangwen]的文章
[Lin,Bo]的文章
[Sun,Zhensu]的文章
必应学术
必应学术中相似的文章
[Wang,Shangwen]的文章
[Lin,Bo]的文章
[Sun,Zhensu]的文章
相关权益政策
暂无数据
收藏/分享
所有评论 (0)
[发表评论/异议/意见]
暂无评论

除非特别说明,本系统中所有内容都受版权保护,并保留所有权利。