使用CodeT5进行最小编辑的程序修复
Program Repair with Minimal Edits Using CodeT5
AI总结:
本文提出使用CodeT5模型,通过微调错误-正确程序对,以最小编辑距离生成正确程序,实验达到91.95%的pass@100,证明其在入门编程问题修复中的有效性。
摘要:
程序员常常难以识别和修复程序中的错误。近年来,许多语言模型(LMs)被提出用于修复错误的程序并支持错误恢复。然而,这些语言模型倾向于生成与原始输入程序不同的解决方案,这可能导致用户理解上的困难。在本文中,我们提出了一种使用CodeT5来建议具有最小修复编辑的正确程序的方法。我们在错误和正确程序的代码对上微调预训练的CodeT5,并评估其与几个基线模型的性能。实验结果表明,微调后的CodeT5达到了91.95%的pass@100,最相似正确程序的平均编辑距离为6.84,这表明通过生成100个候选程序,至少可以建议一个正确的程序。我们证明了语言模型在解决入门编程问题时,通过最小编辑建议程序修复的有效性。
英文摘要:
Programmers often struggle to identify and fix bugs in their programs. In recent years, many language models (LMs) have been proposed to fix erroneous programs and support error recovery. However, the LMs tend to generate solutions that differ from the original input programs. This leads to potential comprehension difficulties for users. In this paper, we propose an approach to suggest a correct program with minimal repair edits using CodeT5. We fine-tune a pre-trained CodeT5 on code pairs of wrong and correct programs and evaluate its performance with several baseline models. The experimental results show that the fine-tuned CodeT5 achieves a pass@100 of 91.95% and an average edit distance of the most similar correct program of 6.84, which indicates that at least one correct program can be suggested by generating 100 candidate programs. We demonstrate the effectiveness of LMs in suggesting program repair with minimal edits for solving introductory programming problems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。