Dynamic Expert Pruning for Multi-Agent Systems
Organizations: Pohang University of Science and Technology (POSTECH) · Microsoft Research Asia
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.
Figures & tables
| 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 |
| 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 | |
| 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 |
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 ( ) | 30.0 | — | — | — |
| Knob | Values | Outcome |
|---|---|---|
| 0, .25, .5, .75 | flat ( ); collapses (above) | |
| learning rate | , , | U-shaped noise |
| final temperature | .05, .15, .4 | flat |
| 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 |
| 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 |
| Task | Workflow | Score | Operator sequence |
|---|---|---|---|
| HotpotQA | genverify_1 r1 | 0.713 | AnsGen Custom Custom |
| genverify_2 r3 | 0.793 | AnsGen ScEns Custom Custom | |
| genverify_2 r4 | 0.790 | AnsGen Custom Custom Custom | |
| genverify_2 r5 | 0.713 | AnsGen AnsGen AnsGen ScEns Custom Custom | |
| HumanEval | gentestfix_1 r1 | 0.920 | Custom Test Custom Test |
| gentestfix_1 r2 | 0.940 | Custom Custom Test Custom Test |
| Level / Task | Workflow | Score | Operator sequence |
|---|---|---|---|
| L2 MBPP (code) | MBPP_1 r7 | 0.567 | CodeGen Custom Test Custom |
| MBPP_1 r9 | 0.700 | CodeGen Test Custom | |
| MBPP_1 r14 | 0.700 | CodeGen ScEns Test Custom | |
| L3 MMLU (knowledge) | MMLU_1 r1 | 0.867 | Custom |
| MMLU_1 r2 | 0.567 | AnsGen Custom Custom ScEns | |
| MMLU_1 r3 | 0.867 | AnsGen Custom Custom Custom ScEns |
| task | policy | accuracy | tokens/prob | generation (s) |
|---|---|---|---|---|
| HotpotQA | dense | .71 .03 | 172 8 | 412 70 |
| DEP | .75 .09 | 181 8 | 405 42 | |
| REAP | .36 .06 | 224 24 | 780 96 | |
| freq | .46 .08 | 477 28 | 894 26 | |
| HumanEval+ | dense | .94 .03 | 1156 72 | 2548 266 |
| DEP | .90 .03 | 1120 42 | 2391 130 |
| 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 |
| 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 |
| 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 | |||
Mixture-of-Experts Pruning
Mixture-of-Experts pruning removes or trims experts to reduce model memory and computation while preserving useful capabilities.
See all 52 papers