arrow
返回

RRGcode: Deep hierarchical search-based code generation

delete2024-05-01
delete4
PRE
AI
Q
Qianwen Gou
Y
Yunwei Dong
W
Wu Yujiao
Q
Qiao Ke *
DOI:10.1016/j.jss.2024.111982delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Retrieval-augmented code generation strengthens the generation model by using a retrieval model to select relevant code snippets from a code corpus. The synergy between retrieval and generation ensures that the generated code closely corresponds to the intended functionality. Existing methods simply feed the retrieved results to the generation model. However, if the retrieval corpus contains erroneous or sub-optimal code examples, there is a risk that the model may replicate these mistakes in the generated code. To tackle these problems, we propose RRGcode (Retrieval, Re-ranking, and Generation for code generation), a deep hierarchical search-based code generation framework that fine-tunes initial retrieved code rankings, reducing the risk of replicating errors from the retrieval corpus and enhancing the generation of higher-quality, more reliable code. Specifically, it first retrieves relevant code candidates from a large code corpus. Then, a reranking model reconstructs the search space through a detailed semantic comparison between code candidates and the query, ensuring that only the most relevant and accurate candidates are considered. Finally, the reranked top -K codes, along with the query, serve as input for the code generation model. Extensive experiments are conducted to evaluate the effectiveness of generated code by RRGcode, demonstrating state-of-the-art performance in code generation tasks.
Keyword:
Hierarchical search
Re-ranking
Semantic comparison
Code generation

期刊

Journal of Systems and Software 封面图
Journal of Systems and Software
IF:
4.1
论文数:
5.5K
被引数:
8.4K

机构

N
Northwestern Polytechnical University
学者数:
4.6W
论文数: 3.7W
被引数: 5.3W
引用论文

引用论文

Deep Graph Matching and Searching for Semantic Code Retrieval
err2021-05-10
err65
errOAAI
errLing, Xiang; Wu, Lingfei; Wang, Saizhuo; Pan, Gaoning; Ma, Tengfei; Xu, Fangli; Liu, Alex X.; Wu, Chunming; Ji, Shouling
err分享
err收藏
err分享
err收藏
STAT2 signaling as double-edged sword restricting viral dissemination but driving severe pneumonia in SARS-CoV-2 infected hamsters
err
IF0
err2020-04-24
err0
errOAAI
errRobbert Boudewijns; Hendrik Jan Thibaut; Suzanne J. F. Kaptein; Rong Li; Valentijn Vergote; Laura Seldeslachts; Carolien De Keyzer; Lindsey Bervoets; Sapna Sharma; Johan Van Weyenbergh; Laurens Liesenborghs; Ji Ma; Sander Jansen; Dominique Van Looveren; Thomas Vercruysse; Dirk Jochmans; Xinyu Wang; Erik Martens; Kenny Roose; Dorien De Vlieger; Bert Schepens; Tina Van Buyten; Sofie Jacobs; Yanan Liu; Joan Martí-Carreras; Bert Vanmechelen; Tony Wawina-Bokalanga; Leen Delang; Joana Rocha-Pereira; Lotte Coelmont; Winston Chiu; Pieter Leyssen; Elisabeth Heylen; Dominique Schols; Lanjiao Wang; Lila Close; Jelle Matthijnssens; Marc Van Ranst; Veerle Compernolle; Georg Schramm; Koen Van Laere; Xavier Saelens; Nico Callewaert; Ghislain Opdenakker; Piet Maes; Birgit Weynand; Christopher Cawthorne; Greetje Vande Velde; Zhongde Wang; Johan Neyts; Kai Dallmeier
err分享
err收藏
没有更多内容