CODESIM: 通过仿真驱动的规划与调试进行多智能体代码生成与问题解决
CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debugging
AI总结:
CODESIM提出了一种基于仿真的多智能体代码生成框架,通过仿真验证和内部调试提升代码生成能力,在多个基准测试中取得新高成绩。
摘要:
大型语言模型(LLMs)在代码生成和问题解决方面取得了显著进展。当前方法依赖于外部工具驱动的迭代调试器,通过编译器或其他工具的运行时反馈来改进各种方法生成的粗略程序。然而,这些方法的有效性严重依赖于初始代码生成的质量,这仍然是一个开放性挑战。本文介绍了一种名为CodeSim的新型多智能体代码生成框架,通过类人感知方法全面解决程序合成-规划、编码和调试的各个阶段。由于人类通过视觉仿真验证其对任何算法的理解,CodeSim通过输入/输出的逐步仿真进行计划验证和内部调试。在七个具有挑战性的竞争性问题解决和程序合成基准测试中,CodeSim的代码生成能力得到了广泛验证。我们的框架在HumanEval、MBPP、APPS和CodeContests等基准测试中分别达到了95.1%、90.7%、22%和29.1%的新状态。此外,我们的方法在与外部调试器结合时还显示出进一步提升的潜力。为了促进该领域的进一步研究和开发,我们在此链接(https://kagnlp.github.io/codesim.github.io/)开源了我们的框架。
英文摘要:
Large Language Models (LLMs) have made significant strides in code generation and problem solving. Current approaches employ external tool-based iterative debuggers that use compiler or other tool-based runtime feedback to refine coarse programs generated by various methods. However, the effectiveness of these approaches heavily relies on the quality of the initial code generation, which remains an open challenge. In this paper, we introduce CodeSim, a novel multi-agent code generation framework that comprehensively addresses the stages of program synthesis-planning, coding, and debugging-through a human-like perception approach. As human verifies their understanding of any algorithms through visual simulation, CodeSim uniquely features a method of plan verification and internal debugging through the step-by-step simulation of input/output. Extensive experiments across seven challenging competitive problem-solving and program synthesis benchmarks demonstrate CodeSim's remarkable code generation capabilities. Our framework achieves new state-of-the-art (pass@1) results-(HumanEval 95.1%, MBPP 90.7%, APPS 22%, and CodeContests 29.1%). Furthermore, our method shows potential for even greater enhancement when cascaded with external debuggers. To facilitate further research and development in this area, we have open-sourced our framework in this link (https://kagnlp.github.io/codesim.github.io/).
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。