Domain-Specific Pruning of Large Mixture-of-Experts Models with Few-shot Demonstrations

zican Dong, Han Peng, Peiyu Liu, Xin Zhao, Dong Wu, Feng Xiao, Zhifeng Wang

Introduction

The deployment of state-of-the-art Mixture-of-Experts (MoE) models has reached a critical bottleneck known as the "memory wall." While MoE architectures like DeepSeek-R1 are computationally efficient—activating only a fraction of their 671 billion parameters for any given token—the entire model weight set must still reside in GPU memory. For DeepSeek-R1, this translates to roughly 750GB of VRAM in FP8 precision, requiring massive hardware clusters (e.g., 16x H800 GPUs) just to load the model.

Existing pruning methods often struggle with these massive scales. Simple router-based statistics frequently miss nuanced expert contributions, while perturbation-based methods—which measure output drift when an expert is removed—are computationally prohibitive for models containing hundreds of experts per layer. This paper introduces EASY-EP (Expert Assessment with Simple Yet-effective scoring for Expert Pruning), a framework that leverages the discovery of "few-shot expert localization" to compress these models for specific domains with minimal data and computation.

The Discovery: Few-Shot Expert Localization

The core insight of this research is that massive MoE models exhibit highly stable expert activation patterns for specific domains. The researchers discovered that as few as 5 to 25 domain-specific examples are sufficient to identify over 90-99% of the experts critical to that domain. In a model like DeepSeek-R1, which features 256 experts per layer, the experts that dominate mathematical reasoning are almost entirely distinct from those utilized for medical or coding tasks. This specialization suggests that for domain-specific deployments, a significant portion of the model is redundant "noise."

The EASY-EP Framework

EASY-EP is a training-free, single-forward-pass pruning method designed to identify and retain only the most critical experts for a target domain. It utilizes two novel metrics to score expert importance:

  1. Output-Aware Expert Importance: Traditional methods often rely solely on the "gating score" (the probability assigned by the router). EASY-EP improves this by multiplying the gating score by the L2 norm of the expert's actual output. This prevents the model from retaining "loud" experts that are frequently called but produce numerically insignificant changes to the hidden representation.
  2. Expert-Level Token Contribution: This metric measures the cosine similarity between the representation before and after the MoE module. If the representation changes significantly, the tokens—and the experts that processed them—are deemed highly important. Conversely, if the change is minimal, those experts are prioritized for pruning.

By running a small calibration set (e.g., 25 math problems), EASY-EP generates these scores and prunes the lowest-ranked experts across the model.

Experimental Setup

The study evaluated EASY-EP across eight benchmarks covering six fundamental domains:

  • Math: AIME-2024, AIME-2025, HMMT-Feb 2025.
  • Coding: LiveCodeBench.
  • Science: GPQA-Diamond.
  • Medicine: USMLE.
  • Finance: FinanceIQ.
  • Agent Execution: AgentBench-OS.

Calibration sets were drawn from separate but related datasets (e.g., using AIME-2023 to calibrate for AIME-2024) to ensure the pruning was truly transferable and not merely overfitted to a specific test set.

Key Results and Efficiency Gains

The results demonstrate that EASY-EP significantly outperforms standard baselines like gating-frequency pruning, which often leads to performance collapse on complex reasoning tasks at high compression ratios.

  • Performance Retention: On DeepSeek-R1, EASY-EP retained over 90% of the original performance while discarding 50% of the experts.
  • Throughput Improvements: Under identical memory constraints, pruning 50% of the experts resulted in a 2.99× increase in inference throughput. This gain is primarily due to the reduced memory footprint, which allows the model to be deployed on fewer GPU nodes, thereby slashing inter-node communication overhead.
  • The "Noise" Effect: In certain scenarios, such as DeepSeek-V3 on AgentBench, pruning irrelevant experts actually improved performance. This suggests that redundant experts can sometimes introduce noise that interferes with task-specific reasoning.

Discussion and Limitations

While EASY-EP enables aggressive compression for specialized tasks, it involves a fundamental trade-off: domain-specific pruning naturally degrades performance on unrelated domains. A "Math-only" R1 will lose its proficiency in medicine or creative writing.

Furthermore, the researchers noted that reasoning-heavy models (like R1) are more sensitive to pruning than standard LLMs (like V3). While domain knowledge remains intact, the long-term "thinking" or chain-of-thought capabilities appear more fragile when the expert pool is halved. Future work will explore "mixed-domain pruning" to find a middle ground between compression and generalist utility, as well as investigating whether these localization patterns hold across other MoE architectures like Mixtral or Grok.

Conclusion

EASY-EP demonstrates that the massive redundancy in MoE models can be exploited through simple, few-shot calibration. By identifying domain-specific expert localization, researchers can deploy state-of-the-art reasoning models on significantly smaller hardware clusters without sacrificing the core capabilities required for the target task.

Summary updated

BibTeX
@inproceedings{dong2025domain,
  author = {zican Dong and Han Peng and Peiyu Liu and Xin Zhao and Dong Wu and Feng Xiao and Zhifeng Wang},
  title = {{Domain-Specific Pruning of Large Mixture-of-Experts Models with Few-shot Demonstrations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=Vvb27TQzO9},
}
Figure