多智能体协作中的自适应置信度门控:用于高效优化的代码生成
Adaptive Confidence Gating in Multi-Agent Collaboration for Efficient and Optimized Code Generation
AI总结:
DebateCoder通过多智能体协作和自适应置信度门控机制,提升小型语言模型在复杂逻辑任务中的代码生成效率和准确性。
摘要:
尽管大型语言模型(LLMs)在自动化代码生成领域引发了突破,但小型语言模型(SLMs)在处理复杂逻辑需求时常面临推理瓶颈和失败循环。为克服这些挑战,我们提出了DebateCoder,一种多智能体协作框架,旨在提升SLMs(如Pangu-1B)在资源受限环境中的推理能力。DebateCoder采用一种结构化的角色扮演协议,包含三个智能体:用户智能体(A_UA)、技术智能体(A_TA)和质量保证智能体(A_QA)。它还包含一种自适应置信度门控机制,设有95%的阈值,以平衡准确性和推理效率。此外,我们引入了多轮讨论模块和由审阅者引导的分析调试循环,用于正向生成的辩论和反向生成的细化。在HumanEval和MBPP上的实验表明,DebateCoder在HumanEval上实现了70.12%的Pass@1,优于MapCoder,同时将API开销降低了约35%。这些结果表明,协作协议可以缓解小型参数模型的局限性,并提供了一种可扩展、高效的高质量自动化软件工程方法。
英文摘要:
While Large Language Models (LLMs) have catalyzed breakthroughs in automated code generation, Small Language Models (SLMs) often encounter reasoning bottlenecks and failure loops when addressing complex logical requirements. To overcome these challenges, we propose DebateCoder, a multi-agent collaborative framework designed to improve the reasoning ability of SLMs (e.g., Pangu-1B) in resource-constrained environments. DebateCoder uses a structured role-playing protocol with three agents: User Agent (A_UA), Technical Agent (A_TA), and Quality Assurance Agent (A_QA). It also includes an Adaptive Confidence Gating mechanism with a 95% threshold to balance accuracy and inference efficiency. In addition, we introduce a multi-turn deliberation module and a reviewer-guided analytical debugging loop for orthogonal pre-generation debate and post-generation refinement. Experiments on HumanEval and MBPP show that DebateCoder achieves 70.12% Pass@1 on HumanEval, outperforming MapCoder while reducing API overhead by about 35%. These results indicate that collaborative protocols can mitigate limitations of small-parameter models and provide a scalable, efficient approach to high-quality automated software engineering.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。