Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer

  • Problem Scaling a neural network's parameter count usually raises its computation cost in step, so capacity is hard to grow cheaply.
  • Method A trainable gating network picks a sparse set of feed-forward experts for each input, so only the selected experts run. The layer sits between stacked LSTM layers and is trained with two auxiliary balancing losses.
  • Results The hierarchical MoE with 4096 experts reached 24% lower test perplexity than a computationally matched baseline on the 1-Billion-Word benchmark. The MoE with 65536 experts reached 39% lower test perplexity than its matched baseline on 100 billion words.

Why sparse experts are needed

In a dense network every parameter is used for every example, so growing the model roughly costs the same growth in training compute as growing the data. Conditional computation avoids this by switching large parts of a network on or off for each example, but earlier schemes had not shown large gains in capacity, training time or quality.

The authors name four obstacles: GPUs favour arithmetic over branching, small per-expert batches waste hardware, network bandwidth can limit embedding-like lookups, and extra loss terms are needed to control sparsity and load. A fifth concern is data size: prior conditional computation work used image datasets of up to 600,000 images, which the authors judge too small to train a model with billions of parameters.

How the gate selects experts

The layer holds n expert networks, each a feed-forward network with the same architecture and separate parameters, plus a gating network whose output for each input is a sparse n-dimensional vector. The output is the gate-weighted sum of the expert outputs, so an expert whose gate value is zero does not need to be evaluated. \[ y = \sum_{i=1}^{n} G(x)_i\, E_i(x) \]

A plain softmax gate multiplies the input by a trainable matrix W_g and applies the softmax, which gives no zeros. Noisy Top-K Gating adds tunable Gaussian noise to the logits, keeps only the k largest values, and sets the rest to minus infinity before the softmax, so unselected gates become zero. \[ G(x) = \mathrm{Softmax}(\mathrm{KeepTopK}(H(x), k)) \] \[ H(x)_i = (x \cdot W_g)_i + \mathrm{StandardNormal}() \cdot \mathrm{Softplus}((x \cdot W_{noise})_i) \] The second trainable matrix W_noise controls how much noise each component receives.

Because the gate is trained by ordinary back-propagation, the top-k gate values receive nonzero gradients with respect to the gating weights, and gradients also flow to the gate inputs. This differs from the boolean gates with a REINFORCE-style update used in the work of Bengio et al. (2015). The layer is applied convolutionally between stacked LSTM layers, so the same MoE is called once for each text position and may choose different experts at each position.

Keeping experts busy with large batches

If the gate picks k out of n experts per example, a batch of b examples gives each expert only about kb/n examples, which makes a naive implementation inefficient as the expert count grows. Batch size is capped by the memory needed to store activations for the backward pass, so simply enlarging the batch is limited.

The authors run the data-parallel batches from all devices synchronously, so their examples can be combined at each MoE layer, while the standard layers and gating network stay data-parallel and each expert keeps a single shared copy. Each device also hosts a subset of the experts, so the same devices serve as data-parallel replicas and as model-parallel shards.

If the model spans d devices with batch size b on each, each expert receives about kbd/n examples, which is a factor of d larger than without this scheme.

Adding devices therefore raises the number of experts, and hence the parameter count, while the batch per expert, the memory and bandwidth per device and the step time stay constant. Applying the MoE to all time steps of a layer as one batch enlarges the input batch by the number of unrolled steps, but a recurrent MoE breaks this trick, so the authors point to recomputation of activations as a way to reduce stored memory.

Bandwidth is a further constraint: an expert's computation must be large compared with its input and output, and for a one-hidden-layer expert that ratio equals the hidden-layer size, which the authors note can be raised by using a larger hidden layer.

Balancing expert usage

The gate tends to favour the same few experts, and this is self-reinforcing because favoured experts train faster and are then picked more often. The authors use a soft constraint instead of the hard constraint of Eigen et al. (2013), defining an expert's importance as the batchwise sum of its gate values over the batch.

\[ \mathrm{Importance}(X) = \sum_{x \in X} G(x) \] \[ L_{\mathrm{importance}}(X) = w_{\mathrm{importance}} \cdot \mathrm{CV}(\mathrm{Importance}(X))^2 \] Here CV is the coefficient of variation of the importance values, and w_importance is a hand-tuned scaling factor, so the loss pushes the expert importances toward equality.

Equal importance does not guarantee equal example counts, since one expert can receive a few large-weight examples while another receives many small-weight ones, which causes memory and speed problems on distributed hardware. A second loss, Lload, is introduced to balance the number of examples routed to each expert.

Language modeling on the 1-Billion-Word benchmark

The 1-Billion-Word Language-Modeling Benchmark contains shuffled unique news sentences of about 829 million words with a 793,471-word vocabulary.

The series uses flat MoEs with 4, 32 and 256 experts and hierarchical MoEs with 256, 1024 and 4096 experts, each expert with about 1 million parameters. The model with four always-active experts performed similarly to the computationally matched baseline, while the 4096-expert model reached 24% lower test perplexity than that baseline.

Two further MoE models with similar capacity of 4 billion parameters but larger computation budgets were trained with larger LSTMs and fewer, larger experts. Against the best published result of 34.7 test perplexity after 10 epochs, the Low-Budget MoE Model reached 34.1 at 8.9 million ops/timestep, and the High-Budget MoE Model reached 28.0 at 142.7 million ops/timestep.

The MoE models were trained in TensorFlow on clusters of 16 to 32 Tesla K40 GPUs, and throughput is reported as TFLOPS per GPU, counting the backward pass, importance-sampling softmax training and multiply-and-add as two operations. Floating point operations in the experts make up between 37% and 46% of the total in the MoE models. Baseline models without MoE reached 1.07 to 1.29 TFLOPS/GPU, the low-computation MoE models 0.74 to 0.90, and the High-Budget MoE Model 1.56 TFLOPS/GPU, which the authors attribute to its larger matrices.

Scaling to a 100-billion-word corpus

The authors built a training set of shuffled unique sentences from Google's internal news corpus, totalling roughly 100 billion words. Models with about 8 million ops/timestep were compared, including a baseline LSTM and MoE layers with 32, 256, 1024, 4096, 16384, 65536 and 131072 experts, which corresponds to up to 137 billion parameters in the MoE layer.

Perplexity degrades at 131072 experts, which the authors suggest may come from too much sparsity. The gap between the two training-size curves widens, which the authors read as evidence that extra capacity helps more on larger training sets.

At 65536 experts, which is 99.994% layer sparsity, computational efficiency stays at 0.72 TFLOPS/GPU.

Translation with MoE layers in GNMT

The model is a modified GNMT, with the encoder and decoder reduced from 9 and 8 LSTM layers to 3 and 2. MoE layers are inserted between layers 2 and 3 of the encoder and between layers 1 and 2 of the decoder, each with up to 2048 experts of about two million parameters, adding about 8 billion parameters.

The WMT’14 En→Fr and En→De training sets have 36M and 5M sentence pairs, with newstest2014 as the test set and newstest2012 plus newstest2013 as the development set. The Google Production English to French data was used as a further test.

The models did not use RL refinement, so the comparison is with the GNMT and GNMT+RL results of Wu et al. (2016) reported in the same tables.

On the Google Production English to French data the MoE model reached 36.57 test BLEU against 35.56 for GNMT, which is 1.01 higher, after training for one sixth of the time.

One MoE model for twelve language pairs

Johnson et al. (2016) trained one GNMT model on twelve language pairs, which gave somewhat worse results than twelve separately trained single-pair models. The authors trained a single MoE-augmented model on the same dataset, processing about 3 billion sentence pairs, which is the same number of training examples.

Its BLEU is higher than the multilingual GNMT model on 11 of the 12 language pairs, with the largest gain of 5.84 points on Korean→English, and it also beats the monolingual GNMT models on 8 of 12 pairs. The authors attribute the weak English→Korean result to severe overtraining, because a small number of real examples for the rarer pairs were heavily oversampled.

Limitations

The 131072-expert model degrades in perplexity, and the authors suggest this may be too much sparsity rather than a fixed limit.

The gating's discontinuities are noted as theoretically unsettling, but the authors have not observed them to be a problem in practice. The systems were not scaled to a trillion-parameter model, and the authors expect that adding hardware would make this possible. The main experiments cover only language modeling and machine translation, and the reported efficiency numbers come from clusters of K40 or K80 GPUs in the cited setups.

Paper info

Authors
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, Jeff Dean
Venue
arXiv · Preprint
First published
2017-1-23
Added
2026-10-20
Updated
2017-1-23
Version
v1
arXiv
1701.06538
Category
cs.LG · cs.CL · cs.NE · stat.ML
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, Jeff Dean (2017). Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer. arXiv:1701.06538v1. https://arxiv.org/abs/1701.06538v1

BibTeX
@misc{shazeer2017outrageously,
  title = {{Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer}},
  author = {Noam Shazeer and Azalia Mirhoseini and Krzysztof Maziarz and Andy Davis and Quoc Le and Geoffrey Hinton and Jeff Dean},
  year = {2017},
  eprint = {1701.06538},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1701.06538v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up