A Provably Effective Method for Pruning Experts in Fine-tuned Sparse Mixture-of-Experts

Mohammed Nowaz Rabbani Chowdhury, Meng Wang, Kaoutar El Maghraoui, Naigang Wang, Pin-Yu Chen, Christopher Carothers

Abstract

Mixture-of-Experts (MoE) models offer a powerful paradigm for scaling model capacity without a linear increase in computational cost. However, their massive memory footprint poses significant challenges for inference and deployment. We present a theoretically grounded method for pruning experts in fine-tuned MoE models. By identifying experts whose routers exhibit the smallest change in $l_2$ norm during fine-tuning, we can effectively remove redundant components. Our approach achieves up to a 60% reduction in memory and a 40% reduction in inference FLOPs while maintaining accuracy within 1% of the original model on standard benchmarks.

Introduction

The sparsely gated Mixture-of-Experts (MoE) architecture has become a cornerstone for scaling deep learning models. By routing input tokens to a subset of specialized experts, MoEs allow for high-capacity training with manageable compute. Despite these training efficiencies, the inference phase remains problematic: the entire model, including all experts, must typically be loaded into memory. This requirement makes deployment on resource-constrained hardware nearly impossible.

While weight and neuron pruning are well-established, pruning at the expert level in MoE architectures is a relatively new frontier. Existing approaches often rely on simple heuristics, such as token-count importance, which lack theoretical backing and may not accurately reflect an expert's contribution to a specific downstream task. This paper addresses this gap by introducing a pruning metric based on the learning dynamics of the router weights.

Methodology

The core of the proposed method is a metric that measures the change in the router's $l_2$ norm between the pre-trained state and the fine-tuned state. The intuition is that experts that learn task-specific features will see their corresponding router weights adapt significantly, while redundant experts will remain relatively unchanged.

Visualization of the MoE pruning process where specific experts and their corresponding routers are removed based on the proposed metric.

The pruning pipeline follows a structured four-step process:

  1. Fine-tuning: The pre-trained MoE model is fine-tuned on the target downstream task.
  2. Metric Calculation: For each expert $s$, the change in router norm is calculated as $\Delta_s^{(T)} = \|w_s^{(T)}\| - \|w_s^{(0)}\|$, where $T$ denotes the fine-tuned state and $0$ the pre-trained state.
  3. Pruning: Experts and their associated routers with the lowest $\Delta_s^{(T)}$ values are removed based on a target pruning ratio.
  4. Recovery: A brief period of post-pruning fine-tuning is conducted to allow the remaining experts to compensate for the removed components.

Theoretical Foundations and Insights

The effectiveness of this method is supported by a rigorous feature-learning theoretical framework. The authors demonstrate that:

  • Importance is Linked to Adaptation: Experts that successfully capture task-relevant features undergo a measurable shift in their router's $l_2$ norm. This makes norm change a more reliable proxy for importance than static measures like absolute magnitude or token frequency.
  • The Flaw in Token Counting: An expert might receive many tokens simply due to pre-training biases or generic feature processing. High token volume does not guarantee that the expert is essential for the final classification task.
  • Induced Specialization: Removing low-impact experts and continuing training forces the remaining routers to further specialize. This mechanism explains why the model can sustain high pruning ratios with minimal performance degradation.

Experimental Results

The method was validated on standard vision benchmarks, including CIFAR-10, CIFAR-100, and ImageNet, using Vision MoE (V-MoE) architectures.

Test accuracy vs. model pruning ratio for different pruning configurations, demonstrating the trade-off between model size and performance.

Key empirical findings include:

  • Significant Compression: On CIFAR-10, the method successfully removed 75% of experts. This led to a 60% reduction in total memory requirements and a 40% reduction in inference time and FLOPs.
  • High Fidelity: Even with 75% of experts pruned, the accuracy remained within 1% of the unpruned baseline after a short recovery phase.
  • Scalability: On the complex ImageNet dataset, the method achieved a 35% reduction in model size (42% of experts pruned) while maintaining an accuracy drop of less than 1%.
  • Baseline Comparison: The norm-change metric consistently outperformed alternative strategies, such as pruning based on token counts or average neuron magnitudes, particularly at higher pruning ratios.

Conclusion and Future Directions

This work provides the first provably effective framework for expert-level pruning in fine-tuned MoE models. By leveraging the learning dynamics of routers, the method identifies and removes redundant experts with high precision. While currently demonstrated on vision tasks, the underlying theory suggests broad applicability to other domains, including Large Language Models (LLMs). Future research will explore the integration of this structured pruning with unstructured techniques like quantization to further optimize MoE models for edge deployment.

Summary updated

BibTeX
@inproceedings{chowdhury2024provably,
  author = {Mohammed Nowaz Rabbani Chowdhury and Meng Wang and Kaoutar El Maghraoui and Naigang Wang and Pin-Yu Chen and Christopher Carothers},
  title = {{A Provably Effective Method for Pruning Experts in Fine-tuned Sparse Mixture-of-Experts}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=1oU4FKpVx5},
}
Figure