NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MasHost Builds It All: Autonomous Multi-Agent System Directed by Reinforcement Learning

Kuo Yang, Xingjie Yang, Linhui Yu, Qing Xu, Yan Fang, Xu Wang, Zhengyang Zhou, Yang Wang · Submission to ICLR 2026 · Withdrawn

TL;DR

Existing multi-agent LLM systems usually rely on hard-coded heuristics or sample from restricted pools of predefined workflows. MasHost introduces a reinforcement learning framework that builds query-adaptive multi-agent interaction graphs completely from scratch. By coupling a joint probabilistic sampling mechanism with Hierarchical Relative Policy Optimization (HRPO), MasHost autonomously generates role-specialized agent teams that maximize accuracy, token efficiency, and structural rationality.

What Problem Does This Paper Address?

While Multi-Agent Systems (MAS) powered by Large Language Models (LLMs) solve complex problems by decomposing them across specialized agents, current design practices remain largely semi-autonomous:

  1. Candidate Pool Sampling: Architectures are sampled or composed from predefined template graphs (e.g., star, chain, debate), restricting structural flexibility and injecting human bias.
  2. Coarse Agentic Workflows: Systems optimize workflows at the dataset or task level rather than dynamically adapting the team topology to individual query demands.

Searching the full combinatorial space of agent roles (nodes) and communication topologies (directed edges) from scratch creates a non-Euclidean search problem with high-dimensional action spaces and disrupted gradient flows. MasHost was created to formulate and solve this full-scale graph generation problem autonomously.

Methods

MasHost casts multi-agent construction as a Markov Decision Process (MDP) evaluated across three criteria: performance quality, resource efficiency, and structural rationality.

Query ──► [ Joint Policy π ] ──► Sample Node/Role (ADD / DELETE / EXIT)
                 │
                 └──► Conditionally Sample Incoming Edges
                             │
                             ▼
              Constructed Multi-Agent Graph (M)
                             │
            ┌────────────────┴────────────────┐
            ▼                                 ▼
   Group-Level Relative Rewards      Step-Wise Absolute Rewards
   (Accuracy vs. Token Cost via      (Tracks intermediate progress;
    intra-group normalization)        protects early agents via T_E)
            └────────────────┬────────────────┘
                             ▼
                    Update via HRPO Loss
  • Joint Probability Space Sampling (JPSS): Instead of treating role selection ($\pi_\theta$) and edge routing ($\pi_\phi$) as detached decisions, JPSS samples agent roles from the full candidate space and conditions the edge connectivity on the joint probability distribution ($a_e \sim p(a_n) \cdot P_{a_e}$). This unified policy formulation preserves end-to-end gradient flow.
  • Hierarchical Relative Policy Optimization (HRPO): Inspired by Group Relative Policy Optimization (GRPO), HRPO balances system-level trade-offs and step-by-step rationality:
  • Group-Relative Advantage: Compares a batch of candidate graphs generated for the same query, rewarding high accuracy and penalizing excessive token usage (prompt + completion tokens).
  • Action-Wise Absolute Reward: Evaluates intermediate answers after each modification. Crucially, it introduces an exemption time ($T_E$) during which early agents (which typically structure or decompose tasks rather than output final solutions) are shielded from penalties for not immediately solving the problem.

Datasets

The authors evaluated MasHost across six standard benchmarks using GPT-4o-mini-0718 as the execution backend:

  • Mathematical Reasoning: GSM8K and MATH.
  • Question Answering: GPQA (graduate-level reasoning) and MMLU.
  • Code Generation: HumanEval and MBPP.

No new datasets were introduced; the authors used established train/test splits (e.g., 200 training samples each for GSM8K, GPQA, MBPP, and MMLU).

Key Insights and Ideas

  • Preventing Premature Penalty of Sub-Tasks: In multi-agent setups, early agents often decompose problems or frame equations rather than produce the final answer. Standard step-wise RL penalizes these intermediate states as "incorrect." MasHost's exemption time ($T_E = 3$) safeguards early exploration, preventing the system from collapsing prematurely into single-agent topologies.
  • Component Rationality Matters: Previous multi-agent frameworks often suffered from semantic mismatch—e.g., selecting a "philosopher" agent to solve a calculus problem because the underlying LLM could still answer correctly despite the persona. MasHost introduces explicit role responsibilities and refusal conditions, achieving a 100% correlation between assigned roles and query domains.
  • Minimal Redundancy: Pruning an agent from MasHost's generated graphs ($M^-$) causes noticeable performance drops, whereas adding an extra agent ($M^+$) slightly degrades accuracy due to over-complication and post-processing noise—confirming that the generated graphs are lean and non-redundant.

Key Results

  • Overall Performance: MasHost achieved an average score of 74.20% across all six benchmarks, outperforming top autonomous MAS baselines including MaAS (73.56%), MAS-GPT (73.07%), and AFlow (72.94%).
  • Task Gains: On GSM8K, MasHost reached 93.23% (+1.47% over MaAS). On MATH, it scored 52.42% (vs. 51.71% for MaAS and 48.31% for GPTSwarm).
  • Cost Efficiency: On the MATH benchmark, MasHost consumed the lowest average cost per query ($2.763 \times 10^{-3}$ USD), compared to MaAS ($3.040 \times 10^{-3}$) and AFlow ($3.106 \times 10^{-3}$), requiring significantly fewer prompt tokens (3,630 vs. 4,938–6,322).
  • Ablation Impact: Removing HRPO caused the largest degradation (dropping GSM8K from 93.23% to 90.64% and inflating token costs by 73%), demonstrating the necessity of the hierarchical reward structure.

Limitations and Future Work

  • Tool Integration: MasHost currently focuses on agent-to-agent communication graphs and does not integrate external tools (e.g., web search, code interpreters, or calculators).
  • Future Directions: The authors aim to decouple agent interaction topologies from tool utilization, creating a unified decision-making setup where agents autonomously determine when, how, and which tools to call dynamically during task execution.

Summary updated

BibTeX
@misc{yang2025mashost,
  author = {Kuo Yang and Xingjie Yang and Linhui Yu and Qing Xu and Yan Fang and Xu Wang and Zhengyang Zhou and Yang Wang},
  title = {{MasHost Builds It All: Autonomous Multi-Agent System Directed by Reinforcement Learning}},
  year = {2025},
  eprint = {2506.08507},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.08507},
}

Loading related content...

Figure