arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.13246cs.SEcs.LG
收藏

会话式自动程序修复

Conversational Automated Program Repair

University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Chunqiu Steven Xia, Lingming Zhang

摘要:

自动程序修复(APR)可以帮助开发人员自动生成bug补丁。由于使用大型预训练语言模型(LLM)在许多代码相关任务上获得了令人印象深刻的性能,研究人员已经开始直接使用LLM进行APR。然而,先前的方法简单地重复采样LLM,给出从原始错误代码创建的相同构造的输入/提示,这不仅导致重复生成相同的错误补丁,而且还错过了测试用例中的关键信息。为了解决这些局限性,我们提出了会话式APR,一种新的模式,程序修复,交替补丁生成和验证之间的对话方式。在会话式APR中,我们通过将先前生成的补丁与验证反馈相结合来迭代地构建模型的输入。因此,我们利用LLM的长期上下文窗口,不仅可以避免生成以前不正确的补丁,而且还可以结合验证反馈,以帮助模型理解被测程序的语义含义。我们评估了10种不同的LLM,包括新开发的ChatGPT模型,以证明会话式APR比APR方法的先前LLM的改进。

英文摘要:

Automated Program Repair (APR) can help developers automatically generate patches for bugs. Due to the impressive performance obtained using Large Pre-Trained Language Models (LLMs) on many code related tasks, researchers have started to directly use LLMs for APR. However, prior approaches simply repeatedly sample the LLM given the same constructed input/prompt created from the original buggy code, which not only leads to generating the same incorrect patches repeatedly but also miss the critical information in testcases. To address these limitations, we propose conversational APR, a new paradigm for program repair that alternates between patch generation and validation in a conversational manner. In conversational APR, we iteratively build the input to the model by combining previously generated patches with validation feedback. As such, we leverage the long-term context window of LLMs to not only avoid generating previously incorrect patches but also incorporate validation feedback to help the model understand the semantic meaning of the program under test. We evaluate 10 different LLM including the newly developed ChatGPT model to demonstrate the improvement of conversational APR over the prior LLM for APR approach.

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

↑