arXiv:2601.21469cs.SEcs.AI2026-01

小模型协作生成代码,用自适应门控提升效率与准确率

Adaptive Confidence Gating in Multi-Agent Collaboration for Efficient and Optimized Code Generation

  • 三角色协作+自适应置信门控,动态控制推理流程
  • 在HumanEval上达70.12%通过率,API开销降低35%
  • 适合资源受限场景下的高质量代码生成任务

尽管大语言模型(LLMs)推动了自动化代码生成的突破,但小语言模型(SLMs)在处理复杂逻辑需求时常面临推理瓶颈和失败循环。为解决此问题,我们提出DebateCoder,一种多智能体协作框架,旨在提升资源受限环境下小模型(如Pangu-1B)的推理能力。该框架采用三角色结构:用户代理(A_UA)、技术代理(A_TA)和质量保证代理(A_QA),并引入自适应置信门控机制,设定95%阈值以平衡准确性与推理效率。此外,还设计多轮讨论模块和评审引导的分析调试循环,实现生成前辩论与生成后优化。在HumanEval和MBPP数据集上的实验表明,DebateCoder在HumanEval上达到70.12% Pass@1,优于MapCoder,同时减少约35%的API调用开销。结果表明,协作协议可有效缓解小参数模型的局限性,提供一种可扩展、高效的高质量自动化软件工程方案。

原文摘要 · Abstract (English)

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.

代码生成多智能体小模型协同推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。