ArticleslgStudy

computer science

Mixture of experts

Mixture of experts is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Mixture of experts rather than just read about it. In short: Mixture of experts (MoE) is a machine learning technique where multiple expert networks (learners) are used to divide a problem space into homogeneous regions. MoE represents a form of ensemble learning.

Mixture of experts — main illustration
Mixture of experts — illustration

Key takeaways

  • Mixture of experts belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Mixture of experts to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Mixture of experts from memory before moving on to harder problems.

Reference excerpt

Mixture of experts (MoE) is a machine learning technique where multiple expert networks (learners) are used to divide a problem space into homogeneous regions. MoE represents a form of ensemble learning. They were also called committee machines.

Basic theory MoE always has the following components, but they are implemented and combined differently according to the problem being solved:

Experts f1,...,fn, each taking the same input x, and producing outputs f1(x),...,fn(x). A weighting function (also known as a gating function) w, which takes input x and produces a vector of outputs (w(x)1,...,w(x)n). This may or may not be a probability distribution, but in both cases, its entries are non-negative. θ=(θ0,θ1,...,θn) is the set of parameters. The parameter θ0 is for the weighting function. The parameters θ1,…,θn are for the experts. Given an input x, the mixture of experts produces a single output by combining f1(x),...,fn(x) according to the weights w(x)1,...,w(x)n in some way, usually by f(x)=∑iw(x)ifi(x). Both the experts and the weighting function are trained by minimizing some loss function, generally via gradient descent. There is much freedom in choosing the precise form of experts, the weighting function, and the loss function.

Meta-pi network The meta-pi network, reported by Hampshire and Waibel, uses f(x)=∑iw(x)ifi(x) as the output. The model is trained by performing gradient descent on the mean-squared error loss L:=1N∑k‖yk−f(xk)‖2. The experts may be arbitrary functions. In their original publication, they were solving the problem of classifying phonemes in speech signal from 6 different Japanese speakers, 2 females and 4 males. They trained 6 experts, each being a "time-delayed neural network" (essentially a multilayered convolution network over the mel spectrogram). They found that the resulting mixture of experts dedicated 5 experts for 5 of the speakers, but the 6th (male) speaker does not have a dedicated expert, instead his voice was classified by a linear combination of the experts for the other 3 male speakers.

Adaptive mixtures of local experts The adaptive mixtures of local experts uses a Gaussian mixture model. Each expert simply predicts a Gaussian distribution, and totally ignores the input. Specifically, the i-th expert predicts that the output is y∼N(μi,I), where μi is a learnable parameter. The weighting function is a linear-softmax function:w(x)i=ekiTx+bi∑jekjTx+bjThe mixture of experts predict that the output is distributed according to the log-probability density function:ln⁡fθ(y|x)=ln⁡[∑iekiTx+bi∑jekjTx+bjN(y|μi,I)]=ln⁡[(2π)−d/2∑iekiTx+bi∑jekjTx+bje−12‖y−μi‖2]It is trained by maximal likelihood estimation, that is, gradient ascent on f(y|x). The gradient for the i-th expert is ∇μiln⁡fθ(y|x)=w(x)iN(y|μi,I)∑jw(x)jN(y|μj,I)(y−μi) and the gradient for the weighting function is∇[ki,bi]ln⁡fθ(y|x)=[x1]w(x)i∑jw(x)jN(y|μj,I)(fi(x)−fθ(y|x)) For each input-output pair (x,y), the weighting function is changed to increase the weight on all experts that performed above average, and decrease the weight on all experts that performed below average. This encourages the weighting function to learn to select only the experts that make the right predictions for each input. The i-th expert is changed to make its prediction closer to y, but the amount of change is proportional to w(x)iN(y|μi,I). This has a Bayesian interpretation. Given input x, the prior probability that expert i is the right one is w(x)i, and N(y|μi,I) is the likelihood of evidence y. So, w(x)iN(y|μi,I)∑jw(x)jN(y|μj,I) is the posterior probability for expert i, and so the rate of change for the i-th expert is proportional to its posterior probability. In words, the experts that, in hindsight, seemed like the good experts to consult, are asked to learn on the example. The experts that, in hindsight, were not, are left alone. The combined effect is that the experts become specialized: Suppose two experts are both good at predicting a certain kind of input, but one is slightly better, then the weighting function would eventually learn to favor the better one. After that happens, the lesser expert is unable to obtain a high gradient signal, and becomes even worse at predicting such kind of input. Conversely, the lesser expert can become better at predicting other kinds of input, and increasingly pulled away into another region. This has a positive feedback effect, causing each expert to move apart from the rest and take care of a local region alone (thus the name "local experts").

Hierarchical MoE Hierarchical mixtures of experts uses multiple levels of gating in a tree. Each gating is a probability distribution over the next level of gatings, and the experts are on the leaf nodes of the tree. They are similar to decision trees. For example, a 2-level hierarchical MoE would have a first order gating function wi, and second order gating functions wj|i and experts fj|i. The total prediction is then ∑iwi(x)∑jwj|i(x)fj|i(x).

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Mixture of experts

Start with the simplest possible case. Write down what Mixture of experts claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Mixture of experts before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Mixture of experts ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Mixture of experts

In research
Mixture of experts appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Mixture of experts in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Mixture of experts is common in secondary-school and first-year university syllabi. It links to neighbouring topics Machine learning algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Mixture of experts outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Mixture of experts” →

How to study Mixture of experts in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Mixture of experts means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Mixture of experts out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Mixture of experts in simple terms?

Mixture of experts (MoE) is a machine learning technique where multiple expert networks (learners) are used to divide a problem space into homogeneous regions. MoE represents a form of ensemble learning.

Why does Mixture of experts matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Mixture of experts?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Mixture of experts.

Tags

  • Machine learning algorithms

Keep exploring