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
FAQ
What is the difference between a dense model and a Mixture of Experts model?
Are MoE models more difficult to use in prompt engineering?
What are the disadvantages of the Mixture of Experts architecture?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- 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
ML Pipeline: Definition and Examples
An ML Pipeline (machine learning pipeline) is an automated sequence of steps that transforms raw data into a deployed and operational machine learning model.
MLOps: Definition and Examples
MLOps (Machine Learning Operations) refers to the set of practices, tools, and methodologies that enable deploying, monitoring, and maintaining models
Model Card: Definition and Examples
A model card is a standardized document that accompanies an AI model to describe its performance, limitations, potential biases, and conditions of use
Model Distillation: Definition and Examples
Model distillation is a compression technique where a smaller model (the student) learns to replicate the behavior of a larger and more performant model (the teacher).
Model Registry: Definition and Examples
A Model Registry is a centralized system for storing, versioning, and managing machine learning models throughout their lifecycle, from training to production deployment.
Model Router: Definition and Examples
A model router is a system that automatically directs each request to the most suitable AI model based on complexity, cost, or nature of the task.
Get new prompts every week
Join our newsletter.