Secret mixtures of experts inside your LLM

Enric Boix-Adsera
12/20/2025
cs.LGcs.AIstat.ML

No official code found. Best implementation: eboix/secret_moe (3 stars, last commit 2025-12-20).

Abstract

Despite being one of the earliest neural network layers, the Multilayer Perceptron (MLP) is arguably one of the least understood parts of the transformer architecture due to its dense computation and lack of easy visualization. This paper seeks to understand the MLP layers in dense LLM models by hypothesizing that these layers secretly approximately perform a sparse computation -- namely, that they can be well approximated by sparsely-activating Mixture of Experts (MoE) layers. Our hypothesis is based on a novel theoretical connection between MoE models and Sparse Autoencoder (SAE) structure in activation space. We empirically validate the hypothesis on pretrained LLMs, and demonstrate that the activation distribution matters -- these results do not hold for Gaussian data, but rather rely crucially on structure in the distribution of neural network activations. Our results shine light on a general principle at play in MLP layers inside LLMs, and give an explanation for the effectiveness of modern MoE-based transformers. Additionally, our experimental explorations suggest new directions for more efficient MoE architecture design based on low-rank routers.

View on arXivView PDF

Code Implementations(1)

eboix/secret_moeCommunity64%

Code for Secret mixtures of experts inside your LLM

30Python, Jupyter NotebookMay 25, 202510 months ago

Similar Papers

Cite this paper

@article{boixadsera2025secret,
  title  = {Secret mixtures of experts inside your LLM},
  author = {Enric Boix-Adsera},
  year   = {2025},
  eprint = {2512.18452},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.18452v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.18452.svg)](https://codeofpaper.com/paper/2512.18452)

Discussion