---
title: 'Default MoE: Efficient Sparse Routing'
url: https://www.emergentmind.com/topics/default-moe-method
type: topic
---

# Default MoE: Efficient Sparse Routing

A Default MoE method is an approach to training sparse Mixture-of-Experts (MoE) models in which a feedforward router assigns each input token to a subset of experts, leveraging a sparsely-gated computation for improved efficiency. The term "Default MoE" has a specific technical meaning indicating a dense backpropagation regime where missing expert activations in the backward pass are substituted with running averages ("default outputs") of each expert’s past outputs. This strategy addresses key challenges in conventional Top-K MoE routing, notably sparse router gradients, load imbalance, and training instability, by supplying the router network with dense gradient feedback from all experts using approximated outputs, while maintaining sparse forward computation [2504.12463].

## 1. Default MoE Architecture and Standard Routing

In a typical sparse MoE layer, input tokens $x \in \mathbb{R}^d$ are routed to $K$ out of $N$ experts by a router parameterized by matrix $W \in \mathbb{R}^{N \times d}$:
- The router produces logits $\pi = \mathrm{Softmax}(Wx) \in \mathbb{R}^N$.
- The $K$ experts with largest $\pi_i$ are selected (index set $A = \mathrm{TopK}(\pi)$).
- The MoE output is a weighted mixture of selected expert responses: $y = \sum_{i \in A} \pi_i E_i(x)$.

Standard Top-K routing schemes activate only a few experts per token. Experts not selected for an input token do not participate in either the forward or backward pass for that token. In the backward pass, only the $K$ selected experts' outputs provide gradient signals to the router, resulting in a sparse gradient $\frac{\partial y}{\partial \pi}$ with zeros for all inactive experts. This sparse feedback causes slow or unstable router learning, load imbalance (where few experts may dominate), and can yield suboptimal convergence [2504.12463, 2401.13920, 2505.22323].

## 2. Dense Backpropagation via Default Outputs

Default MoE approximates a dense gradient for router parameters without increasing forward pass cost. It maintains, for each expert $i$, a "default" output $\hat{E}_i^{(t)}$, an exponential moving average (EMA) of observed outputs over training. For each training step $t$:
\[
\hat{E}_i^{(t)} = \beta \, \hat{E}_i^{(t-1)} + (1-\beta) \, \overline{E_i(x)}
\]
where $\overline{E_i(x)}$ is the batch average over tokens routed to expert $i$, and $\beta$ is the EMA decay (e.g., $0.9$ for $N=8$).

The forward output per token is constructed as:
\[
y = \sum_{i = 1}^N \pi_i \cdot o_i, \quad o_i =
\begin{cases}
E_i(x), & \text{if } i \in A \\
\hat{E}_i^{(t)}, & \text{if } i \notin A
\end{cases}
\]

For the backward pass, $\frac{\partial y}{\partial \pi_i}$ is given by:
\[
\frac{\partial y}{\partial \pi_i} =
\begin{cases}
E_i(x), & i \in A \\
\hat{E}_i^{(t)}, & i \notin A
\end{cases}
\]
This supplies the router with dense gradient signals from all $N$ experts, approximating the full soft-gating gradient at minimal additional cost [2504.12463].

## 3. Algorithmic Implementation and Overhead

The Default MoE algorithm proceeds as follows:

```python
# Inputs: token x, router W, EMAs {Ĕ_i}, decay β, K
Forward(x):
    π = Softmax(W x)          
    A = indices of top K in π 
    for i in A:
        o_i = E_i(x)                  # compute expert outputs
        accumulate sum_E[i] += o_i, count[i] += 1
    for i = 1...N:
        if i not in A:
            o_i = Ĕ_i                 # use default for unactivated
    y = sum(π_i * o_i for i in 1...N) # aggregate
    for i in A:
        avg_i = sum_E[i] / count[i]
        Ĕ_i <- β * Ĕ_i + (1-β) * avg_i # EMA update
    store π, o_i for backward; return y

Backward(∂ℒ/∂y):
    for i = 1...N:
        grad_pi[i] = o_i if i in A else Ĕ_i
    ∂ℒ/∂W = (∂ℒ/∂y) · grad_pi · ∂π/∂W
```
Memory overhead is $O(Nd)$ for EMAs, amounting to $<0.05\%$ of model parameters for $d=1024$, and runtime impact is negligible ($\leq 2\%$ overhead for 2B models, falling to $\sim0\%$ for larger models) [2504.12463].

## 4. Key Hyperparameters and Ablations

Critical hyperparameters include:
- $N$: Number of experts (e.g., $8$ or $32$).
- $K$: Experts activated per token ($1$–$4$).
- EMA decay $\beta$: For $N=8$, $\beta=0.9$ is typical. For $N=32$, optimal $\beta$ depends on $K$ ($0.65$–$0.999$).
- Learning rate: Default MoE is stable at $9 \times 10^{-4}$; TopK requires smaller values.
- Auxiliary load balancing loss weight: $0.01$.

Ablations indicate Default MoE outperforms TopK routing across all tested model sizes (hidden dims $512$–$2048$, parameters $0.56$B–$7.3$B) and expert configurations. Benefits are greatest at lower sparsity. EMA initialization at zero outperforms random. Using default outputs $\hat{E}_i$ in both forward and backward passes yields lower perplexity than restricting defaults to gradients. The approach scales well, with practical memory and computational costs [2504.12463].

## 5. Comparative Results and Specialization

Empirically, Default MoE achieves improvements in training stability and model quality. On a $2$B-parameter MoE ($N=8$, $K=1$, $d_\text{hidden}=1024$, $320$B tokens trained), Default MoE increases final benchmark scores from $42.2$ (TopK) to $43.4$ (+2.8%), reaches target perplexity ($\mathrm{PPL}\approx12.18$) with $9\%$ fewer tokens, enables stable training with higher learning rates, and outperforms architectures such as SparseMixer in early and mid training [2504.12463].

The introduction of dense, approximated router gradients in Default MoE leads to faster convergence, improved load balance, and avoidance of expert collapse. Default MoE retains the hardware and computational efficiency of sparse MoE, while addressing deficiencies of pure Top-K gating [2504.12463].

## 6. Relation to Auxiliary Losses and Recent Developments

The default MoE method is orthogonal to loss-level strategies addressing expert collapse and specialization:
- Standard MoE methods employ an auxiliary load-balancing loss, $\mathcal{L}_{aux}$, that penalizes imbalance in expert assignment rates $f_j$ and routing weights $p_j$, enforcing $f_j \approx 1/n$, $p_j \approx N/n$.
- Recent work augments the default method with orthogonality loss $\mathcal{L}_o$ (to diversify expert outputs) and variance loss $\mathcal{L}_v$ (to increase per-expert routing-score variance), further improving specialization and downstream performance by up to 23.79% relative to classic baselines [2505.22323].

The Default MoE mechanism relates primarily to routing and gradient flow, while loss-level approaches manipulate training objectives directly. Both lines of development target improved expert utilization and adaptive, discriminative routing, but via distinct mechanisms—dense proxy gradients vs. direct regularization [2504.12463, 2505.22323].

## 7. Limitations and Future Directions

Default MoE's approximation depends on the quality of EMA default outputs. Poorly tuned $\beta$ or pathological routing dynamics may impair the informativeness of default vectors, suggesting further research on adaptive EMA strategies. The approach does not directly address distributed communication bottlenecks or expert locality, which remain active areas of optimization (e.g., as in LocMoE [2401.13920]). Nevertheless, by supplying dense router gradients while preserving sparse computation, Default MoE constitutes a robust enhancement to standard Top-K MoE methodology, with demonstrated benefits for training large-scale sparse models [2504.12463].

Source: https://www.emergentmind.com/topics/default-moe-method