Language Models are Unsupervised Multitask Learners

Radford et al., 2019, Language Models are Unsupervised Multitask Learners (OpenAI technical report)

Subscriber deck — free during early access

22 cards

1. Introduction

  1. What is the central claim of the GPT-2 paper?
    Language models trained on a large, diverse web corpus begin to perform tasks like question answering, translation, reading comprehension and summarization zero-shot, without explicit supervision or any parameter or architecture changes, and this ability grows with model capacity.
  2. Why did Radford et al. think single-task supervised learning limits generalization?
    Systems trained on one task and domain are narrow experts, brittle under small changes in data distribution or task specification. From a meta-learning view, each (dataset, objective) pair is one training example, and multitask NLP efforts had only 10–17 such pairs, far too few to generalize.
  3. How does GPT-2 continue the trend in transfer learning?
    From word vectors fed to task architectures, to transferred recurrent representations, to fine-tuning whole Transformers (GPT, BERT) without task-specific architectures, and now to performing tasks with no supervised training or modification at all.

2. Approach

  1. How can a single language model perform many tasks, according to GPT-2?
    A general system should model \(p(\text{output} \mid \text{input}, \text{task})\), and language can specify the task, input and output all as a sequence of symbols, e.g. (translate to french, english text, french text). A language model may learn to infer and perform tasks demonstrated in natural text in order to predict it better.
  2. Why does the GPT-2 paper argue the unsupervised LM objective contains supervised objectives?
    A supervised objective is the same as the language-modelling objective evaluated only on a subset of the sequence (the output), so the global minimum of the unsupervised objective is also a minimum of the supervised one; the question is whether it can be optimized well enough in practice.

2.1. Training Dataset

  1. How was the WebText corpus built, and why that way?
    Common Crawl has serious quality problems, so WebText takes only pages linked from Reddit posts with at least 3 karma, a cheap human filter for quality: about 45M links, giving over 8M documents and 40 GB of text after de-duplication and cleaning. Wikipedia was removed to avoid overlap with test sets.
  2. What naturally occurring task demonstrations did the GPT-2 authors find in WebText?
    For example, English–French translations appearing inside ordinary text (a quoted French phrase followed by its English meaning), showing how a language model could pick up tasks from web text without explicit supervision.

2.2. Input Representation

  1. What input representation does GPT-2 use, and why?
    Byte-level BPE: a base vocabulary of 256 bytes plus merges, 50,257 tokens in total. It can assign a probability to any Unicode string, so the model can be evaluated on any dataset regardless of preprocessing, while keeping the performance of word-level models.
  2. Why did GPT-2 forbid BPE merges across character categories?
    Plain byte-level BPE wastes vocabulary on many variants of common words with attached punctuation (dog., dog!, dog?). Blocking merges across categories (except for spaces) avoids that while barely fragmenting words.

2.3. Model

  1. How does the GPT-2 architecture differ from the original GPT?
    Layer normalization is moved to the input of each sub-block (pre-norm) with an extra one after the final block; residual-layer weights are initialized scaled by \(1/\sqrt{N}\) for \(N\) residual layers; vocabulary 50,257; context 1024 tokens instead of 512; batch size 512.
  2. What model sizes did the GPT-2 paper train?
    Four, roughly log-uniformly spaced: 117M parameters (12 layers, \(d_{\text{model}} = 768\), the size of GPT), 345M (24, 1024, the size of BERT-large), 762M (36, 1280) and 1542M (48, 1600), the last being GPT-2. All still underfit WebText.

3.1. Language Modeling

  1. How did GPT-2 do on language modelling benchmarks zero-shot?
    State of the art on 7 of 8 datasets without any training on them, with large gains on small datasets (Penn Treebank, WikiText-2) and long-dependency tests (LAMBADA, CBT). It was much worse on the One Billion Word Benchmark, whose sentence shuffling removes long-range structure.
  2. How could a byte-level model be evaluated fairly on tokenized LM benchmarks?
    Invertible de-tokenizers removed preprocessing artifacts (disconnected punctuation, split contractions) before scoring, a simple form of domain adaptation that still allows computing the dataset’s log-probability per canonical unit; they gained 2.5–5 perplexity.

3.3. LAMBADA

  1. What did GPT-2 achieve on LAMBADA, and what error pattern did it show?
    Perplexity fell from 99.8 to 8.6 and accuracy rose from 19% to 52.66%. Most errors were valid sentence continuations but not valid final words; a stop-word filter approximating that constraint raised accuracy to 63.24%.

3.5. Reading Comprehension

  1. How was GPT-2 prompted for CoQA, and how did it do?
    Conditioned on the document, the conversation history and a final “A:”, greedy decoding reached 55 F1, matching or beating 3 of 4 supervised baselines without their 127,000+ training examples (supervised state of the art was near the 89 F1 human level). It often used simple heuristics, e.g. answering a “who” question with a name from the document.

3.6. Summarization

  1. How did GPT-2 summarize zero-shot, and how well?
    Append “TL;DR:” to the article, sample 100 tokens with top-\(k\) sampling (\(k = 2\)), and keep the first 3 sentences. ROUGE barely beat 3 random sentences and stayed below classic neural baselines; removing the TL;DR: hint cost 6.4 points, showing the hint invokes task behaviour.

3.7. Translation

  1. How well did GPT-2 translate, and why was it surprising?
    Prompted with example pairs “english sentence = french sentence”: 5 BLEU English→French and 11.5 French→English, beating some unsupervised MT baselines but far below the best (33.5). Non-English pages had been filtered out, leaving only about 10 MB of French in WebText.

3.8. Question Answering

  1. How well did GPT-2 answer Natural Questions without retrieval, and how well calibrated was it?
    It answered 4.1% exactly (5.3 times the smallest model, which didn’t beat a 1% most-common-answer baseline), suggesting capacity matters for stored knowledge. Its probabilities were well calibrated: 63.1% accuracy on the 1% of questions it was most confident about. Retrieval-based systems reached 30–50%.
  2. How did the GPT-2 paper turn a language model into a task solver for each task?
    By writing the task into the context and letting the model continue:
    taskhow the task is invoked
    summarizationarticle … TL;DR:
    translationexample pairs english = french, then english =
    reading comprehensiondocument, dialogue history, A:
    question answeringexample question–answer pairs, then the question

4. Generalization vs Memorization

  1. How did the GPT-2 authors check whether test data leaked into WebText?
    With Bloom filters of WebText 8-grams: common LM test sets had 1–6% 8-gram overlap with WebText (average 3.2%), less than with their own training splits (average 5.9%). Overlap gave a small, consistent benefit (e.g. LAMBADA 8.6 → 8.7 perplexity when overlapping examples were removed).
  2. Why did the GPT-2 authors conclude the model was underfitting rather than memorizing WebText?
    Training and held-out WebText performance were similar and improved together as model size grew; they recommended n-gram overlap de-duplication as a sanity check when creating new datasets.

6. Discussion

  1. What limitations of GPT-2’s zero-shot abilities did its authors acknowledge?
    Zero-shot performance was competitive on reading comprehension but rudimentary on summarization and far from usable in practice; on many tasks it was probably no better than random, and language models only beat trivial baselines with enough capacity. The ceiling with fine-tuning, and whether scale overcomes unidirectionality, were open questions.

Source