arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2304.11938cs.SEcs.AI
收藏

ChatGPT 是终极编程助手吗——它到底有多远?

Is ChatGPT the Ultimate Programming Assistant -- How far is it?

University of Luxembourg(卢森堡大学);The Hong Kong University of Science and Technology(香港科技大学)

Haoye Tian, Weiqi Lu, Tsz On Li, Xunzhu Tang, Shing-Chi Cheung, Jacques Klein, Tegawendé F. Bissyandé

AI总结:

本文实证评估了 ChatGPT 作为编程助手在代码生成、修复和摘要任务上的能力,发现其擅长常见问题但受限于注意力,且能推理代码意图,强调了提示工程的重要性。

摘要:

最近,ChatGPT 大语言模型受到了广泛关注:它可以用作讨论源代码的机器人,提示它建议更改、提供描述甚至生成代码。典型的演示通常集中在现有的基准测试上,这些基准测试可能已在模型训练中使用过(即数据泄漏)。为了评估使用 LLM 作为程序员的有用助手机器人的可行性,我们必须评估其在未见问题上的实际能力以及其在各种任务上的能力。在本文中,我们对 ChatGPT 作为全自动编程助手的潜力进行了实证研究,重点关注代码生成、程序修复和代码摘要任务。该研究调查了 ChatGPT 在常见编程问题上的表现,并将其与两个基准测试上的最先进方法进行了比较。在众多发现中,我们的研究表明 ChatGPT 在处理常见编程问题方面是有效的。然而,我们的实验也揭示了其在注意力跨度方面的局限性:详细的描述会限制 ChatGPT 的注意力,使其无法利用其广泛的知识来解决实际问题。令人惊讶的是,我们发现了 ChatGPT 推理代码原始意图的能力。我们期望未来的工作能基于这一见解来处理预言机问题的开放性问题。我们的发现为开发用于编程辅助的 LLM 提供了有趣的见解,特别是证明了提示工程的重要性,并更好地理解了 ChatGPT 在软件工程中的实际应用。

英文摘要:

Recently, the ChatGPT LLM has received great attention: it can be used as a bot for discussing source code, prompting it to suggest changes, provide descriptions or even generate code. Typical demonstrations generally focus on existing benchmarks, which may have been used in model training (i.e., data leakage). To assess the feasibility of using an LLM as a useful assistant bot for programmers, we must assess its realistic capabilities on unseen problems as well as its capabilities on various tasks. In this paper, we present an empirical study of ChatGPT's potential as a fully automated programming assistant, focusing on the tasks of code generation, program repair, and code summariziation. The study investigates ChatGPT's performance on common programming problems and compares it with state-of-the-art approaches on two benchmarks. Among several findings, our study shows that ChatGPT is effective in dealing with common programming problems. However, our experiments also reveal limitations in terms of its attention span: detailed descriptions will constrain the focus of ChatGPT and prevent it from leveraging its vast knowledge to solve the actual problem. Surprisingly, we have identified the ability of ChatGPT to reason the original intention of the code. We expect future work to build on this insight for dealing with the open question of the oracle problem. Our findings contribute interesting insights to the development of LLMs for programming assistance, notably by demonstrating the importance of prompt engineering, and providing a better understanding of ChatGPT's practical applications for software engineering.

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

↑