Abstract
Large language models (LLMs) with the Mixture-of-Experts (MoE) architecture achieve high cost-efficiency by selectively activating a subset of parameters. Despite the inference efficiency of MoE LLMs, training extensive experts from scratch incurs substantial overhead. Reconstructing a dense LLM into an MoE LLM significantly reduces the training budget; however, existing reconstruction methods often overlook the diversity among experts, leading to potential redundancy. We introduce DIVE (Diversity-Enhanced reconstruction), a method based on the observation that LLMs exhibit notable diversity after being pruned on different calibration datasets. DIVE utilizes domain affinity mining, pruning-based expert reconstruction, and efficient retraining. By implementing DIVE on Llama-style LLMs, we demonstrate that it achieves high training efficiency with minimal accuracy trade-offs, outperforming existing pruning and MoE reconstruction methods.
Introduction
Dense LLMs, where every parameter is activated for every token, are computationally expensive and slow to deploy at scale. The Mixture-of-Experts (MoE) architecture offers a solution by activating only a small subset of parameters (experts) per token. While efficient during inference, training MoE models from scratch is notoriously expensive and often unstable.
To mitigate these costs, researchers have explored "reconstructing" existing dense models into MoE versions. Common techniques, such as "up-cycling" (duplicating layers) or random splitting, often result in homogeneous experts. When experts are nearly identical, the model suffers from redundancy and fails to realize the specialization benefits inherent to the MoE architecture. DIVE addresses this by extracting diverse, specialized experts from a pre-trained dense model without requiring a massive retraining budget.
The DIVE Framework
DIVE operates through a three-phase pipeline designed to maximize expert diversity and minimize training overhead.
1. Domain Affinity Mining
The framework begins with the observation that structured pruning on different "calibration" datasets uncovers inherent domain-specific expertise. By analyzing how a dense model (e.g., Llama-2) performs when pruned using various datasets, the researchers used hierarchical clustering to group 24 diverse datasets into $N$ distinct domains, such as Mathematics, Logic, and General Science.
2. Pruning-based Expert Reconstruction
Rather than simply duplicating the Feed-Forward Network (FFN), DIVE prunes the original dense FFN $N$ times—once for each identified domain cluster. These $N$ pruned versions serve as the initial experts in the new MoE layer. This ensures that each expert begins the training process with a unique "specialization" based on its specific pruning history, effectively carving out different functional sub-networks from the same dense weights.
3. Efficient Retraining
To integrate these diverse experts and the newly initialized routers, DIVE employs a two-stage retraining approach:
- Dense Training: A small volume of data is used to train the routers (the gating mechanisms) while keeping all experts active. This "dense" phase aligns the routing logic before the model transitions to sparse activation.
- Sparse Training: The model is fine-tuned using Low-Rank Adaptation (LoRA) on a larger dataset (e.g., 5B tokens). During this phase, only the experts and normalization layers are updated while the rest of the model remains frozen, utilizing less than 1% of the total parameters.
Experimental Setup
Datasets
- Calibration: 24 datasets including C4, GSM8K, MathQA, SQuAD2, MNLI, and WikiText2 were used for domain mining.
- Retraining: The models were retrained on the SlimPajama corpus.
- Evaluation: Performance was measured using WikiText2 and LAMBADA for language modeling, alongside 11 downstream tasks including SciQ, PIQA, ARC-e/c, and MMLU.
Implementation
The researchers implemented DIVE on Llama-style architectures, specifically TinyLlama-1.1B and Llama2-7B, to test the framework's scalability across different parameter counts.
Key Results and Insights
Superior Efficiency and Performance
DIVE 1/8 (activating 1 out of 8 experts) significantly outperformed standard pruning techniques like FLAP and existing MoE reconstruction methods like LLaMA-MoE. On the LAMBADA dataset, DIVE 1/8 reduced perplexity by 8.38 compared to the next best reconstruction method.
In downstream tasks, DIVE 1/8 achieved the highest average performance among models with 50% sparsity. Notably, it improved accuracy on the BoolQ benchmark by 3.55% compared to the original dense model, suggesting that the MoE structure can occasionally provide better regularization or specialization than the dense original.
The Importance of Diversity
The core innovation of DIVE is treating structured pruning as a mechanism for specialization. Existing "up-cycling" methods start with identical experts, which often leads to a "lazy" router that fails to distinguish between experts. By starting with experts that are already functionally different, DIVE forces the router to learn effective token allocation from the start of training.
Training Speed
DIVE demonstrated remarkable training efficiency; a DIVE 1/8 model trained on just 1B tokens surpassed the performance of competing methods trained on 5B tokens. This represents a 5x improvement in data efficiency for the reconstruction process.
Conclusion and Future Work
DIVE provides a robust framework for transforming dense LLMs into efficient MoE architectures by leveraging pruning-induced diversity. By treating pruning as a tool for specialization rather than just compression, DIVE achieves state-of-the-art performance with minimal training costs.
Future research directions include scaling DIVE to much larger models (e.g., 70B+ parameters), expanding the breadth of calibration domains to include more niche fields like legal or medical text, and exploring more complex routing mechanisms beyond simple linear layers to further optimize token-to-expert allocation.
Summary updated