All models

UniDiffuserTextDecoder

The Transformer language model that learned tasks zero-shot from millions of web pages.

Language · 459 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 (35 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.5M
Operations
459
Framework
PyTorch
Recurrent
No
Published
2023
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
m3256
Graph hash
75f3c16ce4b7899a8298779fe336900f1f86ec8ee02ea0ff03e8ffd9a6137ff1
Skeleton hash
4b8faa81cb022e36c7aeebd824943d493f281dcd0d6822af0272031daf19a206
Architecture hash
1c52238f766273c3a79c93b33a5d3549d9006e3bf186bff26b9567c27a3e663e
Diagram SHA-256
18b334334840f01d42da8eeec44b1d85577f90bce4166b2eaff9f2c8ef03fa81
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 the Transformer language model behind the paper Language Models are Unsupervised Multitask Learners, whose claim is that a language model begins to learn tasks like question answering, translation and summarization with no explicit supervision. Its training set, WebText, was built by scraping all outbound links from Reddit that received at least 3 karma, giving slightly over 8 million documents and 40 GB of text after cleaning. The member traced here is the base gpt2 configuration from the transformers library, which corresponds to the paper's smallest size: 12 layers with a model width of 768, about 117M parameters.

The architecture 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. Residual layer weights are scaled at initialization by 1/√N, where N is the number of residual layers, to account for accumulation on the residual path with depth. The vocabulary grows to 50,257 tokens using a byte-level version of byte pair encoding, and the context size doubles from 512 to 1024 tokens.

The paper trained four sizes with log-uniformly spaced parameter counts, 117M, 345M, 762M and 1542M, and the largest is the one it names GPT-2. That 1.5B parameter model reaches state of the art on 7 of 8 tested language modeling datasets zero-shot, yet still underfits WebText. Conditioned on a document plus questions, its answers reach 55 F1 on CoQA, matching or exceeding 3 of 4 baselines without using the 127,000+ training examples. Capacity matters: performance improves in a log-linear fashion across tasks as the model grows.

Key idea. Showing that a large Transformer language model trained only on web text learns downstream tasks zero-shot, with performance scaling log-linearly in model capacity.

  • GPT-2
  • gpt2
  • GPT
  • OpenAI
  • language model
  • WebText
  • zero-shot
  • text generation
  • Radford
  • CodeGen

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.