Abstract
Building effective multi-agent systems (MAS) powered by Large Language Models (LLMs) typically requires extensive manual prompt engineering and workflow design. While recent automated design methods have emerged, they often search for a single, static architecture to handle entire datasets, leading to resource inefficiency and domain rigidity. This paper introduces MaAS (Multi-agent Architecture Search), a framework that utilizes an agentic supernet to dynamically sample custom agent architectures for every query. By jointly optimizing the architectural distribution and agentic operators, MaAS delivers state-of-the-art performance while utilizing only 6–45% of the inference cost of previous automated systems.
Introduction
The development of multi-agent systems has traditionally been a "monolithic" endeavor. Designers create a fixed workflow—such as a debate between three agents or a sequential chain-of-thought—and apply it to every task within a domain. However, this approach faces two major dilemmas. First, it is resource-inefficient; a system designed for complex reasoning is overkill for simple tasks, wasting expensive tokens. Second, it is rigid; a workflow optimized for one task (e.g., web searching) may perform poorly on another (e.g., code generation).
MaAS addresses this lack of query-dependent adaptability by treating the multi-agent design problem as an architecture search. Instead of finding one best path, MaAS learns to navigate a vast space of potential agent interactions to find the optimal path for each specific query.
Methodology: The Agentic Supernet
The core innovation of MaAS is the Agentic Supernet, a concept adapted from Neural Architecture Search (NAS). The framework consists of several key components:
1. The Supernet Structure
Rather than a single path, the supernet is a probabilistic, multi-layer distribution of various "agentic operators." These operators include common strategies such as Chain-of-Thought (CoT), ReAct, Multi-agent Debate, and Self-Reflection.
2. The Controller
A lightweight network (utilizing MiniLM or Sentence-BERT) acts as a router. For every incoming query, the controller analyzes the task and samples a specific sub-network from the supernet. This allows the system to decide, for instance, whether a query requires a simple single-agent response or a complex multi-stage debate.
3. Early-Exit Operator
To maximize efficiency, MaAS incorporates an "early-exit" mechanism. If the controller determines that a query has been sufficiently solved at an early layer of the supernet, it triggers an exit. This prevents unnecessary LLM calls and significantly reduces latency and cost.
4. Joint Optimization
MaAS employs a dual optimization strategy:
- Distribution Optimization ($\pi$): The system uses Monte Carlo sampling to learn which architectural paths are most effective for different query types.
- Operator Optimization ($O$): Because standard backpropagation cannot be applied to text prompts, MaAS utilizes Textual Gradients. An LLM "gradient agent" analyzes feedback (such as unit test results or ground truth) and rewrites prompts or adjusts tool usage to improve the internal logic of the operators.
Experimental Evaluation
The authors evaluated MaAS across six diverse benchmarks spanning mathematical reasoning (GSM8K, MATH, MultiArith), code generation (HumanEval, MBPP), and real-world tool usage (GAIA).
Performance and Efficiency
MaAS consistently outperformed 14 baselines, including state-of-the-art automated systems like AFlow and GPTSwarm, with improvements ranging from 0.54% to 16.89%. Notably, on the challenging MATH benchmark, MaAS achieved higher accuracy than AFlow while requiring only 15% of the training cost and 25% of the inference cost.
Breakthroughs in Tool Usage
On the GAIA benchmark, which requires complex web browsing and file manipulation, MaAS improved performance on Level 1 and Level 2 tasks by 18.38% and 17.61%, respectively. This success is attributed to the system's ability to adapt its toolset to the specific query, invoking resource-heavy tools like web search only when strictly necessary.
Key Insights
- Cross-LLM Transferability: Architectures optimized using smaller models (e.g., GPT-4o-mini) transfer effectively to larger models (e.g., Llama-3.1-70B), suggesting that the learned architectural strategies are model-agnostic.
- Inductive Generalization: The supernet demonstrates zero-shot architectural flexibility. Even if a specific operator is hidden during training, the system can learn to incorporate it effectively during inference if it is introduced later.
- Dynamic Resource Allocation: By treating inference as a budget problem, MaAS achieves a Pareto improvement, simultaneously increasing accuracy and decreasing cost.
Limitations and Future Work
While MaAS represents a significant step forward, it currently relies on a predefined library of human-designed operators. Future research could explore allowing the supernet to "invent" entirely new agent interaction protocols from scratch. Additionally, while the controller is lightweight, the overhead of sampling adds a small amount of complexity to the system's startup. Finally, the authors suggest moving beyond sequential cascaded workflows toward more complex, non-sequential graph topologies.
Summary updated