OptiMAS: Automatically Optimize Multi-Agent System
Authors: Yuxin Cheng, Chang Liu, Hanxin Yu, Haochen Tan, Taiqiang Wu, Weiqiang Jin, Jie Ran, Kaibo Wang, +4 more
Organizations: The University of Hong Kong · Huawei Foundation Model Department, Huawei Technologies Ltd. · City University of Hong Kong · Xi’an Jiaotong University · The Hong Kong University of Science and Technology
Automated evolution of Multi-Agent Systems (MAS) holds significant potential for reducing the manual effort required to design and optimize LLM-based agent architectures. However, extant search-based paradigms face a fundamental trade-off, where an expanded optimization scope exacerbates evolutionary instability, while discrete branch-and-discard search isolates insights across lineages. To address these limitations, we propose a continuous, data-driven optimization paradigm built upon a unified ReAct-based infrastructure that reconciles a broad optimization scope with operational stability. Under this paradigm, we present OptiMAS, a task-agnostic agentic optimizer that leverages textual interaction trajectories and task feedback as loss signals for end-to-end MAS evolution. Equipped with a novel dual-track memory mechanism, OptiMAS sustains performance improvement over extended optimization horizons. Evaluation on four heterogeneous agentic benchmarks with three varying scale and accessibility LLM backbones, demonstrates that OptiMAS consistently achieves competitive or superior accuracy relative to both domain-specialized hand-crafted systems and existing evolutionary methods. Our work establishes a practical milestone toward robust, automated MAS evolution.
Figures & tables
Figure 1: Comparison of MAS evolution paradigms. (Left) Search-based methods frame evolution as stochastic tree-branching ( G0→Gti ) over full datasets, incurring low efficiency with insights isolated across branches. (Right) OptiMAS reformulates evolution as a data-driven continuous optimization over partitioned data (train/val/test), channeling action trajectories and accuracy as loss signals for OptiMAS to derive textual gradients and perform end-to-end MAS updates, yielding stable, sample-efficient, and overfit-resistant synthesis.
Figure 2: OptiMAS optimizer architecture at step t . (a) The MAS Et executes on train/val queries, producing trajectories and accuracy. (d) The optimizer diagnoses root causes via workspace inspection and evolves Et , governed by (c) a plan-oriented short-term memory enforcing intra-step consistency and (b) a hypothesis-driven long-term memory maintaining a state-tracked ledger of falsifiable hypotheses across steps, yielding Et+1 .
Method
WorkBench (%) ↑
GAIA (%) ↑
BrowseComp* (%) ↑
SWE-Bench* (%) ↑
GPT5
Qwen3.6
Gemini3
GPT5
Qwen3.6
Gemini3
GPT5
Qwen3.6
Gemini3
GPT5
Qwen3.6
Gemini3
Self-define Initial Agent
Single E0
18.6
65.6
71.7
49.5
73.1
80.7
8.3
33.9
52.2
29.4
61.1
72.8
Hand-crafted MAS
SMoA
15.8
57.4
66.3
38.7
50.0
59.7
1.7
6.7
20.0
–
–
–
MAS Debate
15.0
39.2
44.2
32.3
38.7
50.0
5.0
11.7
20.0
13.3
23.3
26.7
Table 1: Main results (task accuracy, %) across four benchmarks and three backbone LLMs: GPT5, Qwen3.6 and Gemini3 (abbreviated in column headers; full specifications in \cref sec:experiment_setting). Green and purple highlight the best and second-best results per backbone column. (–) denotes that such methodology is inapplicable or non-executable on given configurations. (*) marks evaluation subsets sampled via data curation(Appendix A ).
Figure 3: Evolution dynamics on WorkBench. Accuracy of Et on Xtrain (left) and Xtest (right) over 10 epochs. Dashed lines show mean over three trials while solid lines are moving averages to highlight trend.
Figure 4: Ablation analysis of optimizer backbones. Performance is compared across combinations of two MAS backbones and two OptiMAS backbones.
Ablation Settings
WorkBench (%) ↑
SWE-Bench (%) ↑
GPT5
Qwen3.6
GPT5
Qwen3.6
Initial E0 (baseline)
18.6
65.6
29.4
61.1
OptiMAS w/ BS n=10
64.0 (+45.4)
84.5 (+18.9)
41.7 (+12.3)
68.9 (+7.8)
✕ w/ BS n=4
55.0 (+36.4)
81.1 (+15.5)
24.4 (-5.0)
62.8 (+1.7)
✕ Validation Metric
58.2 (+39.6)
82.8 (+17.2)
28.9 (-0.5)
64.4 (+3.3)
✕ Hypothesis Memory
53.9 (+35.3)
71.4 (+5.8)
22.2 (-7.2)
53.3 (-7.8)
Table 2: Ablation analysis of framework components. Bold indicates best results. “✕” signifies component removal, and “BS” represents batch size.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Benchmark
Source size
∣Xtrain∣
∣Xval∣
∣Xtest∣
Total ∣X∣
SWE-Bench-Verified
500
36
4
60
100
BrowseComp
1,266
36
4
60
100
GAIA-text
103
37
4
62
103
Appendix
Table 3: Dataset partitioning for evolutionary experiments.
Mass allocation ratio reserved for historic failed queries
α (Decay Factor)
0.6
Multiplicative discount multiplier for successful queries
β (Boost Factor)
1.2
Multiplicative scaling multiplier for failed queries
pmin (Weight Floor)
0.2
Lower-bound boundary for sample probability clamping
pmax (Weight Ceiling)
2.0
Upper-bound boundary for sample probability clamping
τ (Reset Interval)
2 epochs
Temporal stride between global uniform weight resets
Appendix
Table 5: Parameter configurations for the adaptive sampling subsystem.
Operational Category
Hyperparameter Layer
Calibrated Value
Training Loop Boundaries
Max Optimization Horizon E
10 epochs
Batch Capacity B
10
Adaptive Sampling Subsystem
Retry Ratio ϕ
0.5
Decay Factor α
0.6
Boost Factor β
1.2
Weight Floor pmin
0.2
Appendix
Table 6: Consolidated global hyperparameter specifications.
LLM Backbone
Context Limit
soft limit Csoft
hard limit Chard
force limit Cforce
Tool Output Limit
GPT-5-Nano
128K
126K
127K
128K
20K
Qwen3.6-35B-A3B
262K
260K
261K
262K
20K
Gemini-3-Flash
1M
970K
980K
990K
80K
Appendix
Table 7: Context Management hyperparameters on LLM Backbones.
Figure 5: Architectural Topography of the Evolved Multi-Agent System (MAS) on SWE-Bench-Verified. This schematic contrasts the initial configuration E0 against the evolved architecture ( E∗ ). Through our OptiMAS optimization, the system undergoes severe structural transformation: transitioning from a standard flat-worker scheme into a modular, hierarchical coalition composed of specialized agents ( Worker , Reproducer , Refiner , and Verifier ). Each sub-agent customized ReAct iteration budgets, and differentiated, priority-driven tool and skill allocations.
Large language model (LLM)-based Multi-agent systems (MAS) have shown promise in tackling complex collaborative tasks, where agents are typically orchestrated via role-specific prompts. While the quality of these prompts is pivotal, jointly optimizing them across interacting agents remains a non-trivial challenge, primarily due to the misalignment between local agent objectives and holistic system goals. To address this, we introduce MASPO, a novel framework designed to automatically and iteratively refine prompts across the entire system. A core innovation of MASPO is its joint evaluation mechanism, which assesses prompts not merely by their local validity, but by their capacity to facilitate downstream success for successor agents. This effectively bridges the gap between local interactions and global outcomes without relying on ground-truth labels. Furthermore, MASPO employs a data-driven evolutionary beam search to efficiently navigate the high-dimensional prompt space. Extensive empirical evaluations across 6 diverse tasks demonstrate that MASPO consistently outperforms state-of-the-art prompt optimization methods, achieving an average accuracy improvement of 2.9. We release our code at https://github.com/wangzx1219/MASPO.
Zhexuan Wang, Xuebo Liu, Li Wang +4
Institute of Computing and Intelligence, Harbin Institute of Technology, Shenzhen, China.
LLM-based multi-agent systems (MAS) have emerged as an effective paradigm for complex and long-horizon tasks. However, in real-world tasks, MAS often exhibit various failures during execution and such failures are difficult to eliminate during design. This motivates experience-driven MAS evolution, where a system improves based on its own execution experience. Yet such evolution is challenging because MAS experience is prolonged and intricate, interleaving multiple agents' execution chains and communication messages, which makes it difficult to identify what should be improved. To address this challenge, we propose Meta-Team, an experience-driven MAS evolution framework based on collaborative self-evolution. Meta-Team preserves the execution context of each agent and coordinates post-task communication, enabling agents to exchange distributed evidence for evolution. Building on this design, Meta-Team conducts multi-scale self-evolution, transforming execution experience into reusable improvements to agent behaviors, inter-agent coordination, and team-level organization. Across six long-horizon agent benchmarks, Meta-Team consistently outperforms single-agent systems, hand-crafted MAS, and prior MAS evolution methods; further analyses demonstrate that Meta-Team enables more reliable and scalable MAS self-evolution.
Zhezheng Hao, Tianfu Wang, Huanshuo Dong +7
Zhejiang University · Hong Kong University of Science and Technology · Tencent
Multi-agent systems (MAS) offer a scalable path forward for agentic AI, comprising multiple LLM-based agents, each assigned a system prompt and a position within a workflow that governs inter-agent coordination and output aggregation. System prompts thus form a critical and accessible optimization surface: they specify agents' roles and behaviors, enabling system-level improvements without model finetuning. Although prompt optimization has shown substantial potential for single LLMs, extending it to MAS poses distinct challenges, notably an exponentially growing search space. It remains unclear whether, when, and by how much prompt optimization improves MAS performance, and how sensitive such gains are to system configuration. In this work, we systematically study system-prompt optimization across a broad range of MAS setups varying in task, workflow, communication protocol, and team size, benchmarking two prompt optimizers that naturally extend state-of-the-art single-agent methods. The results reveal its potential to unlock significant gains while exposing open challenges, characterizing when and how much prompt optimization helps across diverse MAS settings.
Juyang Bai, Laixi Shi
Department of Electrical and Computer Engineering, Johns Hopkins University, Baltimore, MD 21218, USA.