TL;DR
Designing effective Multi-Agent Systems (MAS) is a combinatorial nightmare, often forcing researchers to choose between optimizing agent prompts or the workflow topology. This paper introduces MASS (Multi-Agent System Search), a framework that interleaves prompt and topology optimization across three stages to discover state-of-the-art agentic designs. The key takeaway: optimizing individual agents locally before scaling them into a global topology is the most token-efficient way to build high-performing AI systems.
The Challenge of Multi-Agent Design
Large Language Models (LLMs) are increasingly deployed as "agents" that collaborate to solve complex tasks. To build a Multi-Agent System (MAS), developers must decide two crucial things:
- The Prompts: What instructions and examples does each agent receive?
- The Topology: How do these agents interact? (e.g., Do they debate? Does one agent "reflect" on another’s work? Do they vote?)
Currently, this design process is largely manual trial-and-error. While some recent frameworks automate topology search, they often use static, hand-crafted prompts. Conversely, prompt optimizers usually focus on single agents. The authors argue that these two spaces are deeply intertwined; a sophisticated topology is useless if the agents within it are poorly "programmed" via their prompts. The challenge lies in the massive, joint search space and the "compounding error" effect, where a slight prompt sensitivity in one agent can derail an entire multi-agent chain.
Methods: The MASS Framework
To conquer the complexity of joint design, the authors propose MASS (Multi-Agent System Search), a three-stage optimization framework.
- Block-level (Local) Prompt Optimization: Before building the system, MASS "warms up" individual agent types (Predictors, Debaters, Reflectors) in isolation. Using a prompt optimizer, it finds the best instructions and few-shot exemplars for each specific role.
- Workflow Topology Optimization: MASS then explores how to connect these optimized blocks. To avoid searching every possible configuration, it uses Search Space Pruning. It calculates the "incremental influence" of different building blocks (e.g., how much does adding a "Debate" block actually help?) and uses these weights to sample promising topologies via rejection sampling.
- Workflow-level (Global) Prompt Optimization: Once the best structure is found, MASS performs a final round of joint prompt optimization. This ensures that the agents’ prompts are fine-tuned for their specific neighbors and position within the final workflow.
The framework utilizes a library of agentic building blocks: Aggregate (parallel chains + voting), Reflect (criticism and refinement), Debate (multi-agent discussion), and Custom/Tool-use (summarizers or code executors).
Datasets and Evaluation
The authors evaluated MASS across a diverse battery of benchmarks to test different reasoning capabilities:
- Mathematical Reasoning: Hendryck’s MATH.
- Discrete/Symbolic Reasoning: DROP.
- Multi-hop Long-context Understanding: HotpotQA, MuSiQue, and 2WikiMultiHopQA.
- Coding: MBPP, HumanEval, and LiveCodeBench (LCB).
Experiments were primarily conducted using Gemini 1.5 Pro and Flash, with additional validation on Claude 3.5 Sonnet and Mistral Nemo.
Key Insights and Ideas
- Prompts are the Foundation: Optimizing prompts before scaling the topology yields significant gains. In fact, a single prompt-optimized agent often outperforms a complex multi-agent system using default prompts.
- The "Compounding Impact" of Bad Agents: In a MAS, sensitive agents are cascaded. MASS mitigates this by ensuring every "node" in the graph is locally optimized before being integrated.
- Not All Topologies are Created Equal: Many popular MAS patterns (like multi-agent debate) only provide marginal gains on certain tasks while potentially degrading performance on others if not carefully tuned.
- Token Effectiveness: MASS-optimized systems are highly "token-effective." By using better prompts, they achieve higher accuracy with fewer total tokens compared to "brute force" methods like high-count Self-Consistency (voting).
Key Results
MASS consistently outperformed existing automated design baselines like ADAS and AFlow, as well as standard MAS patterns:
- Overall Performance: On Gemini 1.5 Pro, MASS achieved an average score of 78.79% across all tasks, compared to 65.28% for simple Chain-of-Thought (CoT) and 69.72% for ADAS.
- Reasoning Gains: On the difficult MATH benchmark, MASS reached 84.67% accuracy, a substantial jump from the 71.67% CoT baseline.
- Long-Context: In multi-hop QA (MuSiQue), MASS improved performance to 51.40%, nearly 10 points higher than standard Self-Consistency.
- Efficiency: MASS demonstrated a steady trend of optimization, finding high-performing designs within a manageable training budget comparable to other auto-agent frameworks.
Limitations and Future Work
- Search Algorithm Sophistication: Currently, MASS uses rejection sampling for topology search. More advanced algorithms, such as Bayesian Optimization, could further improve sample efficiency.
- Fixed Building Blocks: The search space is currently defined by a set of predefined agentic blocks. Expanding this to allow the discovery of entirely novel interaction patterns is a promising direction.
- Feedback Integration: While MASS optimizes prompts based on validation scores, it does not yet fully utilize textual feedback from error logs (e.g., "Agent A failed because Agent B's output was too verbose") to refine prompts in Stage 3.
Summary updated