Mixture of experts (MoE) is a sparse neural network architecture in which a learned router sends each input to a small subset of parallel "expert" subnetworks and merges their outputs, so a model's total parameter count grows without a proportional rise in per-token compute. In Transformer language models the technique typically replaces the dense feed-forward layer with a bank of experts of which only a few fire per token, giving the now-standard distinction between total and active parameters.4 The concept dates to Jacobs, Jordan, Nowlan, and Hinton's 1991 adaptive mixtures of local experts,1 and the sparsely-gated MoE layer to Shazeer et al. in 2017;4 after Mistral AI's Mixtral 8x7B (2023) and DeepSeek's fine-grained DeepSeekMoE (2024), it became the default architecture of large open-weight and, where disclosed, frontier closed models.1011
Role in the network
Each MoE layer replaces the position-wise feed-forward sublayer of a Transformer block: the router reads the token's hidden state, the chosen experts, usually identical feed-forward networks, transform it, and the merged result passes to the next layer. Self-attention is usually left dense, though some designs sparsify attention or interleave dense and MoE feed-forward layers, as Llama 4 does.
Dense Transformers apply every parameter to every token, so capacity, training cost, and serving cost rise together. The scaling-laws literature established that loss falls predictably with parameters and data, creating pressure to grow parameter counts past any dense inference budget; Chinchilla-style compute-optimal analysis sharpened the trade-off rather than removing it. Conditional computation breaks the coupling: capacity can scale roughly with memory rather than with floating-point operations. Shazeer et al. framed the 2017 layer explicitly as a route to model sizes dense training could not afford, demonstrating 137 billion parameters at small per-token cost.4
The economics follow directly: DeepSeek-V3 holds 671 billion parameters but activates about 37 billion per token, so its per-token compute resembles a mid-sized dense model while its capacity resembles a very large one.14 Since throughput deployments amortize the full parameter set across concurrent requests, MoE favors large-batch API serving over single-user local use; the same logic suits multilingual and multi-domain corpora, whose slices different experts can absorb without interference.5
The mathematics
An MoE layer holds \(N\) expert networks \(E_1, \dots, E_N\) and a lightweight router, a linear map from the token's hidden state \(x \in \mathbb{R}^{d_{\text{model}}}\) to one score per expert:
$$h(x) = x W_r$$The layer dispatches the token to the \(k\) highest-scoring experts, normalizes just those scores with a softmax, and returns the weighted sum of the selected outputs:
$$G_i(x) = \begin{cases} \dfrac{\exp(h_i(x))}{\sum_{j \in T(x)} \exp(h_j(x))}, & i \in T(x) \\ 0, & i \notin T(x) \end{cases}$$ $$y = \sum_{i \in T(x)} G_i(x)\, E_i(x)$$| Symbol | Shape | Meaning |
|---|---|---|
| \(x\) | \(d_{\text{model}}\) | token hidden state |
| \(W_r\) | \(d_{\text{model}} \times N\) | router weights, one column per expert |
| \(h(x)\) | \(N\) | router logits |
| \(T(x)\) | set of \(k\) indices | top-\(k\) experts, \(\operatorname{TopK}(h(x), k)\) |
| \(G_i(x)\) | scalar | gate weight; the selected weights sum to 1 |
| \(E_i\) | \(d_{\text{model}} \to d_{\text{model}}\) | expert network, usually a feed-forward block |
| \(y\) | \(d_{\text{model}}\) | layer output |
A dense mixture instead softmaxes over all \(N\) scores and averages every expert on every token, adding capacity but saving no compute; the sparsely-gated top-\(k\) form is what decouples parameter count from per-token compute.30 Deployed configurations range from top-2 of 8 (Mixtral) through 8 of 128 (Qwen3) and 8 of 256 plus a shared expert (DeepSeek-V3) to 4 of 256 (Trinity Large) and 16 of 896 (Kimi K3).10142122
Router and experts train jointly, so an untended system collapses: a few experts attract most tokens, improve fastest, and attract still more. The standard countermeasure since the 2017 layer is an auxiliary loss that rewards uniform dispatch across each batch, variants of which remained standard into the early 2020s;4 in the Switch Transformer form,
$$L_{\text{aux}} = N \sum_{i=1}^{N} f_i \, P_i$$with \(f_i\) the fraction of batch tokens routed to expert \(i\) and \(P_i\) the mean router probability for expert \(i\) across the batch. Minimized at \(L_{\text{aux}} = 1\) when \(f_i = P_i = 1/N\) for all \(i\), it was introduced by Shazeer et al. as two such losses and reduced to one by Switch Transformer.27
Efficient execution batches each expert's tokens into a fixed-size buffer of
$$C = c \, \frac{kB}{N}$$token slots, where \(B\) is the batch size and \(c \geq 1\) the capacity factor. GShard introduced this capacity-factor discipline;5 tokens overflowing a popular expert's buffer may be dropped, passing through the residual stream unprocessed.
Worked example: routing one token
Take \(d_{\text{model}} = 2\), \(N = 4\) experts, \(k = 2\), and \(x = (1, 0)\), so \(h(x)\) is the first row of \(W_r\); take that row to be \((2.0, 1.0, 0.5, -1.0)\). The top-2 experts are 1 and 2; their exponentials \(e^{2.0} = 7.389\) and \(e^{1.0} = 2.718\) sum to \(10.107\), so
$$G_1 = \frac{7.389}{10.107} = 0.731, \qquad G_2 = \frac{2.718}{10.107} = 0.269$$Treating the experts as scalars, \(E_i(x) = i\), the output is
$$y = 0.731 \times 1 + 0.269 \times 2 = 0.731 + 0.538 = 1.269$$computed with two expert evaluations instead of the dense four.
Worked example: load balancing and capacity
Take \(B = 8\) tokens, \(N = 4\) experts, \(k = 1\), dispatch counts \((3, 2, 2, 1)\) so \(f = (0.375, 0.250, 0.250, 0.125)\), and mean router probabilities \(P = (0.40, 0.30, 0.20, 0.10)\). Then
$$L_{\text{aux}} = 4 \times (0.375 \times 0.40 + 0.250 \times 0.30 + 0.250 \times 0.20 + 0.125 \times 0.10) = 4 \times 0.2875 = 1.15$$above the minimum of 1 attained by a balanced batch (\(f_i = P_i = 0.25\)). With capacity factor \(c = 1\), each buffer holds \(C = 1 \times 8 / 4 = 2\) tokens: expert 1 was offered 3, so its third token is dropped, passing through the residual stream unprocessed; \(c = 1.5\) gives \(C = 3\) and drops nothing.
Intuition
Read statistically, an MoE layer is a mixture model whose mixing proportions are computed from the input: the router's softmax softly partitions input space into \(N\) regions, top-\(k\) selection hardens the partition into a small committee, and the gate weights average the committee's votes. The dense form is the classical mixture in which every component votes on every case; the sparse form keeps the geometry while paying for only \(k\) components.
Joint training creates a winner-take-all dynamic: tokens carry gradient, so an expert that wins early traffic improves faster and keeps winning, and every practical MoE ships a counterweight to break this pull. Fine-grained experts multiply the committees the router can form: choosing 2 of 8 experts offers \(\binom{8}{2} = 28\) combinations, while 8 of 256 offers \(\binom{256}{8} \approx 4 \times 10^{14}\), the stated motivation for assembling a bespoke committee per token.11
Variants and extensions
Gating and routing. Noisy top-k gating adds tunable Gaussian noise before selection, \(h_i(x) = (x W_r)_i + \epsilon \, \mathrm{softplus}((x W_n)_i)\) with \(\epsilon\) standard normal and \(W_n\) learned alongside \(W_r\), keeping early training exploratory.4 Switch Transformer showed top-1 routing suffices at scale, simplifying earlier top-2 designs;6 hash routing assigns tokens by a fixed hash, removing router training entirely at modest quality cost;19 expert-choice routing inverts the selection so each expert picks its top tokens, guaranteeing balance by construction at the price of variable per-token compute.9 ST-MoE added the router z-loss and design guidance that stabilized large sparse runs.8 Since the auxiliary loss trades balance against quality by pushing the router off its preferred assignments, DeepSeek-V3 popularized an auxiliary-loss-free alternative that adjusts a per-expert bias on the routing scores outside the gradient path, nudging traffic toward underused experts without distorting the training objective.1314
Expert structure. DeepSeekMoE argued that slicing the same parameter budget into many smaller experts and activating more of them improves specialization, since the combinatorial number of expert subsets grows sharply; this "fine-grained" recipe, with 64 to several hundred routed experts, was adopted broadly after 2024.11 DeepSeekMoE also isolated always-active shared experts to hold common knowledge, freeing routed experts to specialize;11 shared experts appear in DeepSeek-V2, DeepSeek-V3, Kimi K2, and Llama 4, while Qwen3 dropped them for pure routed banks; both choices coexist in current practice.141521
Execution and initialization. Experts are sharded across accelerators (expert parallelism), and every MoE layer needs all-to-all communication to dispatch tokens and gather results, tying MoE quality to interconnect bandwidth and making distributed-training topology a first-order design input; DeepSeek-V3's report devotes substantial space to overlapping this communication with computation on bandwidth-constrained NVIDIA H800 clusters.14 "Dropless" kernels such as MegaBlocks recast expert computation as block-sparse matrix multiplication so no token is discarded,16 and sparse upcycling initializes an MoE from a trained dense checkpoint by cloning its feed-forward layer into experts, recovering much of the benefit at a fraction of from-scratch cost; the technique is widely believed to underlie several commercial MoEs and was used openly in research systems.18
Beyond text. V-MoE applied sparse experts to the Vision Transformer,17 and multimodal systems including Gemini-line and Llama 4 models pair MoE feed-forward layers with image inputs. Sparse layers combine freely with other efficiency mechanisms: multi-head latent attention in the DeepSeek line,12 linear-attention hybrids in MiniMax-Text-01 and other hybrid architectures, and sliding-window or sparse attention in various stacks. More speculative designs treat sparsity itself as adaptive: Meituan's LongCat-Flash includes, per its technical report, "zero-computation" experts so per-token compute varies with token difficulty, and Moonshot AI calls Kimi K3's routing design a stabilized latent-space variant, Stable LatentMoE.22
Adoption
GPT-4 (2023) is widely reported, though never confirmed by OpenAI, to be a mixture-of-experts system, and Google DeepMind disclosed that Gemini 1.5 Pro is a sparse MoE Transformer, building on the company's GShard, Switch, and GLaM lineage.67 The open-weight turn began with Mixtral 8x7B (December 2023; 46.7 billion total, about 12.9 billion active, top-2 of 8), the first widely deployed open MoE, followed by Mixtral 8x22B;10 xAI's Grok-1 (314 billion total, 2 of 8) was open-sourced in March 2024, and Databricks' DBRX (132 billion total, 4 of 16) arrived the same month.
The DeepSeek family then set the template: DeepSeekMoE's fine-grained plus shared experts,11 scaled through DeepSeek-V2 (236 billion total, 21 billion active)12 to DeepSeek-V3 and DeepSeek-V3.1 (671 billion total, 37 billion active), the base for DeepSeek-R1.14 Among Chinese AI labs the pattern is near-universal: Alibaba's Qwen spans dense and MoE variants (Qwen3-235B-A22B activates 22 of 235 billion;21 the later proprietary Qwen3-Max is reportedly above a trillion); Zhipu AI's GLM-4.5 (355 billion total, about 32 billion active) and GLM-5 continue the GLM line; Tencent's Hunyuan-Large (389 billion total, 52 billion active) was reportedly the largest open MoE at its November 2024 release; and MiniMax, ByteDance (Seed-OSS), Ant Group (Ling), and Meituan (LongCat) all ship MoE flagships. Moonshot AI's Kimi K2 (one trillion total, about 32 billion active) was the largest open-weight model of mid-2025,15 surpassed in July 2026 by Kimi K3 at 2.8 trillion total with 16 of 896 experts active.22
United States open-weight releases followed: Meta AI moved the Llama family to MoE with Llama 4 (Scout 109 billion and Maverick 400 billion total, both 17 billion active);20 OpenAI's gpt-oss models (117 billion total, 5.1 billion active; 21 billion total, 3.6 billion active) carry 4-bit-quantized expert weights;23 and Arcee AI's Trinity Large (400 billion total, roughly 13 billion active, 4-of-256 routing) anchored the Trinity family, whose Trinity Mini brings the recipe to 26 billion parameters.24 The Allen Institute for AI's OLMoE (7 billion total, 1 billion active) is fully open, released with data and code alongside the OLMo program. Frontier closed vendors, including Anthropic (Claude family) and OpenAI (GPT-5 and successors), do not disclose architecture, but commentary as of 2026 generally assumes sparse designs across the frontier; dense architectures persist mainly at small scales, where distilled and edge models (see distillation) often remain dense for deployment simplicity.
Limitations and critiques
Memory versus compute. MoE trades memory for compute: every expert must be resident (in accelerator memory, or paged at a latency cost) even though few run per token, so total parameters bound serving hardware while active parameters bound speed. A 671-billion-parameter model with 37 billion active still needs hundreds of gigabytes of weights, pushing open MoEs toward multi-GPU nodes and aggressive quantization and largely excluding consumer hardware. Per-token efficiency claims are therefore contested as accounting: active-parameter comparisons ignore the memory, interconnect, and orchestration costs that total parameters impose, and quality per total parameter on suites like MMLU often favors dense models.
Routing instability and expert collapse. The router-expert feedback loop can oscillate or collapse during training, and sparse models show occasional loss spikes that dense equivalents avoid; the z-loss, careful initialization, and loss-free balancing are mitigations rather than solutions,813 the z-loss penalizing large router logits to keep mixed-precision runs stable.28 Balanced routing is also in tension with specialization: forcing uniform utilization can push semantically arbitrary assignments, and interpretability studies find many experts specialize by position or syntax rather than by topic.
Fine-tuning difficulty. Sparse models overfit more readily than dense ones during fine-tuning and instruction tuning, with a gap between strong pre-training loss and weaker downstream transfer documented since ST-MoE;8 routed parameters receive sparse, noisy gradients on small datasets, and practitioners variously freeze routers, tune only shared components, or rely on large post-training mixtures and RLHF-style stages. Expert placement also complicates serving, batching, and test-time scaling, since all-to-all communication sits on the critical path of every forward pass.
History
The mixture-of-experts idea descends from the mixture models of classical statistics: generalizing the components of a weighted sum of distributions to small trainable networks yielded mixtures of experts, trained in that era with expectation-maximization and kept deliberately simple against overfitting on small datasets.2 Jacobs, Jordan, Nowlan, and Hinton published "Adaptive Mixtures of Local Experts" in Neural Computation in 1991, proposing a gating network that softly assigns training cases to competing experts so each learns a different region of input space.1 Jordan and Jacobs extended the design to hierarchical mixtures trained with expectation-maximization in 1994,3 and mixtures of experts became a standard tool of 1990s statistical machine learning, well before deep learning's return. The 1991 paper had already recorded the failure mode that would dominate later work: on a phoneme-recognition task, most trained mixtures ended with all but two or three experts effectively unused, and the authors pruned the idle experts after training.26 Eigen, Ranzato, and Sutskever's stacked deep mixtures (2013) anticipated MoE as a repeated layer rather than a top-level ensemble, but their gating still combined every expert densely, saving no compute.2529
The modern sparse era began at Google Brain: Shazeer et al.'s "Outrageously Large Neural Networks" (January 2017) inserted a sparsely-gated MoE layer between LSTM layers, introduced noisy top-k gating and auxiliary balancing losses, and trained language and translation models with up to 137 billion parameters, then unprecedented.4 The Transformer era followed: GShard (June 2020) scaled a top-2 MoE Transformer to 600 billion parameters for multilingual translation and established capacity factors and automatic sharding;5 Switch Transformer (January 2021) simplified routing to top-1 and reached 1.6 trillion parameters;6 GLaM (December 2021) showed a 1.2-trillion-parameter MoE outperforming GPT-3 at a third of the training energy, activating about 97 billion parameters per token.7 V-MoE brought the recipe to vision the same year,17 and ST-MoE (2022) consolidated stability and transfer fixes.8 Through this period MoE remained mostly a Google research program, with PaLM and most public LLMs staying dense.
The open-weight wave changed that: Mixtral 8x7B, released as a magnet link in December 2023 and described in "Mixtral of Experts" (January 2024), made sparse MoE an open standard;10 DeepSeekMoE (January 2024) added fine-grained and shared experts,11 and the DeepSeek-V2/V3 reports multi-head latent attention, loss-free balancing, and detailed systems co-design.1214 From 2024 through 2026 essentially every major open flagship shipped sparse: Grok-1, DBRX, Llama 4, Qwen3, GLM-4.5, Kimi K2, gpt-oss, Trinity Large, and Kimi K3, whose 2.8-trillion-parameter release capped the trillion-parameter open MoE era that DeepSeek's economics had opened.152224 What began as a 1991 proposal for divide-and-conquer learning is, as of 2026, the default answer to how model capacity can grow faster than compute budgets.
See also
References
-
Jacobs, R. A., Jordan, M. I., Nowlan, S. J., Hinton, G. E., "Adaptive Mixtures of Local Experts," Neural Computation 3(1), 1991. ↩↩
-
Jordan, M. I., and Jacobs, R. A., "Hierarchical Mixtures of Experts and the EM Algorithm," Neural Computation 6(2), 1994. ↩
-
Jordan, M. I., Jacobs, R. A., "Hierarchical Mixtures of Experts and the EM Algorithm," Neural Computation 6(2), 1994. ↩
-
Shazeer, N., et al., "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer," arXiv:1701.06538, January 2017. ↩↩↩↩↩↩
-
Lepikhin, D., et al., "GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding," arXiv:2006.16668, June 2020. ↩↩↩
-
Fedus, W., Zoph, B., Shazeer, N., "Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity," arXiv:2101.03961, January 2021. ↩↩↩
-
Du, N., et al., "GLaM: Efficient Scaling of Language Models with Mixture-of-Experts," arXiv:2112.06905, December 2021. ↩↩
-
Zoph, B., et al., "ST-MoE: Designing Stable and Transferable Sparse Expert Models," arXiv:2202.08906, February 2022. ↩↩↩↩
-
Zhou, Y., et al., "Mixture-of-Experts with Expert Choice Routing," arXiv:2202.09368, February 2022. ↩
-
Jiang, A. Q., et al., "Mixtral of Experts," arXiv:2401.04088, January 2024. ↩↩↩↩
-
Dai, D., et al., "DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models," arXiv:2401.06066, January 2024. ↩↩↩↩↩↩
-
DeepSeek-AI, "DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model," arXiv:2405.04434, May 2024. ↩↩↩
-
Wang, L., et al., "Auxiliary-Loss-Free Load Balancing Strategy for Mixture-of-Experts," arXiv:2408.15664, August 2024. ↩↩
-
DeepSeek-AI, "DeepSeek-V3 Technical Report," arXiv:2412.19437, December 2024. ↩↩↩↩↩↩↩
-
Kimi Team, "Kimi K2: Open Agentic Intelligence," arXiv:2507.20534, July 2025. ↩↩↩
-
Gale, T., et al., "MegaBlocks: Efficient Sparse Training with Mixture-of-Experts," arXiv:2211.15841, November 2022. ↩
-
Riquelme, C., et al., "Scaling Vision with Sparse Mixture of Experts," arXiv:2106.05974, June 2021. ↩↩
-
Komatsuzaki, A., et al., "Sparse Upcycling: Training Mixture-of-Experts from Dense Checkpoints," arXiv:2212.05055, December 2022. ↩
-
Roller, S., et al., "Hash Layers For Large Sparse Models," arXiv:2106.04426, June 2021. ↩
-
Meta AI, "The Llama 4 herd: The beginning of a new era of natively multimodal AI innovation," April 2025. ↩
-
Qwen Team, "Qwen3 Technical Report," arXiv:2505.09388, May 2025. ↩↩↩
-
OpenAI, "gpt-oss-120b and gpt-oss-20b Model Card," August 2025. ↩
-
Eigen, D., Ranzato, M., Sutskever, I., "Learning Factored Representations in a Deep Mixture of Experts," arXiv:1312.4314, December 2013. ↩
-
Jacobs, R. A., et al., "Adaptive Mixtures of Local Experts," Neural Computation 3(1), 1991. ↩
-
Fedus, W., Zoph, B., and Shazeer, N., "Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity," arXiv:2101.03961, January 2021. ↩
-
Zoph, B., et al., "ST-MoE: Designing Stable and Transferable Sparse Expert Models," arXiv:2202.08906, February 2022. ↩
-
Eigen, D., Ranzato, M., and Sutskever, I., "Learning Factored Representations in a Deep Mixture of Experts," arXiv:1312.4314, December 2013. ↩
-
Shazeer, N., et al., "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer," arXiv:1701.06538, January 2017. ↩