TL;DR
GPT-3 is an autoregressive Transformer with 175 billion parameters, trained only to predict the next token of web text. Show it a few worked examples of a task inside the prompt and it performs the task with no gradient updates. On several benchmarks it comes close to models that were fine-tuned on thousands of labeled examples. The paper's main claim is that this ability, called in-context learning, improves smoothly as the model gets bigger.
Where you'll see it: the prompt-driven way most people use large language models today, where a task is described and demonstrated in text instead of trained into a new model.
The problem
The standard recipe before 2020 was pretrain then fine-tune. Train a large model on unlabeled text, then run Fine-Tuning on a labeled dataset for each new task. Fine-tuning works, but it needs thousands to hundreds of thousands of labeled examples per task. A fine-tuned model can also latch onto narrow patterns in its training data, so its benchmark score may overstate how well it understands the task. A person, by contrast, can learn a new language task from one instruction or two examples.
Zero-shot transfer without fine-tuning had shown promise, but it was far behind. The paper cites one earlier result that scored only 4% on Natural Questions. The open question was whether scale alone could close that gap, so that a single model could do many tasks from a short description and a handful of examples.
Key idea
Keep the model task-agnostic, make it much larger, and give the task at inference time as text. The prompt holds a natural language description, optionally a few input and output pairs, and then the new input. The model continues the text, and the continuation is the answer. No weights change. The paper's example asks for English to French translation:
Translate English to French:
sea otter => loutre de mer
peppermint => menthe poivrée
plush giraffe => girafe peluche
cheese =>
The model is expected to write "fromage". The paper calls the inner loop of this process in-context learning. The outer loop is the pretraining that gave the model its skills. The authors measure how much the model improves as they add demonstrations and as they increase its size.
The method
Architecture and scale
GPT-3 uses the same architecture as GPT-2, with one change: the layers alternate dense attention with locally banded sparse attention, similar to the Sparse Transformer. The authors trained eight sizes, from 125 million to 175 billion parameters, to test how performance depends on scale. The table shows four of the eight (the others are 350M, 760M, 2.7B and 6.7B). All use a context window of 2048 tokens and a feedforward width of four times the model width.
| Model | Parameters | Layers | Model width | Heads | Batch (tokens) | Learning rate |
|---|---|---|---|---|---|---|
| GPT-3 Small | 125M | 12 | 768 | 12 | 0.5M | 6.0e-4 |
| GPT-3 XL | 1.3B | 24 | 2048 | 24 | 1M | 2.0e-4 |
| GPT-3 13B | 13.0B | 40 | 5140 | 40 | 2M | 1.0e-4 |
| GPT-3 175B | 175.0B | 96 | 12288 | 96 | 3.2M | 0.6e-4 |
The largest model is 1400 times bigger than the smallest one by parameter count, which is the range the scaling experiments need.
Training data
The corpus is a mix of five sources. Filtered Common Crawl is 410 billion tokens and makes up 60% of the training mix. The rest is WebText2 (19 billion tokens), Books1 (12 billion), Books2 (55 billion), and English Wikipedia (3 billion). Sampling is not proportional to size. Over the 300 billion training tokens, Common Crawl is seen only 0.44 times and Books2 0.43 times, while WebText2 (2.9 times), Books1 (1.9 times) and Wikipedia (3.4 times) are repeated. The authors accept some overfitting on the curated data in exchange for higher quality.
The authors also tried to remove any overlap between their training data and the test and development sets of every benchmark they report. A filtering bug let some overlap through, and retraining was too expensive, so Section 4 measures the effect of the leftover contamination afterward.
Training objective and compute
Training is standard autoregressive language modeling. The model reads a sequence of tokens and is trained to assign high probability to each next token:
Here is the token at position , is the set of all weights, and is the probability the model gives that token. Minimizing this sum is the same as maximizing the likelihood of the training text.
GPT-3 was trained on 300 billion tokens. A common rule of thumb says training takes about six floating-point operations per parameter per token, since each parameter does about two operations in the forward pass and about four in the backward pass. The paper's estimate is FLOPs, which matches .
Three settings and how they are scored
The paper compares four ways to specify a task.
| Setting | What the model sees at test time | Weight updates |
|---|---|---|
| Fine-tuning | Nothing at test time; the weights were trained on the task | Yes, on thousands of examples |
| Few-shot | Task description plus K demonstrations (K typically 10 to 100) | None |
| One-shot | Task description plus one demonstration | None |
| Zero-shot | Task description only | None |
GPT-3 is evaluated in the last three settings. The demonstrations are drawn at random from the task's training set, and K is chosen on the development set. For multiple-choice tasks the model scores each candidate completion by its likelihood, normalized by length. For free-form answers it uses beam search with width 4 and a length penalty of 0.6, then scores with F1, BLEU, or exact match, whichever is standard for the dataset.
Results
Language modeling
On the Penn Tree Bank, zero-shot, GPT-3 reaches a perplexity of 20.50. The previous state of the art was 35.8, so the improvement is about 15 points. The authors skip most standard language-modeling benchmarks because they are built from Wikipedia, which the model saw during training.
Cloze and completion
On LAMBADA, which tests whether the model can predict the last word of a passage that needs long context, few-shot GPT-3 reaches 86.4% accuracy. The previous best was 68.0%. Zero-shot reaches 76.2%.
Closed-book question answering
Closed-book means the model must answer from what it stored in its weights, with no retrieval step. On TriviaQA few-shot GPT-3 reaches 71.2%, above the 68.0% of a fine-tuned open-domain system that uses retrieval. On Natural Questions it reaches 29.9% few-shot, well behind the fine-tuned open-domain system at 44.5%.
SuperGLUE
On the SuperGLUE suite, GPT-3 was given 32 examples per task in the few-shot setting. Its test-set average (Table 3.8) is 71.8, just above fine-tuned BERT-Large at 69.0 and far below the fine-tuned state of the art at 89.0. It is near state of the art on COPA (92.0 against 94.8) and ReCoRD. It reaches 80.1% on WSC. It is weak on WiC, at 49.4%, which is chance for a two-way task. The authors also find, from a sweep over the number of examples on the dev set (Figure 3.8), that fewer than eight examples per task are enough for GPT-3 to beat a fine-tuned BERT-Large on the overall score. That sweep uses dev scores, so it is not directly comparable to the test-set table.
Arithmetic
The authors wrote ten arithmetic tests and asked the model to answer in plain text, for example "Q: What is 48 plus 76? A:". Accuracy on the 175B model:
| Setting | 2-digit add | 3-digit add | 4-digit add | 5-digit add |
|---|---|---|---|---|
| Zero-shot | 76.9 | 34.2 | 4.0 | 0.7 |
| One-shot | 99.6 | 65.5 | 14.0 | 3.5 |
| Few-shot | 100.0 | 80.4 | 25.5 | 9.3 |
- few-shot
- one-shot
- zero-shot
Smaller models do much worse. Even the 13B model solves two-digit addition only about half the time.
News articles
The authors generated news articles from titles and asked about 80 people per model to say which article a human wrote. Accuracy at spotting the deliberately bad control model was about 86%. Accuracy on the 175B model's articles was about 52%, barely above chance.
Scaling
Across the eight sizes, cross-entropy loss follows a power law in training compute, and the trend continues for about two more orders of magnitude with little bending. Downstream performance also rises with size in all three settings. The gap between zero-shot and few-shot performance grows with size, which the authors read as evidence that larger models are better at learning from context.
Limitations the authors report
Long samples lose coherence, repeat themselves, and sometimes contradict themselves. Few-shot performance is weak on natural language inference (ANLI, RTE) and on some reading-comprehension sets. The model is autoregressive, so it cannot look ahead, and the paper does not test bidirectional or denoising objectives. Pretraining is also very sample-inefficient compared with a human. Finally, the authors do not know whether few-shot learning acquires a new task at inference time or recognizes a task seen in training, and inference at this scale is expensive.
Why it mattered
GPT-3 showed that a single pretrained model could be steered by its prompt for many tasks, which made the prompt itself a programming interface. It turned scale into a research strategy. The paper's results shaped the next generation of models that were trained or tuned to follow instructions, and they made the case that large models could be used through an API rather than retrained for each task. The authors themselves name distillation as the route to making models of this size practical.
Reading guide
Read the paper with these lessons in hand, in reading order:
- Introduction. The paper leans on In-Context Learning and on the contrast with Fine-Tuning. Read both first, and Transfer Learning for the wider pretraining context.
- Section 2.1 (model). Uses the Transformer architecture, pre-normalization with Layer Normalization, and Softmax inside attention and at the output.
- Section 2.2 (data). Tokens are counted with byte-pair encoding; see Subword Tokenization. The N-gram Language Model is the older way of predicting the next word and helps explain why scale matters.
- Section 2.3 (training). Uses the Adam Optimizer and the batch-size and learning-rate choices in Table 2.1.
- Section 2.4 (evaluation). Depends on in-context learning as defined above. The likelihood scoring for multiple choice is the part to read closely.
- Section 3.7 (SuperGLUE) and the comparison to BERT. Compare with BERT: Pre-training of Deep Bidirectional Transformers, which is the fine-tuned baseline the paper beats, and with Masked Language Modeling, the alternative objective the paper does not use.