The Mixture-of-Experts (MoE) model uses a set of expert networks that specialize on subsets of a dataset under the supervision of a gating network. A common issue in MoE architectures is ``expert collapse'' where overlapping class boundaries in the raw input feature space cause multiple experts to learn redundant representations, thus forcing the gating network into rigid routing to compensate. We propose an enhanced MoE architecture that utilizes a feature extractor network optimized using Soft Nearest Neighbor Loss (SNNL) prior to feeding input features to the gating and expert networks. By pre-conditioning the latent space to minimize distances among class-similar data points, we resolve structural expert collapse which results to experts learning highly orthogonal weights. We employ Expert Specialization Entropy and Pairwise Embedding Similarity to quantify this dynamic. We evaluate our experimental approach across four benchmark image classification datasets (MNIST, FashionMNIST, CIFAR10, and CIFAR100), and we show our SNNL-augmented MoE models demonstrate structurally diverse experts which allow the gating network to adopt a more flexible routing strategy. This paradigm significantly improves classification accuracy on the FashionMNIST, CIFAR10, and CIFAR100 datasets.
Figures & tables
Figure 1. Architecture of the CNN-based Feature Extractor. This module computes disentangled representations that are subsequently routed to the MoE gating network and experts.
Figure 2. The mixture-of-experts model is a system of experts and gating networks where each expert become a function of a subset of the input environment. These expert networks receive the same inputs and produce the same number of outputs. The gating network also receives the same input as the expert networks, but its output is the probability of choosing a particular expert on a given input.
Figure 3. We optimize the soft nearest neighbor loss over the hidden layers found in the feature extractor network before the MoE model. In doing so, the input features to the expert and gating networks are transformed to a set of representations with the classification information ingrained in them, thereby helping improve the overall classification performance of the MoE model.
ACC (MEAN (SD) in %)
SIM (MEAN (SD) in x100)
ENT (MEAN (SD) in x100)
Dataset
Baseline
Experimental
Baseline
Experimental
Baseline
Experimental
MNIST
99.36 (0.03) *
99.25 (0.08)
0.03 (0.03)
0.04 (0.06)
0.58 (0.06)
1.94 (0.14)
FMNIST
91.33 (0.13)
91.61 (0.23) *
0.03 (0.07)
-0.01 (0.05)
16.82 (10.88)
16.00 (11.03)
CIFAR10
70.91 (1.09)
71.23 (0.91) (ns)
0.05 (0.11)
0.03 (0.06)
14.00 (15.28)
15.01 (15.52)
CIFAR100
35.75 (1.64)
36.74 (1.59) *
0.20 (0.24)
0.10 (0.15)
43.92 (26.88)
45.74 (26.60)
Table 1. Classification Accuracy (ACC), Embedding Similarity (SIM), and Routing Entropy (ENT) across Baseline and Experimental MoE models. Values represent MEAN (SD). Asterisks (*) denote statistical significance at p<0.05 via Wilcoxon signed-rank test; (ns) denotes not significant.
Figure 4. Pairwise cosine similarity between expert weight matrices on CIFAR10. (Left) The Baseline shows distinct patches of redundancy (e.g. between Expert 0 and 3). (Right) The SNNL condition visibly suppresses these redundancies, thus forcing experts to learn highly distinct and orthogonal features.
Figure 5. Distribution of Test Accuracy and Routing Entropy across random seeds. (Top/CIFAR100) SNNL provides a robust, highly stable boost to both accuracy and entropy, elevating the entire interquartile range. (Bottom/CIFAR10) While median entropy slightly increases, the wider variance and overlapping accuracy boxes explain the non-significant accuracy gain on this intermediate dataset.
Figure 6. UMAP projection of the latent feature space immediately prior to the MoE gating network on CIFAR10. (Left) The baseline feature extractor produces highly entangled class boundaries. (Right) The SNNL-regularized feature extractor minimizes intra-class distance, producing dense and homogeneous class clusters.
Figure 7. The effect of the SNNL weight ( α ) on the pairwise embedding similarity of the experts. The dashed regression line shows a negative correlation, indicating that stronger SNNL penalties actively suppress expert redundancy.
Mixture of Experts (MoE) models route inputs to specialized subnetworks, aiming to scale capacity and adapt computation without activating every parameter.
Sparse Mixture-of-Experts (SMoE) models improve scalability by routing input tokens to only a subset of expert networks, but they often suffer from representation collapse, in which multiple experts converge toward similar functions and lose their intended diversity. Prior work has addressed this limitation either by improving router architectures or by introducing auxiliary loss terms that implicitly penalize similarity among experts. However, router-based approaches remain vulnerable to routing collapses, and loss-based approaches can conflict with the task's original objective during optimization. In this work, we propose GaP-MoE (Gradient Accumulation and Projection in MoE), which induces expert specialization by directly manipulating expert output gradients rather than modifying the loss function. At each training step, GaP-MoE stochastically selects one of the TopK routed experts as a leader based on normalized routing scores, and projects the gradients of the remaining follower experts onto the orthogonal complement of the subspace spanned by the leader's recent gradients. This removes directional overlap between expert gradients without altering the task loss, allowing specialization to emerge as a direct consequence of the optimization dynamics rather than an externally imposed constraint. We evaluate GaP-MoE in both fine-tuning settings (BERT-based, on GLUE) and from-scratch pretraining settings (GPT-2-based, on WikiText-103, enwik8, and text8), and further confirm its compatibility as a drop-in module for existing SMoE architectures. Experimental results show that GaP-MoE achieves performance comparable to or better than standard SMoE.
Donghyun Jeong, Yoon-Yeong Kim
Department of Statistics and Data Science University of Seoul Republic of Korea · Department of Statistics University of Seoul Republic of Korea
Sparse Mixture-of-Experts (MoE) architectures route each token through a subset of experts at each layer independently. We propose viewing MoE computation through the lens of expert paths -- the sequence of expert selections a token makes across all layers. This perspective reveals that, despite NL possible paths for N experts across L layers, tokens in practice cluster into a small fraction of paths that align with linguistic function, yet the vast majority of paths remain unexplored, representing a statistical inefficiency. This motivates architectures that constrain the effective path space to amplify this natural concentration. As one instantiation, we introduce \pathmoe{}, which shares router parameters across blocks of consecutive layers. Analysis confirms that \pathmoe{} amplifies the emergent path structure: it produces more concentrated path clusters, better cross-layer consistency, and greater robustness to routing perturbations. Experiments on 0.9B and 16B parameter \pathmoe{} models demonstrate consistent improvements on perplexity and downstream tasks over independent routing, while eliminating the need for auxiliary losses. These results establish expert paths as a useful design axis for MoE architectures, complementary to existing work on independent routing mechanisms.
Mixture-of-experts (MoE) models have become an important approach for scaling model parameters. Modern MoE architectures increasingly combine two design choices: fine-grained expert segmentation and shared experts. The former increases expressiveness by enabling more expert combinations at a fixed activation ratio, and the latter introduces experts that are active for every token. We identify an exploration dilemma between these designs: shared experts can make routing less exploratory by reducing the variability of token representations. This conflicts with the greater need for exploration induced by fine-grained expert segmentation due to the combinatorially enlarged routing space. Consequently, the additional expressiveness offered by fine-grained segmentation may not be fully realized in practice. MirrorMoE is proposed to reconcile this exploration dilemma by shrinking the exploration space through token-adaptive suppression of unnecessary experts. MirrorMoE consistently improves performance across model scales.
Bingcong Li, Hao Ma, Michael Muehlebach +2
ETH Zurich · The University of Hong Kong · Max Planck Institute for Intelligent Systems +1