Language Models are Few-Shot Learners

Brown et al., 2020, Language Models are Few-Shot Learners (Advances in Neural Information Processing Systems 33 (NeurIPS 2020))

Subscriber deck — free during early access

21 cards

1 Introduction

  1. What is GPT-3, and what did its paper set out to test?
    A 175-billion-parameter autoregressive language model, 10× larger than any previous dense LM, used to test whether scaling improves task-agnostic few-shot performance: tasks and demonstrations are given purely as text, with no gradient updates or fine-tuning.
  2. What remaining limitation of the pretrain-then-fine-tune paradigm motivated GPT-3?
    Even with task-agnostic architectures, a task-specific fine-tuning step on a large labelled data set remained; GPT-2 had suggested it might be unnecessary, but its zero-shot results were mostly far below supervised baselines.
  3. What is in-context learning, and how did the GPT-3 paper frame it?
    Learning a task from instructions and demonstrations placed in the model’s context, without weight updates. Language models can be seen as meta-learners: slow outer-loop gradient descent during pre-training plus fast inner-loop “in-context” learning within the activations.
  4. How does the gap between zero-, one- and few-shot performance change with model size?
    It generally grows with capacity: zero-shot performance improves steadily with size, but few-shot improves faster, suggesting larger models are better in-context learners.

2 Approach

  1. Distinguish fine-tuning, few-shot, one-shot and zero-shot in the GPT-3 paper.
    Fine-tuning updates weights on thousands of labelled examples. Few-shot gives \(K\) demonstrations (typically 10–100, as many as fit in the 2048-token context) plus the query, with no updates. One-shot uses \(K = 1\). Zero-shot gives only a natural language task description.
    settingprompt (invented example)
    zero-shotTranslate English to French:
    bread =>
    one-shotTranslate English to French:
    cat => chat
    bread =>
    few-shotTranslate English to French:
    cat => chat
    house => maison
    …
    bread =>
  2. What are the advantages and drawbacks of few-shot learning versus fine-tuning, according to Brown et al.?
    Few-shot needs far less task-specific data and avoids overfitting to narrow training distributions or exploiting spurious features; but its results were generally well below fine-tuned state of the art, and it still needs a few examples. One- and zero-shot are the fairest comparisons with humans.

2.1 Model and Architectures

  1. How does GPT-3’s architecture differ from GPT-2’s?
    It is the same (modified initialization, pre-normalization, byte-level BPE) except for alternating dense and locally banded sparse attention patterns, as in the Sparse Transformer. Eight sizes were trained, from 125M to 175B parameters, to test the scaling laws.

2.2 Training Dataset

  1. How was GPT-3’s training data built?
    Common Crawl filtered by similarity to high-quality reference corpora, fuzzy document-level deduplication (within and across data sets, protecting the validation set), plus high-quality corpora: an expanded WebText, two book corpora and English Wikipedia.

2.4 Evaluation

  1. How were few-shot examples chosen when evaluating GPT-3?
    For each test example, \(K\) examples were drawn at random from the task’s training set (or the development set when no training set exists, as for LAMBADA), separated by newlines, sometimes with a natural language prompt; free-form answers used beam search (width 4).

3.1 Language Modeling, Cloze, and Completion Tasks

  1. How did GPT-3 do on LAMBADA, and what trick helped few-shot?
    Zero-shot accuracy 76.2%, 8 points above the previous state of the art; few-shot with a fill-in-the-blank format (“Alice was friends with Bob. Alice went to visit her friend, ___. → Bob”) reached 86.4%. The format didn’t help one-shot, perhaps because several examples are needed to recognize the pattern.

3.2 Question Answering

  1. How did GPT-3 do on closed-book TriviaQA?
    Without any retrieval or fine-tuning: 64.3% zero-shot (beating fine-tuned closed-book T5-11B), 68.0% one-shot (matching an open-domain system with learned retrieval over 21M documents), and 71.2% few-shot.
  2. Where did GPT-3 underperform on question answering and reading comprehension?
    On Natural Questions (fine-grained Wikipedia knowledge), it trailed fine-tuned T5-11B; on DROP (discrete reasoning and numeracy), few-shot 36.5 F1 vs 89.1 for the state of the art. On CoQA it came within 3 points of humans (85.0 F1 few-shot).

3.3 Translation

  1. How well did GPT-3 translate, and why was it asymmetric?
    With 7% non-English training text and no back-translation, few-shot GPT-3 matched prior unsupervised NMT on average, beating it into English (e.g. Fr→En 39.2 BLEU) but underperforming out of English (En→Ro 21.0), reflecting its strength as an English LM and a tokenizer built for English.

3.4 SuperGLUE

  1. How did few-shot GPT-3 do on SuperGLUE?
    With 32 examples per task: 71.8 average vs 69.0 for fine-tuned BERT-large and 89.0 state of the art. Near state of the art on COPA and ReCoRD; around BERT-large on BoolQ, WSC, MultiRC and RTE; chance level on WiC.
  2. What weakness did WiC, RTE and CB reveal in GPT-3?
    GPT-3 was weak in few- and one-shot settings at tasks that compare two sentences or snippets (whether a word means the same in two sentences, or whether one sentence entails another); no prompt phrasing made WiC work.

4 Measuring and Preventing Memorization Of Benchmarks

  1. How did the GPT-3 authors check for benchmark contamination?
    For each benchmark they built a “clean” subset removing examples with any 13-gram overlap with the pre-training data and compared scores. Performance mostly changed negligibly, with no correlation between contamination level and score difference, so either contamination was overestimated or had little effect.

5 Limitations

  1. What limitations of GPT-3 did its authors acknowledge?
    Long samples repeat themselves, lose coherence or contradict themselves; no bidirectionality hurts tasks that compare passages or re-read before short answers; the LM objective weights all tokens equally and isn’t goal-directed; there is no grounding in other modalities; the model is expensive to deploy. They suggested learning objectives from humans, RL fine-tuning, multimodality and distillation.

7.1 Misuse of Language Models

  1. Which misuse risks did the GPT-3 paper discuss?
    Text-generating harms like misinformation, spam, phishing, abuse of legal processes, fraudulent essays and social-engineering pretexts, which are often bottlenecked by writing high-quality text. Threat analysis found little successful misuse yet, but expected more consistent, steerable models to attract malicious actors.

7.2 Fairness, Bias, and Representation

  1. What gender bias did the GPT-3 paper find?
    For “The {occupation} was a”, 83% of 388 occupations were more likely to be followed by male than female words; prompting “The competent {occupation} was a” made this stronger. Women were more often described with appearance words like “beautiful” and “gorgeous”.
  2. What did GPT-3’s bias probes find for race and religion, and what caveats apply?
    Sentiment of words co-occurring with race prompts was consistently highest for “Asian” and lowest for “Black”; for Islam, words like “terrorism” co-occurred more than for other religions. The models were explicitly prompted to discuss these groups, and co-occurrence sentiment can reflect socio-historical text, so the analysis is preliminary; mitigation should be holistic, not metric-driven.

7.4 News Generation

  1. How well could people tell GPT-3’s news articles from human-written ones?
    Barely: mean accuracy was about 52% (chance is 50%) for ~200-word articles from GPT-3 175B, versus 86% for a deliberately bad control model, falling with model size; it stayed about 52% for ~500-word articles.

Source

  • 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 and Dario Amodei. 2020. Language Models are Few-Shot Learners. In Advances in Neural Information Processing Systems 33 (NeurIPS 2020). https://papers.nips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html