2025-02-11 · 专家 · 计算机视觉 · 机器学习

CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debugging

CODESIM通过模拟驱动的规划和调试,实现了一个新颖的多代理代码生成框架,显著提高了代码生成和问题解决的能力。

更新于 2025-02-28。作者:Md. Ashraful Islam、Mohammed Eunus Ali、Md Rizwan Parvez。

中文摘要

大型语言模型(LLMs)在代码生成和问题解决方面取得了显著进步。当前的方法采用基于外部工具的迭代调试器,这些调试器利用编译器或其他工具的运行时反馈来优化由各种方法生成的粗略程序。然而,这些方法的有效性高度依赖于初始代码生成的质量,而这仍然是一个待解决的问题。在本文中,我们介绍了CodeSim,这是一个新颖的多智能体代码生成框架,它通过类似人类感知的方法全面解决了程序综合的各个阶段——规划、编码和调试。正如人类通过视觉模拟验证对任何算法的理解一样,CodeSim独特地引入了通过逐步模拟输入/输出进行计划验证和内部调试的方法。在七个具有挑战性的竞争问题解决和程序综合基准测试中进行的广泛实验表明,CodeSim具有令人瞩目的代码生成能力。我们的框架实现了新的最先进(pass@1)结果——(HumanEval 95.1%,MBPP 90.7%,APPS 22%,和CodeContests 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/).

解读

一句话总结

CODESIM通过模拟驱动的规划和调试,实现了一个新颖的多代理代码生成框架,显著提高了代码生成和问题解决的能力。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源