P

Mixture Of Experts: Definition and Examples

Neural network architecture that divides a model into multiple specialized sub-networks (the "experts") and uses a routing mechanism to activate only a subset of them per request, enabling massive models while controlling computational cost.

Full definition

Mixture of Experts (MoE) is a machine learning architecture in which a model is composed of multiple independent sub-networks, called "experts", each specializing in processing certain types of data or tasks. A key component, the routing network (or "gating network"), dynamically decides which experts to activate for each input. Thus, only a fraction of the total model is invoked at each inference.

The main advantage of this approach is decoupling total model size (number of parameters) from actual computational cost. An MoE model can contain hundreds of billions of parameters but activate only tens of billions per request. This makes it possible to achieve the performance of a very large dense model while maintaining inference speed comparable to a much smaller model.

In the context of large language models (LLMs), the MoE architecture was popularized by models like Mixtral from Mistral AI or GPT-4 from OpenAI (whose presumed architecture is based on MoE). Specifically, each transformer layer contains multiple feed-forward experts, and the router typically selects the 2 most relevant experts out of 8 or 16 available to process each token.

For the end user, MoE has a direct impact: it makes more powerful, faster, and cheaper models possible. It is one of the architectural innovations that explains why recent models are both more powerful and more accessible than their predecessors.

Etymology

The concept of Mixture of Experts was introduced in 1991 by Robert Jacobs, Michael Jordan, Steven Nowlan, and Geoffrey Hinton. The term draws on the idea of a committee of human experts where each specialist contributes to questions within their domain. The word 'mixture' refers to the underlying probabilistic model (a mixture of distributions), while 'experts' denotes the specialized sub-networks.

Concrete examples

Choosing a model suited to deployment constraints

I need to deploy an LLM on a server with a single GPU. What are the advantages of a Mixture of Experts model like Mixtral 8x7B compared to a dense model of equivalent size in terms of performance?

Understanding model performance

Explain why Mixtral 8x7B, which has 46 billion total parameters, is as fast as a 13 billion parameter model at inference.

Evaluating model architecture for a specialized use case

For a multilingual application (French, English, Spanish), would an MoE model be more suitable than a dense model, given that some experts could specialize by language?

Practical usage

In prompt engineering, understanding the MoE architecture helps in choosing the right model based on cost and performance constraints. MoE models excel on diverse tasks because their experts naturally specialize, making them excellent candidates for general-purpose applications. When selecting a model, it is useful to compare the number of active parameters (not total) to estimate actual inference speed.

Related concepts

TransformerSparse ModelGating NetworkFine-tuningInferenceScaling Laws

FAQ

What is the difference between a dense model and a Mixture of Experts model?
A dense model activates all its parameters for every request, while an MoE model activates only a subset of experts at each inference. For example, Mixtral 8x7B has 46 billion total parameters but uses only about 13 billion per token, making it as fast as a dense 13B model while offering performance close to a 70B model.
Are MoE models more difficult to use in prompt engineering?
No, from the user's perspective, an MoE model is used exactly like a dense model. The routing between experts is fully automatic and transparent. The same prompt engineering techniques (few-shot, chain-of-thought, structured instructions) apply identically.
What are the disadvantages of the Mixture of Experts architecture?
The main drawbacks are a larger memory footprint (all experts must be loaded in memory even if only a few are active), increased complexity during fine-tuning, and a risk of routing imbalance where some experts are underutilized. These constraints primarily concern model developers rather than end users.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.