RGD:基于精化与生成引导的多LLM智能体调试器
RGD: Multi-LLM Based Agent Debugger via Refinement and Generation Guidance
AI总结:
本文提出多LLM智能体调试框架RGD,通过引导、调试和反馈三个智能体将代码生成分解为多步迭代精化过程,在HumanEval和MBPP上分别提升9.8%和16.2%,显著增强了LLM自主生成与调试代码的能力。
摘要:
大型语言模型(LLMs)在代码生成任务中展现出巨大潜力,近期关于提示工程的研究也增强了LLMs对文本信息的理解能力。然而,确保生成代码的正确性通常仍需要程序员进行大量测试与验证。尽管LLMs通常能够根据任务描述生成代码,但其准确率仍然有限,尤其是在需要同时深入理解问题陈述和代码生成过程的复杂任务上。这一局限主要源于LLMs需要同时理解文本并生成语法和语义均正确的代码,却缺乏自动精化代码的能力。在现实世界的软件开发中,程序员很少仅凭任务描述就能一次性写出完美代码,他们依赖迭代式反馈和调试来精化程序。受这一过程启发,我们提出了一种基于LLM智能体的新型代码生成与自动调试架构:精化与引导调试(Refinement and Guidance Debugging,RGD)。RGD框架是一个基于多LLM的智能体调试器,利用三个不同的LLM智能体——引导智能体(Guide Agent)、调试智能体(Debug Agent)和反馈智能体(Feedback Agent)。RGD将代码生成任务分解为多个步骤,确保工作流更加清晰,并支持基于自我反思和反馈的迭代式代码精化。实验结果表明,RGD展现出卓越的代码生成能力,在HumanEval数据集上相比最先进方法和传统直接提示方法取得了9.8%的提升,在MBPP数据集上取得了16.2%的提升,达到了最先进性能。我们强调了RGD框架在增强LLM自主生成和精化代码能力方面的有效性。
英文摘要:
Large Language Models (LLMs) have shown incredible potential in code generation tasks, and recent research in prompt engineering have enhanced LLMs' understanding of textual information. However, ensuring the accuracy of generated code often requires extensive testing and validation by programmers. While LLMs can typically generate code based on task descriptions, their accuracy remains limited, especially for complex tasks that require a deeper understanding of both the problem statement and the code generation process. This limitation is primarily due to the LLMs' need to simultaneously comprehend text and generate syntactically and semantically correct code, without having the capability to automatically refine the code. In real-world software development, programmers rarely produce flawless code in a single attempt based on the task description alone, they rely on iterative feedback and debugging to refine their programs. Inspired by this process, we introduce a novel architecture of LLM-based agents for code generation and automatic debugging: Refinement and Guidance Debugging (RGD). The RGD framework is a multi-LLM-based agent debugger that leverages three distinct LLM agents-Guide Agent, Debug Agent, and Feedback Agent. RGD decomposes the code generation task into multiple steps, ensuring a clearer workflow and enabling iterative code refinement based on self-reflection and feedback. Experimental results demonstrate that RGD exhibits remarkable code generation capabilities, achieving state-of-the-art performance with a 9.8% improvement on the HumanEval dataset and a 16.2% improvement on the MBPP dataset compared to the state-of-the-art approaches and traditional direct prompting approaches. We highlight the effectiveness of the RGD framework in enhancing LLMs' ability to generate and refine code autonomously.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。