GBC:用于优化多智能体系统的梯度连接方法
GBC: Gradient-Based Connections for Optimizing Multi-Agent Systems
摘要
基于大型语言模型构建的多智能体系统,通过角色分工与结构化交互机制,为解决复杂任务提供了有效的解决方案。然而,其性能往往受到协调不当的影响,更根本的问题是各智能体之间缺乏精细的责任分配机制。现有方法通常依赖粗粒度反馈机制,因此难以确定究竟是哪些智能体或交互步骤导致了错误。我们提出了基于梯度的连接方法,这是一种用于实现多智能体系统精细责任分配与优化的技术。该方法将多智能体系统视为计算图,并引入基于梯度的连接权重,以量化每个智能体的输出对下游智能体在词级上的影响。通过构建责任分配图并传递与任务相关的损失信号,我们的方法能够准确识别错误来源,并进行有针对性的优化调整。我们还开发了AgentChord这一高效实现方案,它利用前缀式梯度计算方式来实现上述功能。在MultiWOZ和τ-bench实验中的结果表明,基于梯度连接的方案能够提升多智能体系统的性能,其效果优于传统的单智能体及多智能体基线方案;同时,更高的责任分配精度也意味着更好的优化效果。代码可访问于:https://github.com/yxc-cyber/AgentChord。
English Abstract
Multi-agent systems (MAS) built on large language models (LLMs) provide a promising framework for solving complex tasks through role specialization and structured interaction. However, their performance is often limited by miscoordination and, more fundamentally, the lack of fine-grained credit assignment across agents. Existing approaches typically rely on coarse-grained feedback, making it difficult to identify which agents or interaction steps are responsible for errors. We propose Gradient-Based Connections (GBC), an approach for fine-grained attribution and optimization of multi-agent systems. GBC models a MAS as a computational graph and introduces gradient-based connection weights to quantify the influence of each agent's output on downstream agents at the token level. By constructing an attribution graph and propagating task-specific loss signals backward, our method enables precise identification of error sources and targeted prompt optimization. We further develop AgentChord, an efficient implementation that leverages prefix-based gradient computation. Experiments on MultiWOZ and τ-bench show that GBC improves multi-agent performance and outperforms strong single-agent and multi-agent baselines, and higher attribution quality is associated with greater optimization effectiveness. Code is available at: https://github.com/yxc-cyber/AgentChord.