---
title: 'MAS²: Self-Generative Multi-Agent Systems'
url: https://www.emergentmind.com/topics/mas-2
type: topic
---

# MAS²: Self-Generative Multi-Agent Systems

MAS$^2$ (“Self-Generative, Self-Configuring, Self-Rectifying Multi-Agent Systems”) is a recursive meta-multi-agent framework that autonomously designs, configures, deploys, and adaptively rectifies bespoke multi-agent systems (MAS) to address diverse tasks under real-world dynamism. Distinct from prior “generate-once-and-deploy” paradigms, MAS$^2$ features a tri-agent architecture—comprising Generator, Implementer, and Rectifier meta-agents—that dynamically synthesizes and repairs agent collectives. It is trained using Collaborative Tree Optimization, yielding significant gains across a wide array of benchmarks and maintaining Pareto efficiency with respect to token cost and task performance [2509.24323].

## 1. Paradigm Shift and Conceptual Foundations

Traditional LLM-based MAS, such as AutoGen, MetaGPT, G-Designer, and MAS-GPT, rely either on hand-crafted ensembles or automated but static workflows. These systems exhibit brittleness: failures in tool invocation or resource access, pipeline collapses from single-point deviations, and lack of online repair mechanisms or cost-aware adaptation strategies. MAS$^2$ addresses these challenges by introducing a recursive, meta-level orchestration paradigm: a system designed not only to instantiate MAS on demand but also to continuously adapt the agent collective at runtime.

MAS$^2$ operationalizes three nested procedural loops:

- The **Generator** designs a high-level template—defining roles, communication protocols, and tool requisites.
- The **Implementer** configures the template with concrete LLM backbones and tool bindings.
- The **Rectifier** monitors execution, detects performance or cost anomalies, and iteratively refines the live MAS instance.

This recursion enables MAS$^2$ to self-configure and self-rectify in situ, facilitating robust operation under unpredictable task, resource, and tooling constraints.

## 2. Tri-Agent Architecture and Dynamic Coordination

MAS$^2$ formalizes each generated MAS as $\mathcal{M} = \langle \mathcal{R}, \mathcal{P}, \mathcal{T}, \mathcal{B} \rangle$, where:

- $\mathcal{R}$: Agent roles.
- $\mathcal{P}$: Messaging and communication schema among roles.
- $\mathcal{T}$: Available toolset (e.g., REPL, web search).
- $\mathcal{B}$: Assignments mapping roles to specific LLM backbones.

Each meta-agent is governed by a stochastic policy:

- Generator $\pi_\mathrm{gen}$ samples MAS templates $\mathcal{M}_\mathrm{temp} \sim \pi_\mathrm{gen}(\cdot \mid Q)$ given query $Q$.
- Implementer $\pi_\mathrm{imp}$ assigns roles to LLMs: $\phi \sim \pi_\mathrm{imp}(\cdot \mid \mathcal{M}_\mathrm{temp}, \mathbb{L}, Q)$, with LLM pool $\mathbb{L}$.
- Rectifier $\pi_\mathrm{rec}$ is activated by a trigger $\mathrm{Trigger}(s_t)$ (e.g., when cost exceeds threshold or failure is detected), producing a revised collective $\mathcal{M}_{t+1} \sim \pi_\mathrm{rec}(\cdot \mid \mathcal{M}_t, s_t)$.

**Inference pseudocode:**

```python
Input: query Q
Output: final answer / output O

1.  M_temp ← Generator.generate(Q)
2.  M ← Implementer.instantiate(M_temp, LLM_pool)
3.  state s ← INITIAL
4.  while not s.is_terminal():
5.     (agent, message) ← M.next_step(s)
6.     s ← agent.execute(message)
7.     if Rectifier.trigger(s):
8.         ΔM ← Rectifier.modify(M, s)
9.         M ← M ⊕ ΔM
10. return s.output
```

At execution, the Rectifier may dynamically reroute communications, alter prompt contents, or swap agent backbones, yielding a self-modifying operational MAS.

## 3. Collaborative Tree Optimization: Meta-Agent Training

MAS$^2$ employs Collaborative Tree Optimization (CTO) to jointly train the policies $\pi_\mathrm{gen}$, $\pi_\mathrm{imp}$, and $\pi_\mathrm{rec}$. For each query $Q$, a decision tree $\mathcal{G}_Q = (V, E)$ is constructed:

- Node labels specify the meta-agent acting at each stage.
- Paths from root-to-leaf trace a complete generation–instantiation–rectification trajectory $\tau$ for a MAS instance.

**Cost-sensitive reward:**
\[
R(\tau) = \mathbbm{1}[\mathrm{success}(\tau)] \times \frac{1}{C_\mathrm{norm}(\tau)}, \quad
C_\mathrm{norm}(\tau) = \frac{C(\tau)}{\frac{1}{|\mathcal{T}|}\sum_{\tau'}C(\tau')}
\]
where $C(\tau)$ denotes resource usage (e.g., token count or wall time), and failed runs receive zero reward.

Each decision node $v$ receives a value
\[
V(v) = \mathbb{E}_{\tau \ni v}[R(\tau)] \approx \frac{1}{|\mathcal{T}(v)|} \sum_{\tau \ni v} R(\tau)
\]

**Training objective:** For each node, action pairs with $\Delta V > 0$ are used to build a preference dataset, optimizing a value-scaled PPO-style loss:
\[
\mathcal{L}_{\mathrm{CTO}}(\pi_\theta; \pi_{\mathrm{ref}}) =
- \mathbb{E}_{(c, a_w, a_\ell, \Delta V)}\big[
\Delta V \cdot \log \sigma \big(
\beta \log \frac{\pi_\theta(a_w \mid c)}{\pi_{\mathrm{ref}}(a_w \mid c)}
- \beta \log \frac{\pi_\theta(a_\ell \mid c)}{\pi_{\mathrm{ref}}(a_\ell \mid c)}
\big)
\big]
\]
High-value trajectory discriminations thus dominate gradient signals during learning.

## 4. Empirical Performance, Cost Analysis, and Pareto Efficiency

MAS$^2$ is evaluated on seven benchmarks spanning four domains: multi-hop QA (HotpotQA, Bamboogle, NQ), deep research (BrowseComp⁺), code generation (HumanEval, MBPP), and mathematics (MATH). The LLM pool comprises GPT-4o, GPT-4o-mini, Qwen2.5-72B, Qwen3-14B, and QwQ-32B; meta-agents default to Qwen3-8B.

**Main results:** MAS$^2$ achieves average gains of up to $19.6\%$ in performance ($\Delta P_{\mathrm{max}}$) compared to SOTA baselines, with specific gains such as:
- HotpotQA: 89.3% (+23.8)
- Bamboogle: 67.2% (+31.0)
- NQ: 79.1% (+15.5)
- BrowseComp⁺: 19.7% (+10.2)
- HumanEval: 97.0% (+19.6)
- MBPP: 85.1% (+21.4)
- MATH: 71.3% (+13.3)

MAS$^2$ consistently resides on the empirical Pareto frontier of performance versus token cost, such as on Bamboogle ($P = 67.2\%$ at $\$0.15$) outperforming ScoreFlow ($64.8\%$ at the same cost). Gains are statistically significant with $p<0.01$ versus the second-best MAS across per-example accuracy vectors.

**Ablation studies** confirm the necessity of each meta-agent: removal of Generator, Implementer, or Rectifier yields performance drops on MBPP, HotpotQA, and MATH (e.g., MBPP drops from 85.2 to 79.0, 80.4, or 81.7, respectively) [2509.24323].

## 5. Cross-Backbone Generalization Capability

MAS$^2$ demonstrates robust generalization to unseen LLM backbones. While trained on pool $\mathbb{L}_\mathrm{train}$, inference augments the pool with previously unencountered models (Qwen3-Coder, GPT-5-Mini, Gemini-2.5-Pro). The Implementer policy, without further fine-tuning, can select these novel backbones when beneficial.

Formally, for $\phi^*$ the original implemented mapping, the inference stage solves:
\[
\phi' \in \argmax_{\phi: \mathcal{R} \to \mathbb{L}'} V_{\mathrm{gen+imp}}(\phi \mid Q)
\]
where $\mathbb{L}' = \mathbb{L}_{\mathrm{train}} \cup \{\text{new backbones}\}$.

Empirical results show up to a $15.1\%$ lift in accuracy on MATH (71.3%→90.6%) and Bamboogle (67.2%→84.0%) at moderate additional cost, illustrating a high degree of zero-shot backbone integration.

## 6. Scalability, Limitations, and Potential Extensions

The decoupled architecture allows each meta-agent to scale independently to larger pools and more complex agent collectives. CTO reuses offline-fabricated trajectory data, reducing demands for costly online RL interaction.

**Identified limitations:**
- CTO training remains compute-intensive on complex orchestration tasks.
- Performance is ultimately bounded by the underlying LLMs’ capacities. Error rectification is only possible to the degree that failure modes are describable in natural language.
- Current Rectifier mechanisms focus on cost and failure criteria; subtler correctness shifts are not directly detected.

**Proposed extensions:**
- Hierarchical Rectification with multi-level monitoring (e.g., at the subgraph or token level).
- Continuous adaptation using test-time gradient updates.
- Memory-augmented meta-agents to enable persistent cross-task knowledge transfer.
- Automated tool discovery, allowing the Implementer to create or integrate novel code modules or retrieval systems.

MAS$^2$ thus inaugurates a shift toward meta-MAS research in which multi-agent collectives are not static but self-evolving and autonomously modifiable [2509.24323].

Source: https://www.emergentmind.com/topics/mas-2