TL;DR
Large Language Model (LLM)-based multi-agent systems achieve impressive performance through collaboration, but their complex communication networks lead to massive token consumption and high API costs. This paper introduces AgentPrune, a plug-and-play framework that models multi-agent communication as a spatial-temporal graph and prunes redundant or malicious messages. By cutting out the "chatter," it drastically reduces token usage and costs while maintaining task performance and improving system robustness against adversarial attacks.
The Problem: Communication Redundancy
In the world of LLMs, collective intelligence often outperforms individual capabilities. Multi-agent systems—where several LLM instances take on different personas (e.g., coder, critic, manager) and debate or collaborate—consistently achieve state-of-the-art results on complex tasks.
However, this collaboration comes at a steep economic price. Existing frameworks (like AutoGen or GPTSwarm) often rely on dense communication topologies where every agent reads the outputs of every other agent, both within a single dialogue round and across multiple rounds. The authors identify a phenomenon termed Communication Redundancy: a massive portion of these message exchanges does not actually contribute to solving the problem. This redundancy causes token counts to explode, making large-scale deployment economically unfeasible and increasing the system's vulnerability to adversarial attacks (e.g., if one agent is compromised, it can easily mislead the entire dense network).
Methods: Pruning the Spatial-Temporal Graph
To solve this, the authors propose AgentPrune, which treats the entire multi-agent system as a spatial-temporal communication graph:
- Spatial edges represent intra-dialogue communication (agents talking to each other in the same round).
- Temporal edges represent inter-dialogue communication (passing dialogue history to the next round).
Instead of relying on hardcoded, dense connections, AgentPrune learns which connections actually matter:
- Graph Mask Optimization: It applies a differentiable mask to the graph edges. Using policy gradient methods, it optimizes these masks to maximize the system's utility (accuracy/performance) while enforcing low-rank sparsity.
- One-Shot Pruning:
AgentPrunedoesn't optimize indefinitely. After a few initial dialogue rounds (or a few initial queries in a dataset), it performs a one-shot magnitude pruning. It drops the least important edges, leaving a fixed, sparse, and highly efficient communication topology. - Plug-and-Play Integration: This pruned graph is then used for the remainder of the task. The method is designed to be easily integrated into existing frameworks.
Key Insights
- Less is Actually More: The authors found that randomly dropping 10-30% of connections in dense multi-agent networks actually improves performance. This proves that excessive agent chatter introduces noise that distracts the LLMs.
- Low-Rank Sparsity Equals Robustness: By forcing the communication graph to be low-rank during optimization,
AgentPrunenaturally filters out malicious messages. If an attacker injects a prompt to turn one agent into a "liar," the pruning process recognizes its outputs as unhelpful and severs its outgoing connections, effectively quarantining the compromised agent. - Emergent Role Differentiation: Visualizing the pruned graphs reveals that
AgentPrunenaturally understands agent roles. "Critic" agents end up with many incoming edges to review others' work, while "Knowledge Experts" retain many outgoing edges to broadcast facts. - High Transferability: A communication topology optimized by
AgentPruneon one dataset (like GSM8K) can be directly applied to a similar dataset (like AQuA) and still achieve excellent performance without needing re-optimization.
Key Results
The authors evaluated AgentPrune across six standard benchmarks covering general reasoning (MMLU), mathematical reasoning (GSM8K, MultiArith, SVAMP, AQuA), and code generation (HumanEval).
- Massive Cost Savings: On the MMLU benchmark,
AgentPruneachieved comparable performance to state-of-the-art topologies (like GPTSwarm) but cost merely $5.60 compared to their $43.70. - Token Reduction: When integrated into existing frameworks,
AgentPrunereduced total token consumption by 28.1% to 72.8%. - Maintained/Improved Performance: Despite the massive drop in tokens, performance remained top-tier (e.g., achieving 90.3% Pass@1 on HumanEval and 95.8% accuracy on GSM8K).
- Adversarial Defense: Under "agent prompt" and "agent replacement" attacks, unpruned systems suffered heavy performance drops (up to 20.8%).
AgentPrunesuccessfully defended against these, yielding a 3.5% to 10.8% performance boost over baselines in attack scenarios.
Limitations and Future Work
AgentPrune requires a multi-agent setup with at least three agents and a moderately organized structure to be useful; it cannot be applied to overly simplistic structures like linear chains or direct-output systems. Additionally, there is a slight token overhead during the initial "training/optimization" phase before the one-shot pruning occurs.
Looking forward, by solving the economic bottleneck of token consumption, AgentPrune paves the way for scaling up to much larger multi-agent swarms, facilitating the next generation of large-scale collective AI intelligence.
Summary updated