
CDial-GPT (Chinese Dialogue GPT)
Language541 ops95.5M params
The Transformer language model that learned tasks zero-shot from millions of web pages.
Language · 539 operations Checked
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
How this diagram was made
transformers.AutoModel.from_config()
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.
AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.