What Is Mixture of Experts (MoE)? Active vs Total Parameters

By LatestLLM Editorial · Published · Facts verified · 8 min read

Also called: MoE, sparse mixture of experts, experts, router, active parameters, sparse model

Before this: Feed-forward network, Transformer

In one line

A mixture-of-experts model splits its feed-forward layers into many experts and uses a router to send each token to only a few, so most of its parameters stay idle per token.

Mixture of experts, simply and technically

In plain English

A big model is expensive because every word has to pass through every part of it. A mixture-of-experts model gets around this by splitting part of itself into many smaller specialists, called experts, and sending each word to only a few of them. A small piece of the model, the router, decides which experts a word should visit.

The model can hold the knowledge of a very large network while doing the work of a much smaller one for each word. The trade-off is memory: all the experts must be loaded and ready, even though a given word uses only a few of them.

Think of it like this: A mixture of experts is like a hospital with 128 specialists. A triage nurse (the router) looks at each patient and sends them to the three or four specialists who fit, instead of having every patient see every doctor. Each visit is quick and cheap, but the hospital still has to employ all 128 doctors, which is the model's memory bill. Unlike hospital specialists, a model's experts are not assigned subjects by hand; they find their own niches during training.

Everyday example: Which experts see this word?

A model has 128 experts and its router picks the best 4 for each word.

Input:

128 experts, 4 chosen per word

Output:

Work for 4 experts per word, memory for all 128

What it shows: The word “Paris” might be sent to four experts, and “sat” to a different four. Each word uses only 4 of the 128, so only about 3% of the expert weights do any work for it. All 128 experts still have to sit in memory, because the next word could need any of them.

Technically

An MoE layer replaces a transformer block's feed-forward network with E expert networks and a router, a small linear layer that scores the experts for each token. The top-k experts are selected, their outputs are combined with weights from a softmax over the chosen scores, and the rest do nothing. Shazeer et al. (2017) introduced the sparsely gated layer and reported more than a thousand-fold increase in capacity at minor efficiency cost; Switch Transformer simplified routing to a single expert; Mixtral 8x7B routes each token to 2 of 8 experts, giving access to 47B parameters while using 13B per token.

Current models use many small experts. gpt-oss-120b has 128 experts per layer with 4 active (116.83B total, 5.13B active); gpt-oss-20b has 32 with 4 active (20.91B, 3.61B); Gemma 4 26B-A4B has 128 experts with 8 active plus one shared (25.2B, 3.8B); DeepSeek-V3 has 256 routed experts with 8 active plus one shared, in all but its first three layers (671B, 37B). Shared experts, which every token uses, capture common knowledge and let routed experts specialise (DeepSeekMoE, Dai et al. 2024).

Technical example: Routing and the active fraction

A toy router scores 8 experts and picks 4 with softmax weights over only the chosen ones, then the published total and active parameter counts of four real models are compared.

Code (python):

import math

def route(logits, k):
    top = sorted(range(len(logits)), key=lambda i: -logits[i])[:k]
    peak = max(logits[i] for i in top)
    exps = [math.exp(logits[i] - peak) for i in top]
    return [(i, round(e / sum(exps), 3)) for i, e in zip(top, exps)]

toy_scores = [0.2, 1.7, -0.5, 2.3, 0.9, -1.1, 1.9, 0.0]   # illustrative router output
print("expert, weight:", route(toy_scores, 4))

models = {"gpt-oss-120b": (116.83, 5.13), "gpt-oss-20b": (20.91, 3.61),
          "Gemma 4 26B-A4B": (25.2, 3.8), "DeepSeek-V3": (671, 37)}
for name, (total, active) in models.items():
    print(f"{name:16s} {total:>7}B total, {active:>5}B active: {100 * active / total:4.1f}% runs per token")

Output:

expert, weight: [(3, 0.406), (6, 0.272), (1, 0.223), (4, 0.1)]
gpt-oss-120b      116.83B total,  5.13B active:  4.4% runs per token
gpt-oss-20b        20.91B total,  3.61B active: 17.3% runs per token
Gemma 4 26B-A4B     25.2B total,   3.8B active: 15.1% runs per token
DeepSeek-V3          671B total,    37B active:  5.5% runs per token

What it shows: The router's four weights add up to 1 and favour the highest score. Only 4.4% of gpt-oss-120b's parameters, 15.1% of Gemma 4 26B-A4B's and 5.5% of DeepSeek-V3's do work for any one token, yet the memory needed is that of the whole model. The router scores here are illustrative, since real routers are learned.

Routing a token to its experts. Choose a model, a token and a layer. A grid shows every expert in that layer with the chosen ones highlighted, and two bars compare the parameters that must be in memory with the parameters active for one token. Which experts light up is illustrative, because real routing is learned and not published. Expert counts, top-k and parameter totals from the published configs and model cards; the routes drawn are illustrative.

Dense versus sparse models

In plain English: In an ordinary, dense model every part of the network works on every word. In a sparse model, only a chosen part works on each word. The sparse model can therefore be much larger for the same running cost.

Technically:

A dense model's compute per token is proportional to its parameter count. An MoE model separates the two: compute follows the active parameters, while capacity follows the total. Shazeer et al. framed this as conditional computation, where parts of the network are active on a per-example basis, and showed capacity gains of over 1000× with only minor losses in computational efficiency.

Only the feed-forward networks are split in most designs, because they hold two thirds of a layer's parameters. Attention layers, embeddings and the output layer are shared by all tokens, which is why a model's active count is higher than its experts' share alone.

The router

In plain English: The router is a tiny network that looks at a word's current numbers and gives every expert a score. The highest few are chosen, and their answers are blended using weights based on the scores. Because the router is trained along with everything else, it learns which kinds of words suit which experts.

Technically:

A router is a matrix of size hidden × experts. Scores for a token are computed, the top-k chosen and a softmax applied over the chosen experts to get combination weights, as the gpt-oss model card describes. DeepSeek-V3 scores with sigmoid, divides experts into 8 groups and lets a token pick from the best 4 groups, then scales the weights by 2.5. Switch Transformer used k = 1 to cut communication and compute.

Routing is per token and per layer, so one word may visit different experts in different layers. In practice experts specialise loosely by token type or position rather than by clean topics such as “maths” or “French”.

What is top-k routing?

Choosing the k experts with the highest router scores for each token and ignoring the rest.

What is a shared expert?

An expert that every token passes through in addition to its routed experts, so common knowledge need not be duplicated across them.

Keeping the experts busy

In plain English: If the router sends most words to the same few experts, those few get overworked and the rest sit idle, which wastes the whole idea. Training therefore includes a way to spread the load evenly.

Technically:

Classic MoE adds an auxiliary loss that penalises uneven expert usage. That helps balance but pulls against the main training objective. DeepSeek-V3 instead adds a per-expert bias used only when choosing experts, raised for under-used experts and lowered for over-used ones, so no balancing penalty enters the loss; a tiny sequence-wise loss remains. The failure mode being avoided is routing collapse, where a few experts absorb nearly all tokens.

In serving, balance also matters across GPUs: experts are spread over devices, and uneven routing leaves some devices waiting for others.

Go deeper: details for practitioners
  • Capacity limits, which drop or reroute tokens when an expert is over its quota, were used in earlier systems; many recent designs avoid dropping tokens.

What it means for memory and cost

In plain English: Running a mixture-of-experts model is cheaper per word, but not smaller to store. You need room for all the experts, so the saving shows up in speed and energy rather than in the size of the download.

Technically:

gpt-oss-120b's checkpoint is 60.8 GiB, small enough for a single 80 GB GPU because its expert weights are stored in 4-bit MXFP4, while its per-token compute is that of a 5.13B-parameter model. DeepSeek-V3's FP8 checkpoint is 641.3 GiB and needs several GPUs, though only 37B parameters work for each token. Decoding speed is bounded by reading the active weights, so MoE models are fast per token if all experts fit in memory.

The costs are complexity and variability: batching many tokens activates many different experts, so weight reads per token improve less at large batch sizes, and experts must be spread across devices. Dense models of the same total size usually give higher quality per parameter, so MoE trades memory for speed.

Everyday example: Fast but heavy

Two models answer the same question: a 30B dense model and a 120B MoE model that uses 5B parameters per word.

What it shows: The MoE model does about the work of a 5B model per word, so it can be faster than the dense one, but it needs about four times the memory to hold its experts.

Common misconceptions

  • Myth: A 120B mixture-of-experts model runs like a 120B model.

    Reality: It does the compute of its active parameters, 5.13B for gpt-oss-120b, per token. It still needs memory for all 116.83B.

  • Myth: Each expert is a specialist in a topic such as law or maths.

    Reality: Experts specialise in subtler patterns learned during training. There is no hand-assigned subject, and routing differs by layer.

  • Myth: Only the experts you use need to be loaded.

    Reality: Which experts a token needs is unknown until the router runs, and every token may need different ones, so all must be available.

Where you'll see this

Key takeaways

  • A mixture-of-experts layer replaces one feed-forward network with many expert networks and a router that picks a few per token.
  • Active parameters, the ones that run per token, set the compute cost: 5.13B of gpt-oss-120b's 116.83B.
  • Total parameters set the memory cost, because every expert must be loaded even if a token uses only a few.
  • Designs differ in expert count and size, in the number chosen per token, and in whether some shared experts always run.

Frequently asked questions

What is a mixture-of-experts model?

A model whose feed-forward layers are split into many expert networks, with a router choosing a few experts for each token.

What are active parameters?

The parameters actually used to process one token. For gpt-oss-120b that is 5.13B out of 116.83B.

Why are MoE models cheaper to run?

Compute per token follows the active parameters, which are a small fraction of the total, so each token needs far fewer calculations.

Do MoE models need less memory?

No. All experts must be stored, so memory follows the total parameter count, not the active count.

What is a shared expert?

An expert that every token uses alongside its routed experts, used in Gemma 4 26B-A4B and DeepSeek-V3.

Sources

Facts last verified November 23, 2026.

Next concept: Pre-training and loss

Learn next

  • Grouped-query attention (Intermediate): Grouped-query attention lets several query heads share one set of key and value heads, cutting the KV cache by the group size at little cost in quality.
  • Quantization (Intermediate): Quantization stores a model's numbers in fewer bits, for example 4 instead of 16, so it needs a fraction of the memory and often runs faster, at some cost in precision.
  • Open-weight models (Beginner): An open-weight model is a language model whose trained weights are published for download, so anyone can run and adapt it, though that is not always the same as being fully open source.