NLP Lineage

30 June 2020 · Scale and data

GShard

GShard: Scaling Giant Models with Conditional Computation

D. Lepikhin, H. Lee, Y. Xu, et al. (9 authors)

Date
30 June 2020
What the date marks
arXiv submission
Kind
Infrastructure
Organisation
Google
Access
Apache 2.0
Other dates
ICLR 2021
Threads
In the guided tour
Chapter 5. Scale becomes a science
Learning phases
8. Training from scratch

A turning point: 6 later milestones descend directly from it, and its descendants reach 9 of the 10 threads. How levels are decided

Drafted with Claude from the paper on 15 October 2026; reviewed by Zeeshan Arif. Read from arxiv.org (arXiv version 1 (June 2020), a preprint under review; the paper was later published at ICLR 2021).

What it changed

It made giant mixture-of-experts models practical to train. A programmer adds a few notes to the model code to say how each large array should be split, and a compiler spreads the work over thousands of chips. With it, the authors trained a 600-billion-parameter translation model in 4 days.

The problem before it

Larger models were better, but training them was hard in practice. The authors list four problems:

Sparsely gated mixture-of-experts layers had already shown how to add parameters without adding much computation per token. But they had been used with recurrent networks, and splitting them over many devices was still hard.

The idea

The mechanism. The paper has two parts: a model design and a system to train it.

The model: a Transformer with mixture-of-experts layers. Start from a Transformer encoder-decoder and replace every second feed-forward layer with a mixture-of-experts layer. An expert is a small feed-forward network. A gating network picks at most 2 experts for each token, so each token uses only a small part of the model. The gate has four rules to keep the work balanced:

The system: GShard. GShard is a small set of annotation functions and an extension to the XLA compiler.

In the translation model, attention layers are copied to every device, and the experts are split across devices, one expert per device in each mixture-of-experts layer.

The notation. For a token x_s, the layer’s output is y_s = Σ_e G_(s,e) · FFN_e(x_s). Here FFN_e is expert e, and G_(s,e) is its gate weight, which is zero for all but at most 2 experts.

What it showed

Reported in the paper. We read version 1 of the arXiv preprint. The task is translation from 100 languages into English, trained on about 13 billion example pairs mined from the web. BLEU is a standard translation score; higher is better. The paper reports the average gain over separate models trained for each language pair.

Limits, and what came later

The limits come from the paper:

Switch Transformer simplified the routing to one expert per token. Mixtral and DeepSeekMoE built on this kind of conditional computation. Google’s later large models, such as PaLM and Gemini, were built on Google’s sharding infrastructure.

What to know first

How to read it

The paper is 35 pages, with 25 pages of main text. It is half model and half systems.

  1. Read section 1 with Figure 1 for the problem and the main result.
  2. Read section 2, the mixture-of-experts Transformer and its gating rules.
  3. Read section 3.2 for the annotation functions. Section 3.3 is compiler detail and is optional.
  4. Read section 4 with Figure 6 and Tables 1 to 3 for the translation results.
  5. Skim section 5 for memory and speed.

Expect about 2 hours for the steps above (an estimate).

In brief, from the research data

Before it

Mixture-of-experts worked in research but was hard to distribute across accelerators.

The problem

Routing tokens to experts on other devices creates communication patterns the compiler cannot infer.

What it introduced

Annotation-based sharding that lets a compiler distribute a 600B-parameter MoE automatically.

Why it matters

It made sparse models an engineering reality rather than a paper result.

What modern models inherit

Automatic sharding of expert layers across devices.

What came next

Switch Transformer simplified the routing; Mixtral and DeepSeek inherited the approach.

Before and after

The milestones it descends from, and the milestones that descend from it. Work developed alongside it is not counted. Weak links are left out unless you include them.

Before: where it came from

GShard has 4 documented ancestors across 2 chapters, reaching back to Recurrent networks in 1990. Showing its direct parents and the 2 turning points among them.

GShard has 4 documented ancestors across 2 chapters, reaching back to Recurrent networks in 1990. Showing all of them.

GShard has 4 recorded ancestors, including indirect ones, across 2 chapters, reaching back to Recurrent networks in 1990. Showing its direct parents and the 2 turning points among them.

GShard has 4 recorded ancestors, including indirect ones, across 2 chapters, reaching back to Recurrent networks in 1990. Showing all of them.

  1. 2020GShardThis milestone.
  2. 2017Sparse MoE Turning pointGShard built directly on thisChapter 3. Attention, then only attention
  3. 1997LSTM Turning pointSparse MoE built directly on thisChapter 1. Language as probability
  4. 1991Mixture of expertsSparse MoE built directly on thisChapter 1. Language as probability
  5. 1990Recurrent networksLSTM was influenced by thisChapter 1. Language as probability
  1. 2020GShardThis milestone.
  2. 2017Sparse MoE Turning pointGShard built directly on thisChapter 3. Attention, then only attention
  3. 1997LSTM Turning pointSparse MoE built directly on thisChapter 1. Language as probability
  4. 1991Mixture of expertsSparse MoE built directly on thisChapter 1. Language as probability
  5. 1990Recurrent networksLSTM was influenced by thisChapter 1. Language as probability

After: what it led to

GShard has 29 documented descendants across 8 chapters, reaching forward to Qwen3.8 in 2026. Showing its direct descendants.

GShard has 29 documented descendants across 8 chapters, reaching forward to Qwen3.8 in 2026. Showing all of them.

GShard has 32 recorded descendants, including indirect ones, across 8 chapters, reaching forward to Qwen3.8 in 2026. Showing its direct descendants.

GShard has 32 recorded descendants, including indirect ones, across 8 chapters, reaching forward to Qwen3.8 in 2026. Showing all of them.

  1. 2020GShardThis milestone.
  2. 2021Switch Transformerbuilt directly on GShardChapter 5. Scale becomes a science
  3. 2022PaLMwas influenced by GShardChapter 5. Scale becomes a science
  4. 2022Emergent abilitieswas influenced by PaLMChapter 5. Scale becomes a science
  5. 2022Flan-T5 / Flan-PaLMbuilt directly on PaLMChapter 6. Teaching models what people want
  6. 2023Emergence miragesucceeded Emergent abilitiesChapter 5. Scale becomes a science
  7. 2023Gemini 1.0was influenced by GShardChapter 11. Seeing and hearing
  8. 2023Mixtral 8x7Bbuilt directly on GShardChapter 8. The weights get out
  9. 2024DeepSeekMoEbuilt directly on GShardChapter 8. The weights get out
  10. 2024Gemini 1.5was influenced by GShardChapter 10. Reading more than you remember
  11. 2024Gemmabuilt directly on Gemini 1.0Chapter 8. The weights get out
  12. 2024DeepSeek-V2 / MLAbuilt directly on DeepSeekMoEChapter 9. Making it run anywhere
  13. 2024Gemini 2.0built directly on Gemini 1.5Chapter 14. Where the threads meet now
  14. 2024DeepSeek-V3built directly on DeepSeekMoEChapter 8. The weights get out
  15. 2025DeepSeek-R1built directly on DeepSeek-V3Chapter 12. Thinking longer
  16. 2025Gemini 2.5was influenced by Gemini 1.5Chapter 12. Thinking longer
  17. 2025Llama 4was influenced by Switch TransformerChapter 8. The weights get out
  18. 2025Qwen3was influenced by DeepSeek-R1Chapter 8. The weights get out
  19. 2025Kimi K2was influenced by DeepSeekMoEChapter 8. The weights get out
  20. 2025IMO goldbuilt directly on Gemini 2.5Chapter 12. Thinking longer
  21. 2025DeepSeek-V3.2was influenced by DeepSeek-V2 / MLA
    built directly on DeepSeek-V3
    Chapter 10. Reading more than you remember
  22. 2025IMO-ProofBenchwas influenced by IMO goldChapter 12. Thinking longer
  23. 2025Gemini 3was influenced by Gemini 1.5Chapter 14. Where the threads meet now
  24. 2026Gemini 3 Deep Thinkbuilt directly on Gemini 3Chapter 12. Thinking longer
  25. 2026Qwen3.5built directly on Qwen3Chapter 8. The weights get out
  26. 2026Gemini 3.1built directly on Gemini 3Chapter 14. Where the threads meet now
  27. 2026Muse Sparksucceeded Llama 4Chapter 8. The weights get out
  28. 2026DeepSeek-V4was influenced by DeepSeek-V3Chapter 8. The weights get out
  29. 2026Kimi K3built directly on Kimi K2Chapter 8. The weights get out
  30. 2026Qwen3.8built directly on Qwen3.5Chapter 8. The weights get out
  1. 2020GShardThis milestone.
  2. 2021Switch Transformerbuilt directly on GShardChapter 5. Scale becomes a science
  3. 2022PaLMwas influenced by GShardChapter 5. Scale becomes a science
  4. 2022Emergent abilitieswas influenced by PaLMChapter 5. Scale becomes a science
  5. 2022Flan-T5 / Flan-PaLMbuilt directly on PaLMChapter 6. Teaching models what people want
  6. 2023Emergence miragesucceeded Emergent abilitiesChapter 5. Scale becomes a science
  7. 2023Gemini 1.0was influenced by GShardChapter 11. Seeing and hearing
  8. 2023Mixtral 8x7Bbuilt directly on GShardChapter 8. The weights get out
  9. 2024DeepSeekMoEbuilt directly on GShardChapter 8. The weights get out
  10. 2024Gemini 1.5was influenced by GShardChapter 10. Reading more than you remember
  11. 2024Gemmabuilt directly on Gemini 1.0Chapter 8. The weights get out
  12. 2024DeepSeek-V2 / MLAbuilt directly on DeepSeekMoEChapter 9. Making it run anywhere
  13. 2024Gemini 2.0built directly on Gemini 1.5Chapter 14. Where the threads meet now
  14. 2024DeepSeek-V3built directly on DeepSeekMoEChapter 8. The weights get out
  15. 2025DeepSeek-R1built directly on DeepSeek-V3Chapter 12. Thinking longer
  16. 2025Gemini 2.5was influenced by Gemini 1.5Chapter 12. Thinking longer
  17. 2025Llama 4was influenced by Switch Transformer
    was influenced by Mixtral 8x7B (indirect influence)
    Chapter 8. The weights get out
  18. 2025Qwen3was influenced by DeepSeek-R1Chapter 8. The weights get out
  19. 2025Kimi K2was influenced by DeepSeekMoEChapter 8. The weights get out
  20. 2025IMO goldbuilt directly on Gemini 2.5Chapter 12. Thinking longer
  21. 2025gpt-osswas influenced by DeepSeek-R1 (indirect influence)Chapter 8. The weights get out
  22. 2025GLM-4.5was influenced by DeepSeek-R1 (indirect influence)Chapter 8. The weights get out
  23. 2025DeepSeek-V3.2was influenced by DeepSeek-V2 / MLA
    built directly on DeepSeek-V3
    Chapter 10. Reading more than you remember
  24. 2025IMO-ProofBenchwas influenced by IMO goldChapter 12. Thinking longer
  25. 2025Gemini 3was influenced by Gemini 1.5Chapter 14. Where the threads meet now
  26. 2026Gemini 3 Deep Thinkbuilt directly on Gemini 3Chapter 12. Thinking longer
  27. 2026Qwen3.5built directly on Qwen3Chapter 8. The weights get out
  28. 2026Gemini 3.1built directly on Gemini 3Chapter 14. Where the threads meet now
  29. 2026Muse Sparksucceeded Llama 4Chapter 8. The weights get out
  30. 2026DeepSeek-V4was influenced by DeepSeek-V3Chapter 8. The weights get out
  31. 2026GLM-5.2built directly on GLM-4.5Chapter 8. The weights get out
  32. 2026Kimi K3built directly on Kimi K2Chapter 8. The weights get out
  33. 2026Qwen3.8built directly on Qwen3.5Chapter 8. The weights get out

Direct links and their sources

Where it came from

Built directly on

Developed alongside

What it led to

Built on directly by

Influenced

Terms