arXiv:2410.19245cs.SEcs.CV2024-10被引 4

多智能体协作图让编程更准更快,错误少9成,成本降近九成。

MaCTG: Multi-Agent Collaborative Thought Graph for Automatic Programming

  • 用动态图结构自动分配角色、调整任务,实现精准协作。
  • 编程准确率达83.33%,比现有方法减少89.09%运行成本。
  • 适合需要高效、低成本自动化编程的开发者和研究者。

随着大语言模型(LLMs)的快速发展,基于LLM的方法在多个领域展现出强大的问题求解能力。然而,在自动编程中,单个LLM通常仅限于函数级代码生成,而由多个LLM组成的多智能体系统常因任务规划效率低而受限。缺乏结构化协调易引发级联幻觉,导致错误累积、工作流低效及计算成本过高。为此,我们提出MaCTG(Multi-Agent Collaborative Thought Graph),一种新型多智能体框架,采用动态图结构实现任务的精确分配与受控协作。MaCTG能根据编程需求自主分配代理角色,通过上下文感知动态优化任务分发,并系统性地验证与整合项目级代码,有效降低幻觉错误并提升整体准确率。通过混合部署策略,将专有模型用于复杂推理,开源模型处理常规编码与验证任务,显著提升成本效益。在传统图像处理自动编程任务上,MaCTG达到83.33%的准确率,相比现有框架降低89.09%的运营成本,验证了其高效性、可扩展性与实际应用价值。

原文摘要 · Abstract (English)

With the rapid advancement of Large Language Models (LLMs), LLM-based approaches have demonstrated strong problem-solving capabilities across various domains. However, in automatic programming, a single LLM is typically limited to function-level code generation, while multi-agent systems composed of multiple LLMs often suffer from inefficient task planning. This lack of structured coordination can lead to cascading hallucinations, where accumulated errors across agents result in suboptimal workflows and excessive computational costs. To overcome these challenges, we introduce MaCTG (Multi-Agent Collaborative Thought Graph), a novel multi-agent framework that employs a dynamic graph structure to facilitate precise task allocation and controlled collaboration among LLM agents. MaCTG autonomously assigns agent roles based on programming requirements, dynamically refines task distribution through context-aware adjustments, and systematically verifies and integrates project-level code, effectively reducing hallucination errors and improving overall accuracy. MaCTG enhances cost-effectiveness by implementing a hybrid LLM deployment, where proprietary models handle complex reasoning, while open-source models are used for routine coding and validation tasks. To evaluate MaCTG's effectiveness, we applied it to traditional image processing auto-programming tasks, achieving a state-of-the-art accuracy of 83.33%. Additionally, by leveraging its hybrid LLM configuration, MaCTG significantly reduced operational costs by 89.09% compared to existing multi-agent frameworks, demonstrating its efficiency, scalability, and real-world applicability.

多智能体自动编程成本优化协同推理

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