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

Sanae Lotfi, Lucas Caccia, Alessandro Sordoni, Jordan T. Ash, Miroslav Dudík

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).

Overview of ensembling, merging, and routing paradigms.

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.
Multi-task loss comparison across baselines, ensembling, merging, and routing.

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 Dudík},
  title = {{Trade-offs in Ensembling, Merging and Routing Among Parameter-Efficient Experts}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2026},
}
Figure