What is a mixture-of-experts model? Explained with an office front desk
A mixture-of-experts (MoE) model is a big AI model split into many experts, with a router that sends each word to just a few of them. Explained with an office whose front desk passes each job to two specialists.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- AI
Our story on Amazon's new Ergo model calls it a mixture-of-experts model, with 1.1 trillion parameters but only 55 billion used for each word. Here is what that means.
In one sentence: A mixture-of-experts (MoE) model is an AI model built from many smaller parts called experts, where a small router picks just a few of them to work on each word, so a very large model does only a fraction of its work at a time.
The everyday picture
Picture a large office with hundreds of specialists and one front desk. Every piece of work that comes in goes to the front desk first.
The front desk does not send the work to everyone. It looks at it and passes it to the two or three specialists most likely to handle it well. Everyone else carries on with nothing to do for that piece.
The office is huge, so it knows a lot. But each piece of work only costs the time of a few people. That is the idea behind a mixture-of-experts model.
The router (front desk) reads each token and sends it to the best few experts. Their results are blended into the answer, while the other experts sit idle for that token.
How it works, step by step
- Your text is split into tokens (the pieces of work), which are words or parts of words. Each token passes through the model's layers.
- The router (the front desk) is a small network inside the model. For each token, it scores every expert and picks the best few, often just one or two.
- The chosen experts (the specialists) do the work on that token. The other experts stay idle for it, which saves computing.
- The results are blended, weighted by how strongly the router chose each expert, and the model moves on. This happens again in each expert layer, and for every new token, so different words can go to different experts.
- Total versus active size. The total parameters (the model's learned settings) count every specialist in the office. The active parameters count only the ones working on a token. Ergo has 1.1 trillion in total and 55 billion active per token, according to its model card.
Try it · Myth or fact
Mixture of experts: myth or fact?
Decide for yourself first, then tap each statement to check it.
0 of 4 checked
Where the picture stops
- Real experts are not neat subject specialists, like "the law expert" or "the French expert". Studies find they tend to pick up small patterns, such as punctuation or names, and no single expert handles a whole language.
- Nobody assigns the front desk its rules. The router learns its choices during training, together with the experts. Training even adds a nudge so a few favourite experts don't get all the work.
- In a real office, idle staff can go home. In an MoE model, every expert must still be loaded into the computer's memory, ready to be called. So it needs hardware sized for the total, not the active part.
Why it matters for your business
- Cost and speed. Each token only uses the active part of the model, so a very large MoE model can run faster and cheaper per token than an ordinary model of the same total size. Several recent models in our news, including Amazon's Ergo, use this design.
- Reading model specs. When a provider lists two sizes, such as "2.4 trillion total, 71 billion active", the active number hints at running cost and the total number hints at memory needs.
- Self-hosting. If you plan to run an open-weight MoE model on your own servers, size the hardware for the total parameters. A small active number does not make it a small model to host.
- Quality still needs testing. The design says nothing about how well a model does on your own tasks. Compare models on real work before you switch.
An example
Imagine a 30-person software company choosing a model for its coding assistant. One option is a mixture-of-experts model with a huge total size but a small active size, and it is priced lower per token than the model they use now. They test both on 20 real tasks from their backlog and compare results and total cost. They also learn that hosting it themselves would need far more graphics memory than its active size suggests, so they decide to use it through a cloud provider instead.
Frequently asked questions
What does MoE stand for in AI?
MoE stands for mixture of experts. It is a way of building a model from many smaller expert networks, with a router that sends each token to only a few of them.
What is the difference between total and active parameters?
Total parameters count every expert in the model. Active parameters count only the part that works on each token, which mostly decides how much computing each word needs.
Is mixture of experts the same as model routing?
No. Model routing sends a whole request to one of several separate models. A mixture-of-experts model is a single model, and its router picks experts inside it for every token, many times per answer.
Is a mixture-of-experts model cheaper to run?
It needs less computing per token than an ordinary model of the same total size. But it still needs enough memory to hold every expert, so it is not cheap to host just because the active part is small.
Related explainers
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.