Mixture of experts (MoE)

Mixture of experts is a model design that splits parts of a network into many sub-networks, called experts, and has a learned router send each piece of input to only a few of them.

A standard neural network uses every one of its parameters for every input. A mixture-of-experts model breaks some of its layers into many smaller sub-networks called experts and adds a small gating network, often called a router, that decides which experts handle each token. Only the chosen experts do any work. The rest sit idle for that token, which saves computing effort.

Mixtral 8x7B, published in 2024, shows the arithmetic. Each of its layers has eight experts, and the router picks two of them for every token. Each token therefore has access to 47 billion parameters but uses only 13 billion of them. That is why MoE models are described with two numbers: total parameters, which set how much the model can know, and active parameters, which set how much work each token costs.

Picture a hospital with dozens of specialists and a triage nurse at the door. A patient does not see every doctor; the nurse sends them to the two most relevant. The hospital as a whole holds a great deal of expertise, but each visit stays affordable. The router is the triage nurse. The picture has one flaw: experts are not assigned subjects, and they rarely divide up neatly by topic. When Mistral AI's researchers analysed Mixtral's routing, they found no obvious pattern of experts by subject; the choices followed syntax more than topic.

The idea dates to 1991, when Robert Jacobs, Michael Jordan, Steven Nowlan and Geoffrey Hinton published Adaptive Mixtures of Local Experts. In 2017 Noam Shazeer, Geoffrey Hinton, Jeff Dean and colleagues scaled it up with a sparsely gated layer of up to thousands of experts, building models of up to 137 billion parameters at little extra computing cost. In 2021 Google Brain's Switch Transformer used the approach to become one of the first language models to pass a trillion parameters.

The savings are real but partial. Every expert still has to be loaded into memory, because any token might be routed to any of them, so hardware needs follow the total parameter count rather than the active one. Training is also harder, since the router has to be kept from overloading a few favourite experts. When a vendor quotes an MoE model's size, ask for both numbers.

Common questions

What does MoE mean in AI?

MoE stands for mixture of experts, a way of building AI models in which the network is divided into many sub-networks called experts. A router sends each token to a small number of them, so only part of the model runs at a time. It lets developers build very large models without the computing cost growing at the same rate.

What is the difference between total and active parameters?

Total parameters count every number in the model, across all experts. Active parameters count only the ones used to process a single token. Mixtral 8x7B, for example, has 47 billion total parameters but uses about 13 billion per token. Active parameters drive the computing cost of each answer, while total parameters drive memory needs.

Is a mixture-of-experts model cheaper to run?

Per token, usually yes, because only a fraction of the model does work for each piece of input. But the whole model must still sit in memory, so it needs as much hardware memory as a standard model of the same total size. The saving shows up in speed and computing cost rather than in the size of the machine required.

Finding more

Search for "mixture of experts explained", "sparsely gated mixture of experts" or "active vs total parameters" to understand how the design works. Reliable sources include the original papers on arXiv, such as the 2017 sparsely gated MoE paper and the Switch Transformer paper, model cards and technical reports published with MoE models, and encyclopedia articles that cite them. Treat size comparisons between MoE and standard models with care when only one parameter figure is given.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.