All models

BioMedLM

GPT-2 is a decoder-only Transformer trained on WebText that picks up many language tasks with no explicit supervision.

Language · 541 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (30 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
GPT-2
Parameters
124.4M
Operations
541
Framework
PyTorch
Recurrent
No
Published
2019, OpenAI technical report
Authors
Alec Radford, Jeffrey Wu, Rewon Child and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m12413
Graph hash
3b0267eddb86cea40aa30b3b15be4c7ea503e05a5afe368bf773dbfff26fdfd0
Skeleton hash
7336e42a243c87cd0e452aaee111639e75d880d97c10903b31fa508c57f8f100
Architecture hash
625f3914c4b84378c551fd720ababa452b922fa5f51df1f8403386681204ec21
Diagram SHA-256
47f89adb048fb67540b0d5aa1c0a0c958957d3c6e71de141d1fa73e91c422858
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

About this model's family

GPT-2 is a Transformer language model trained on WebText, a new dataset of millions of webpages, and the paper's claim is that such a model begins to learn tasks like question answering, translation and summarization without any explicit supervision. The largest model has 1.5B parameters and reaches state of the art on 7 of 8 tested language modeling datasets zero-shot, while still underfitting WebText. The authors' motivation is a move away from narrow experts toward general systems that perform many tasks without a hand-labelled dataset for each.

Architecturally it largely follows the OpenAI GPT model with a few modifications. Layer normalization moves to the input of each sub-block, like a pre-activation residual network, and an extra layer normalization is added after the final self-attention block. A modified initialization accounts for the accumulation on the residual path as the model gets deeper. The vocabulary is expanded to 50,257 and the context size from 512 to 1024 tokens. Four sizes were trained: 117M, 345M, 762M and 1542M parameters, with 12, 24, 36 and 48 layers and model widths from 768 to 1600. The smallest is equivalent to the original GPT and the second smallest to the largest BERT.

The paper's headline demonstration is reading comprehension: conditioned on a document plus questions, the model's answers reach 55 F1 on CoQA, matching or exceeding 3 of 4 baseline systems without using the 127,000+ training examples. Even so, all four models still underfit WebText, with held-out perplexity still improving given more training time.

Key idea. GPT-2 shows that a high-capacity Transformer language model trained on WebText performs downstream tasks zero-shot, with performance improving log-linearly in capacity across tasks.

  • GPT-2
  • gpt2
  • Generative Pre-trained Transformer 2
  • language model
  • WebText
  • zero-shot
  • OpenAI GPT
  • transformer decoder
  • text generation
  • gpt-sw3
  • BioMedLM
  • MarioGPT
  • distilgpt2
  • UBAR

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@article{gpt22019,
  title = {Language Models are Unsupervised Multitask Learners},
  author = {Alec Radford and Jeffrey Wu and Rewon Child and David Luan and Dario Amodei and Ilya Sutskever},
  year = {2019},
  journal = {OpenAI technical report}
}