Skip to main content
GW
HomeWorkAI appsPapersAboutNotesStackLabPilotPlan↗ (opens in a new tab)INVST↗ (opens in a new tab)
Govind Waghmare

Finance systems and AI. Building in public from NYC.

Resume (PDF)Book 20 minEmail
HomeNotesWorkAboutStackPapersLabFor founders
XLinkedInGitHubllms.txt
© 2026 · New York City

Keyboard shortcuts

?
Open this list
g then h
Go to Home
g then w
Go to Work
g then n
Go to Notes
g then a
Go to About
c
Ask the AI guide
Esc
Close this list
Original paperSection A, The abstract
Open in new tab (opens in a new tab)
All papers
FoundationsClassic

GPT-3: a huge model that learns from examples in the prompt

Paper: Language Models are Few-Shot Learners

Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, Dario Amodei · arXiv preprint (OpenAI) · Posted 28 May 2020 · 30 min read · arXiv 2005.14165

Share this paper

LinkedIn (opens in a new tab)X (opens in a new tab)WhatsApp (opens in a new tab)EmailDownload PDFExplainer (PDF), 1.0 MB

  • Pre-trained models still need thousands of labeled examples for each new task.
  • Humans can learn a new language task from a few examples.
  • The authors ask if a much bigger model can do the same.
175 billion

parameters in GPT-3, 10x more than any earlier non-sparse model.

  • They trained 8 model sizes, from 125 million to 175 billion parameters.
  • They tested zero-shot, one-shot and few-shot use, with no weight updates.
  • They used over two dozen NLP datasets and new tasks.
  • They checked for test data in the training set.

  • Few-shot results rose smoothly with model size.
  • GPT-3 matched or beat fine-tuned models on some tasks.
  • It struggled on tasks that compare two sentences.
  • People could not tell its news articles from human ones: 52% accuracy.

People guess GPT-3 articles at close to chanceFrom Table 3.11
0255075100Mean human accuracy at spotting model-written news (%)Control (bad model)86%GPT-3 Small76%GPT-3 Medium61%GPT-3 Large68%GPT-3 XL62%GPT-3 2.7B62%GPT-3 6.7B60%GPT-3 13B55%GPT-3 175B52%

Hover, tap or focus a bar to read its exact value.

ModelHuman accuracy (%)
Control (bad model)86
GPT-3 Small76
GPT-3 Medium61
GPT-3 Large68
GPT-3 XL62
GPT-3 2.7B62
GPT-3 6.7B60
GPT-3 13B55
GPT-3 175B52

  • Contamination: a filter bug let some test data into training.
  • It still lost coherence over long passages and repeated itself.
  • Models this large cost a lot to run.
  • It shows bias about gender, race and religion.

Jump to

  1. A The abstract
  2. 1 Introduction
  3. 2 Approach
  4. 2.1 Model and architectures
  5. 2.2 Training dataset
  6. 2.3 Training process
  7. 2.4 Evaluation
  8. 3 Results: overview and scaling
  9. 3.1 Language modeling, cloze and completion
  10. 3.2 Closed book question answering
  11. 3.3 Translation
  12. 3.4 Winograd-style tasks
  13. 3.5 Common sense reasoning
  14. 3.6 Reading comprehension
  15. 3.7 SuperGLUE
  16. 3.8 Natural language inference
  17. 3.9 Synthetic and qualitative tasks
  18. 4 Measuring and preventing memorization of benchmarks
  19. 5 Limitations
  20. 6.1 Broader impacts: misuse of language models
  21. 6.2 Broader impacts: fairness, bias and representation
  22. 6.3 Broader impacts: energy usage
  23. 7 Related work
  24. 8 Conclusion
  25. A-B Appendices A and B (summary)
  26. C Appendix C: contamination study details (summary)
  27. D Appendix D: compute used (summary)
  28. E Appendix E: human quality assessment (summary)
  29. F-H Appendices F, G and H (summary)
  30. W Words to know

Every detail from the paper

Cards follow the paper's own order. Dotted words link to Words to know. Numbers match the paper.

The problem

  • Pre-training then fine-tuning has given large gains on many NLP tasks.
  • But it still needs task-specific data sets of thousands or tens of thousands of examples.
  • Humans can do a new task from a few examples or simple instructions.

The idea

  • Scaling up language models greatly improves task-agnostic few-shot performance.
  • Sometimes it is competitive with earlier best fine-tuned methods.

The model

  • GPT-3 is an autoregressive language model.
  • It has 175 billion parameters, 10x more than any earlier non-sparse language model.
  • It is tested in the few-shot setting.
  • It gets no gradient updates and no fine-tuning.
  • Tasks and examples are given purely as text.

The results

  • Strong results on many NLP data sets, including translation, question answering and cloze tasks.
  • Also on tasks that need on-the-fly reasoning, such as unscrambling words.
  • Other examples: using a novel word in a sentence, and 3-digit arithmetic.
  • Some data sets are still hard for few-shot learning.
  • Some have problems from training on large web text.
  • GPT-3 writes news articles that human judges find hard to tell from human ones.
  • The paper also discusses wider effects on society.

How the field got here

  • First, word vectors fed task-specific models.
  • Then RNNs with several layers gave stronger representations.
  • Then pre-trained recurrent and transformer models were fine-tuned directly.
  • This removed the need for task-specific architectures.

The limit

  • You still need a task-specific data set and fine-tuning.
  • Strong results typically need thousands to hundreds of thousands of examples.

Why remove that limit

  • First: a labeled data set for every task limits where models can be used.
  • Tasks range from grammar fixes to story critiques. Data is hard to collect for many.
  • Second: larger models and narrow tuning data raise the chance of spurious links.
  • Fine-tuned results can overstate real performance on the task.
  • Third: humans learn from a short instruction or a tiny number of examples.

Meta-learning

  • Meta-learning means the model learns broad skills in training.
  • At run time it uses those skills to adapt fast to the task.
  • In-context learning is the inner loop of this process.
  • It happens inside one forward pass on each sequence.
  • The model gets an instruction or a few examples, then predicts what comes next.

Earlier results

  • Earlier work did this with far worse results.
  • It reached only 4% on Natural Questions.
  • Its 55 F1 on CoQA was more than 35 points behind the best.

The scale trend

  • Transformer models grew from 100 million to 17 billion parameters.
  • The steps were 300 million, 1.5 billion, 8 billion and 11 billion.
  • Each step helped. Loss follows a smooth trend with scale.
  • So in-context learning may also improve with scale.
  • This paper tests that with 175 billion parameters.

Terms

  • 'Zero-shot transfer' can mislead, since examples may still be shown.
  • So the authors use 'meta-learning' for the whole loop.
  • They use 'in-context learning' for the inner loop.
  • They then say zero-shot, one-shot or few-shot, by how many examples appear.

What they did

  • They trained GPT-3.
  • They tested it on over two dozen NLP data sets and new tasks.
  • Few-shot means as many examples as fit in the context window, typically 10 to 100.
  • One-shot means a single example.
  • Zero-shot means an instruction with no example.
  • They did not fine-tune GPT-3. That is left for later work.

Sample results

  • CoQA F1: 81.5 zero-shot, 84.0 one-shot, 85.0 few-shot.
  • TriviaQA accuracy: 64.3% zero-shot, 68.0% one-shot, 71.2% few-shot.
  • The few-shot TriviaQA result is best among fine-tuned closed-book models.

Other findings

  • GPT-3 can unscramble words, do arithmetic, and use new words after one definition.
  • In the few-shot setting it writes news articles people struggle to detect.
  • It struggles on inference sets like ANLI.
  • It also struggles on reading sets like RACE and QuAC.
  • Few-shot gaps over zero-shot often grow with model size.
  • So larger models may be better meta-learners.

Contamination

  • Data contamination is when test data sits in the training set.
  • This happens often on web data like Common Crawl.
  • The authors built tools to measure it.
  • It had little effect on most data sets.
  • A few data sets are marked with an asterisk, or left out.

The smaller models

  • They also trained models from 125 million to 13 billion parameters.
  • Most tasks scale smoothly in all three settings.
  • The paper covers broader impacts in Section 6.

What is the same

  • The basic training is like GPT-2, only scaled up.
  • It scales model size, data size, data variety and training length.
  • In-context learning is also like GPT-2, but studied more systematically.
Four ways to use a model on a taskFrom Section 2 and Figure 2.1
  1. Fine-tuning: train on many labeled examples
  2. Few-shot: 10 to 100 examples
  3. One-shot: one example plus instruction
  4. Zero-shot: instruction only

Few-shot, one-shot and zero-shot use only forward passes. The weights never change.

The four settings

Fine-tuning (FT)

  • Update the weights by training on a labeled data set for the task.
  • It uses thousands to hundreds of thousands of examples.
  • Strength: strong results on many benchmarks.
  • Weakness: a new large data set for every task.
  • It may generalize poorly out of its training range.
  • It may exploit spurious features of the data.
  • The authors do not fine-tune GPT-3. They focus on task-agnostic results.

Few-shot (FS)

  • Give K examples of context and completion, then one final context.
  • The model gives the completion. No weight updates.
  • K is usually 10 to 100, whatever fits in the context window of 2048 tokens.
  • Strength: far less task data, and less risk of a narrow fit.
  • Weakness: results so far are much worse than the best fine-tuned models.
  • It still needs a little task data.

One-shot (1S)

  • Like few-shot, but with one example plus a task description.
  • It matches how some tasks are given to people.
  • For example, a worker on a crowd platform often sees one example.

Zero-shot (0S)

  • No examples. Only a natural language instruction.
  • It is the most convenient and avoids spurious links.
  • It is also the hardest setting.
  • Sometimes it is unfairly hard, even for people.
  • Example: 'make a table of world records for the 200m dash' is unclear.

How they use the settings

  • They study these settings as trade-offs, not as rivals.
  • The trade-off is task score against the need for task data.
  • Few-shot results are often only slightly behind the best fine-tuned models.
  • One-shot and sometimes zero-shot seem the fairest match to human performance.
  • Exact phrasings are in Appendix G.

Design

  • GPT-3 uses the same model and architecture as GPT-2.
  • That includes the changed initialization, pre-normalization and reversible tokenization.
  • One change: alternating dense and locally banded sparse attention layers.
  • This is like the Sparse Transformer.

Eight sizes

  • They train 8 sizes, over three orders of magnitude.
  • The sizes run from 125 million to 175 billion parameters.
  • The largest is called GPT-3.
  • Earlier work says loss should fall as a smooth power law with size.
  • Many sizes let them test this for loss and for tasks.

Reading the table

  • nparams is the number of trainable parameters.
  • nlayers is the number of layers.
  • dmodel is the size of each bottleneck layer.
  • The feed-forward layer is always 4 times dmodel.
  • dhead is the size of each attention head.
  • All models use a context window of nctx = 2048 tokens.

Practical points

  • They split the model across GPUs by depth and width, to cut data transfer.
  • Exact settings are chosen for compute efficiency and load balance.
  • Earlier work says loss is not very sensitive to these settings.
ModelParams / layers / dmodelHeads x dheadBatch / learning rate
GPT-3 Small125M / 12 / 76812 x 640.5M / 6.0 x 10^-4
GPT-3 Medium350M / 24 / 102416 x 640.5M / 3.0 x 10^-4
GPT-3 Large760M / 24 / 153616 x 960.5M / 2.5 x 10^-4
GPT-3 XL1.3B / 24 / 204824 x 1281M / 2.0 x 10^-4
GPT-3 2.7B2.7B / 32 / 256032 x 801M / 1.6 x 10^-4
GPT-3 6.7B6.7B / 32 / 409632 x 1282M / 1.2 x 10^-4
GPT-3 13B13.0B / 40 / 514040 x 1282M / 1.0 x 10^-4
GPT-3 175B (GPT-3)175.0B / 96 / 1228896 x 1283.2M / 0.6 x 10^-4

Table 2.1: sizes and settings

Batch size is in tokens. All models trained for a total of 300 billion tokens.

The data problem

  • Common Crawl holds nearly a trillion words.
  • That is enough to train the largest models without seeing a sequence twice.
  • But unfiltered Common Crawl tends to have lower quality than curated data.
How the training data was preparedFrom Section 2.2
  1. Filter Common Crawl by quality
  2. Remove near-duplicate documents
  3. Add curated high-quality sets
  4. Sample better data more often

Quality filtering used similarity to high-quality reference sets. Duplicates were removed within and across data sets.

The three steps

  • One: they filtered Common Crawl by similarity to high-quality reference sets.
  • Two: they removed near-duplicate documents at document level.
  • This keeps the held-out set a fair test for overfitting.
  • Three: they added curated sets to raise variety.
  • These are an expanded WebText, two book sets (Books1, Books2) and English Wikipedia.
  • Appendix A has the filtering details.

The size

  • Common Crawl came from 41 monthly shards, covering 2016 to 2019.
  • That was 45TB of compressed text before filtering and 570GB after.
  • It is roughly 400 billion byte-pair-encoded tokens.
  • Higher-quality sets are sampled more often.
  • Common Crawl and Books2 are sampled less than once.
  • The others are sampled 2-3 times.
  • This accepts a little overfitting for better data.
DatasetTokensWeight in mixEpochs at 300B tokens
Common Crawl (filtered)410 billion60%0.44
WebText219 billion22%2.9
Books112 billion8%1.9
Books255 billion8%0.43
Wikipedia3 billion3%3.4

Table 2.2: the training mix

The weights are not in proportion to data set size.

Contamination

  • A big risk: test or dev sets may have been seen in pre-training.
  • They tried to remove overlaps with all test sets in the paper.
  • A bug in the filter missed some overlaps.
  • Retraining was too costly.
  • Section 4 measures the effect of the remaining overlap.

Settings

  • Larger models can use a larger batch size but need a smaller learning rate.
  • They measure the gradient noise scale to pick the batch size.
  • They use model parallelism within each matrix multiply and across layers.
  • This keeps memory use down.
  • All models trained on V100 GPUs, on a high-bandwidth cluster from Microsoft.
  • Appendix B has more details.

Few-shot setup

  • For each test example, draw K examples at random from the task's training set.
  • Separate them with 1 or 2 newlines.
  • For LAMBADA and StoryCloze there is no training set. They use the dev set.
  • For Winograd there is one data set, so they draw from it.
  • K runs from 0 up to what the 2048 token window holds.
  • That is typically 10 to 100.
  • Larger K is usually but not always better.
  • They try a few K values on the dev set.
  • Then they run the best on the test set.
  • Some tasks also use a natural language prompt.

How answers are scored

  • Multiple choice: compare the likelihood of each completion given the examples.
  • Most tasks use per-token likelihood, to adjust for length.
  • For ARC, OpenBookQA and RACE, they divide by the unconditional chance of each answer.
  • Binary tasks get meaningful names, like True and False, then run as multiple choice.
  • Free-form tasks use beam search, with beam width 4 and length penalty α = 0.6.
  • They score by F1, BLEU or exact match, whichever is standard.

Reporting

  • Results are on the test set when it is public, for each size and setting.
  • When the test set is private, the model is often too big for the server.
  • Then they report on the dev set.
  • They submit only to a few test servers: SuperGLUE, TriviaQA and PiQa.

Training curves

  • Figure 3.1 shows training curves for the 8 models, plus 6 extra-small models.
  • The smallest has as few as 100,000 parameters.
  • Language modeling follows a power law when compute is used well.
  • The trend continues two more orders of magnitude, with only a slight bend, if any.

Does it matter

  • Lower loss could come from fitting spurious details of the corpus.
  • The next sections show that lower loss gives steady gains on many tasks.

The nine groups

  • Section 3.1: language modeling, cloze and completion.
  • Section 3.2: closed-book question answering.
  • Section 3.3: translation.
  • Section 3.4: Winograd-style tasks.
  • Section 3.5: common sense reasoning.
  • Section 3.6: reading comprehension.
  • Section 3.7: SuperGLUE.
  • Section 3.8: natural language inference.
  • Section 3.9: invented tasks that probe in-context learning.

3.1.1 Language modeling (PTB)
  • They test zero-shot perplexity on the Penn Tree Bank.
  • They skip the 4 Wikipedia tasks and the one-billion word set.
  • These are inside the training data.
  • PTB is old, so it is safe.
  • GPT-3 sets a new best by 15 points: perplexity 20.50.
  • Only zero-shot is measured, as PTB has no clear one-shot or few-shot split.
SettingPTB perplexity
SOTA (zero-shot)35.8
GPT-3 zero-shot20.5

Table 3.1: PTB zero-shot perplexity

Lower is better.

3.1.2 LAMBADA
  • LAMBADA tests long-range links: predict the last word of a sentence from a paragraph.
  • Some argued that bigger models give diminishing returns here.
  • GPT-3 reaches 76% zero-shot.
  • A standard model does not know the answer is one word, so it spreads chances.
  • Few-shot fixes this. Examples frame the task as a cloze test of one word.
  • Result: 86.4% few-shot, over 18% above the earlier best.
  • The fill-in-blank form cuts the smallest model by almost 20%. For GPT-3 it adds 10%.
  • It does not help one-shot. One-shot is always worse than zero-shot.
  • A significant minority of LAMBADA is in the training data. Section 4 shows little effect.
SettingLAMBADA accStoryCloze accHellaSwag acc
SOTA68.091.885.6
GPT-3 zero-shot76.283.278.9
GPT-3 one-shot72.584.778.1
GPT-3 few-shot86.487.779.3

Table 3.2: cloze and completion

LAMBADA perplexity: SOTA 8.63, zero-shot 3.00, one-shot 3.35, few-shot 1.92.

3.1.3 HellaSwag
  • HellaSwag asks for the best ending to a story.
  • It was built to be hard for models.
  • Humans score 95.6%.
  • GPT-3 gets 78.1% one-shot and 79.3% few-shot.
  • That beats a fine-tuned 1.5B model at 75.4%.
  • The best result, 85.6%, is a fine-tuned multi-task model, ALUM.
3.1.4 StoryCloze
  • StoryCloze 2016: pick the right ending for a five-sentence story.
  • GPT-3 gets 83.2% zero-shot and 87.7% few-shot, with K = 70.
  • That is 4.1% below the fine-tuned best, a BERT-based model.
  • It beats earlier zero-shot results by about 10%.

The test

  • These tasks test broad facts stored in the model.
  • Usually a search system finds text, and a model answers from it. That is 'open-book'.
  • 'Closed-book' means the model answers with no search.
  • GPT-3 is even stricter: no outside text and no fine-tuning on the data set.
  • The data sets are Natural Questions, WebQuestions and TriviaQA.
TriviaQA scores rise from zero-shot to few-shotFrom Table 3.3
Zero-shotOne-shotFew-shot
0255075100Accuracy (%)TriviaQA64.3%68.0%71.2%WebQS14.4%25.3%41.5%NaturalQS14.6%23.0%29.9%

Hover, tap or focus a bar to read its exact value.

Data setZero-shot (%)One-shot (%)Few-shot (%)
TriviaQA64.368.071.2
WebQS14.425.341.5
NaturalQS14.623.029.9
SettingNaturalQSWebQSTriviaQA
RAG (fine-tuned, open-domain)44.545.568.0
T5-11B+SSM (fine-tuned, closed-book)36.644.760.5
T5-11B (fine-tuned, closed-book)34.537.450.1
GPT-3 zero-shot14.614.464.3
GPT-3 one-shot23.025.368.0
GPT-3 few-shot29.941.571.2

Table 3.3: closed-book question answering

TriviaQA

  • 64.3% zero-shot, 68.0% one-shot, 71.2% few-shot.
  • Zero-shot already beats fine-tuned T5-11B by 14.2%.
  • It beats a version with Q&A span prediction in pre-training by 3.8%.
  • One-shot gains 3.7% and matches the best open-domain system.
  • That system fine-tunes and uses retrieval over a 15.3B parameter index of 21M documents.
  • Few-shot adds another 3.2%.

WebQuestions

  • 14.4% zero-shot, 25.3% one-shot, 41.5% few-shot.
  • Fine-tuned T5-11B gets 37.4%. T5-11B+SSM gets 44.7%.
  • Few-shot GPT-3 comes close to the best fine-tuned models.
  • The big jump from zero-shot to few-shot may mean a style shift in the questions.

Natural Questions

  • 14.6% zero-shot, 23.0% one-shot, 29.9% few-shot.
  • Fine-tuned T5 11B+SSM gets 36.6%.
  • The questions need very fine facts from Wikipedia.
  • That may test the limits of the model.

Overall

  • On one of three data sets, one-shot matches the open-domain fine-tuned best.
  • On the other two it nears the closed-book best, with no fine-tuning.
  • On all 3, scores scale smoothly with model size.
  • This may mean more capacity holds more knowledge.

Data

  • GPT-2 had some French ability from only 10 megabytes of French text.
  • GPT-3 has far more capacity, and more other-language text.
  • Its data is still 93% English by word count, with 7% in other languages.
  • They add German and Romanian to French.

Not a fair match

  • Earlier unsupervised translation uses paired language sets and back-translation.
  • GPT-3 mixes languages in its data and uses one training goal.
  • Its one-shot and few-shot runs use 1 or 64 paired examples.
  • That is up to a page or two of examples.

What they found

  • Zero-shot GPT-3 is behind recent unsupervised results.
  • One example adds over 7 BLEU, and few-shot adds another 4 BLEU.
  • Translation into English is much better than out of English.
  • Few-shot gains over prior unsupervised work are about 5 BLEU into English.
  • English to Romanian is over 10 BLEU worse.
  • A cause may be the English-heavy GPT-2 tokenizer.
  • On Fr-En and De-En few-shot GPT-3 beats the best supervised result they found.
  • They doubt those are true best results, as the benchmarks seem weak.
  • On Ro-En it is within 0.5 BLEU of the overall best.
  • That best uses pretraining, fine-tuning on 608K labeled examples and back-translation.
  • Scores rise smoothly with model size in all pairs and settings.
SettingEn-FrFr-EnEn-De
SOTA (supervised)45.635.041.2
XLM33.433.326.4
MASS37.534.928.3
mBART--29.8
GPT-3 zero-shot25.221.224.6
GPT-3 one-shot28.333.726.2
GPT-3 few-shot32.639.229.7

Table 3.4: BLEU by language pair (part 1)

SettingDe-EnEn-RoRo-En
SOTA (supervised)40.238.539.9
XLM34.333.331.8
MASS35.235.233.1
mBART34.035.030.5
GPT-3 zero-shot27.214.119.9
GPT-3 one-shot30.420.638.6
GPT-3 few-shot40.621.039.5

Table 3.4: BLEU by language pair (part 2)

WMT'14 Fr-En, WMT'16 De-En and WMT'16 Ro-En. Measured with multi-bleu.perl and XLM tokenization.

The task

  • The Winograd Schemas Challenge asks which word a pronoun refers to.
  • It is unclear in grammar but clear to a person.
  • Fine-tuned models are near human on the original set.
  • The harder Winogrande set is still far from human level.

Winograd (original 273)

  • GPT-3 gets 88.3% zero-shot, 89.7% one-shot and 88.6% few-shot.
  • There is no clear in-context learning gain.
  • It is a few points below the best and below estimated human level.
  • Some schemas were in the training data. The effect seems small. Results carry an asterisk.

Winogrande

  • GPT-3 gets 70.2% zero-shot, 73.2% one-shot and 77.7% few-shot.
  • A fine-tuned RoBERTA gets 79%.
  • The best, a fine-tuned T5, gets 84.6%.
  • Humans get 94.0%.

PIQA

  • PIQA asks common sense questions about the physical world.
  • GPT-3 gets 81.0% zero-shot, 80.5% one-shot and 82.8% few-shot (test server).
  • The earlier best, a fine-tuned RoBERTa, got 79.4%.
  • GPT-3 is still over 10% worse than humans.
  • PIQA was flagged for possible contamination, so the result has an asterisk.

ARC

  • ARC has multiple choice science questions from grades 3 to 9.
  • Challenge set: 51.4% zero-shot, 53.2% one-shot, 51.5% few-shot.
  • This nears a fine-tuned RoBERTa baseline at 55.9%.
  • Easy set: 68.8%, 71.2% and 70.1%. This slightly beats that baseline.
  • UnifiedQA beats GPT-3 few-shot by 27% on Challenge and 22% on Easy.

OpenBookQA

  • GPT-3 improves a lot from zero-shot to few-shot.
  • It is still over 20 points short of the best.
  • Few-shot is like a fine-tuned BERT Large baseline.

Overall

  • Results are mixed.
  • PIQA and ARC show only small and uneven gains from examples.
  • OpenBookQA shows a large gain.
  • GPT-3 sets a new best on PIQA in all settings.

The tests

  • They use 5 data sets, with varied answer formats.
  • The spread of GPT-3 scores is wide.

The results

  • Best: CoQA, within 3 points of the human baseline.
  • CoQA F1: 81.5 zero-shot, 84.0 one-shot, 85.0 few-shot.
  • Worst: QuAC, which is 13 F1 below an ELMo baseline.
  • DROP: few-shot beats the fine-tuned BERT baseline. It is well below humans and the best.
  • SQuAD 2.0: few-shot gains almost 10 F1 over zero-shot, to 69.8.
  • That slightly beats the best fine-tuned result in the original paper.
  • RACE: weak. It matches only the earliest contextual work and is 45% behind the best.

Setup

  • SuperGLUE is a standard set of 8 tasks.
  • Few-shot uses 32 examples per task, drawn at random from the training set.
  • For most tasks, new examples are drawn for each problem.
  • For WSC and MultiRC, one fixed set is used for all problems.

What they found

  • COPA and ReCoRD: near the best in one-shot and few-shot.
  • COPA is second on the leaderboard. First place is a fine-tuned 11 billion parameter T5.
  • WSC: strong, at 80.1% few-shot. The original Winograd gives 88.6%.
  • BoolQ, MultiRC and RTE: reasonable, like a fine-tuned BERT-Large.
  • CB: 'signs of life' at 75.6% few-shot.
  • WiC is a weak spot: 49.4%, which is chance.
  • They tried many phrasings of WiC. None worked.
  • GPT-3 seems weak when it must compare two sentences or snippets.
  • This may explain low RTE and CB scores too.
  • GPT-3 beats a fine-tuned BERT-Large on four of eight tasks.
  • On two tasks it is close to the best, a fine-tuned 11 billion parameter model.

Scaling

  • The few-shot score rises with model size and with the number of examples.
  • K was scaled up to 32 examples per task.
  • GPT-3 needs fewer than eight examples per task to beat a fine-tuned BERT-Large.
ModelSuperGLUE avgBoolQ accCB acc
Fine-tuned SOTA89.091.096.9
Fine-tuned BERT-Large69.077.483.6
GPT-3 few-shot71.876.475.6

Table 3.8: SuperGLUE test results (part 1)

CB F1: 93.9, 75.7 and 52.0. COPA accuracy: 94.8, 70.6 and 92.0. RTE accuracy: 92.5, 71.7 and 69.0.

ModelWiC accWSC accMultiRC acc
Fine-tuned SOTA76.193.862.3
Fine-tuned BERT-Large69.664.624.1
GPT-3 few-shot49.480.130.5

Table 3.8: SuperGLUE test results (part 2)

MultiRC F1a: 88.2, 70.0 and 75.4. ReCoRD accuracy: 92.5, 71.3 and 90.2. ReCoRD F1: 93.3, 72.0 and 91.1.

The task

  • NLI asks if sentence two follows from, contradicts, or may be true given sentence one.
  • RTE is the two-way version in SuperGLUE.

What they found

  • On RTE, only the largest GPT-3 beats random (56%) clearly.
  • Few-shot it is like a single-task fine-tuned BERT Large.
  • ANLI is adversarial, in three rounds.
  • All models smaller than GPT-3 are at chance, about 33%, even few-shot.
  • GPT-3 shows signs of life on Round 3.
  • Few-shot GPT-3 175B closes almost half the gap from chance to the best.
  • The dev set has only 1500 examples. The estimated standard deviation is 1.2%.
  • So NLI is still very hard for language models.

Why these tasks

  • These probe on-the-fly reasoning, new patterns and fast adaptation.
  • Tasks: arithmetic, word unscrambling, SAT analogies, news writing, new words and grammar.
  • The authors will release the synthetic data sets.
3.9.1 Arithmetic

The 10 tests

  • Two to five digit addition and subtraction (2D+ to 5D-).
  • Two digit multiplication (2Dx).
  • One-digit composite, such as 6+(4*8) (1DC).
  • The model must give the exact answer.
  • Each test has 2,000 random examples.
GPT-3 175B gets strong at small sums with examplesFrom Table 3.9
Zero-shotOne-shotFew-shot
0255075100Exact-answer accuracy (%)2D+76.9%99.6%100.0%2D-58.0%86.4%98.9%3D+34.2%65.5%80.4%3D-48.3%78.7%94.2%4D+4.0%14.0%25.5%5D+0.7%3.5%9.3%2Dx19.8%27.4%29.2%1DC9.8%14.3%21.3%

Hover, tap or focus a bar to read its exact value.

TaskZero-shot (%)One-shot (%)Few-shot (%)
2D+76.999.6100.0
2D-58.086.498.9
3D+34.265.580.4
3D-48.378.794.2
4D+4.014.025.5
5D+0.73.59.3
2Dx19.827.429.2
1DC9.814.321.3

What they found

  • Few-shot: 100% on 2 digit addition and 98.9% on 2 digit subtraction.
  • 80.2% on 3 digit addition and 94.2% on 3 digit subtraction.
  • 25-26% on four digit operations, and 9-10% on five digit operations.
  • 29.2% on 2 digit multiplication, and 21.3% on one-digit composites.
  • Small models do poorly. Even 13B solves 2 digit sums only about half the time.
  • One-shot and zero-shot are weaker, so task recognition matters.
  • Full GPT-3 zero-shot beats few-shot for all smaller models.

Memorization check

  • They searched for 3-digit problems in the training data.
  • Only 17 of 2,000 addition problems matched (0.8%).
  • Only 2 of 2,000 subtraction problems matched (0.1%).
  • Wrong answers often miss a carried '1'. So the model tries to compute.
3.9.2 Word scrambling

The 5 tasks

  • CL: cycle letters in a word, such as 'lyinevitab'.
  • A1: anagram of all but the first and last letter.
  • A2: anagram of all but the first and last 2 letters.
  • RI: random punctuation or spaces inserted between letters.
  • RW: a reversed word.
  • Each task uses 10,000 examples, from the most frequent words.
SettingCLA1A2
Zero-shot3.662.288.91
One-shot21.78.6225.9
Few-shot37.915.139.7

Table 3.10: GPT-3 175B word tasks (accuracy %)

RI: 8.26, 45.4 and 67.2. RW: 0.09, 0.48 and 0.44.

What they found

  • Scores rise smoothly with size.
  • Few-shot GPT-3 gets 66.9% on random insertion in the text.
  • It gets 38.6% on cycled letters, 40.2% on A2 and 15.1% on A1.
  • No model can reverse letters in a word.
  • One-shot is weaker by half or more. Zero-shot rarely works.
  • So the model seems to learn these tasks at test time.
  • The task needs character work, yet the tokens are about 0.7 words each.
3.9.3 SAT analogies
  • They collected 374 SAT analogy problems.
  • GPT-3 gets 65.2% few-shot, 59.1% one-shot and 53.7% zero-shot.
  • The average college applicant scored 57%. Random guessing gives 20%.
  • The 175 billion model gains over 10% on the 13 billion model.
3.9.4 News article generation

Setup

  • GPT-3 treats a bare news title as a tweet at first.
  • So they give three earlier news articles as context.
  • Then it writes a new article from a title and subtitle.

The human test

  • They chose 25 titles and subtitles from newser.com.
  • Models from 125M to 175B parameters wrote about 200 words each.
  • Around 80 US participants did each quiz.
  • A control model is a 160M parameter model with no context and more randomness.
Humans fall to chance at spotting bigger-model articlesFrom Table 3.11
0255075100Mean human accuracy (%)Control (bad model)86%GPT-3 Small76%GPT-3 Medium61%GPT-3 Large68%GPT-3 XL62%GPT-3 2.7B62%GPT-3 6.7B60%GPT-3 13B55%GPT-3 175B52%

Hover, tap or focus a bar to read its exact value.

ModelHuman accuracy (%)
Control (bad model)86
GPT-3 Small76
GPT-3 Medium61
GPT-3 Large68
GPT-3 XL62
GPT-3 2.7B62
GPT-3 6.7B60
GPT-3 13B55
GPT-3 175B52

What they found

  • Accuracy on the bad control model is about 86%. Chance is 50%.
  • On GPT-3 175B it is about 52%, barely above chance.
  • People spend more time as model size grows.
  • Facts may be wrong, as the model cannot know the real event.
  • Other clues: repetition, non sequiturs and odd phrasing.
  • Automatic detectors may do better than humans.

Longer articles

  • They tried 12 Reuters articles averaging 569 words.
  • GPT-3 wrote completions averaging 498 words.
  • Accuracy was about 88% for the control and about 52% for GPT-3 175B.
  • So even at about 500 words, people struggle to tell them apart.
3.9.5 Learning and using novel words
  • They give GPT-3 the meaning of a made-up word, such as 'Gigamuru'.
  • Then they ask it to use the word in a sentence.
  • They give one to five earlier examples of other words.
  • The paper judges the results by reading samples, not by a score.
3.9.6 Correcting English grammar
  • In few-shot form, GPT-3 is given poor English and a fix.
  • It then fixes new poor English sentences.
  • The paper shows this with samples.

The problem

  • Common Crawl may hold test data from the benchmarks.
  • The first fix failed. A bug kept only part of the overlaps out.
  • Retraining was too costly. So they measure the effect.

The method

  • For each benchmark they make a 'clean' version.
  • It drops any example with a 13-gram overlap with the training set.
  • Short examples must overlap entirely.
  • Then they score GPT-3 on the clean part and compare to the full score.
  • If scores are close, contamination has little effect.
  • If the clean score is lower, contamination may inflate results.

The finding

  • Potential contamination is often high. A quarter of benchmarks are over 50%.
  • But in most cases scores change very little.
  • They see no link between contamination level and score change.
  • Either the method over-counts, or contamination matters little.

Reading comprehension

  • Over 90% of QuAC, SQuAD2 and DROP examples were flagged.
  • In every case checked, the source text was in training.
  • The questions and answers were not.
  • So the model gains background only.

German translation

  • 25% of WMT16 German-English test examples were flagged, for 1-2 BLEU.
  • None looked like paired translation data.
  • The overlaps were single-language.

Reversed words and anagrams

  • They used 2-grams for filtering, because the tasks are short.
  • The overlaps were mostly palindromes or trivial cases, like 'kayak = kayak'.
  • Removing them made the tasks harder, which gave a false signal.
  • Symbol insertion shows high overlap but no score change.
  • The reason: the overlap check ignores non-letter characters.

PIQA

  • 29% of examples were flagged. The clean score fell 3 points (4% relative).
  • Some web pages used by the data set makers are in training.
  • A 25x smaller model fell by a similar amount.
  • So the cause may be statistical bias, not memorization. This is not proven.
  • The result carries an asterisk.

Winograd

  • 45% of examples were flagged, with a 2.6% fall on the clean part.
  • 132 Winograd schemas were in training, in a different format.
  • The result carries an asterisk.

Language modeling

  • The 4 Wikipedia sets and the Children's Book Test are almost all in training.
  • No clean part is possible, so they report no results.
  • Penn Tree Bank is old and unaffected. It became the main language model test.

LAMBADA and limits

  • LAMBADA has real contamination, yet the clean part scored within 0.5%.
  • The fill-in-blank form blocks simple memorization.
  • A limit: the clean part may not match the original in difficulty.
  • But the many near-zero shifts make this unlikely.
  • Appendix C has the method details.

Text and tasks

  • GPT-3 text still repeats itself, loses coherence over long passages and contradicts itself.
  • It sometimes gives non-sequitur sentences.
  • They will release 500 uncurated samples.
  • It struggles with 'common sense physics', like whether cheese melts in a fridge.
  • It is near chance on some comparison tasks: WiC and ANLI.
  • It is also weak on some reading comprehension tasks.

Design limits

  • GPT-3 is a one-direction (autoregressive) model.
  • There are no bidirectional or denoising models in the tests.
  • That may cost score on fill-in-the-blank, comparing two texts or re-reading a long passage.
  • A large bidirectional model may fine-tune better. It is a direction to try.

The objective

  • The training goal weights every token equally.
  • It has no sense of which tokens matter most.
  • Useful assistants may need goal-directed action, not only prediction.
  • Models lack grounding in video or the physical world.
  • Ideas: learn the goal from humans, use reinforcement learning, add images.

Efficiency and meaning

  • Pre-training sees far more text than a person reads in a lifetime.
  • It is unclear if few-shot learning learns a task from scratch or only recognizes it.
  • Word scrambling and nonsense words look more like learning from scratch.
  • Translation clearly comes from pre-training.
  • Models of this size are costly and awkward to run.
  • Distillation, which shrinks a big model, may help.
  • Its decisions are hard to interpret. It is not well calibrated on new inputs.
  • It keeps the biases of its data.

Misuse potential

  • Better text raises misuse risk.
  • Examples: misinformation, spam, phishing and fake essays.
  • Many of these were limited by the need for human writers.
  • Good language models could lower that barrier.

Threat actors

  • The authors watched forums where misuse is discussed.
  • After GPT-2 there was much talk but few tests and no successful use.
  • Talk rose with media coverage.
  • They judge the threat from low and mid-skill actors as not immediate.
  • Large gains in reliability could change that.
  • Threat analysts saw no change in advanced persistent threat operations since GPT-2.
  • Control of the content is still at an early stage.

Why humans are still needed

  • Model output is random.
  • A 99% reliable bot still needs a human to filter the 1% of bad output.
  • The authors expect more steerable models will attract malicious users later.

Overall

  • Models trained on the internet carry internet-scale bias.
  • This is a preliminary study of gender, race and religion.
  • They probe the 175 billion model and smaller ones.

Gender

  • Occupations lean male.
  • 83% of 388 occupations were more likely to be followed by a male word.
  • Higher education roles like legislator and banker lean male.
  • So do heavy labor roles like mason and sheriff.
  • Midwife, nurse and receptionist lean female.
  • Mean bias scores: -1.11 neutral, -2.14 competent, -1.15 incompetent.
  • Winogender: GPT-3 175B was most accurate at 64.17%.
  • It was the only model where female occupation accuracy beat male: 81.7% vs 76.7%.
  • Women got more appearance words, like 'beautiful' and 'gorgeous'.

Race

  • They made 800 samples of length about 50 for each prompt.
  • 'Asian' had a consistently high sentiment. It ranked first in 3 of 7 models.
  • 'Black' had a consistently low sentiment. It ranked lowest in 5 of 7 models.
  • The gaps narrowed a little in larger models.
  • Prompts forced talk about race. Word counts may show history, such as slavery.

Religion

  • They made 800 samples for each of six religions.
  • Words like violent and terrorism appeared more often with Islam.
  • Ramadan, prophet and mosque also appeared more often.

The authors' view

  • This is subjective signposting, not a full study.
  • Mitigation should not only chase one metric to 'remove' bias.
  • It needs a shared vocabulary and input from affected groups.

Cost of training

  • GPT-3 175B used several thousand petaflop/s-days of compute in pre-training.
  • A 1.5B parameter GPT-2 used tens of petaflop/s-days.

Cost of use

  • Once trained, it is efficient to use.
  • Writing 100 pages can cost on the order of 0.4 kW-hr.
  • That is only a few cents of energy.
  • Distillation and better algorithms may cut costs more.

Scaling

  • Earlier work scaled LSTMs to over a billion parameters.
  • Transformer sizes grew: 213 million, 300 million, 1.5 billion and more.
  • Mixture-of-experts models reach 100 billion parameters, but use only a few per pass.
  • Other work adds compute without more parameters.
  • This paper makes the network bigger.
  • It is 10x larger than earlier models of this kind.
  • Other studies find a smooth power law of loss with scale. This paper agrees.

Other lines of work

  • Some work makes models small, like ALBERT and distillation.
  • Hard benchmarks are being built, since fine-tuned models near human level.
  • Earlier work fine-tuned an 11 billion parameter model for question answering.
  • Meta-learning in language models was tried with limited results.
  • In-context learning looks like RL2: adaptation in activations, without weight updates.
  • Natural language instructions were used in supervised multi-task work.
  • Multi-task learning needs hand-built data set collections.
  • Pre-training at scale gives a natural broad mix of tasks.

Algorithm progress

  • Gains came from denoising bidirectionality, prefix models and encoder-decoders.
  • They keep to a pure autoregressive model, to study in-context learning.
  • Adding these ideas could help, especially for fine-tuning.

Summary

  • A 175 billion parameter model shows strong results on many tasks.
  • It works in zero-shot, one-shot and few-shot settings.
  • Sometimes it nearly matches fine-tuned systems.
  • It writes good samples and does well on tasks defined on the fly.
  • Scaling trends are roughly predictable, with no fine-tuning.

The outlook

  • Despite many limits, very large models may be a key part of adaptable systems.

Appendix A: Common Crawl filtering

  • They trained a logistic regression classifier.
  • It told WebText, Wikipedia and a web books set from raw Common Crawl.
  • They kept documents using a random draw tied to the score, with α = 9.
  • α was chosen to match the score spread on WebText.
  • They removed near-duplicates with MinHashLSH, using 10 hashes.
  • They also removed WebText from Common Crawl.

Appendix B: training details

  • Adam with β1 = 0.9, β2 = 0.95 and ε = 10^-8.
  • They clip the global gradient norm at 1.0.
  • Cosine decay of learning rate to 10% over 260 billion tokens.
  • Linear warmup over the first 375 million tokens.
  • Batch size ramps up linearly from 32k tokens over the first 4-12 billion tokens.
  • Weight decay is 0.1.
  • Sequences are the full 2048 tokens, with short documents packed together.
  • An end of text token separates them.

Initial filtering

  • They searched for 13-gram overlaps with all test and dev sets.
  • They cut out the match plus a 200 character window around it.
  • Pieces under 200 characters were dropped.
  • Documents split into more than 10 pieces were removed.
  • They ignored 13-grams that matched more than 10 training documents.

Overlap method

  • N was the 5th percentile example length.
  • N was at least 8 and at most 13.
  • They used Apache Spark for exact matches over the full training set.
  • They trained on only 40% of the filtered Common Crawl.
  • A 'dirty' example has any N-gram overlap. A 'clean' one has none.

Notes

  • The filter failed on long documents such as books, due to a bug.
  • DROP shows 94% dirty. Only the passages were in training, not questions or answers.
  • The paper lists overlap numbers for every data set in Table C.1.

What it shows

  • It gives the way to estimate training compute for Figure 2.2.
  • It ignores attention, which uses less than 10%.
  • For each model: tokens, active parameters, and flops per parameter per token.
  • Multiply those to get total flops.
  • For T5, only half of the parameters are active, as it is encoder-decoder.

Key point from Figure 2.2

  • GPT-3 trains on far fewer tokens than usual for its size.
  • A 3B GPT-3 is almost 10x larger than RoBERTa-Large (355M parameters).
  • Yet both took roughly 50 petaflop/s-days of compute.

Participants

  • 718 people joined 6 experiments. 97 failed an internet check question.
  • That left 621: 343 male, 271 female and 7 other.
  • Mean age was about 38. All were US-based, from Positly.
  • Each was paid $12 for about 60 minutes.

Design

  • They took 25 newser.com articles from early 2020.
  • They made outputs from 8 models, from 125M to 175B parameters.
  • Five outputs were made per question.
  • The one closest in length to the human text was kept.
  • Each quiz had 25 articles, half human and half model written.
  • Order was shuffled. A two-sample t-test compared each model to the control.

Appendix F: more samples

  • More GPT-3 samples, including news articles.

Appendix G: task phrasing

  • The exact prompts, examples and descriptions for every task.

Appendix H: all results

  • Table H.1 gives scores for every task, setting and model size.
  • It also gives extra scaling curves for one-shot and zero-shot.

Coverage note

  • This paper has 75 pages. The main body is covered in full above.
  • The appendices are summarized only. Tables in Appendices C and H are not copied.

Words to know

  • Autoregressive: Writes one token at a time, using the tokens before it.
  • Data contamination: Test data that also appears in the training data.
  • Fine-tuning: Training a pre-trained model more on one task's labeled data.
  • Gradient update: A change to the model weights made during training.
  • In-context learning: Learning a task from examples written in the prompt.
  • Meta-learning: Learning broad skills so you can adapt fast to a new task.
  • Perplexity: A score of how surprised a model is. Lower is better.
  • Task-agnostic: Built to work on many tasks, not one task.

Share this paper

LinkedIn (opens in a new tab)X (opens in a new tab)WhatsApp (opens in a new tab)EmailDownload PDFExplainer (PDF), 1.0 MB

Ask AI about this paper

Stuck on a word or an idea? Ask in plain words. The answer comes from the write-up on this page.

Read the original paper on arXiv: Language Models are Few-Shot Learners (opens in a new tab)

Jump to

One paper a week, in plain English

Every Monday: the new AI papers worth your time. Short lines, the key number, and what to do with it.

One email a week. Unsubscribe with one click. No spam.