ResMAS: Resilience Optimization in LLM-based Multi-agent Systems

Zhilun Zhou, Zihan Liu, Jiahe Liu, Qingyu Shao, Yihan Wang, Kun Shao, Depeng Jin, Fengli Xu

TL;DR

Multi-agent systems (MAS) powered by Large Language Models are highly effective but vulnerable to random agent failures and communication errors due to their distributed nature. This paper introduces ResMAS, a two-stage framework that proactively optimizes both the communication network topology and individual agent prompts to maximize system resilience. By combining a Graph Convolutional Network (GCN) reward model with reinforcement learning and topology-aware prompt tuning, ResMAS builds multi-agent systems that maintain high performance even when individual agents frequently fail.

What Problem Does This Paper Address?

When we deploy LLM-based multi-agent systems in the real world, the agents often run on different devices, servers, or environments. This distributed setup makes them highly susceptible to non-malicious perturbations, such as network drops, API timeouts, or random agent failures (where an agent suddenly outputs nonsense or an incorrect response).

While prior research has heavily focused on reactive defenses against malicious adversarial attacks (like prompt injection), very little work has explored how to proactively design multi-agent systems to be inherently fault-tolerant. The authors set out to answer a fundamental question: Given a fixed budget of agents and communication links, how can we optimize the system's structure and instructions so it doesn't collapse when some agents fail?

System performance and resilience characteristics under agent perturbations

Methods

The authors propose ResMAS, a two-stage optimization framework designed to handle the massive search space of topologies and prompts.

Stage 1: Topology Optimization

Instead of using slow, iterative graph search algorithms, ResMAS trains an LLM (Qwen2.5-7B-Instruct) to directly generate a resilient adjacency list based on task descriptions and constraints.

  1. Supervised Fine-Tuning (SFT): The LLM is first trained on random graphs to learn the required JSON formatting constraints.
  2. GRPO Training with a GCN Reward Model: Evaluating a topology's resilience by running actual LLM agents under various error rates is incredibly slow. To bypass this bottleneck, the authors train a task-aware Graph Convolutional Network (GCN) as a Reward Model. This model predicts whether a given topology will succeed across five different error rates ($p \in \{0, 0.2, 0.4, 0.6, 0.8, 1.0\}$). The topology generator LLM is then optimized via Group Relative Policy Optimization (GRPO) using the GCN's predictions as the reward signal.
The topology optimization framework in ResMAS

Stage 2: Topology-Aware Prompt Optimization

Once the network structure is locked in, ResMAS optimizes the system prompt for each agent. An agent's role depends heavily on its position in the network. ResMAS runs the MAS on a small training set and curates:

  • Positive Examples: Instances where an agent initially gave a wrong answer but successfully corrected it after looking at its neighbors' responses.
  • Negative Examples: Instances where an agent had the right answer but was misled by a failing neighbor.

A powerful optimizer LLM (GPT-4o-mini) reviews these examples alongside the neighbors' prompts to rewrite the agent's system prompt, explicitly teaching it when to trust its peers and when to stick to its own reasoning.

Topology-aware prompt optimization framework in ResMAS

Datasets

The framework was trained and evaluated on three distinct benchmarks:

  • MMLU-Pro: A challenging dataset spanning multiple disciplines to evaluate commonsense and multi-task reasoning.
  • MATH (Level-5): The hardest tier of competition-level mathematical problems to evaluate complex reasoning.
  • Chess: A subset of the BIG-bench benchmark focused on predicting valid chess moves given a game history.
  • HumanEval: Used exclusively to test the framework's cross-task generalization capability (code generation), as it was completely unseen during the training of the topology generator.

Key Insights and Ideas

  • Topology Matters More Than Redundancy Alone: While adding more agents and links naturally increases fault tolerance due to redundancy, how they are connected is critical. For instance, hierarchical or decentralized structures consistently outperform centralized "star" topologies because they avoid single points of failure.
  • Decentralization Breeds Resilience: Case studies showed that ResMAS favors decentralized graphs where nodes have equal degrees, preventing a single failing agent from corrupting or isolating large portions of the network.
  • Prompt Optimization Needs Context: Standard prompt optimization treats agents in isolation. ResMAS shows that prompts must be optimized conditioned on the topology. Agents need explicit instructions on how to critically filter information coming from their specific neighbors.
Effect of topology and prompt on MAS resilience

Key Results

  • Superior Resilience: Across MATH, MMLU-Pro, and Chess datasets, ResMAS consistently outperformed state-of-the-art baselines (including GPTSwarm, TextGrad, and OPRO) under various node and edge constraints. For example, on the MATH dataset with 10 agents and 10 edges, ResMAS achieved a resilience score of 0.813, compared to GPTSwarm's 0.752 and G-Designer's 0.490.
  • The Accuracy-Resilience Pareto Front: When configured to optimize for standard accuracy instead of resilience, ResMAS successfully pushed the Pareto front forward, achieving higher accuracy with minimal drops in resilience compared to other methods.
Comparison of accuracy and resilience with baselines
  • Strong Generalization: The topology generator successfully generalized to the unseen HumanEval coding task without retraining. Furthermore, topologies generated using Qwen transfer effectively to other backbone models like GPT-3.5-turbo and GPT-4o-mini.

Limitations and Future Work

  • Sequential Optimization: ResMAS optimizes the system in two discrete stages: topology first, then prompts. The authors note that a joint, simultaneous optimization of both components could unlock even higher performance.
  • Homogeneous Agents: The current framework assumes all agents share the same underlying LLM backbone. Real-world distributed systems often use a mix of large and small models (heterogeneous MAS). Extending ResMAS to handle agents with varying capabilities and costs remains an open direction for future research.

Summary updated

BibTeX
@inproceedings{zhou2026resmas,
  author = {Zhilun Zhou and Zihan Liu and Jiahe Liu and Qingyu Shao and Yihan Wang and Kun Shao and Depeng Jin and Fengli Xu},
  title = {{ResMAS: Resilience Optimization in LLM-based Multi-agent Systems}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i41.40824},
}
Figure