Papers
Topics
Authors
Recent
Search
2000 character limit reached

HS-MoE: Bayesian Sparse Expert Routing

Updated 21 January 2026
  • HS-MoE models integrate horseshoe priors with input-dependent gating to enforce data-adaptive sparsity in expert utilization.
  • A dedicated particle learning algorithm ensures efficient sequential inference by propagating only sufficient statistics for streaming data.
  • Empirical evaluations demonstrate competitive predictive accuracy with minimal active experts while providing robust uncertainty quantification.

Horseshoe Mixtures-of-Experts (HS-MoE) models constitute a Bayesian approach for sparse expert selection within mixture-of-experts (MoE) architectures, integrating the adaptive global-local shrinkage properties of the horseshoe prior with input-dependent gating. The principal motivation is to achieve data-adaptive sparsity in expert utilization, thereby enabling efficient and uncertainty-aware routing across a potentially large pool of experts. A dedicated particle learning algorithm enables sequential inference with memory and computational efficiency by propagating only sufficient statistics forward in time. The HS-MoE formulation is closely related to modern sparse MoE layers used in LLMs under strict sparsity constraints, differing crucially in its Bayesian treatment of uncertainty and sparsity control (Polson et al., 14 Jan 2026).

1. Model Specification and Priors

Given input xRdx \in \mathbb{R}^d and response yy, HS-MoE introduces KK experts, each parameterized by θj\theta_j and an input-dependent gating function gj(x;ϕ)g_j(x; \phi). The marginal predictive model is defined as:

p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)

where fjf_j represents the expert likelihood. Introducing a latent assignment z{1,,K}z \in \{1, \ldots, K\}, the generative process is:

  • zx,ϕCategorical(g1(x),,gK(x))z \mid x, \phi \sim \mathrm{Categorical}(g_1(x), \ldots, g_K(x))
  • yx,z=j,θjfj(yx;θj)y \mid x, z=j, \theta_j \sim f_j(y \mid x; \theta_j)

A canonical choice for yy0 is the Gaussian linear expert:

yy1

Sparsity induction—enabling only a subset of experts to be meaningfully used for a given input—leverages the horseshoe prior: yy2 yy3 denotes a half-Cauchy with scale yy4, and an analogous horseshoe prior can be imposed on gate weights yy5.

2. Input-Dependent Gating and Data-Adaptive Expert Sparsity

A common gate parameterization is the softmax function:

yy6

The horseshoe prior on each gating vector yy7 incorporates a local scale yy8 and a global scale yy9. The local-global structure ensures that while the global parameter KK0 sets the overall gate sparsity, local scales KK1 allow certain experts' gates to "escape" shrinkage and become active in specific data regions. This mechanism yields data-adaptive sparsity, with most KK2 near zero for any KK3, except for a small dynamically determined set of active experts.

3. Sequential Inference via Particle Learning

HS-MoE employs a particle learning (PL) algorithm, a sequential Monte Carlo method that propagates only sufficient statistics. For the Gaussian expert scenario, these sufficient statistics per expert KK4 are KK5, representing the Normal-inverse-gamma conjugate posterior parameters for KK6. For each gate stick (in logistic stick-breaking parameterization), sufficient statistics are KK7, yielding KK8.

The algorithm iteratively updates particle weights using predictive densities, resamples according to these weights, samples expert assignments KK9, and updates corresponding sufficient statistics with observations θj\theta_j0. Pólya–Gamma augmentation facilitates logistic gate updates. Refreshing horseshoe scales θj\theta_j1 can be optionally performed via Gibbs or slice sampling steps. This sequential inference framework is amenable to streaming data and is memory-efficient, requiring only the storage of particle-level sufficient statistics.

4. Computational and Statistical Considerations

HS-MoE’s global-local shrinkage effects allow adaptive expert selection. The global scale θj\theta_j2 controls the overall sparsity—smaller θj\theta_j3 causes most experts to collapse. The local scales θj\theta_j4 modulate whether individual experts are "enabled," facilitating expert sharing when θj\theta_j5 are large.

The particle learning algorithm offers per-timestep computational complexity of θj\theta_j6 for θj\theta_j7 particles, θj\theta_j8 experts, and θj\theta_j9-dimensional inputs, with rank-one Cholesky updates as the computational bottleneck. Unlike conventional batch MCMC, which has complexity gj(x;ϕ)g_j(x; \phi)0 (for gj(x;ϕ)g_j(x; \phi)1 data points and gj(x;ϕ)g_j(x; \phi)2 iterations), PL is streaming and maintains gj(x;ϕ)g_j(x; \phi)3 memory. Particle approximations converge to the true posterior as gj(x;ϕ)g_j(x; \phi)4 under classical results from interacting particle systems theory (Del Moral, Gordon et al.).

5. Relation to Modern Sparse MoE Layers in Neural Architectures

Sparse Transformer-MoE architectures (e.g., Shazeer et al., Switch-Transformer) typically employ hard top-gj(x;ϕ)g_j(x; \phi)5 routing by selecting the largest gj(x;ϕ)g_j(x; \phi)6 for each token in a sequence, resulting in a deterministic and fixed number of active experts per input. In contrast, HS-MoE replaces this procedure with a Bayesian router: horseshoe shrinkage on gj(x;ϕ)g_j(x; \phi)7 renders most logits negligible, yielding a soft top-gj(x;ϕ)g_j(x; \phi)8 effect. At deployment, gj(x;ϕ)g_j(x; \phi)9 experts with the largest posterior mean logits can be selected, but these logits reflect model uncertainty and adapt to streaming data.

The effective p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)0 in HS-MoE is data-driven, rather than fixed, and its Bayesian structure provides uncertainty quantification for expert assignment. This suggests safer expert routing in scenarios with domain shift or changing data regimes.

6. Empirical Validation

Empirical evaluation is illustrated on a synthetic Gaussian-linear regression task with p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)1 experts, of which only p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)2 are truly active. Using p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)3 samples, p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)4 features, and p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)5 particles, the experts are assigned Gaussian linear models with Normal-inverse-gamma priors and a softmax gate under the horseshoe prior (inactive gate bias p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)6, global p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)7).

A summary of the empirical findings is presented below:

Metric HS-MoE Value Baseline Comparison
True positive expert identification p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)8 n/a
False activation rate on inactive experts p(yx,Θ)=j=1Kgj(x;ϕ)fj(yx;θj)p(y \mid x, \Theta) = \sum_{j=1}^K g_j(x; \phi) \, f_j(y \mid x; \theta_j)9 n/a
Predictive log-likelihood gap within fjf_j0 nats/sample vs. oracle (oracle = 3 active)
Average experts used ("effective fjf_j1") fjf_j2 Soft MoE: fjf_j3 (fixed)

Estimated allocation frequencies accurately recover the three true active experts, with inactive experts’ frequencies shrunk to nearly zero. Predictive performance matches that of baselines using more experts on average, and HS-MoE yields well-calibrated routing probabilities. This suggests that HS-MoE provides both competitive predictive accuracy and a minimal effective number of experts, with the added benefit of uncertainty quantification (Polson et al., 14 Jan 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Horseshoe Mixtures-of-Experts (HS-MoE).