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

面向深度学习程序修复的ChatGPT提示设计、优势与局限性研究

A study on Prompt Design, Advantages and Limitations of ChatGPT for Deep Learning Program Repair

Jialun Cao, Meiziniu Li, Ming Wen, Shing-chi Cheung

AI总结:

本文通过三个研究问题系统探索ChatGPT在深度学习程序修复中的能力,提出提示设计分类与多种提示模板,并总结其在代码异味检测、重构及API误用检测方面的优势与局限。

摘要:

ChatGPT已经革新了许多研究和工业领域。ChatGPT在软件工程中展现出巨大潜力,能够提升程序修复、代码理解和代码生成等多种传统任务。然而,自动程序修复(APR)是否适用于深度学习(DL)程序仍是未知的。DL程序的决策逻辑并未显式编码在源代码中,这给APR带来了独特的挑战。修复DL程序时,APR方法不仅需要从语法上解析源代码,还需要理解代码意图。在现有最佳工作中,故障定位的性能仍远不能令人满意(仅约30%)。因此,在本文中,我们通过提出三个研究问题来探索ChatGPT在DL程序修复方面的能力:(1)ChatGPT能否有效调试DL程序?(2)如何通过提示来提升ChatGPT的修复性能?(3)对话以何种方式有助于促进修复?在此基础上,我们对DL程序修复中有用的提示设计的常见方面进行了分类。此外,我们提出了多种提示模板以提升性能,并总结了ChatGPT能力的优势与不足,例如检测不良代码异味、代码重构以及检测API误用/弃用。

英文摘要:

ChatGPT has revolutionized many research and industrial fields. ChatGPT has shown great potential in software engineering to boost various traditional tasks such as program repair, code understanding, and code generation. However, whether automatic program repair (APR) applies to deep learning (DL) programs is still unknown. DL programs, whose decision logic is not explicitly encoded in the source code, have posed unique challenges to APR. While to repair DL programs, an APR approach needs to not only parse the source code syntactically but also needs to understand the code intention. With the best prior work, the performance of fault localization is still far less than satisfactory (only about 30\%). Therefore, in this paper, we explore ChatGPT's capability for DL program repair by asking three research questions. (1) Can ChatGPT debug DL programs effectively? (2) How can ChatGPT's repair performance be improved by prompting? (3) In which way can dialogue help facilitate the repair? On top of that, we categorize the common aspects useful for prompt design for DL program repair. Also, we propose various prompt templates to facilitate the performance and summarize the advantages and disadvantages of ChatGPT's abilities such as detecting bad code smell, code refactoring, and detecting API misuse/deprecation.

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

↑