Training-Free Dynamic Upcycling of Expert Language Models

Eros Fanì, Oguzhan Ersoy

TL;DR

This paper introduces Dynamic Upcycling MoE (DUME), a novel method that creates a unified, multi-domain Mixture-of-Experts (MoE) model by reusing pre-trained dense language experts without requiring any additional training. DUME leverages a closed-form solution from ridge regression to initialize the MoE router, making it cost-efficient and scalable while achieving competitive or superior performance compared to existing methods.

What Problem Does This Paper Address?

Training large language models (LLMs) is incredibly expensive, and while they excel at general tasks, they often lack specialized domain expertise. Fine-tuning for specific domains can lead to overspecialization, and creating a single multi-domain expert is challenging due to conflicting objectives and catastrophic forgetting during multitask training. Existing approaches like Mixture-of-Experts (MoE) architectures can combine experts but still require costly multitask fine-tuning. This paper tackles the problem of efficiently creating a unified, multi-domain LLM that leverages existing specialized experts without incurring the expense of further training.

Methods

The core of DUME lies in its "training-free" approach to initializing the router in an MoE architecture. The process involves two main steps:

  1. MoErging: This step involves averaging the parameters of all layers in pre-trained dense experts except for the Multi-Layer Perceptron (MLP) layers. The MLP layers are then treated as individual experts within the MoE. This is based on the observation that MLP layers are often more domain-specific than other transformer layers.
  2. Ridge Regression Initialization: Instead of traditional fine-tuning for the router, DUME uses the closed-form solution of ridge regression. The paper explains how to extract statistics (XTX and XTY matrices) from the pre-trained dense experts' intermediate layers. These statistics are then used with ridge regression to directly compute the optimal weights for the MoE router. This bypasses the need for gradient-based optimization and backpropagation for router training. The method is designed to be embarrassingly parallel, allowing for efficient processing of data from different domains.

Datasets

The paper uses existing datasets for evaluation:

  • Causal Language Modeling (CLM): Experiments were conducted on five domains: Coding, Mathematics, Physics, History, and Philosophy. The models were trained on the M2D2 dataset.
  • Reasoning: For reasoning tasks, the paper utilized four domain-specific datasets:
  • HumanEval (Chen, 2021) for coding.
  • GSM8k (Cobbe et al., 2021) for mathematics.
  • M_ARC (Lai et al., 2023) for multilingual understanding.
  • IFEval (Zhou et al., 2023) for instruction following.

The paper also mentions using datasets for extracting ridge regression statistics in the DUME OOD (Out-of-Distribution) experiments, including Magicoder, DART-Math, Aya, and TULU-3 persona IF.

Key Insights and Ideas

  • Ridge Regression as a Router Initializer: The most significant insight is the successful application of ridge regression's closed-form solution to initialize MoE routers. This elegantly sidesteps the need for computationally expensive fine-tuning, offering a "training-free" approach.
  • Leveraging Existing Experts: DUME demonstrates that pre-trained dense experts can be effectively "upcycled" into a unified MoE model without losing their specialized capabilities or requiring further training.
  • Cost-Efficiency and Scalability: By eliminating the need for multitask fine-tuning, DUME drastically reduces computational costs and enables dynamic addition of experts without performance degradation.
  • Robustness to Domain Labels: While DUME uses domain labels during its initialization phase, it does not require them at inference time, making it more practical than methods like the "Oracle" baseline.
  • Surpassing Baselines Without Training: The method achieves competitive or superior performance compared to baselines like BTX (which requires fine-tuning) even without any additional training.

Key Results

  • CLM Performance: DUME retains up to 97.6% of the performance of a specialized dense expert in the causal language modeling setting.
  • Reasoning Performance: In reasoning tasks, DUME can surpass the performance of the best dense experts, achieving up to 102.1% of their performance.
  • Outperforming Baselines: DUME consistently outperforms baseline methods like random routing and BTX (without fine-tuning) in both CLM and reasoning experiments.
  • DUME+ Performance: Further fine-tuning (DUME+) leads to even better results, approaching or exceeding the Oracle baseline in many cases.
  • DUME OOD: The method shows robustness to shifts in data distribution, performing well even when ridge regression statistics are collected from different datasets than those used for evaluation.

Limitations and Future Work

  • Domain Labels for Training: While DUME doesn't require domain labels at inference, it does need them during the training dataset phase for initialization. This could be a limitation if training nodes only have access to domain-uniform partitions.
  • Larger Models and More Domains: The paper suggests exploring the applicability of DUME with more domains and larger models as a future direction.
  • Alternative Router Training: The authors mention that future work could explore alternative router training methods, such as multitask reinforcement learning, to potentially further improve performance.

Summary updated

BibTeX
@inproceedings{fani2026training,
  author = {Eros Fanì and Oguzhan Ersoy},
  title = {{Training-Free Dynamic Upcycling of Expert Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=SzaPAbJjWE},
}
Figure