Sparsely-Gated MoE (sparsely-gated mixture of experts) is a layer that prepares many small networks (experts) and, for each input, has a gating network select only a few () of them to compute. It was proposed by Shazeer et al. in 2017. Even when the number of parameters is increased greatly, the computation per input hardly increases.
An ordinary neural network uses all its parameters for every input. As a result, making the model larger increases the computation proportionally. When both the data and the model are scaled up, the training cost grows roughly quadratically.
This motivated "conditional computation", which runs only part of the network depending on the input. It resembles a hospital where the receptionist looks at the symptoms and sends the patient to only a few of dozens of specialists. Adding more doctors (experts) does not change the effort to examine one patient.
The idea of mixing the outputs of several experts with a gate goes back to the 1991 mixture of experts. This paper uses it as a single layer inside a deep network, makes the gate sparse (setting the weights of most experts to 0) to save computation, and adds techniques to run it efficiently on large GPU clusters. As a result, it trains language models with MoE layers of up to 137 billion parameters inserted between LSTM layers.
This layer became the basis of later large-scale MoE models such as GShard, Switch Transformer, and Mixtral.

