Abstract
Designing effective multi-agent systems (MAS) using Large Language Models (LLMs) is a complex challenge due to the vast combinatorial search space of agent prompts and interaction topologies. This paper introduces Multi-Agent System Search (MASS), a novel framework that automates the design of MAS by interleaving prompt optimization and topology search. MASS employs a three-stage process: local prompt optimization of individual building blocks, workflow topology search based on incremental influence, and final global prompt tuning. Evaluated across eight benchmarks spanning reasoning, coding, and long-context understanding, MASS-optimized systems achieved an average score of 78.8%, significantly outperforming standard baselines and existing automated design frameworks. Our results demonstrate that optimizing individual agent prompts is more cost-effective and accurate than simply scaling the number of unoptimized agents.
Introduction
Large Language Models (LLMs) have shown remarkable capabilities when orchestrated as Multi-Agent Systems (MAS). In these systems, different agents assume specialized roles—such as generators, verifiers, or debaters—to collaboratively solve complex problems. However, the performance of a MAS is highly sensitive to two primary design factors:
- Prompts: The specific instructions and few-shot exemplars that define an agent's behavior.
- Topology: The structural arrangement and workflow of agent interactions, such as parallel voting, sequential refinement, or multi-round debate.
Historically, developers have relied on manual trial-and-error to navigate these intertwined design spaces. While recent automated frameworks have attempted to optimize topologies, they often neglect the critical role of prompt optimization. Because LLMs are sensitive to minor prompt variations, cascading poorly prompted agents can lead to amplified errors throughout the system. This paper addresses the challenge of jointly optimizing both prompts and topology through the Multi-Agent System Search (MASS) framework.
The MASS Framework
MASS treats MAS design as a multi-stage optimization problem that transitions from local agent behavior to global system performance. The framework utilizes a set of predefined agent building blocks, including Aggregate (parallel voting), Reflect (self-correction), Debate (multi-agent discussion), Summarize, and Tool-use.
The optimization process occurs in three interleaved stages:
1. Block-level (Local) Prompt Optimization
Before constructing the full system, MASS "warms up" the prompts for each individual building block. Using an automatic prompt optimizer (such as MIPRO), the framework tunes the instructions and examples for the simplest version of each block. This ensures that the subsequent topology search is conducted using high-quality components.
2. Workflow Topology Optimization
MASS evaluates the "incremental influence" of each warmed-up block. If a specific interaction pattern (e.g., Debate) does not improve performance during initial testing, it is pruned from the search space. The framework then samples and evaluates various combinations of the remaining blocks. To manage complexity, MASS follows a predefined logical ordering (Summarize → Reflect → Debate → Aggregate) when constructing candidate workflows.
3. Workflow-level (Global) Prompt Optimization
Once the optimal topology is identified, MASS performs a final round of joint prompt optimization over the entire system. This stage fine-tunes how agents collaborate and pass information, ensuring that the global workflow is cohesive and efficient.
Experimental Results
The MASS framework was evaluated on a diverse suite of eight benchmarks:
- Reasoning: MATH and DROP.
- Long-context Understanding: HotpotQA, MuSiQue, and 2WikiMultiHopQA.
- Coding: MBPP, HumanEval, and LiveCodeBench.
Using Gemini 1.5 Pro as the underlying model, MASS-optimized systems achieved an average score of 78.8%. This represents a substantial improvement over standard baselines such as Chain-of-Thought (65.3%), Self-Consistency (68.2%), and Multi-Agent Debate (70.3%). Furthermore, MASS outperformed existing automated baselines like ADAS (69.7%), highlighting the necessity of integrated prompt optimization.
Ablation studies confirmed the value of each stage: local prompt optimization provided a +6% average gain, topology search added +3%, and global prompt tuning contributed an additional +2%.
Key Insights and Discussion
A central finding of this research is that prompting beats blind scaling. As shown in the performance analysis, optimizing the prompts of a small number of agents is far more token-efficient than simply increasing the number of unoptimized agents (e.g., via standard Self-Consistency).
Additionally, the study revealed that task-specific architectural patterns are crucial. For instance, reasoning tasks benefit most from parallel exploration (Aggregation), while coding tasks rely heavily on Reflection and Tool-use. Pruning unhelpful topologies early in the search process is essential for maintaining efficiency, as complex interactions like multi-agent debate can occasionally degrade performance on specific discrete reasoning tasks.
Conclusion
The MASS framework demonstrates that the key to high-performing multi-agent systems lies in the joint optimization of agent prompts and interaction topologies. By moving from local to global optimization, MASS prevents compounding errors and discovers efficient, task-specific architectures. Future work will explore sparse communication graphs to reduce token costs and integrate more advanced optimization algorithms to further enhance search efficiency.
Summary updated