This research introduces HC-SMoE, a novel framework designed to shrink Sparse Mixture-of-Experts (SMoE) models by merging redundant experts. By utilizing hierarchical clustering based on actual expert outputs rather than routing decisions, the authors achieve significant parameter reduction (up to 50%) with minimal performance loss—all without requiring a single step of retraining.
TL;DR
HC-SMoE is a retraining-free framework that reduces the memory footprint of Large Language Models (LLMs) by merging functionally similar experts. By leveraging hierarchical clustering on expert outputs, it outperforms traditional pruning and merging methods, maintaining high accuracy even when model parameters are halved.
The Problem: The "VRAM Tax" of SMoEs
Sparse Mixture-of-Experts architectures, such as Mixtral 8x7B or Qwen-MoE, are highly popular because they offer the reasoning power of a massive model with the inference speed of a much smaller one. They achieve this by activating only a small subset of "experts" (specialized neural network layers) for any given token.
However, there is a catch: the "VRAM Tax." Even if a model only uses two experts at a time during inference, the system must still store all of them in memory. This makes deploying state-of-the-art SMoEs nearly impossible on consumer hardware or resource-constrained edge devices.
Existing solutions generally fall into two camps:
- Pruning: Deleting "unimportant" experts entirely. This often causes irreversible information loss.
- Merging: Combining similar experts. Previous merging methods often relied on "router logits" (which expert the model prefers to send data to) or raw weights, which fail to capture the actual functional similarity of the experts. Furthermore, many of these methods require expensive retraining or task-specific fine-tuning.
The HC-SMoE Method
The authors propose a three-step, task-agnostic pipeline to solve these inefficiencies:
- Expert Outputs as a Similarity Metric: Instead of looking at internal weights or the router's "opinion," the authors run a small calibration dataset (like C4) through the model and record the average output vector of each expert. If two experts produce similar outputs for the same inputs, they are deemed functionally redundant.
- Hierarchical Clustering (HC): Unlike K-means, which is sensitive to random initialization and assumes spherical clusters, HC is deterministic. It builds a "tree" (dendrogram) of experts, iteratively pairing the most similar ones using average linkage. This ensures that the resulting groups are cohesive and distinct.
- Frequency-Weighted Merging: Once experts are clustered, their weights are merged. Rather than a simple average, HC-SMoE uses a weighted average based on how frequently each expert was activated during calibration. This ensures the "knowledge" of the most active experts is heavily preserved.
Datasets and Evaluation
The researchers evaluated HC-SMoE across a wide range of benchmarks:
- Calibration: C4 (general text), MATH, and CodeQA were used to collect expert statistics.
- Zero-Shot Evaluation: Eight standard LM-Harness tasks, including ARC, BoolQ, HellaSwag, MMLU, OpenBookQA, RTE, and Winogrande.
- Models Tested: State-of-the-art architectures including Qwen1.5-MoE-A2.7B, Mixtral 8x7B, and DeepSeek-MoE-16B.
Key Insights
- Function > Preference: The core "aha moment" is that router logits are a poor proxy for expert similarity. A router might send different tokens to two experts, but those experts might perform nearly identical transformations. Merging based on outputs captures this hidden redundancy.
- Deterministic Stability: High-dimensional neural space is messy. The paper demonstrates that K-means often gets stuck in local minima, leading to inconsistent results. Hierarchical clustering provides a stable, theoretically grounded alternative.
- The Redundancy Buffer: The results suggest that current SMoEs have massive internal redundancy. In some cases (like the RTE task on Mixtral), merging experts actually improved performance, likely by reducing noise or over-specialization.
Key Results
- Superior Accuracy: On Qwen 1.5-MoE, HC-SMoE achieved a 6.95% improvement over the strongest pruning baseline at a 25% reduction rate.
- Resilience at Scale: Even at a 50% expert reduction (effectively halving the expert parameter count), HC-SMoE maintained an average accuracy gap of less than 8% compared to the original unpruned model, significantly outperforming all other retraining-free methods.
- Efficiency: The merging process is incredibly fast. For Mixtral 8x7B, the entire merging process completes in roughly 10 minutes on a single A100 GPU, compared to the hours or days required for retraining-based methods.
Limitations and Future Work
- Static Routers: HC-SMoE merges the experts but leaves the router network untouched. The router still "thinks" the original number of experts exists, which prevents some potential speedups in the routing layer itself.
- Soft Clustering Challenges: The authors experimented with "Soft Clustering" (allowing an expert to belong to multiple groups) but found it degraded performance due to interference in the router weights. Developing a more sophisticated way to handle router weights during merging is a key area for future research.
- Extreme Compression: While performance is excellent at 25-50% reduction, accuracy begins to drop sharply at 75% reduction, suggesting a hard floor for how much "knowledge" can be compressed without retraining.
Summary updated