Language Models are Unsupervised Multitask Learners

The paper made the decoder-only Transformer language model a strong zero-shot task interface at scale.

Metadata

FieldValue
PaperLanguage Models are Unsupervised Multitask Learners
AuthorsAlec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al.
Year2019
VenueOpenAI technical report
PDFOpenAI PDF
Codeopenai/gpt-2
Statusverified

Question

Most NLP systems were trained or fine-tuned for specific supervised tasks. The question was whether a sufficiently large autoregressive language model trained on broad web text could perform many tasks from natural-language context alone.

The architectural question is whether the decoder side of the Transformer can become a general interface: provide a text prefix, let the model continue it, and express tasks through the prefix rather than through a new supervised head.

This moves the center of gravity from:

to:

Main Claim

A decoder-only Transformer trained with next-token prediction can acquire broad zero-shot task behavior when model capacity and data diversity increase.

Autoregressive objective:

The architecture interface is:

This should be read as a transfer claim, not a proof that supervised task learning is unnecessary. The paper shows that next-token pre-training plus scale can expose many task behaviors through prompting.

Architecture Contract

ItemContract
Inputtoken prefix
Outputprobability distribution over the next token
Backbonedecoder-only Transformer
Attention patterncausal self-attention
Training objectivenext-token prediction
Adaptation interfaceprompt/context formatting
Natural usegeneration, completion, zero-shot/few-shot task framing

For token sequence , the model factorizes the sequence probability as:

The hidden states are produced by a causal Transformer:

and next-token probabilities are:

The key restriction is that cannot attend to future tokens.

Decoder-Only Block

GPT-2 uses the decoder-only branch of the Transformer family. Compared with Attention Is All You Need, it removes the encoder and cross-attention path and keeps only causal self-attention plus feed-forward blocks.

One layer can be summarized as:

The causal attention mask is:

so attention is:

The decoder-only simplification is what makes the same architecture useful for open-ended continuation.

Method

ComponentRole
decoder-only Transformercausal token mixing
byte-pair encodingopen-vocabulary tokenization
WebTextbroad next-token training data
prompt conditioningexpresses tasks as text context
scale sweeptests whether capacity improves transfer

Prompt Interface

GPT-2 is important because it treats tasks as text continuation problems.

TaskPrompt-like framingOutput behavior
translationsource text plus translation cuetarget-language continuation
summarizationdocument plus summary cuesummary continuation
question answeringcontext/question textanswer continuation
reading comprehensionpassage and querycompletion with answer span or answer text

This is the predecessor of later prompt engineering and in-context learning. The paper does not yet have modern chat formatting, tool calling, system messages, or RLHF, but it makes the interface shift visible.

The general template is:

Scaling Claim

The paper compares models of different sizes and argues that zero-shot task performance improves with scale.

The implicit claim is:

For this wiki, keep the claim narrow:

  • the evidence is from the paper’s selected zero-shot benchmarks;
  • improvements are tied to model size, data, tokenization, and evaluation framing;
  • zero-shot behavior is not the same as reliable instruction following;
  • a scaling trend is not a proof of robust reasoning.

Evidence

ClaimEvidence in paperCaveat
Larger language models improve zero-shot transfertask benchmarks under no fine-tuningprompting and evaluation protocols were early
Next-token prediction can encode task behaviorquestion answering, summarization, translation, and reading comprehension testsdata contamination and benchmark framing require care
Decoder-only Transformers scale as general sequence modelsmodel-size comparisonsarchitecture, data, and compute are inseparable

Benchmark Card

FieldValue
Main task familyzero-shot NLP transfer through language modeling
Input/output unitprompt/context text to continuation text
Main model familydecoder-only Transformer
Main objectiveautoregressive next-token prediction
Main comparisonsmaller GPT-style models and task-specific systems
Main metricstask-specific accuracy, F1, perplexity-like or benchmark-specific scores
Not directly testedinstruction tuning, RLHF, tool use, retrieval-grounded generation, agent loops

Ablation Reading

GPT-2 is less of a clean architecture ablation paper than ResNet or the original Transformer. Its strongest reading is about the interaction between architecture, scale, and data.

AxisWhat it testsReading
model sizewhether capacity improves transfersupports scaling, not architecture alone
broad web pre-trainingwhether diverse text creates task exposureraises contamination and distribution questions
zero-shot promptingwhether tasks can be expressed as continuationsensitive to prompt format
next-token objectivewhether one objective supports many behaviorsdoes not isolate supervised fine-tuning alternatives

The paper should not be cited as proving that decoder-only Transformers are universally superior. It is evidence that decoder-only language modeling becomes a powerful general interface when scaled.

Relation to BERT

PaperBackboneObjectiveNatural Use
BERTencoder-only Transformermasked token reconstructionrepresentation and understanding tasks
GPT-2decoder-only Transformernext-token predictiongeneration and prompt-conditioned transfer

BERT asks: can bidirectional pre-training create reusable representations?

GPT-2 asks: can autoregressive pre-training create reusable behavior through text continuation?

Both depend on the Transformer, but they split the architecture family into two important branches.

From GPT-2 to Agents

GPT-2 is not an agent paper, but it is part of the path toward LLM agents.

Capability LayerGPT-2 ContributionMissing Piece
text continuationstrong decoder-only LM interfaceinstruction alignment
prompt conditioningtasks expressed in contextrobust prompt following
broad task behaviorzero-shot benchmark transfertool use and external state
generated action textlanguage can represent actionsexecution, verification, memory

Modern agents add tool contracts, memory, environment feedback, planning loops, and verification. GPT-2 contributes the base interface: a language model can condition on context and produce task-relevant continuations.

Implementation Notes

  • Causal masks must be correct; a leaked future token invalidates autoregressive training.
  • Tokenization affects context length, rare words, code-like text, and benchmark formatting.
  • Prompt formatting is part of the evaluation protocol, not a cosmetic detail.
  • Decoding changes behavior: greedy, sampling, top-k, nucleus sampling, and temperature are not equivalent.
  • Benchmark contamination is a serious issue for web-scale language models.
  • Zero-shot outputs often need normalization before metric computation.
  • Context length limits force truncation or retrieval-like preprocessing for long inputs.

Limitations

  • GPT-2 is a scaling and data paper as much as an architecture note.
  • Zero-shot evaluation is sensitive to prompt format and benchmark leakage.
  • Causal attention cannot condition on future tokens directly.
  • The original report predates modern instruction tuning, RLHF, tool use, and chat interfaces.
  • The paper does not provide a clean causal separation between data scale, model scale, and architecture.
  • WebText-style training data makes exact benchmark exposure hard to rule out.
  • Next-token prediction can generate plausible text without grounding or verification.
  • A continuation interface is flexible but underspecified; users must encode task intent in text.

Why It Matters

GPT-2 is the practical bridge from Transformer language modeling to prompt-based general-purpose LLM interfaces.

The reusable pattern is:

This pattern later becomes the base for instruction-tuned LLMs, chat models, coding agents, tool-using agents, and retrieval-augmented systems.

Connections