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.
Figures & tables
Figure 1: Static masks that track the dense model for a single agent lose much of that accuracy on a multi-agent workload. Left: identical pruning methods, backbone, retention ( ρ=50% ), and calibration data; only the serving setting changes. Right: the resulting accuracy–memory frontier.
Figure 2: Agents differ in what they do, and therefore in the experts they use. (a) Per-role and (b) per-operator expert usage (HumanEval+, layer 24; deviation from the row mean over the top-64 experts, percentage points); (c) share of each role’s segments per operator, across three tasks.
Method
MATH-500
GSM8K
HumanEval+
MBPP+
MMLU
HotpotQA
Mean
Dense (56.9 GB)
68.3 ± 8.6
97.3 ± 1.2
92.8 ± 1.4
80.0 ± 6.9
82.7 ± 1.5
71.9 ± 1.7
82.2 ± 1.0
50% retention (keep 64/128; 29.9 GB resident)
Freq.
62.3 ± 9.0
95.3 ± 1.5
2.9 ± 1.4
3.0 ± 1.0
51.0 ± 2.6
65.4 ± 3.7
46.7 ± 1.9
REAP
40.7 ± 6.8
71.3 ± 4.5
78.7 ± 0.8
45.7 ± 4.0
40.3 ± 4.0
47.3 ± 3.0
54.0 ± 1.6
HC-SMoE
60.3 ± 6.4
84.0 ± 3.0
75.8 ± 2.2
75.0 ± 7.8
48.3 ± 0.6
60.4 ± 1.6
67.3 ± 1.5
DEP
67.3 ± 10.6
95.3 ± 2.3
84.5 ± 0.8
76.7 ± 2.5
70.7 ± 4.7
60.7 ± 3.2
75.9 ± 2.3
Table 1: DEP gives the best overall accuracy at both retentions, and is the only policy still usable at ρ=25% . AFlow-discovered multi-agent workflows (Qwen3-30B-A3B); DEP against static masks calibrated on the identical union. Values are % (pass@1; HotpotQA SQuAD-F1; MMLU accuracy), mean ± std; protocol in Section 4.1 .
ρ=50%
ρ=25%
task
Dense
Freq.
REAP
HC-SMoE
DEP
Freq.
REAP
HC-SMoE
DEP
Unseen structure
HotpotQA
68.0 ± 6.6
12.9 ± 1.5
12.3 ± 2.7
54.5 ± 5.5
65.0 ± 2.8
0.4 ± 0.4
5.3 ± 3.3
0.1 ± 0.1
38.3 ± 0.6
HumanEval+
94.3 ± 3.5
39.0 ± 2.6
59.3 ± 1.5
82.3 ± 1.5
83.4 ± 4.1
0.0 ± 0.0
7.7 ± 2.5
0.0 ± 0.0
9.7 ± 3.2
MATH
68.3 ± 3.3
0.0 ± 0.0
2.8 ± 2.5
45.8 ± 8.2
55.0 ± 2.4
0.0 ± 0.0
0.0 ± 0.0
0.0 ± 0.0
9.4 ± 1.0
Unseen family
HotpotQA
67.5 ± 4.3
9.9 ± 0.1
29.5 ± 8.9
56.4 ± 7.2
53.1 ± 3.2
0.0 ± 0.0
3.1 ± 1.2
0.0 ± 0.0
44.4 ± 2.6
HumanEval+
92.0 ± 1.9
58.7 ± 1.7
74.0 ± 2.1
87.6 ± 3.4
88.2 ± 3.9
0.0 ± 0.0
27.5 ± 3.2
0.0 ± 0.0
28.0 ± 2.3
Table 2: One predictor, fixed after training, keeps working as the workload moves away from it. Generalization ladder: one universal predictor and one static calibration, both fixed after training on a three-task workflow pool, evaluated at increasing distance from training. Accuracy % (HotpotQA F1), 30 problems per cell, mean ± std over 3 seeds. Bold = best, underline = second-best pruned method per row and retention.
Figure 3: Predicted masks organize themselves by task and by role. Jaccard overlap of predicted kept-expert masks at ρ=50% (chance = 0.33). (a) Between benchmarks; (b, c) between the agents of the MATH and HumanEval+ teams. Diagonals: the same row on different problems. Measured on hand-crafted agent teams, not the discovered workflows of Table 1 .
policy
memory (GB)
accuracy
tokens/prob
generation (s)
Δ -load (s)
total (s)
dense
56.9
0.78
1905
3239
—
3239
DEP
29.9
0.76
1872
3275
+42
3317
REAP
29.9
0.53
2077
3803
0
3803
freq
29.9
0.27
3365
5457
0
5457
Table 3: A wrong mask wastes more time rambling than a right mask spends swapping experts. Efficiency at ρ=50% over three workflows (HotpotQA, HumanEval+, MATH; 3 random 50-problem seeds), not comparable with Table 1 ; per task in Table 12 . Tokens and times are measured; Δ -load is an analytic upper bound on the per-agent-step swap cost, which static masks never pay.
Table 7
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Objective
MATH
HumanEval+
HotpotQA (F1)
Mean
Dense reference
82.0
92.0
72.2
82.1
KD + BCE(REAP) (ours)
76.0
90.0
71.7
79.2
LM + BCE(REAP)
76.0
84.0
68.4
76.1
LM + BCE(norm)
82.0
80.0
0.0
54.0
KD only ( α=1 )
30.0
—
—
—
Appendix
Table 6: Objective ablation ( ρ=50% , n=50 ). Both terms of Eq. 6 are load-bearing.
Knob
Values
Outcome
α
0, .25, .5, .75
flat ( ±3 ); α=1 collapses (above)
learning rate
3⋅10−5 , 10−4 , 3⋅10−4
U-shaped ±5⇒ noise
final temperature T
.05, .15, .4
flat
Appendix
Table 7: Hyperparameter sweep (screened on MATH, the only task with headroom; paired on identical problems). All three knobs are null; apparent winners did not survive paired replication on an independent subset.
Task
Workflow
Operator sequence
HotpotQA
debate_1 r2
Custom → Custom → Custom → Custom
debate_1 r3
Custom → Custom → Custom → Custom → Custom
debate_1 r5
AnsGen → AnsGen → AnsGen → ScEns → Custom
debate_1 r6
AnsGen → AnsGen → Custom → Custom
decompose_1 r3
Custom → AnsGen → Custom → ScEns
decompose_1 r6
Custom → AnsGen → ScEns → Custom
Appendix
Table 8: Trained-on structures (32 workflows): only these train the universal predictor.
Task
Workflow
Score
Operator sequence
HotpotQA
debate_1 r4
0.719
Custom → Custom → Custom → Custom → Custom
decompose_2 r4
0.833
Custom → AnsGen → AnsGen → ScEns → Custom
direct_1 r4
0.453
Custom → AnsGen
HumanEval
review_1 r2
0.900
Custom → Custom → ScEns → Test
selfcons_1 r6
0.960
Custom → Custom → ScEns
MATH
direct_2 r2
0.833
Custom → ScEns
Appendix
Table 9: Level 0 held-out — unseen structures (held-out rounds of families the predictor did train on).
Table 12: Per-task efficiency at ρ=50% : mean ± std over 3 random 50-problem seeds, sequential contention-free runs.
Method
MATH
GSM8K
HumanEval+
MBPP+
HotpotQA
Mean
Dense (workflow)
52.0
84.0
72.0
86.0
59.7
70.7
Direct (single call)
50.0
90.0
76.0
84.0
56.9
71.4
50% retention (keep 80/160)
Freq.
33.0
71.0
17.0
5.0
39.2
33.0
REAP
32.0
68.0
38.0
56.0
38.5
46.5
DEP
34.0
74.0
46.0
66.0
38.7
51.7
Appendix
Table 13: DeepSeek-V2.5-236B (59 MoE layers, 160 routed experts, top-6, plus 2 shared experts that are always active and never pruned). Values are % ( n=50 problems per task; pass@1, HotpotQA token-F1, MATH/GSM8K exact match); Dense and Direct are unpruned references. Bold = best pruned method per task.
Policy
Accuracy (F1)
Tokens/prob
ms/token
Median tok
Max tok
# exploded
dense
0.73
180
47.3
4
21
0
DEP
0.70
188
45.5
4
11
0
REAP
0.36
259
69.9
7
128
3
freq
0.33
510
38.9
6
128
4
Appendix
Table 14: Token statistics of the final-answer agent (HotpotQA, ρ=50% , N=50 ). Exploded = generations ≥ 100 tokens; ms/token reflects batch padding, not per-token compute.
Policy
Output
Tok
Score
Q: “The saint in ‘A Time for Miracles’ was born on what date?”
dense
August 28, 1774
10
1.00
DEP
August 28, 1774
10
1.00
REAP
1774.1755-5.1815.1755-5.1815… (repeats to max)
128
0.00
freq
Answer: (empty)
3
0.00
Q: “Gail Matthius co-anchored Weekend Update with the actor who
Appendix
Table 15: Generation collapse under static masks: the same input, all four policies. Top: REAP collapses; bottom: freq collapses.
Institute of Automation, Chinese Academy of Sciences · School of Artificial Intelligence, University of Chinese Academy of Sciences · Zhongguancun Academy +1