HyperAIHyperAI

Command Palette

Search for a command to run...

aaai 2026

모자이크 프루닝: 혼합 전문가 모델의 일반화 가능한 프루닝을 위한 계층적 프레임워크

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

초록

희소 혼합 전문가(SMoE) 아키텍처는 추론 중 전체 파라미터의 일부만 활성화하여 우수한 성능을 제공함으로써 대규모 언어 모델(LLM) 확장의 새로운 지평을 열었습니다. 그러나 모든 전문가를 메모리에 로드해야 하므로 상당한 정적 메모리 오버헤드가 발생하여 실제 배포가 심각하게 저해됩니다. 기존의 사후 훈련 프루닝 방법은 모델 크기를 줄이지만, 종종 단일한 일반 목적 코퍼스에서 프루닝 기준을 도출합니다. 이로 인해 프루닝된 모델을 다른 도메인에 적용할 때 치명적인 성능 저하가 발생하고, 각 새 도메인에 대해 비용이 많이 드는 재프루닝이 필요하게 되는 중요한 한계가 있습니다. 이러한 일반화 격차를 해결하기 위해 우리는 모자이크 프루닝(MoP)을 소개합니다. MoP의 핵심 아이디어는 구조화된 '클러스터링 후 선택' 프로세스를 통해 기능적으로 포괄적인 전문가 집합을 구성하는 것입니다. 이 프로세스는 다양한 작업 도메인에서 전문가 성능을 포착하는 유사성 메트릭을 활용하여 전문가를 기능적으로 클러스터링하고, 제안된 활성화 변동성 점수(Activation Variability Score)를 기반으로 각 클러스터에서 가장 대표적인 전문가를 선택합니다. 단일 코퍼스에 최적화하는 방법과 달리, 제안된 모자이크 프루닝은 프루닝된 모델이 원래 모델의 기능을 완전한 그림으로 함께 구성하는 모자이크 타일처럼 기능적으로 상호 보완적인 전문가 집합을 유지하여 다양한 하위 작업을 처리할 수 있도록 보장합니다. 다양한 MoE 모델에 대한 광범위한 실험은 우리 접근 방식의 우수성을 입증합니다. MoP는 이전 연구를 크게 능가하여 일반 작업에서 7.24%, 수학 추론 및 코드 생성과 같은 특수 작업에서 8.92%의 향상을 달성했습니다.

One-sentence Summary

Researchers from Xi'an Jiaotong University and China Telecom's TeleAI introduce Mosaic Pruning (MoP), a hierarchical cluster-then-select framework that leverages an Activation Variability Score and cross-domain expert similarity to retain functionally complementary experts and mitigate the generalization gap inherent in single-corpus pruning, achieving 7.24%7.24\%7.24% higher performance on general tasks and 8.92%8.92\%8.92% on specialized tasks such as math reasoning and code generation.

Key Contributions

  • The paper introduces Mosaic Pruning (MoP), a post-training pruning framework for Sparse Mixture-of-Experts (SMoE) models that employs a hierarchical "cluster-then-select" process to retain a diverse, functionally complementary set of experts rather than optimizing for a single calibration corpus.

  • The method groups experts by a similarity metric that captures performance across different task domains, then selects the most representative expert from each cluster using a proposed Activation Variability Score, which preserves specialist capabilities across diverse downstream tasks.

  • Extensive experiments across multiple MoE model families demonstrate that MoP outperforms existing pruning baselines, achieving a 7.24% average improvement on general tasks and an 8.92% gain on specialized tasks such as mathematical reasoning and code generation.

Introduction

Mixture-of-Experts (MoE) models such as Mixtral 8x7B activate only a subset of their parameters during inference, delivering stronger performance than larger dense models like Llama 2 70B while keeping computational cost per token low. Yet their practical deployment is limited by massive static memory footprints (over 80GB for Mixtral) and by redundancy among experts, since many experts are functionally similar or contribute little to most tasks. Prior post-training pruning, exemplified by Enumeration Pruning, removes experts that contribute least to token reconstruction loss on generic corpora, but this fails to generalize to specialized domains, causing a "functional collapse" on tasks such as mathematical reasoning and code generation because generalist experts are retained while domain-specialist experts are discarded. To address this, the authors introduce Global Variability-aware Pruning (GVP), which scores each expert with an Activation Variability Score derived from KL divergence, and then propose Mosaic Pruning (MoP), a hierarchical cluster-then-select framework that groups experts by a Task Performance Similarity matrix and keeps the most critical representative within each group based on the diversity score. This preserves a functionally comprehensive set of experts and provides a strong inductive bias toward cross-task generalization; experiments on Mixtral-8x7B and Qwen1.5-MoE-A2.7B demonstrate average improvements of 7.24% on general tasks and 8.92% on specialized tasks.

Dataset

Dataset Composition and Sources

The authors evaluate their method using two calibration dataset sources and a structured set of evaluation benchmarks across multiple capability domains.

Calibration Datasets

  • The main baseline, Enumeration Pruning, uses a calibration dataset sourced from the general-purpose C4 corpus.
  • The proposed GVP and MoP methods rely on a mixed-diversity calibration dataset, designed to improve functional clustering. The exact composition of this dataset is described in a referenced section of the paper.

Evaluation Benchmark Subsets

  • General capability assessment: seven standard benchmarks, including ARC-c/e, BoolQ, HellaSwag, MMLU, Open-BookQA, and WinoGrande.
  • Mathematical reasoning: GSM8K and MATH.
  • Code generation: HumanEval and MBPP.
  • Expert diversity validation: six distinct domain-specific test sets, namely Math-GSM8K (math), Code-HumanEval (code), Commonsense-PIQA (commonsense reasoning), Summarization-XSum (summarization), Science-ARC-C (science), and Logic-MNLI (logic).

How the Data Is Used

  • The calibration data is used exclusively for the pruning process, with different sources assigned to different methods: C4 for Enumeration Pruning, and the mixed-diversity set for GVP and MoP.
  • The evaluation benchmarks are used to assess model performance after pruning, covering general capability, specialized skills, and expert diversity.
  • Models are tested on two open-source MoE architectures: Mixtral-8x7B-Instruct (47B parameters, 8 experts per layer) and Qwen1.5-MoE-A2.7B-Chat (14.3B parameters, 60 experts per layer), allowing the authors to evaluate robustness and scalability across very different expert counts.
  • All experiments run on a server equipped with four NVIDIA A100 80G GPUs.

Processing and Construction Details

  • The mixed-diversity calibration dataset is constructed to support functional clustering, though the paper does not detail its exact filtering rules or schema in the provided text.
  • The benchmark samples for expert diversity validation are drawn from six distinct domains, each represented by a single task type per domain, ensuring broad coverage for diversity checks.
  • No cropping strategy or additional metadata construction is described in the supplied material; the pipeline centers on calibration data selection and benchmark evaluation only.

Method

The authors propose a hierarchical expert pruning framework designed to balance model performance and functional diversity. The methodology progresses through three distinct stages: an initial baseline approach, an intermediate variability-aware strategy, and a final hierarchical clustering-based solution. Refer to the framework diagram for a conceptual overview of these strategies.

The baseline strategy, Enumeration Pruning (Enu), focuses on minimizing the perturbation to the model's output upon expert removal. It searches a calibration dataset to find an optimal subset of experts that minimizes the output reconstruction loss. The optimization problem is formally expressed as:

Ekept∗=arg⁡min⁡Ekept⊂E,∣Ekept∣=rLrecon(Dcache,Ekept)\mathcal{E}_{\text{kept}}^* = \underset{\mathcal{E}_{\text{kept}} \subset \mathcal{E}, |\mathcal{E}_{\text{kept}}| = r}{\arg \min} \mathcal{L}_{\text{recon}}(\mathcal{D}_{\text{cache}}, \mathcal{E}_{\text{kept}})Ekept∗​=Ekept​⊂E,∣Ekept​∣=rargmin​Lrecon​(Dcache​,Ekept​)

where Lrecon\mathcal{L}_{\text{recon}}Lrecon​ quantifies the cumulative difference between the outputs of the original unpruned Mixture of Experts (MoE) layer and the pruned layer. While effective for models with a small number of experts, exhaustive enumeration becomes computationally infeasible for larger configurations. In such cases, a greedy strategy is employed to iteratively remove the expert contributing least to the reconstruction loss increase. However, this approach tends to preserve functionally generalist experts at the expense of specialists crucial for downstream tasks.

To address the over-reliance on reconstruction loss in Enu, the authors introduce Global Variability-aware Pruning (GVP). This method prioritizes functional specialists using a unified variability metric. The core metric is the Activation Variability Score (SvarS_{\text{var}}Svar​), which quantifies an expert's functional specialization by calculating the Kullback-Leibler divergence between its normalized activation distribution and a uniform distribution over all tokens:

Svar(i)=∑t=1Ntotalpt,iZilog⁡2(pt,iZiNtotal)S_{\text{var}}(i) = \sum_{t=1}^{N_{\text{total}}} \frac{p_{t,i}}{Z_i} \log_2 \left( \frac{p_{t,i}}{Z_i} N_{\text{total}} \right)Svar​(i)=t=1∑Ntotal​​Zi​pt,i​​log2​(Zi​pt,i​​Ntotal​)

A high SvarS_{\text{var}}Svar​ score indicates a concentrated activation pattern, suggesting the expert is a functional specialist. The GVP strategy operates in two stages. First, it retains a core set of general experts (Egeneral\mathcal{E}_{\text{general}}Egeneral​) by minimizing reconstruction loss to ensure baseline performance. Second, from the remaining candidate pool, it selects the most specialized experts based on the global ranking of SvarS_{\text{var}}Svar​ scores. Despite its improvements, GVP's global ranking can retain functionally similar yet highly specialized experts, leading to redundancy.

To fundamentally address the redundancy issue in GVP, the authors propose Mosaic Pruning (MoP), a hierarchical framework that systematically preserves expert functional diversity. The first stage of MoP mirrors GVP by retaining a shared expert set to secure baseline performance. The core innovation lies in the second stage, which replaces GVP’s simple global ranking with a structured cluster-then-select process based on functional similarity. Refer to the workflow diagram for a detailed visualization of this process.

The MoP pipeline begins with data-driven domain discovery. A mixed-diversity calibration dataset is utilized to evaluate expert performance across different functional domains. The authors apply K-Means clustering to the input hidden states of all tokens to partition the token embeddings into semantically coherent domains, minimizing the Within-Cluster Sum of Squares (WCSS):

min⁡C∑k=1K∑xt∈Ck∥xt−μk∥22\min_{\mathcal{C}} \sum_{k=1}^{K} \sum_{\mathbf{x}_t \in C_k} \|\mathbf{x}_t - \boldsymbol{\mu}_k\|_2^2Cmin​k=1∑K​xt​∈Ck​∑​∥xt​−μk​∥22​

where μk\boldsymbol{\mu}_kμk​ is the centroid of the kkk-th cluster. The number of clusters KKK is set to match the number of experts to be selected, creating a one-to-one mapping between discovered functional clusters and experts.

Next, a similarity matrix is constructed to evaluate expert functional similarity. For each pair of experts in the candidate pool, the authors compute a similarity score based on their performance across the discovered domains. Spearman’s rank correlation coefficient is chosen as the core metric because it is nonparametric, robust to outliers, and captures monotonic relationships in expert performance. The performance vector viperf\mathbf{v}_i^{\text{perf}}viperf​ for an expert iii is constructed using its average reconstruction error in each domain. The Spearman correlation ρ\rhoρ between the rank-transformed performance vectors of two experts iii and jjj is calculated, and the final performance similarity score is normalized to the interval [0,1][0, 1][0,1]:

Sperf(i,j)=12(1+ρ(Ri,Rj))S_{\text{perf}}(i, j) = \frac{1}{2} \left( 1 + \rho(\mathbf{R}_i, \mathbf{R}_j) \right)Sperf​(i,j)=21​(1+ρ(Ri​,Rj​))

Agglomerative hierarchical clustering is then applied to group experts. The similarity matrix is converted into a distance matrix, and Ward’s linkage method is used to iteratively merge the closest pairs of clusters. The merge cost is defined as the increase in the total Error Sum of Squares (ESS) resulting from the merger:

Δ(ESS(Ca,Cb))=∣Ca∣∣Cb∣∣Ca∣+∣Cb∣∥μa−μb∥22\Delta(\text{ESS}(C_a, C_b)) = \frac{|C_a||C_b|}{|C_a| + |C_b|} \|\boldsymbol{\mu}_a - \boldsymbol{\mu}_b\|_2^2Δ(ESS(Ca​,Cb​))=∣Ca​∣+∣Cb​∣∣Ca​∣∣Cb​∣​∥μa​−μb​∥22​

This process continues until the candidate pool is partitioned into the target number of clusters.

Finally, intra-cluster representative selection is performed. The Activation Variability Score (SvarS_{\text{var}}Svar​) is used to identify the most specialized expert within each functional cluster. For each cluster GkG_kGk​, the representative expert ek∗e_k^*ek∗​ is chosen as:

ek∗=arg⁡max⁡i∈GkSvar(i)e_k^* = \underset{i \in G_k}{\arg \max} S_{\text{var}}(i)ek∗​=i∈Gk​argmax​Svar​(i)

The resulting set of representatives forms a group of experts that are both individually specialized and functionally complementary, effectively mitigating redundancy while maintaining diverse capabilities.

Experiment

The experiments were conducted on Mixtral-8x7B and Qwen1.5-MoE across general, mathematical, coding, and multi-domain benchmarks. MoP consistently outperformed all baselines across pruning rates and models, showing that preserving functional diversity enables more robust model compression while also delivering memory savings and faster inference. Ablation studies confirmed that each component contributes progressively, and MoP remains superior even when the calibration dataset is held equal. Activation analysis revealed that MoP retains clear domain specialization, whereas enumeration-based pruning causes functional homogenization, and on specialized math and code tasks the pruned model preserves complex reasoning abilities far better than existing methods.

Mosaic Pruning (MoP) consistently outperforms baseline pruning methods such as Enumeration, Random, and Frequency pruning across all expert retention rates and benchmarks, with an average improvement of 7.24% over Enumeration Pruning. The method preserves functional diversity among experts, leading to robust compression. It also achieves significant deployment efficiency gains, including memory savings and an average inference speedup of 1.20×. MoP achieves the highest average scores at both 6 and 4 experts per layer compared to all baselines. Performance gaps widen at higher pruning rates, with MoP retaining much stronger average accuracy than Frequency or Random pruning. The method's advantage is attributed to preserving expert functional diversity, preventing the functional homogenization seen in baseline methods.

An ablation study across two models shows progressive performance gains when moving from Enumeration Pruning to GVP to MoP, with MoP achieving the best average scores in both cases. Even when Enumeration Pruning is recalibrated on the same mixed-diversity dataset as MoP, MoP still outperforms it on all benchmarks. MoP achieves the highest average accuracy on both Mixtral and Qwen among all pruning methods. Using the same mixed calibration dataset, MoP surpasses Enumeration Pruning (Mixed) across every evaluated benchmark. Performance improves progressively from Enumeration Pruning to GVP to MoP, confirming the contribution of each component.

Mosaic Pruning (MoP) reduces the number of expert modules in MoE models, leading to substantial memory savings and faster inference. Across both Mixtral and Qwen architectures, pruning fewer experts yields meaningful speedups, with an average inference speedup of 1.20x. The method achieves these efficiency gains while preserving model performance. Removing expert modules significantly lowers peak memory usage across both models. Inference speed increases consistently as experts are pruned, with speedups ranging from 1.12x to 1.52x. MoP achieves an average 1.20x speedup due to fewer experts and reduced inter-device communication overhead.

MoP consistently outperforms Enumeration Pruning on GSM8K across both models and expert counts, with particularly large gains at higher pruning rates. On the MATH benchmark, improvements are less uniform: MoP achieves substantial gains for Qwen at high pruning, but results for Mixtral are mixed. The overall pattern supports that MoP preserves functional diversity and avoids the functional collapse seen in existing pruning methods. MoP yields large accuracy improvements over Enumeration Pruning on GSM8K, especially when pruning Mixtral down to fewer experts. On MATH, MoP shows a strong advantage for Qwen at higher pruning rates, while Mixtral results are more mixed. Across all specialized benchmarks, MoP averages an 8.92% performance gain over Enumeration Pruning, reflecting better preservation of expert specialization.

On code generation benchmarks with zero-shot evaluation, the MoP pruning method consistently outperforms Enumeration Pruning across both Mixtral and Qwen models at various expert retention levels. The performance gap is especially pronounced at higher pruning rates, where Enumeration Pruning collapses to near-zero scores while MoP retains meaningful capability. MoP preserves substantially higher HumanEval and MBPP scores than Enumeration Pruning at the same expert counts, particularly for Mixtral with 4 experts retained. Enumeration Pruning shows severe functional collapse at aggressive pruning rates, with HumanEval scores dropping below 2 points on both models. At a moderate pruning level for Qwen (50 experts), MoP achieves a HumanEval score over 10 times higher than Enumeration Pruning, while MBPP gains are smaller but still positive.

Mosaic Pruning (MoP) consistently outperforms baseline pruning methods across benchmarks, models, and expert retention rates by preserving functional diversity among experts, which prevents the functional collapse seen in baselines. Ablation studies confirm that each component contributes progressively, with MoP surpassing even recalibrated Enumeration Pruning on mixed-diversity datasets. Beyond accuracy, MoP yields meaningful deployment gains, including memory savings and an average 1.20x inference speedup. On specialized tasks like GSM8K, MATH, and code generation, MoP retains substantially higher performance at aggressive pruning rates where baselines often collapse.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp