Table of Contents
Fetching ...

Multi-Agent Design: Optimizing Agents with Better Prompts and Topologies

Han Zhou, Xingchen Wan, Ruoxi Sun, Hamid Palangi, Shariq Iqbal, Ivan Vulić, Anna Korhonen, Sercan Ö. Arık

TL;DR

This paper addresses the challenge of designing effective multi-agent systems using large language models. It introduces MASS, a three-stage framework that interleaves block-level prompt optimization, workflow topology search in a pruned design space, and workflow-level prompt optimization to efficiently explore MAS configurations. MASS achieves state-of-the-art performance across a broad suite of reasoning, long-context understanding, and coding tasks, surpassing manually crafted baselines and other automated approaches. The work also presents design principles for future MAS development, emphasizing the primacy of prompts, the value of a focused topology space, and the benefits of joint prompt-topology optimization.

Abstract

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.

Multi-Agent Design: Optimizing Agents with Better Prompts and Topologies

TL;DR

This paper addresses the challenge of designing effective multi-agent systems using large language models. It introduces MASS, a three-stage framework that interleaves block-level prompt optimization, workflow topology search in a pruned design space, and workflow-level prompt optimization to efficiently explore MAS configurations. MASS achieves state-of-the-art performance across a broad suite of reasoning, long-context understanding, and coding tasks, surpassing manually crafted baselines and other automated approaches. The work also presents design principles for future MAS development, emphasizing the primacy of prompts, the value of a focused topology space, and the benefits of joint prompt-topology optimization.

Abstract

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.

Paper Structure

This paper contains 16 sections, 1 equation, 10 figures, 5 tables, 1 algorithm.

Figures (10)

  • Figure 1: Proposed Multi-Agent System Search (Mass) framework discovers effective multi-agent system designs (with both optimized topology and optimized prompts, right) via interleaved prompt optimization and topology optimization in a customizable multi-agent design space (key components illustrated on the left).
  • Figure 2: Accuracy vs. the total token counts for prompt-optimized agents per question on MATH by Gemini 1.5 Pro compared to scaling agents with self-consistency (SC), self-refine (reflect), and multi-agent debate (debate) only. The error bar indicates 1 standard deviation. We show that by utilizing more compute, better accuracy can be obtained via more effective prompting.
  • Figure 3: The performance of different topologies with Gemini 1.5 Pro compared to the base agent with each topology being optimized with APO, where Sum. (Summarize) and Exe. (Executor) are task-specific topologies as illustrated in Fig. \ref{['fig:main']}. We observe that not all topologies have a positive influence on the MAS design.
  • Figure 4: Illustration of the Mass framework with its search space and the multi-stage optimization. The search space combines both prompts (Instruction, Demo) and configurable agentic building blocks (Aggregate, Reflect, Debate, Summarize, and Tool-use). 1) Block-level Prompt Optimization: we conduct block-level prompt optimization for each agentic module individually (denoted by </>); 2) Workflow Topology Optimization: conditioned on the best prompts found in Stage 1 on each agent block, Mass samples valid configurations from an influence-weighted design space while fusing the prompts of each building block from Stage 1; 3) Workflow-level Prompt Optimization: conditioned on the best workflow found in the Stage 2, we again conduct workflow-level prompt optimization on the best-found MAS (topologies visualized for illustration only).
  • Figure 5: Left: average performance per optimization stage of Mass over 8 evaluation tasks on Gemini 1.5 Pro. We compare Mass with a single agent (CoT) starting point as the reference and an APO baseline that optimizes over the single agent by MIPROv2 opsahl-ong-etal-2024-optimizing. Refer to App. §\ref{['app:additional']} for the detailed ablation per task. Right: a comparative ablation study on topology optimization (2TO) without pruning and without the former stage of prompt optimization (1PO) evaluated on HotpotQA.
  • ...and 5 more figures