Abstract
In this work, we address the memory overhead of deploying Mixture-of-Experts (MoE) architectures in Large Language Models (LLMs). While MoE layers improve LLM performance without increasing inference costs, the ever-growing number of experts inflates memory requirements, hindering practical deployment. Our empirical study reveals that some experts encode redundant knowledge during pre-training. We thus propose a method of grouping and pruning similar experts to improve the model’s parameter efficiency. We validate the effectiveness of our method by pruning three state-of-the-art MoE architectures, including Mixtral, Deepseek-MoE, and Qwen. The evaluation shows that our method outperforms other model pruning methods on a range of natural language tasks.
Introduction
Mixture-of-Experts (MoE) architectures, exemplified by models such as Mixtral and DeepSeek, have become a cornerstone for scaling Large Language Models (LLMs). By routing tokens to a sparse subset of experts, these models increase parameter counts and performance without a proportional increase in inference compute. However, the massive parameter count translates directly to high memory overhead, making deployment on consumer hardware challenging. For instance, loading Mixtral-8x7B requires approximately 88 GB of VRAM.
Pruning experts is a natural solution to this memory bottleneck. While task-specific pruning can be effective, it requires fine-tuning data and limits the model's generalizability. Task-agnostic pruning is more desirable but significantly more difficult, as identifying redundant experts without task-specific cues often leads to substantial performance degradation. Traditional methods, such as dropping the least-frequently used experts, often fail to preserve the model's broad capabilities.
Methodology
We propose a two-stage, task-agnostic pruning pipeline designed to identify and merge redundant experts while preserving their collective knowledge. The core of our approach lies in measuring expert similarity using Centered Kernel Alignment (CKA).
We introduce two strategies for similarity discovery:
- Data-Centric Strategy: This method utilizes a small calibration dataset (e.g., 128-512 samples from C4). Experts process these inputs independently of the router, and CKA is computed on their output embeddings to identify functional similarity.
- Model-Centric Strategy: This approach relies solely on the experts' weight matrices. By comparing weight structures directly, we can identify experts that have developed similar internal representations during training.
Once similar experts are grouped, we perform a weight-space merge (e.g., uniform averaging). Critically, we also merge the corresponding routing weights. This ensures that the router continues to direct tokens to the appropriate knowledge base, now represented by a more efficient, merged expert.
Experimental Results
Our method was evaluated across several state-of-the-art architectures, including Mixtral-8x7B, DeepSeek-MoE-16B, and Mixtral-8x22B, using standard benchmarks like MMLU and BoolQ.
On Mixtral-8x7B, reducing the expert count from 8 to 6 per layer using our data-centric method yielded an average task score of 62.4%, significantly outperforming the enumeration-based baseline (59.9%). This pruning resulted in a 1.17x inference speedup and a 16.8% reduction in GPU memory usage. For DeepSeek-MoE-16B, our method maintained high performance even when pruning one-third of the experts, outperforming the next best baseline by 2.6% on the MMLU benchmark. Interestingly, the model-centric approach proved particularly robust for larger models like Mixtral-8x22B, where it avoided potential overfitting to small calibration sets.
Conclusion
Our findings demonstrate that MoE models naturally develop redundant expert knowledge during pre-training. By merging rather than simply dropping these redundant experts, we can significantly reduce the memory footprint and inference latency of LLMs with minimal impact on performance. Future research will focus on dynamic, layer-wise pruning rates, as our analysis indicates that redundancy is not uniform across the model's depth.
Summary updated