Bookmarks

MoE — mixture of experts

A neural network architecture in which only individual “experts” work on each token: a router decides whose weights to use, so the model is large but the computation per token is small.

Also: sparse mixture of experts, MoE model, MoE architecture

checked 9 Nov

All terms

MoE is a way to build a very large model without a proportional rise in computation: the total number of parameters is huge, but only a small part of them runs on each token — the part the router has selected. Many large modern language models are built this way.

How the mixture works

ComponentWhat it does
Expertsseveral blocks with an identical structure — usually fully connected layers — but different weights
Routera small trainable network: for each token it decides which experts will process it
Shared parametersembeddings, attention layers and other parts that every token passes through
Active parametersthe weights that actually run on a given token: the selected experts plus the shared parts

The router assigns the selected experts a weight — a factor by which to multiply their output — and the weighted sum of these outputs becomes the result of the layer. If not all experts are used for a token, the mixture is called sparse: for example, in Mixtral each layer selects two of the eight experts for a token.

Active and shared parameters: an example

This split is worth putting into numbers: in parameters, a MoE model is larger than a dense network of the same quality, while in computation per token it is smaller. Memory is still needed for all the parameters, though: the experts are stored in full, even if only one or two of the eight run on a token. MoE therefore saves computation but not memory, and this is taken into account when placing models on inference servers.

ModelTotal parametersActive per token
Mixtral 8×7B47 billion13 billion
DeepSeek-V3671 billion37 billion

Where the term comes from

The idea of a mixture of experts was proposed by Robert Jacobs, Michael Jordan, Steven Nowlan and Geoffrey Hinton in the paper “Adaptive Mixtures of Local Experts” (1991): several trainable “local experts” plus a trainable module that divides the inputs between them.

In deep neural networks, the sparse mixture was popularised by the 2017 paper by Shazeer et al. with a layer of thousands of fully connected experts, and Switch Transformer (2021) simplified routing and scaled training up to models with a trillion parameters. Since then, MoE has become a common choice for large language models.

Sources

the term is written from these pages

Verified 9 Nov