Large language models, employed as multiple agents that interact and collaborate with each other, have excelled at solving complex tasks. The agents are programmed with prompts that declare their functionality, along with the topologies that orchestrate interactions across agents. Designing prompts and topologies for multi-agent systems (MAS) is inherently complex. To automate the entire design process, we first conduct an in-depth analysis of the design space aiming to understand the factors behind building effective MAS. We reveal that prompts together with topologies play critical roles in enabling more effective MAS design. Based on the insights, we propose Multi-Agent System Search (MASS), a MAS optimization framework that efficiently exploits the complex MAS design space by interleaving its optimization stages, from local to global, from prompts to topologies, over three stages: 1) block-level (local) prompt optimization; 2) workflow topology optimization; 3) workflow-level (global) prompt optimization, where each stage is conditioned on the iteratively optimized prompts/topologies from former stages. We show that MASS-optimized multi-agent systems outperform a spectrum of existing alternatives by a substantial margin. Based on the MASS-found systems, we finally propose design principles behind building effective multi-agent systems.
翻译:将大型语言模型部署为多个相互交互协作的智能体,在解决复杂任务方面已展现出卓越性能。这些智能体通过声明其功能的提示词进行编程,并依赖协调智能体间交互的拓扑结构进行组织。为多智能体系统设计提示词与拓扑结构本质上是复杂的。为实现全流程自动化设计,我们首先对设计空间展开深入分析,旨在理解构建高效多智能体系统的关键因素。研究发现,提示词与拓扑结构共同对实现更有效的多智能体系统设计起着决定性作用。基于此洞见,我们提出多智能体系统搜索框架,该框架通过三阶段交错优化——从局部到全局、从提示词到拓扑结构——高效探索复杂多智能体设计空间:1)模块级(局部)提示词优化;2)工作流拓扑结构优化;3)工作流程级(全局)提示词优化,其中每个阶段的优化均以前序阶段迭代优化的提示词/拓扑结构为条件。实验表明,经MASS优化的多智能体系统显著优于现有多种方案。基于MASS发现的系统架构,我们最终提出了构建高效多智能体系统的设计原则。