arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.05514cs.SE
收藏

RAG增强的提交信息生成

RAG-Enhanced Commit Message Generation

Linghao Zhang, Hongyi Zhang, Chong Wang, Peng Liang

AI总结:

本文提出REACT框架,通过混合检索器检索代码差异与提交信息示例,结合微调与上下文学习增强PLMs和LLMs的提交信息生成性能,显著超越基线。

摘要:

提交信息是软件开发与维护中最重要的文本信息之一。然而,手动编写提交信息非常耗时,提交信息生成(CMG)已成为研究热点。近年来,多个具备代码能力的预训练语言模型(PLMs)和大语言模型(LLMs)被引入,并在代码相关任务上展现出令人瞩目的性能。同时,已有研究探索了检索技术在CMG中的应用,但将先进检索技术与不同生成模型相结合会产生何种效果仍不清楚。本文提出了REACT,一个面向提交信息生成的检索增强框架。该框架将先进检索技术与不同的PLMs和LLMs相结合,以提升这些模型在CMG任务上的性能。具体而言,设计了一个混合检索器,用于检索最相关的代码差异与提交信息对作为示例。随后,通过微调和上下文学习,利用检索到的示例对来引导并增强PLMs和LLMs完成CMG任务。实验结果表明,REACT显著提升了这些模型在CMG任务上的性能,将CodeT5的BLEU分数提高了最多55%,将Llama 3的BLEU分数提升了102%,并大幅超越了所有基线。

英文摘要:

Commit message is one of the most important textual information in software development and maintenance. However, it is time-consuming to write commit messages manually. Commit Message Generation (CMG) has become a research hotspot. Recently, several pre-trained language models (PLMs) and large language models (LLMs) with code capabilities have been introduced, demonstrating impressive performance on code-related tasks. Meanwhile, prior studies have explored the utilization of retrieval techniques for CMG, but it is still unclear what effects would emerge from combining advanced retrieval techniques with various generation models. This paper proposed REACT, a REtrieval-Augmented framework for CommiT message generation. It integrates advanced retrieval techniques with different PLMs and LLMs, to enhance the performance of these models on the CMG task. Specifically, a hybrid retriever is designed and used to retrieve the most relevant code diff and commit message pair as an exemplar. Then, the retrieved pair is utilized to guide and enhance the CMG task by PLMs and LLMs through fine-tuning and in-context learning. The experimental results show that REACT significantly enhances these models' performance on the CMG task, improving the BLEU score of CodeT5 by up to 55%, boosting Llama 3's BLEU score by 102%, and substantially surpassing all baselines.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑