CARD: Towards Conditional Design of Multi-agent Topological Structures

Tongtong Wu, Yanming Li, Ziye Tang, Chen Jiang, Linhao Luo, Guilin Qi, Shirui Pan, Gholamreza Haffari

TL;DR

Multi-agent LLM systems often rely on rigid, "hard-wired" communication paths that fail when models are upgraded or tools go offline. This paper introduces CARD, a framework that dynamically redesigns agent communication graphs in real-time based on environmental conditions, leading to significantly higher accuracy and robustness across coding and reasoning tasks.

What Problem Does This Paper Address?

In the world of AI agents, collaboration is key. We often build systems where multiple Large Language Models (LLMs) act as "specialists" (e.g., a coder, a reviewer, and a manager) to solve complex problems. However, the communication topology—the map of who talks to whom—is usually fixed or statically learned.

The authors argue that this "one-size-fits-all" approach is brittle. In the real world, environments are dynamic: an API might become unreliable, a model might be upgraded from GPT-4o-mini to GPT-5, or a specific knowledge source might become unavailable. A communication structure optimized for a weak model might be redundant for a strong one, and a path that relies on a broken tool can bring the whole system down. The challenge is creating a system that can "rewire" itself on the fly without needing to be completely retrained.

Methods

The authors propose the Adaptive Multi-Agent Communication Protocol (AMACP), which formalizes the need for effectiveness, cost-efficiency, and adaptiveness. To implement this, they built CARD (Conditional Agentic Graph Designer).

Key components of CARD include:

  • Dual-Channel Encoding: It represents agents through two lenses: a profile channel (static traits like role and base model) and a condition channel (dynamic signals like current API reliability, token costs, and tool availability).
  • Conditional Graph Generation: Using a graph encoder-decoder architecture, CARD takes these embeddings and predicts the probability of communication edges between agents. It essentially asks: "Given that Agent A is currently using a cheaper model and the Search Tool is slow, should Agent A talk to Agent B?"
  • Environment-Aware Training: The system is trained to maximize task success while minimizing "communication noise" and financial costs.
  • Zero-Shot Runtime Adaptation: This is the "secret sauce." At deployment, if the environment shifts (e.g., you swap out the search engine), CARD performs a single-pass re-computation to update the graph. No retraining is required to handle these new conditions.

Datasets

The framework was evaluated on three heavy-hitting benchmarks:

  1. HumanEval: For Python code generation.
  2. MATH: For complex mathematical reasoning.
  3. MMLU: For general knowledge across dozens of subjects.

Crucially, the researchers didn't just test on static setups. They simulated environmental shifts, such as upgrading/downgrading LLMs (using models like GPT-4o, DeepSeek-V3, and Llama-3-70B) and swapping external tools (Google Search vs. Wiki Search) to see how well the topologies adapted.

Key Insights and Ideas

  • Weaker Models Need More Friends: One of the most intuitive "aha" moments in the paper is the visualization of topology density. When using weaker base models (like GPT-4o-mini), CARD generates denser graphs. The agents communicate more frequently to compensate for lower individual capability. Stronger models result in sparser, more efficient graphs.
  • Structure Beats Prompting: A common way to handle changes is "prompt injection"—simply telling the agent in text that a tool is down. The authors found this can actually "backfire," confusing the agents and dropping performance. Changing the structure (the topology) proved far more reliable.
  • Self-Healing Properties: In adversarial tests where an intermediate agent was "attacked" or made faulty, CARD was able to route information around the failure point, maintaining higher accuracy than static baselines.

Key Results

  • Superior Performance: CARD consistently outperformed state-of-the-art baselines like GPT-Swarm and Aflow. It achieved an average accuracy of 90.50% on HumanEval and 86.67% on MMLU.
  • Robustness to Model Shifts: When moving from in-domain models (used during training) to out-of-domain models (unseen during training), CARD’s performance remained stable, while other methods saw significant drops.
  • Cost-Efficiency: By pruning unnecessary communication edges for capable models, CARD achieved a better "accuracy-to-cost" balance than fixed-path methods.

Limitations and Future Work

While CARD is a leap forward in agentic flexibility, the authors note a few hurdles:

  • Static Agent Behaviors: While the graph adapts, the individual agent prompts and internal profiles remain static. Future versions might try to optimize the "what" (content) alongside the "who" (topology).
  • Procedural Nuance: Representing everything as a graph might be too simplistic for highly complex workflows (like massive software engineering projects) that require strict procedural logic.
  • Scaling Up: The current study focused on relatively small groups of agents. The authors plan to explore how CARD handles massive agent ensembles and integrate online reinforcement learning for even more granular adaptation.

Summary updated

Abstract

Large language model (LLM)-based multi-agent systems have shown strong capabilities in tasks such as code generation and collaborative reasoning. However, the effectiveness and robustness of these systems critically depend on their communication topology, which is often fixed or statically learned, ignoring real-world dynamics such as model upgrades, API (or tool) changes, or knowledge source variability. To address this limitation, we propose CARD (Conditional Agentic Graph Designer), a conditional graph-generation framework that instantiates AMACP, a protocol for adaptive multi-agent communication. CARD explicitly incorporates dynamic environmental signals into graph construction, enabling topology adaptation at both training and runtime. Through a conditional variational graph encoder and environment-aware optimization, CARD produces communication structures that are both effective and resilient to shifts in model capability or resource availability. Empirical results on HumanEval, MATH, and MMLU demonstrate that CARD consistently outperforms static and prompt-based baselines, achieving higher accuracy and robustness across diverse conditions. The source code is available at: https://github.com/Warma10032/CARD.
BibTeX
@inproceedings{wu2026card,
  author = {Tongtong Wu and Yanming Li and Ziye Tang and Chen Jiang and Linhao Luo and Guilin Qi and Shirui Pan and Gholamreza Haffari},
  title = {{CARD: Towards Conditional Design of Multi-agent Topological Structures}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=JgvJdICc6P},
}
Figure