Understanding the Mixture-of-Experts with Nadaraya-Watson Kernel

Chuanyang Zheng, Jiankai Sun, Yihang Gao, Enze Xie, Yuehao Wang, Peihao Wang, Ting Xu, Matthew Chang, Liliang Ren, Jingyao Li, Jing Xiong, Kashif Rasul, Mac Schwager, Anderson Schneider, Zhangyang Wang, Yuriy Nevmyvaka · DOI

Abstract

Mixture-of-Experts (MoE) models have become essential for scaling Large Language Models (LLMs) efficiently. However, the standard Softmax-based routing mechanism often leads to gradient vanishing and suboptimal expert utilization. This paper identifies a mathematical equivalence between MoE routing and classical Nadaraya-Watson (NW) kernel regression. Leveraging this insight, we propose KERN (Kernel Inspired Router with Normalization), which replaces Softmax with $\ell_2$-normalization and ReLU activation. KERN achieves superior validation loss and training stability across various model scales and expert granularities with zero additional computational cost.

Introduction

Mixture-of-Experts (MoE) architectures allow models like Mixtral and DeepSeek to scale parameter counts significantly without a proportional increase in compute cost. This is achieved by using a "router" to dispatch tokens to a subset of specialized expert sub-networks. For decades, the Softmax function has been the default choice for these routers. However, Softmax is prone to "gradient starvation," where experts with low initial weights stop receiving updates, leading to poor utilization. This research explores a more mathematically grounded approach to routing by reframing MoE through the lens of classical statistics.

Theoretical Framework: MoE as Nadaraya-Watson Regression

The authors demonstrate that MoE routing is mathematically equivalent to Nadaraya-Watson (NW) regression, a non-parametric method for estimating values based on the similarity (kernel) between inputs. In this framework:

  1. Feed-Forward Networks (FFNs) can be viewed as parametric NW estimators.
  2. MoE Routers act as the kernel weight calculators, while the experts function as the values being aggregated.

By treating the router as a standard component of a neural network rather than a specialized probability generator, we can apply modern architectural best practices to improve routing efficiency.

The KERN Router

Based on the NW regression insight, the authors introduce KERN (Kernel Inspired Router with Normalization). KERN discards the exponential Softmax function in favor of a more robust pipeline:

  • Linear Projection: Maps inputs to expert scores.
  • $\ell_2$-Normalization: Ensures the output scale remains invariant to the number of experts, preventing exploding or vanishing signals in large-scale models.
  • ReLU Activation: Induces natural sparsity by zeroing out negative scores without the gradient-killing effects of exponential squashing.
  • Learnable Global Scaler ($\gamma$): A single parameter that controls the overall magnitude of routing weights.

Experimental Results

KERN was evaluated against standard routers (Softmax, Sigmoid, Tanh) and a Dense baseline across multiple datasets, including Arxiv and Books3.

Validation loss comparison across Arxiv and Books3 datasets at different sequence lengths. KERN consistently achieves the lowest loss across all configurations.

As shown in the experimental data, KERN consistently outperformed all other routing mechanisms. For instance, on the Books3 dataset (125M active parameters), KERN achieved a validation loss of 3.3080, significantly lower than Softmax (3.3882) and Sigmoid (3.3206). Crucially, the performance gap between KERN and traditional routers widened as model scale increased, demonstrating superior scalability.

Robustness to Expert Granularity

A key trend in modern MoE design (e.g., DeepSeek-V3) is high granularity—using a large number of smaller experts. Traditional Softmax routers often struggle in these settings due to the difficulty of tuning the distribution across hundreds of experts. KERN’s $\ell_2$-normalization ensures constant variance regardless of expert count, making it exceptionally robust to changes in granularity.

Performance of KERN vs. Softmax across different expert granularities. KERN maintains stable and superior performance as the number of experts increases.

Conclusion

By bridging the gap between classical kernel regression and modern MoE architectures, KERN provides a principled alternative to Softmax routing. It eliminates gradient starvation, improves scaling behavior, and handles high-granularity expert configurations with zero additional training or inference overhead. Future work will explore KERN's performance in specialized domains like long-context retrieval and complex code generation.

Summary updated

BibTeX
@inproceedings{zheng2026understanding,
  author = {Chuanyang Zheng and Jiankai Sun and Yihang Gao and Enze Xie and Yuehao Wang and Peihao Wang and Ting Xu and Matthew Chang and Liliang Ren and Jingyao Li and Jing Xiong and Kashif Rasul and Mac Schwager and Anderson Schneider and Zhangyang Wang and Yuriy Nevmyvaka},
  title = {{Understanding the Mixture-of-Experts with Nadaraya-Watson Kernel}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=NdDlqHV1md},
}
Figure