Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity

William Fedus, Barret Zoph, Noam Shazeer
1/11/2021
5,423 citations
cs.LGcs.AI
transformer-attentionmoe

Official code: tensorflow/mesh (1,623 stars, Python, Apache-2.0, last commit 2023-11-17).

Abstract

In deep learning, models typically reuse the same parameters for all inputs. Mixture of Experts (MoE) defies this and instead selects different parameters for each incoming example.

Show full abstract

The result is a sparsely-activated model -- with outrageous numbers of parameters -- but a constant computational cost. However, despite several notable successes of MoE, widespread adoption has been hindered by complexity, communication costs and training instability -- we address these with the Switch Transformer. We simplify the MoE routing algorithm and design intuitive improved models with reduced communication and computational costs. Our proposed training techniques help wrangle the instabilities and we show large sparse models may be trained, for the first time, with lower precision (bfloat16) formats. We design models based off T5-Base and T5-Large to obtain up to 7x increases in pre-training speed with the same computational resources. These improvements extend into multilingual settings where we measure gains over the mT5-Base version across all 101 languages. Finally, we advance the current scale of language models by pre-training up to trillion parameter models on the "Colossal Clean Crawled Corpus" and achieve a 4x speedup over the T5-XXL model.

View on arXivView PDF

Code Implementations(1)

tensorflow/meshOfficial100%
Apache-2.0

Mesh TensorFlow: Model Parallelism Made Easier

1,623255Python, ShellSep 20, 20183 years agoApache-2.0

Similar Papers

Cite this paper

@article{fedus2021switch,
  title  = {Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity},
  author = {William Fedus and Barret Zoph and Noam Shazeer},
  year   = {2021},
  eprint = {2101.03961},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.03961}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2101.03961.svg)](https://codeofpaper.com/paper/2101.03961)

Discussion