Mosaic Pruning: A Hierarchical Framework for Generalizable Pruning of Mixture-of-Experts Models

Wentao Hu, Mingkuan Zhao, Shuangyong Song, Xiaoyan Zhu, Xin Lai, Jiayin Wang

TL;DR

This paper introduces Mosaic Pruning (MoP), a novel hierarchical pruning framework for Mixture-of-Experts (MoE) models. MoP addresses the critical issue of performance degradation on specialized tasks after pruning by preserving functional diversity among experts, leading to significant improvements in both general and specialized downstream tasks.

What Problem Does This Paper Address?

Mixture-of-Experts (MoE) models have become a popular architecture for scaling Large Language Models (LLMs) due to their ability to achieve high performance with reduced computational cost per token. However, a major practical hurdle is the substantial static memory overhead, as all experts must be loaded into memory even if only a fraction are used during inference. Existing pruning methods aim to reduce this overhead by removing redundant experts. The core problem this paper tackles is that current post-training pruning techniques, which typically optimize for performance on a single, general-purpose dataset, often lead to a "functional collapse." This means the pruned model performs poorly on specialized downstream tasks (like math reasoning or code generation) because the pruning process inadvertently discards "specialist" experts that are crucial for these domains, favoring more "generalist" experts. This necessitates costly re-pruning for each new domain, limiting the practical applicability of pruned MoE models.

Methods

Mosaic Pruning (MoP) is a two-stage hierarchical framework designed to preserve functional diversity.

  1. Data-Driven Domain Discovery & Expert Clustering: MoP first uses a specially constructed "mixed-diversity" calibration dataset to reveal latent functional domains within the data. It then applies K-Means clustering to partition token embeddings into these domains. Subsequently, it constructs a similarity matrix between experts based on their performance across these discovered domains. This similarity is measured using Spearman's rank correlation coefficient on expert performance vectors (specifically, reconstruction error across domains). This allows for the functional clustering of experts using Agglomerative Hierarchical Clustering with Ward's linkage, grouping experts with similar performance profiles.
  2. Intra-Cluster Representative Selection: After clustering, MoP selects a single representative expert from each cluster. This selection is guided by the Activation Variability Score (Svar), a metric that quantifies an expert's specialization by measuring the KL divergence between its activation distribution and a uniform distribution. This ensures that within each functional group, the most specialized expert is retained, creating a functionally complementary set of experts.

This "cluster-then-select" approach contrasts with previous methods that either rely solely on reconstruction loss (Enumeration Pruning) or global variability scores (Global Variability-aware Pruning, GVP), which can still lead to redundancy or loss of specialization.

Datasets

The paper utilizes several datasets for their experiments:

  • Calibration Datasets:
    • C4 Corpus: Used by the baseline Enumeration Pruning method.
  • Mixed-Diversity Calibration Dataset: A custom dataset introduced by the authors to facilitate the discovery of functional domains and expert clustering. This dataset is crucial for MoP's domain discovery stage.
  • Evaluation Benchmarks:
    • General Capability: ARC-c/e, BoolQ, HellaSwag, MMLU, Open-BookQA, WinoGrande.
  • Specialized Tasks: * Mathematical Reasoning: GSM8K, MATH.
  • Code Generation: HumanEval, MBPP.
  • Expert Diversity Validation: Test samples from six distinct domains (Math-GSM8K, Code-HumanEval, Commonsense-PIQA, Summarization-XSum, Science-ARC-C, Logic-MNLI).

Key Insights and Ideas

  • Functional Collapse is a Real Problem: The paper clearly demonstrates that pruning methods optimizing for a single general corpus can lead to a significant drop in performance on specialized tasks, a phenomenon they term "functional collapse." This is because specialist experts are often discarded.
  • Diversity is Key to Generalization: The core insight is that a pruned MoE model's generalization capability hinges on the breadth of its functional diversity. MoP aims to preserve this diversity by ensuring that the retained experts collectively cover a wide range of specialized skills.
  • Hierarchical Pruning for Structure: The "cluster-then-select" hierarchical approach is crucial. Clustering based on performance similarity first groups experts, preventing the selection of redundant specialists. Then, selecting the most variable expert within each cluster ensures specialization is maintained.
  • Domain Discovery is Essential: The use of a mixed-diversity dataset and K-Means clustering to discover latent functional domains is a novel step that allows MoP to tailor its pruning to the underlying structure of expert specializations.
  • Spearman Correlation for Similarity: Using Spearman's rank correlation coefficient to measure expert similarity is a robust choice, as it captures monotonic relationships in performance across domains without making assumptions about data distribution and is less sensitive to outliers.

Key Results

  • Performance Improvement: MoP consistently outperforms baseline methods (Enumeration Pruning, Random Pruning, Frequency Pruning).
  • General Tasks: Achieved an average performance improvement of 7.24% over Enumeration Pruning.
  • Specialized Tasks: Achieved a more significant average performance improvement of 8.92% on mathematical reasoning and code generation tasks.
  • Memory and Speed: As a structured pruning method, MoP significantly reduces memory usage and improves inference speed. For example, for Mixtral, MoP achieved a speedup of 1.52x and reduced memory from 87.87GB to 45.87GB (when pruning to 4 experts).
  • Expert Diversity: Heatmaps of expert activation weights (Figure 3) visually confirm that MoP preserves domain specialization, with different experts activating for different tasks, unlike Enumeration Pruning which leads to homogenization.

Limitations and Future Work

  • Calibration Dataset: The effectiveness of MoP relies on the quality and diversity of the calibration dataset used for domain discovery and similarity calculation. The paper introduces a "mixed-diversity" dataset, but its optimal construction for various MoE architectures and tasks might require further investigation.
  • Computational Cost of Pruning: While MoP significantly improves deployment efficiency, the pruning process itself, particularly the similarity matrix construction and hierarchical clustering, can be computationally intensive, especially for models with a very large number of experts.
  • Future Work: The authors suggest that their work establishes a "prune once, deploy efficiently across diverse tasks" paradigm. Future work could explore more automated or adaptive methods for creating the mixed-diversity calibration dataset and further optimize the computational efficiency of the pruning process. Investigating the theoretical underpinnings of why this hierarchical approach leads to such robust generalization could also be a fruitful direction.

Summary updated

BibTeX
@inproceedings{hu2026mosaic,
  author = {Wentao Hu and Mingkuan Zhao and Shuangyong Song and Xiaoyan Zhu and Xin Lai and Jiayin Wang},
  title = {{Mosaic Pruning: A Hierarchical Framework for Generalizable Pruning of Mixture-of-Experts Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i26.39341},
}

Loading related content...

Figure