Most programmers make mistakes when writing code. Some of these mistakes are small and require few edits to the original program -- a class of errors recently termed last mile mistakes. These errors break the flow for experienced developers and can stump novice programmers. Existing automated repair techniques targeting this class of errors are language-specific and do not easily carry over to new languages. Transferring symbolic approaches requires substantial engineering and neural approaches require data and retraining. We introduce RING, a multilingual repair engine powered by a large language model trained on code (LLMC) such as Codex. Such a multilingual engine enables a flipped model for programming assistance, one where the programmer writes code and the AI assistance suggests fixes, compared to traditional code suggestion technology. Taking inspiration from the way programmers manually fix bugs, we show that a prompt-based strategy that conceptualizes repair as localization, transformation, and candidate ranking, can successfully repair programs in multiple languages with minimal effort. We present the first results for such a multilingual repair engine by evaluating on 6 different languages and comparing performance to language-specific repair engines. We show that RING can outperform language-specific repair engines for three of these languages.
翻译:大部分程序员在写入代码时犯错误。 其中一些错误很小, 需要对原始程序进行少许编辑 -- -- 这是最近称为最后一英里错误的一类错误。 这些错误打破了经验丰富的开发者的流动, 并且可以设置新程序员。 现有的针对这类错误的自动修理技术是语言专用的, 并不容易传到新的语言。 转让象征性方法需要大量的工程和神经方法, 需要大量的数据和再培训。 我们引入了一种多语言修理引擎, 由诸如代码( LLMC)等受过训练的大型语言模型驱动。 这种多语言引擎可以提供快速的编程协助模式, 程序员写代码和 AI 协助可以提出与传统代码建议技术相比的修补。 我们从程序员手工修补错误的方式中获取灵感, 我们显示, 一种将修补概念化为本地化、 变换和候选人排级的快速战略, 能够以极少努力的方式成功修补多种语言的方案。 我们通过评价6种不同语言和将性能与语言修理引擎进行比较, 来显示这样的多语言修理引擎的第一个结果。 我们显示, RIN可以超越三种语言的修理引擎的精准功能。