Manuscript Offprint

arXiv:2610.02951

Dynamic Expert Pruning for Multi-Agent Systems

Jabin Koo, Soheil Abbasloo, Sungjae Lee, Jungseul Ok

ABSTRACT

Mixture-of-Experts (MoE) architectures scale language models efficiently by activating only a few experts per token, but the saving is confined to computation: every expert must stay resident on the accelerator, so memory bounds where these models can be deployed. Expert pruning reduces this footprint, yet existing methods are static — a single mask, calibrated offline, is applied to the model for every subsequent request. This assumption can fail when the workload is heterogeneous, most prominently in multi-agent systems, where one backbone serves many tasks and roles at once: our analysis shows that different tasks and roles recruit different experts, while static methods assign one fixed subset to all of them. We therefore propose Dynamic Expert Pruning (DEP), which rests on a finding we establish here: an agent's system and task prompts are by themselves sufficient to identify the experts that agent and its task require, since that text already describes what the agent will do. A lightweight predictor, trained once on workflow transcripts, turns those prompts into a specialized per-request mask in a single forward pass, with no per-configuration calibration. Across diverse tasks and roles, model scales, and MoE architectures, DEP achieves better overall accuracy than static pruning and merging baselines, and generalizes to workflows unseen in training without retraining. Its margin over those baselines is largest when few experts are retained, suggesting that the role specialization inherent to multi-agent systems permits sparser serving than static pruning allows.

1 INTRODUCTION

Scaling language models has increasingly meant scaling them sparsely rather than densely. A Mixture-of-Experts (MoE) layer replaces a single feed-forward network with a pool of expert networks and a router that activates only a few of them per token, so the parameter count can grow without a proportional growth in per-token computation (Shazeer et al., 2017; Fedus et al., 2022). The design now underpins the strongest open models (Jiang et al., 2024; DeepSeek-AI, 2024; Yang et al., 2025) and frontier proprietary systems alike (Gemini Team, Google, 2024). The saving it delivers, however, is in arithmetic, not memory: routing is re-decided at every token, so any expert may be needed at any step and the entire pool must stay resident on the accelerator — or be paged in at a latency cost. Memory, not compute, therefore often determines where an MoE model can be deployed. This asymmetry has made expert pruning an active line of work — removing the experts that contribute least (Lu et al., 2024; Lasby et al., 2026), or merging redundant ones (Chen et al., 2025) — with a shared, encouraging finding: a large fraction of the experts can be discarded at modest loss, provided the retained subset matches the workload the model will actually serve.

Current methods simply assume that condition holds. Previous expert pruning methods are calibration-based: expert importance is averaged over a corpus taken to stand for future traffic, and the resulting static mask is frozen for every subsequent request. But a single backbone increasingly serves many prompting contexts at once — most prominently multi-agent systems, which assign it different tasks and agentic roles through prompts alone. Static calibration answers this diversity by finding one uniform, best-on-average set of experts; we argue that different tasks and roles may require different experts, so a single averaged subset ends up fitted to none of them.

Our analysis bears this out. Static pruning methods that deliver on single-workload benchmarks lose much of their accuracy in settings that mix tasks and roles, multi-agent systems chief among them, and the loss has a mechanism: agents in different roles and on different tasks recruit measurably different experts, so preserving quality calls for an expert mask specialized to each agent and task. Specialization by calibration, however, scales poorly — one pass per configuration, redone whenever a prompt is edited, a role is added, or a workflow is re-searched. This motivates expert pruning that is dynamic: specialized to each request, without a calibration pass for each.

This is precisely what we propose: Dynamic Expert Pruning (DEP). Instead of calibrating a mask, DEP predicts it, with a lightweight predictor that learns which experts an agent on a given task will need from nothing but the agent's system prompt and its task input. A central claim of this paper is that these prompts are by themselves sufficient: the system prompt specifies what the agent is and what it will do, and the task input specifies what knowledge doing it demands, so the text that configures an agent is enough on its own to identify its specialized expert set before a single token is generated — and our experiments bear this out, on agents and workflows the predictor never saw. The predictor is trained on transcripts of the backbone at work — supervised by which experts contributed to each output, and by how little the masked model's distribution moves — and at serving time the mask is held fixed for the turn, preserving what makes static pruning deployable: a bounded resident expert set, reuse across a batch, untouched weights. Because it conditions on prompt text rather than a roster identifier, even agents and workflows never seen in training receive their masks in one shot — a single small forward pass on the system and task prompts, with no additional calibration.

Empirically, DEP achieves better overall accuracy than static pruning and merging baselines across benchmarks, workflows, model scales, and MoE architectures, and it generalizes to configurations unseen in training; our analyses trace why. No single static criterion is uniformly worse — each wins somewhere — but each also collapses somewhere, and DEP is the only policy that does not. Its advantage is largest in the sparsest regime: as the budget tightens, a fixed subset must cover every context and ends up serving none well, while DEP spends the whole budget on the experts one request needs. These results suggest that specialization opens the door to sparser pruning — narrowing a mask to a single agent's task and knowledge can let far fewer experts suffice.

References (50)

  • Program Synthesis with Large Language Models
  • Why Do Multi-Agent LLM Systems Fail?
  • Retraining-free merging of sparse MoE via hierarchical clustering
  • Evaluating Large Language Models Trained on Code
  • Introducing SWE-bench verified
  • Training Verifiers to Solve Math Word Problems
  • DeepSeek-V3 Technical Report
  • Fast inference of mixture-of-experts language models with off-floading (opens arXiv in a new tab)
  • Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity
  • GPTQ: Accurate post-training quantization for generative pre-trained transformers
  • Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context
  • Measuring massive multitask language understanding
  • Measuring mathematical problem solving with the MATH dataset
  • MetaGPT: Meta programming for a multi-agent collaborative framework
  • Instruction-following pruning for large language models
  • Pre-gated MoE: An algorithm-system co-design for fast and scalable mixture-of-expert inference
  • Mixtral of Experts
  • SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations (ICLR), 2024
  • The illusion of multi-agent advantage (opens arXiv in a new tab)
  • Towards a science of scaling agent systems (opens arXiv in a new tab)
  • REAP the experts: Why pruning prevails for one-shot MoE compression
  • ReasonOps: Operator segmentation for LLM reasoning traces (opens arXiv in a new tab)
  • Let's verify step by step
  • Parrot: Efficient serving of LLM-based applications with semantic variable
  • AWQ: Activation-aware weight quantization for LLM compression and acceleration
  • Is your code generated by ChatGPT really correct? rigorous evaluation of large language models for code generation
  • Deja vu: Contextual sparsity for efficient LLMs at inference time
  • Not all experts are equal: Efficient expert pruning and skipping for mixture-of-experts large language models
  • Are NLP models really able to solve simple math word problems? In North American Chapter of the Association for Computational Linguistics (NAACL), 2021
  • Outrageously large neural networks: The sparsely-gated mixture-of-experts layer
  • AutoGen: Enabling next-gen LLM applications via multi-agent conversation
  • MoE-Infinity: Offloading-efficient MoE model serving (opens arXiv in a new tab)
  • Qwen3 Technical Report
  • HotpotQA: A dataset for diverse, explainable multi-hop question answering
  • AFlow: Automating agentic workflow generation
  • Per task we run the AFlow MCTS search (Zhang et al., 2025) with a Claude-Sonnet optimizer and the target backbone as executor, for up to 10 rounds, and select the best-scoring discovered workflow on the search validation split
  • Both terms of Eq
  • All three knobs are null; apparent winners did not survive paired replication on an independent subset
  • >HumanEval</td><td>review_1 r2</td><td>0.900</td><td>Custom $\rightarrow$ Custom $\rightarrow$ ScEns $\rightarrow$ Test</td></tr><tr><td>selfcons_1 r6</td><td>0.960</td><td>Custom $\rightarrow$ Custom $\rightarrow$ ScEns</td></tr><tr><td rowspan=
  • Scores are the workflows' own validation scores under the dense backbone
  • >L2 · MBPP (code)</td><td>MBPP_1 r7</td><td>0.567</td><td>CodeGen → Custom → Test → Custom</td></tr><tr><td>MBPP_1 r9</td><td>0.700</td><td>CodeGen → Test → Custom</td></tr><tr><td>MBPP_1 r14</td><td>0.700</td><td>CodeGen → ScEns → Test → Custom</td></tr><tr><td rowspan=
  • Dense and DEP never explodes; each static mask does, on different inputs
  • DEP needs transcripts of the dense backbone running the training workflows, and one predictor per retention level — our $\rho = 50\%$ and $\rho = 25\%$ checkpoints differ in exactly one field, $K$
  • Pruned accuracy still trails the dense workflow at both retentions: we claim graceful degradation under compression, not free compression
  • >HotpotQA</td><td>dense</td><td>.71±.03</td><td>172±8</td><td>412±70</td></tr><tr><td>DEP</td><td>.75±.09</td><td>181±8</td><td>405±42</td></tr><tr><td>REAP</td><td>.36±.06</td><td>224±24</td><td>780±96</td></tr><tr><td>freq</td><td>.46±.08</td><td>477±28</td><td>894±26</td></tr><tr><td rowspan=
  • Values are % (n=50 problems per task; pass@1, HotpotQA token-F1, MATH/GSM8K exact match); Dense and Direct are unpruned references
  • Masking requires $K \geq k$ , so retention below $k/E$ cannot be expressed at all, and just above it the router has little freedom left inside the kept set
  • Exploded = generations $\geq 100$ tokens; ms/token reflects batch padding, not per-token compute
  • Top: REAP collapses; bottom: freq collapses
  • The saint in 'A Time for Miracles' was born on what date?