Trade-offs in Ensembling, Merging and Routing Among Parameter-Efficient Experts

Sanae Lotfi, Lucas Caccia, Alessandro Sordoni, Jordan T. Ash, Miroslav Dudik

TL;DR

Fusing specialized LoRA experts is a powerful way to achieve multi-task learning without retraining, but how should we combine them? This paper systematically evaluates the trade-offs between ensembling, merging, and routing, finding that input-dependent routing optimized via SGD delivers the best task-agnostic performance, nearly matching an omniscient oracle while avoiding the massive inference overhead of ensembling.

What Problem Does This Paper Address?

With repositories like Hugging Face hosting over a million fine-tuned models, a major opportunity has emerged: can we combine these specialized "experts" (specifically lightweight LoRA adapters) to create a single, powerful multi-task model?

The catch is that at inference time, we usually don't know which task an input belongs to (a task-agnostic setting). This paper tackles the design space of model fusion—specifically comparing ensembling (aggregating model outputs), merging (fusing weights statically), and routing (integrating weights dynamically per input). The authors aim to understand the fundamental trade-offs between these strategies and determine whether the added complexity of routing is justified by its performance gains.

Methods

The authors formalize and compare three core paradigms for integrating a library of LoRA adapters:

  1. Ensembling: Computes $N$ forward passes (one for each expert) and averages the output token probabilities. They test both uniform weights and weights optimized via Stochastic Gradient Descent (SGD), as well as a distilled single-model variant.
  2. Merging: Statically averages the LoRA matrices ($A$ and $B$) directly in parameter space, requiring only a single forward pass at inference. They explore uniform merging and SGD-optimized merging (both global and layer-dependent).
  3. Routing: Dynamically computes merging coefficients based on the input sequence, acting as an input-dependent parameter-space mixture of experts. They evaluate an end-to-end SGD-optimized router.

To mitigate the parameter overhead introduced by routing over large pools of models, they also investigate expert selection and reduction techniques, such as Model-Based Clustering (MBC) and Hierarchical Clustering (HC).

Figure 1: Model fusion of parameter-efficient experts for task-agnostic multi-task learning. (a): We use a publicly available library of LoRA experts, each fine-tuned independently on Flan v2 tasks from the same Phi-2 pretrained LLM (Ostapenko et al., 2024). These experts provide a diverse foundation for multi-task learning. (b): Comparison of three model fusion approaches and their trade-offs. Ensembling aggregates outputs from the independent experts at inference. Merging fuses expert weights into a single model via parameter averaging. Routing extends merging by making the weight combination input-dependent, adapting to each input dynamically.

Datasets

The experiments leverage a library of 256 LoRA experts fine-tuned from a Phi-2 (2.8B) base model on diverse tasks from the Flan v2 dataset. To make extensive evaluations computationally feasible, the authors primarily compress these into 10 cluster-based experts using Model-Based Clustering (MBC), while still evaluating final generalization performance across the test sets of all 256 tasks.

Key Insights and Ideas

  • Mode Connectivity is Nuanced: While models fine-tuned from the same initialization appear linearly connected globally (showing low loss on a mixed dataset), they lack task-specific mode connectivity. This explains why static merging underperforms ensembling—it cannot dynamically adapt to individual task demands in parameter space.
  • Global Over Layer-Specific Merging: When optimizing merging weights via SGD, enforcing the same weights across all layers (global) unexpectedly outperforms letting them vary per layer. This suggests that maintaining cross-layer consistency outweighs structural flexibility.
  • Low-Rank Merging Suffices: Merging LoRA factors ($A$ and $B$) directly in their low-rank subspace performs just as well as reconstructing full-rank weight updates ($W = AB$), saving massive computational and memory overhead.
  • Routing is the Sweet Spot: Because routing allows input-dependent adaptation, it bypasses the limitations of mode connectivity without requiring the $N$ forward passes that make ensembling prohibitively expensive at inference time.

Key Results

  • Routing Wins: SGD-optimized routing achieved the lowest average multi-task loss (0.75) among all non-oracle methods, closely approaching the Oracle baseline (0.66), which has perfect knowledge of task IDs.
  • Ensembling is Strong but Costly: SGD-optimized ensembling (0.91) and uniform ensembling (0.99) both outperformed all static merging techniques, confirming that output-space aggregation remains a highly reliable baseline if you can afford the inference cost.
  • Merging Struggles Statically: Uniform merging (1.31) and SGD-optimized global merging (1.26) performed poorly compared to ensembling, though they still vastly outperformed a single shared expert trained on all tasks simultaneously (2.62).
  • Expert Refactoring Works: The authors found that 30% of experts do not even rank first on their own training tasks. Greedily selecting a subset showed that using just 150 of the 256 experts is sufficient to completely recover full private oracle routing performance.
Figure 2: Performance of different model fusion approaches for multi-task learning. We evaluate the average multi-task test loss across 256 Flan v2 tasks for various ensembling, merging, and routing strategies, reporting the standard error across all tasks. Ensembling methods include uniform output averaging, as well as learned ensembling coefficients through stochastic gradient descent (SGD) optimization and knowledge distillation into a single model. Merging strategies involve parameter-space fusion via uniform averaging and SGD optimization of the fusion coefficients, where the learned coefficients can be either globally shared across all layers (Global SGD) or layer-specific. Routing strategies include layer-dependent routing optimization via SGD, hierarchical clustering (HC), and an optimized version of HC initialized with Arrow weights (Arrow HC). Our results indicate that ensembling outperforms merging, which may reflect limitations of the mode connectivity assumption. Routing, however, delivers the best performance among non-oracle methods. Notably, end-to-end SGD optimization consistently yields the best results across all model fusion approaches.

Limitations and Future Work

  • Routing Parameter Overhead: While routing saves inference compute compared to ensembling, learning input- and layer-dependent routing parameters introduces significant training complexity, as the routing model's parameters scale linearly with the number of experts.
  • Distillation Trade-offs: Knowledge distillation compresses an ensemble into a single model to eliminate inference overhead, but it requires a two-stage training process that effectively doubles the total optimization cost.
  • Lack of Sparsity: The current SGD routing mechanism evaluates contributions from all experts. The authors note that incorporating sparsity-inducing regularization during optimization is an important open direction to further reduce computational overhead.

Summary updated

BibTeX
@article{lotfi2026trade,
  author = {Sanae Lotfi and Lucas Caccia and Alessandro Sordoni and Jordan T. Ash and Miroslav Dudik},
  title = {{Trade-offs in Ensembling, Merging and Routing Among Parameter-Efficient Experts}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2026},
}
Figure