NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Retraining-Free Merging of Sparse MoE via Hierarchical Clustering

I-Chun Chen, Hsu-Shen Liu, Wei-Fang Sun, Chen-Hao Chao, Yen-Chang Hsu, Chun-Yi Lee

TL;DR

The paper introduces HC-SMoE (Hierarchical Clustering for Sparsely activated Mixture of Experts), a retraining-free, task-agnostic framework designed to reduce the massive memory footprint of Sparse Mixture-of-Experts (SMoE) models. By grouping and merging functionally redundant experts using hierarchical clustering based on actual expert outputs, HC-SMoE achieves significant parameter reduction while maintaining near-original model performance across diverse language tasks.

What Problem Does This Paper Address?

Sparsely activated Mixture-of-Experts (SMoE) architectures (like Mixtral 8x7B or Qwen1.5-MoE) have become highly popular because they scale up a model's capacity without a proportional increase in computational cost during inference—only a few "experts" are activated per token. However, storing all these experts requires immense GPU memory, making deployment in resource-constrained environments difficult.

Existing solutions fall short:

  1. Expert Pruning: Completely removing non-essential experts often leads to an irreversible loss of learned representations and requires expensive fine-tuning to recover performance.
  2. Existing Expert Merging: Prior attempts to combine experts rely heavily on router logits or activation frequencies to determine similarity. The authors show that these metrics are highly dependent on specific datasets and tasks, leading to poor generalization when the model encounters new domains.

Methods

HC-SMoE introduces a two-phase, retraining-free framework consisting of expert grouping followed by expert merging:

  1. Expert Outputs as a Similarity Metric: Instead of looking at where the router prefers to send tokens (router logits), HC-SMoE computes the average output vector of each expert over a small calibration dataset. This directly captures the intrinsic mathematical transformation performed by each expert, serving as a robust proxy for functional similarity.
  2. Agglomerative Hierarchical Clustering (HC): Using the expert output vectors, the method applies bottom-up hierarchical clustering with average linkage. Unlike K-means, which is highly sensitive to random centroid initialization and can get trapped in local minima, HC is entirely deterministic and stable.
  3. Frequency-Weighted Merging: Once clusters of functionally similar experts are identified, they are combined in the weight space. The merging weights are proportional to how frequently each expert was selected by the router on the calibration dataset, ensuring dominant experts retain their influence.
Figure 3. Comparison of expert pruning and merging strategies.

Datasets

  • Calibration Datasets: The primary calibration dataset used to collect expert statistics is sampled from the C4 corpus. To prove the method's task-agnostic nature, the authors also test domain-specific calibration sets: MATH and CodeQA.
  • Evaluation Benchmarks: Models are evaluated using the EleutherAI Language Model Evaluation Harness across eight zero-shot tasks: ARC-Challenge, ARC-Easy, BoolQ, HellaSwag, MMLU, OpenBookQA, RTE, and Winogrande.
  • Domain-Specific Evaluation: The framework is additionally validated on MedMCQA, a challenging medical question-answering dataset.

Key Insights and Ideas

  • Outputs Over Logits: Router logits reflect input-dependent assignment preferences rather than the actual transformations an expert performs. Mapping similarity via expert outputs provides a task-agnostic view of what the experts actually "know."
  • The K-Means Trap: High-dimensional expert spaces cause K-means clustering to be highly unstable. Shifting from a fixed to a random initialization in K-means led to a massive 12.96% drop in average accuracy in some tests, highlighting why a deterministic approach like Hierarchical Clustering is essential.
  • Information Preservation: Merging experts acts as a safety net compared to pruning. Even if an expert is rarely used, completely deleting it (pruning) can catastrophically destroy niche capabilities, whereas merging absorbs its parameters into a combined expert.

Key Results

The authors evaluated HC-SMoE on state-of-the-art models including Qwen1.5-MoE-A2.7B-Chat and Mixtral 8x7B.

  • Superiority Over Baselines: As shown in Figure 1, HC-SMoE consistently outperforms existing pruning (O-prune, S-prune, F-prune) and merging (M-SMoE) baselines at 25%, 37.5%, and 50% parameter reduction rates.
  • Minimal Performance Drop: At a 25% expert reduction rate, both Qwen and Mixtral retain their capabilities, exhibiting an average performance gap of less than 3% compared to their unpruned counterparts. On certain tasks (like Mixtral 6x7B on BoolQ), the merged model actually surpassed the original unpruned model by reducing expert redundancy.
  • Extreme Compression: Even at a 50% expert reduction on Qwen, HC-SMoE outperforms the best baseline (F-prune) by a substantial margin of 7.46%.
Figure 1. Effectiveness of expert parameter reduction approaches on Qwen1.5-MoE-A2.7B-Chat (Team, 2024). Average accuracy across 8 LM-Harness benchmarks demonstrates HC-SMoE’s supe- rior performance over existing retraining-free pruning and merging baselines at 25%, 37.5%, and 50% expert parameter reduction rates. ⋆indicates the original unpruned Qwen model performance.

Limitations and Future Work

  • Unrealized Router Latency Benefits: While HC-SMoE successfully reduces the model's memory footprint (saving parameters), it retains the original router weights to prevent accuracy degradation. Consequently, the router still computes routing scores across the original number of channels, meaning the ideal computational speedups from a smaller router are not fully realized.
  • Challenges with Soft Clustering: The authors experimented with soft clustering (Fuzzy C-Means), allowing experts to belong to multiple clusters. However, this introduced severe interference and noise into the router weights, causing significant performance degradation. Developing a more sophisticated routing mechanism that can handle soft-clustered experts remains an open area for future research.

Summary updated

BibTeX
@inproceedings{chen2025retraining,
  author = {I-Chun Chen and Hsu-Shen Liu and Wei-Fang Sun and Chen-Hao Chao and Yen-Chang Hsu and Chun-Yi Lee},
  title = {{Retraining-Free Merging of Sparse MoE via Hierarchical Clustering}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=hslOzRxzXL},
}
Figure