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

LLMLOOP: 通过自动化迭代反馈循环改进大语言模型生成的代码和测试

LLMLOOP: Improving LLM-Generated Code and Tests through Automated Iterative Feedback Loops

King's College London(伦敦国王学院)

Ravin Ravi, Dylan Bradshaw, Stefano Ruberto, Gunel Jahangirova, Valerio Terragni

AI总结:

LLMLOOP通过自动化迭代反馈循环提升大语言模型生成的代码和测试质量,通过五种循环解决编译错误、静态分析问题、测试失败和测试质量改进,验证了其在HUMANEVAL-X基准上的有效性。

摘要:

大型语言模型(LLMs)在生成源代码方面表现出色,但生成的代码常存在编译错误或不正确的问题。研究人员和开发者在实现检查和细化LLM生成的代码时往往浪费精力,重复劳动频繁。本文提出了LLMLOOP框架,该框架自动化了LLM生成的源代码和测试用例的细化过程。LLMLOOP采用五个迭代循环:解决编译错误、处理静态分析问题、修复测试用例失败、通过突变分析改进测试质量。这些循环确保生成高质量的测试用例,既作为验证机制,又作为生成代码的回归测试套件。我们在HUMANEVAL-X基准上评估了LLMLOOP,结果证明该工具在细化LLM生成输出方面非常有效。

英文摘要:

Large Language Models (LLMs) are showing remarkable performance in generating source code, yet the generated code often has issues like compilation errors or incorrect code. Researchers and developers often face wasted effort in implementing checks and refining LLM-generated code, frequently duplicating their efforts. This paper presents LLMLOOP, a framework that automates the refinement of both source code and test cases produced by LLMs. LLMLOOP employs five iterative loops: resolving compilation errors, addressing static analysis issues, fixing test case failures, and improving test quality through mutation analysis. These loops ensure the generation of high-quality test cases that serve as both a validation mechanism and a regression test suite for the generated code. We evaluated LLMLOOP on HUMANEVAL-X, a recent benchmark of programming tasks. Results demonstrate the tool's effectiveness in refining LLM-generated outputs.

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

↑