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

大语言模型在软件工程中的批判性综述:以ChatGPT与自动化程序修复为例

A Critical Review of Large Language Model on Software Engineering: An Example from ChatGPT and Automated Program Repair

Quanjun Zhang, Tongke Zhang, Juan Zhai, Chunrong Fang, Bowen Yu, Weisong Sun, Zhenyu Chen

AI总结:

该研究构建了ChatGPT训练截止时间后的全新APR基准,评估其漏洞修复能力,验证了不同提示词及对话式修复流程的效果,指出需重新评估黑盒大模型在软件工程任务中的成果。

摘要:

大语言模型(LLMs)正受到越来越多的关注,并在各类软件工程(SE)任务中展现出可观的性能,例如自动化程序修复(APR)、代码摘要生成和代码补全。比如,最新的黑盒大语言模型ChatGPT已被大量近期研究探讨,并在多项任务中表现出令人印象深刻的性能。但由于这类大语言模型通常闭源,具体训练细节(如预训练数据集)尚不明确,因此存在数据泄露的潜在风险。\n本文旨在通过不同研究目标,在一个干净的APR基准上评估ChatGPT的漏洞修复能力。我们首先介绍\enchmark——这是一个全新的基准,包含2023年起(即ChatGPT训练数据截止时间之后)的竞赛编程问题中的错误程序及对应的修复后程序。在\enchmark上的实验结果显示,使用基础提示词时,ChatGPT能在35轮独立运行中修复151个错误程序里的109个,预测准确率分别比当前最优的大语言模型CodeT5和PLBART高出27.5%和62.4%。我们还探究了三类提示词的影响,即问题描述、错误反馈和漏洞定位,这类提示词额外修复了34个漏洞。此外,我们从ChatGPT的交互特性出发展开补充讨论,说明基于对话的修复工作流可额外修复9个漏洞。受这些发现启发,我们进一步明确了在不久的将来,搭载此类大语言模型(如ChatGPT)的前沿软件工程研究面临的各类挑战与机遇。更重要的是,本研究呼吁学界更多关注重新评估现有黑盒大语言模型在各类软件工程任务上取得的成果,而不仅限于ChatGPT在APR任务中的表现。

英文摘要:

Large Language Models (LLMs) have been gaining increasing attention and demonstrated promising performance across a variety of Software Engineering (SE) tasks, such as Automated Program Repair (APR), code summarization, and code completion. For example, ChatGPT, the latest black-box LLM, has been investigated by numerous recent research studies and has shown impressive performance in various tasks. However, there exists a potential risk of data leakage since these LLMs are usually close-sourced with unknown specific training details, e.g., pre-training datasets. In this paper, we seek to review the bug-fixing capabilities of ChatGPT on a clean APR benchmark with different research objectives. We first introduce {\benchmark}, a new benchmark with buggy and the corresponding fixed programs from competitive programming problems starting from 2023, after the training cutoff point of ChatGPT. The results on {\benchmark} show that ChatGPT is able to fix 109 out of 151 buggy programs using the basic prompt within 35 independent rounds, outperforming state-of-the-art LLMs CodeT5 and PLBART by 27.5\% and 62.4\% prediction accuracy. We also investigate the impact of three types of prompts, i.e., problem description, error feedback, and bug localization, leading to additional 34 fixed bugs. Besides, we provide additional discussion from the interactive nature of ChatGPT to illustrate the capacity of a dialog-based repair workflow with 9 additional fixed bugs. Inspired by the findings, we further pinpoint various challenges and opportunities for advanced SE study equipped with such LLMs (e.g.,~ChatGPT) in the near future. More importantly, our work calls for more research on the reevaluation of the achievements obtained by existing black-box LLMs across various SE tasks, not limited to ChatGPT on APR.

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

↑