AnyMAC: Cascading Flexible Multi-Agent Collaboration via Next-Agent Prediction
Song Wang, Zhen Tan, Zihan Chen, Shuang Zhou, Tianlong Chen, Jundong Li
TL;DR
AnyMAC reframes multi-agent collaboration from fixed graph topologies to a sequential routing paradigm, enabling Next-Agent Prediction and Next-Context Selection to flexibly allocate roles and retrieve global history. Built on a transformer-based encoder with task-adaptive NAP/NCS tokens, it constructs task-specific communication pipelines that permit agent reuse and global context routing, optimizing for accuracy, efficiency, and robustness via RL training. Empirical results show state-of-the-art or near-state-of-the-art performance across reasoning, math, code, and evaluation benchmarks, with tunable efficiency through the AnyMAC-Eff variant. The approach demonstrates strong resilience to adversarial inputs and provides a scalable framework for flexible, adaptive, and interpretable multi-agent LLM systems in real-world tasks.
Abstract
Recent progress in large language model (LLM)-based multi-agent collaboration highlights the power of structured communication in enabling collective intelligence. However, existing methods largely rely on static or graph-based inter-agent topologies, lacking the potential adaptability and flexibility in communication. In this work, we propose a new framework that rethinks multi-agent coordination through a sequential structure rather than a graph structure, offering a significantly larger topology space for multi-agent communication. Our method focuses on two key directions: (1) Next-Agent Prediction, which selects the most suitable agent role at each step, and (2) Next-Context Selection (NCS), which enables each agent to selectively access relevant information from any previous step. Together, these components construct task-adaptive communication pipelines that support both role flexibility and global information flow. Extensive evaluations across multiple benchmarks demonstrate that our approach achieves superior performance while substantially reducing communication overhead.
