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

使用大语言模型修复Python编译器中的bug

Repairing Bugs in Python Assignments Using Large Language Models

Yale University(耶鲁大学);Microsoft(微软)

Jialu Zhang, José Cambronero, Sumit Gulwani, Vu Le, Ruzica Piskac, Gustavo Soares, Gust Verbruggen

摘要:

作为学习过程的一部分,学生经常在介绍性编程作业中犯错误。不幸的是,为这些错误提供自定义修复可能需要大量的时间和精力,从课堂教师。自动程序修复(APR)技术可用于合成这样的修复。先前的工作已经探索了在教育领域中使用符号和神经技术进行APR。这两种方法都需要大量的工程努力或大量的数据和培训。我们建议使用一个经过代码训练的大语言模型,比如Codex,来构建一个APR系统--MMAPR--用于介绍Python编程作业。我们的系统可以修复语法和语义错误相结合的多模态提示,迭代查询,基于测试用例的选择少数镜头,和程序分块。我们在286个真实的学生程序上评估了MMAPR,并将其与通过结合最先进的Python语法修复引擎BIFI和最先进的Python语义修复引擎Refactory构建的基线进行了比较。我们发现,MMAPR可以修复更多的程序,并产生更小的补丁平均。

英文摘要:

Students often make mistakes on their introductory programming assignments as part of their learning process. Unfortunately, providing custom repairs for these mistakes can require a substantial amount of time and effort from class instructors. Automated program repair (APR) techniques can be used to synthesize such fixes. Prior work has explored the use of symbolic and neural techniques for APR in the education domain. Both types of approaches require either substantial engineering efforts or large amounts of data and training. We propose to use a large language model trained on code, such as Codex, to build an APR system -- MMAPR -- for introductory Python programming assignments. Our system can fix both syntactic and semantic mistakes by combining multi-modal prompts, iterative querying, test-case-based selection of few-shots, and program chunking. We evaluate MMAPR on 286 real student programs and compare to a baseline built by combining a state-of-the-art Python syntax repair engine, BIFI, and state-of-the-art Python semantic repair engine for student assignments, Refactory. We find that MMAPR can fix more programs and produce smaller patches on average.

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

↑