TL;DR
AgentSlimming is a plug-and-play, training-free compression framework designed to optimize large language model (LLM) multi-agent systems. By adapting neural network pruning and quantization techniques to multi-agent workflows, it slashes token costs by up to 78.9% while maintaining or even improving task accuracy.
What Problem Does This Paper Address?
Multi-Agent Systems (MAS) have transitioned from basic prompt engineering to complex, automated workflows where specialized agents collaborate to solve difficult reasoning and coding tasks. However, state-of-the-art workflow discovery algorithms (like AFlow) typically operate under an "unconstrained resources" assumption.
The resulting workflows are computationally bloated. They feature dense, redundant communication channels and uniformly deploy expensive, top-tier LLMs (like GPT-4) for every single sub-task, regardless of complexity. This creates a massive bottleneck in token consumption and API costs, making these advanced systems impractical to scale in production environments.
Methods
AgentSlimming tackles this structural and semantic bloat using a three-stage pipeline inspired by classic neural network compression:
- Hybrid Importance Evaluation: Before modifying the workflow, AgentSlimming evaluates each agent node's significance. It uses Reciprocal Rank Fusion (RRF) to combine four distinct signals:
- Topological Priors: Degree Centrality and Betweenness Centrality to measure how structurally connected a node is within the graph.
- Functional Contribution: An Approximate Shapley Value calculated via a Leave-One-Out (LOO) strategy to see how much task performance drops if the node is removed.
- Economic Potential: A Delta-Cost signal measuring potential monetary API savings.
- AgentPruner (Structural Pruning): This stage iteratively removes the least important agent nodes and performs "graph surgery" (edge patching) to maintain the workflow's connectivity.
- AgentQuant (Semantic Quantization): For the remaining lower-importance nodes, AgentSlimming replaces expensive, high-precision LLMs with cost-effective, lightweight surrogates (e.g., swapping GPT-4 for GPT-4o-mini).
- AgentTuner (Adaptive MCTS Fine-tuning): An optional offline enhancement stage that leverages Monte Carlo Tree Search to refine prompts and local connections, recovering any minor performance drops.
Crucially, both pruning and quantization employ a "greedy + rollback" mechanism: if an optimization step causes performance to drop below a baseline-anchored threshold, the operation is immediately revoked to prevent performance collapse.
Datasets
The authors evaluated AgentSlimming across eight diverse benchmarks, categorized into two difficulty tiers:
- Standard Benchmarks: GSM8K (mathematical reasoning), MBPP (program synthesis), HotpotQA (multi-hop question answering), DROP (reading comprehension), and MATH (Level-5 subset).
- High-Difficulty Benchmarks: AIME (competition-level mathematics), MuSiQueAns (complex QA), and LiveCode (holistic programming evaluation).
Key Insights and Ideas
- Denoising via Pruning: Automated workflow generation often creates redundant parallel paths (e.g., multiple code generators or answer verifiers). The authors discovered that pruning these doesn't just save money—it removes algorithmic "noise," which can actually improve final task accuracy.
- Strategic Heterogeneity: Not every node needs the smartest model. AgentSlimming naturally discovers a mixed-precision configuration, keeping high-capability models for core generation tasks while quantizing procedure-oriented nodes (like consensus aggregators, formatters, or validators) to cheaper models.
- Pipeline Order Matters for Efficiency: While reversing the pipeline (quantization before pruning) yields a similar final cost-accuracy trade-off, pruning first shrinks the graph structure early. This significantly reduces the search space and computational cost of the subsequent quantization stage.
Key Results
AgentSlimming consistently discovered workflows that strictly dominated the baselines in both cost and quality:
- Win-Win on Math & Coding: On GSM8K, AgentSlimming matched the baseline AFlow accuracy (95.5) while achieving a 78.8% cost reduction. On MBPP and LiveCode, it achieved a "dual victory"—improving accuracy scores (73.3 to 77.9 on MBPP; 55.3 to 61.7 on LiveCode) while slashing costs by 71.7% and 78.9% respectively.
- Affordable Evaluation: Post-optimization, evaluating entire test sets became remarkably cheap. Standard benchmarks like MBPP and GSM8K required less than $2.00 to evaluate the entire test set ($1.63 and $1.84, respectively).
- Cross-Architecture Generalization: The framework proved robust when transferred to different model families, maintaining substantial cost reductions and competitive accuracy when tested on the Qwen3 series.
Limitations and Future Work
While highly effective, the authors note a few limitations:
- Model Scope: The evaluation primarily focused on the GPT-4.1 and Qwen3 series, leaving newer frontier models untested.
- Task-Level vs. Instance-Level: AgentSlimming currently operates at the task level, meaning it optimizes a static workflow for an entire dataset. It does not dynamically adapt compute resources at the instance level based on the difficulty of an individual query.
For future work, the authors plan to explore instance-level dynamic adaptation, utilizing multi-agent memory to adjust workflows on the fly.
Summary updated