LD-MoLE: Learnable Dynamic Routing for Mixture of LoRA Experts

Yuan Zhuang, Yi Shen, Yuexin Bian, Qing Su, Shihao Ji, Yuanyuan Shi, Fei Miao

TL;DR

LD-MoLE introduces a fully differentiable, learnable, and dynamic routing mechanism for Mixture of LoRA Experts (MoLE). By replacing rigid TopK routing with a closed-form mathematical projection (Sparsegen), it allows large language models to adaptively allocate a variable number of experts per token and per layer, achieving state-of-the-art performance while guaranteeing that no token is left without an expert.

What Problem Does This Paper Address?

Combining Parameter-Efficient Fine-Tuning (PEFT)—like LoRA—with Mixture-of-Experts (MoE) architectures is a powerful strategy for adapting Large Language Models (LLMs) to downstream tasks without massive computational overhead. However, existing Mixture of LoRA Experts (MoLE) frameworks are held back by their routing strategies:

  1. Rigid TopK Routing: Traditional methods route every single token to a fixed number of experts ($K$). This requires tedious hyperparameter tuning and treats easy tokens (like punctuation) with the same computational weight as complex, information-heavy tokens. Furthermore, the TopK operation is non-differentiable, hindering end-to-end optimization.
  2. Unstable ReLU Routing: Recent alternatives use ReLU-based routers to achieve dynamic allocation, but they suffer from a "zero-activation" problem where some tokens are assigned to zero experts, leading to degenerate representations and broken gradient flows.

The authors ask: Can we design a routing mechanism that adaptively learns to allocate experts in a stable, controllable, and fully differentiable way?

Methods

The authors propose LD-MoLE (Learnable Dynamic Mixture of LoRA Experts), which relies on three core components:

  • Sparsegen Routing: Instead of Softmax followed by a hard TopK cut, LD-MoLE uses Sparsegen, a mathematical projection onto the probability simplex. This yields a sparse probability vector via a fully differentiable, closed-form solution. Crucially, it mathematically guarantees that at least one expert is activated for every token, eliminating the zero-activation flaw of ReLU routing.
  • Learnable Sparsity Factor ($\lambda$): To make the routing token-dependent, a lightweight Multi-Layer Perceptron (MLP)—shared across layers with the same dimensionality—predicts a token-specific sparsity parameter, $\lambda$. This parameter dynamically shifts the routing distribution between sparse (concentrated on a few experts) and uniform (spread across many experts) based on the token's context.
  • Analytical Sparsity Control Loss: The authors derive an exact mathematical range for $\lambda$ that corresponds to activating a specific number of experts. Using this, they introduce a regularized sparsity loss ($L_{sparse}$) that allows practitioners to explicitly penalize the model if it exceeds a target number of activated experts, offering direct control over computational efficiency.
Figure 2: (a) Standard TopK routing activates a fixed number (K) of experts using non-differentiable selection. (b) Sparsegen routing introduces a differentiable projection onto the probability simplex, controlled by a sparsity parameter λ, which enables adaptive expert selection. (c) In the Sparsegen routing module, for each token, a lightweight shared MLP predicts the sparsity factor λ. Together with the logits u, λ determines the probability simplex p over LoRA experts, enabling dynamic, token-dependent expert allocation across layers. The detailed mathematical formulation is provided in Section 3.1.

Datasets

The model was evaluated across a diverse suite of standard NLP and instruction-tuning benchmarks:

  • Reasoning & Knowledge: MMLU-Pro, ARC-Challenge, ARC-Easy, OpenBookQA, CommonsenseQA.
  • Sentence Completion & Commonsense: SWAG, HellaSWAG.
  • Sequence Classification (GLUE): CoLA (linguistic acceptability), RTE (textual entailment).

Key Insights and Ideas

  • Harder Tokens Get More Brainpower: The model naturally learns to allocate more experts to rare or complex tokens, while highly frequent or predictable tokens (like prompt formatting or common words) activate fewer experts. This achieves an intuitive form of token-level compute compression.
  • Layer-Wise Specialization: Expert allocation is inherently depth-dependent. The model naturally activates more experts in the lower layers of the network and tapers off in the deeper layers. Fixed routing strategies completely miss this depth-wise variance.
  • Controllable Compute-Performance Trade-off: Through the analytical sparsity loss, users can dial up the sparsity constraint to reduce effective FLOPs (floating-point operations) during inference, navigating a clean trade-off curve between speed and accuracy.

Key Results

The authors evaluated LD-MoLE against prominent baselines like MoLA (fixed TopK) and ReMoLE (dynamic ReLU) using Llama-3.1-8B, Llama-3.2-3B, and Qwen3-1.7B as base models.

Performance comparison across downstream tasks
  • Superior Accuracy: LD-MoLE achieved the highest average scores across all base models. For instance, on Llama-3.1-8B, it reached an average score of 85.18%, outperforming MoLA(8888) at 82.48% and ReMoLE at 84.47%.
  • Robustness to Task Types: While dynamic routing occasionally underperformed slightly on short sequence classification tasks (like RTE), it excelled significantly on reasoning-heavy benchmarks (ARC-E, SWAG, HellaSWAG), showing cross-model gains of over +3.5%.
  • Sparsity Regularization Success: Activating the sparsity control loss successfully reduced the average number of active experts (and thus FLOPs) with only marginal impacts on downstream task accuracy.

Limitations and Future Work

The primary limitation identified is the computational overhead of the router itself. Predicting $\lambda$ via the shared MLP introduces additional FLOPs before the LoRA experts are even evaluated. While the sparsity loss mitigates this by reducing the number of active experts downstream, the router itself remains an extra step.

For future work, the authors suggest exploring ways to bake the $\lambda$ generation directly into the gating projection matrix to eliminate the MLP overhead. They also aim to test LD-MoLE during the pre-training stages of LLMs and extend its application to multi-modal models.

Summary updated

BibTeX
@inproceedings{zhuang2026ld,
  author = {Yuan Zhuang and Yi Shen and Yuexin Bian and Qing Su and Shihao Ji and Yuanyuan Shi and Fei Miao},
  title = {{LD-MoLE: Learnable Dynamic Routing for Mixture of LoRA Experts}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=4ST2YyTjI7},
}
Figure