arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.07994cs.SEcs.CLcs.LG
收藏

评估大语言模型使用往返翻译的潜在自动化程序修复能力

Assessing the Latent Automated Program Repair Capabilities of Large Language Models using Round-Trip Translation

Simula Research Laboratory(Simula研究实验室)

Fernando Vallecillos Ruiz, Anastasiia Grishina, Max Hort, Leon Moonen

AI总结:

本研究探索利用往返翻译(RTT)通过大语言模型进行自动化程序修复,发现该方法能生成合理补丁,并可作为APR框架的补充组件。

摘要:

研究表明,自然语言中的错误可以通过使用语言模型将文本翻译成另一种语言再翻译回来进行纠正。我们通过研究往返翻译(RTT)——使用大语言模型(LLMs)将代码从一种编程语言翻译成另一种编程语言或自然语言,然后再翻译回来——来探索这种潜在纠正能力在多大程度上扩展到自动化程序修复(APR)。我们假设RTT通过向均值回归,恢复了LLM训练语料库中最常见的模式,用更常见、自然、无错误的代码替换不频繁的bug。为验证这一假设,我们使用了九个LLM和四个Java中常见的APR基准,并对RTT生成的补丁进行了详细的定量和定性分析。我们发现,在HumanEval-Java基准上,使用GPT-4通过英语进行RTT为164个bug中的100个生成了合理补丁,其中97个在我们的手动评估中被认为是正确的。此外,RTT独特地为46个被专门针对APR微调的LLM遗漏的bug生成了合理补丁。虽然这证明了RTT在APR中的可行性,我们也观察到局限性,例如整体bug修复率低于最先进水平,以及稀释了原始编码风格。我们分析了这些局限性的影响,并讨论了将RTT用作APR框架中补充组件的潜力。复制包可从https://doi.org/10.5281/zenodo.10500593下载。

英文摘要:

Research shows that errors in natural language can be corrected by translating texts to another language and back using language models. We explore to what extent this latent correction capability extends to Automated Program Repair (APR) by investigating Round-Trip Translation (RTT): translating code from one programming language into another programming or natural language and back, using Large Language Models (LLMs). We hypothesize that RTT restores patterns most commonly seen in the LLM's training corpora through regression toward the mean, replacing infrequent bugs with more frequent, natural, bug-free code. To test this hypothesis, we employ nine LLMs and four common APR benchmarks in Java, and perform a detailed quantitative and qualitative analysis of RTT-generated patches. We find that RTT through English generates plausible patches for 100 of 164 bugs with GPT-4 on the HumanEval-Java benchmark, and 97 are found to be correct in our manual assessment. Moreover, RTT uniquely generates plausible patches for 46 bugs that were missed by LLMs specifically fine-tuned for APR. While this demonstrates the viability of RTT for APR, we also observe limitations, such as a lower overall bug fix rate than the state-of-the-art and diluting the original coding style. We analyze the impact of these limitations and discuss the potential of using RTT as a complementary component in APR frameworks. A replication package is available for download from https://doi.org/10.5281/zenodo.10500593. Keywords: automated program repair, large language model, machine translation

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

↑