Pre-training
×Language modelling on WebText, about 8 million web pages that Reddit users linked to, the learning rate tuned for each size on held-out WebText.
Next-token prediction
In words
At every position the model gives each token of the vocabulary a probability of coming next; the loss is the negative logarithm of the probability it gave the token that does come next, averaged over the sequence.
: the token at position ; : the probability the model, reading the tokens before it, gave that token; : the sequence length.
The paper writes the language model’s factorization, .
Next-token prediction as drawn for DeepSeek‑V3.2‑Exp →That plate also draws multi-token prediction, fill-in-the-middle and DeepSeek-V3’s sequence-wise balance loss.
- Data
- WebText, about 8 million documents, 40 GB
- Context
- 1,024 tokens
- Batch
- 512
- Fit
- all four still underfit
Not disclosed Tokens · Steps · Epochs · Optimizer · Hardware
Why
Common Crawl, a large and nearly unlimited source, has significant data quality issues. WebText keeps only pages people had curated: outbound links from Reddit with at least 3 karma, a heuristic sign that users found them interesting, educational or funny. GPT-2 paper §2.1, p. 3
Wikipedia is removed because it is a common source of other datasets, and overlap between training data and the test tasks could complicate the analysis. GPT-2 paper §2.1, p. 3
All settings9
- Data
- WebText: the text of the outbound links from Reddit that received at least 3 karma, 45 million links; the version used has no links created after December 2017 and, after de-duplication and heuristic cleaning, slightly over 8 million documents, 40 GB of text; Wikipedia documents removed
- Objective
- Language modelling: the probability of a text as the product of each token’s probability given the tokens before it
- Context
- 1,024 tokens, up from GPT’s 512
- Batch
- 512, up from GPT’s; the paper gives no unit
- Learning rate
- Tuned by hand for each size, for the best perplexity on a 5% held-out sample of WebText; the values are not given
- Vocabulary
- 50,257 tokens, byte-level BPE whose merges never cross character categories, spaces excepted
- Sizes
- Four, log-uniformly spaced: the smallest equals the original GPT, the second the largest BERT; 117M, 345M, 762M and 1,542M parameters by the paper’s count
- Fit
- All four still underfit WebText; held-out perplexity was still improving with more training time
- Trainable
- Every parameter
Sources3
- gpt2-language_models_are_unsupervised_multitask_learners.pdf, p. 3Data
- gpt2-language_models_are_unsupervised_multitask_learners.pdf, p. 2Objective
- gpt2-language_models_are_unsupervised_multitask_learners.pdf, p. 4Context, Batch, Learning rate, Vocabulary, Sizes, Fit, Trainable