Improving Language Understanding by Generative Pre-Training
GPT-1 demonstrated that a Transformer decoder pretrained to predict the next token can transfer to many language-understanding tasks through lightweight supervised fine-tuning.
Key takeaway
GPT-1 introduced a two-stage recipe: first pretrain a 12-layer Transformer decoder on unlabeled BooksCorpus with next-token prediction, then fine-tune it on labeled NLP tasks using task-specific input formatting and a small output head. The model achieved state-of-the-art results on 9 of 12 benchmarks studied.
Updated on Nov 23, 2026
01
Abstract
The central idea
GPT-1 separates learning language from learning a task. It first trains a general language model on a large unlabeled text collection, then adapts that model to each supervised task. The key insight is that next-token prediction on broad text teaches reusable representations that can be transferred with relatively small task-specific changes.
02
Background
Related work and lineage
GPT-1 builds on the Transformer architecture and earlier work on unsupervised language representation learning and transfer. It is an important precursor to GPT-2, which scaled the same autoregressive direction and emphasized zero-shot multitask behavior. BERT later explored a contrasting bidirectional encoder objective.
03
Methodology
Predict the next token
The model learns to estimate the next token from the tokens that came before it. Because attention is causally masked, a position cannot inspect future tokens. This objective is self-supervised: the text itself supplies the prediction targets, so pre-training does not require human task labels.
Two-stage training procedure
During pre-training, contiguous text sequences are used to optimize the language-model likelihood. During fine-tuning, labeled examples are converted into token sequences, passed through the pretrained Transformer, and scored by a task-specific linear layer. The paper also retains an auxiliary language-model objective during fine-tuning.
Decoder-only Transformer and task-specific input transformations
The left panel is the pre-trained model: 12 stacked Transformer decoder blocks (masked multi-head self-attention, then a feed-forward layer, each followed by layer norm with a residual connection) on top of token and learned position embeddings. Each block uses 768-dimensional states and 12 attention heads, with 3,072-dimensional feed-forward inner states. The model is first trained on BooksCorpus to predict the next token ("Text Prediction"); during fine-tuning a linear "Task Classifier" is added on top of the final token's representation, and the language-modeling loss is kept as an auxiliary objective. The right panel shows the paper's key practical trick (Section 3.3): instead of designing a new architecture for every task, each structured input is rewritten as one token sequence, wrapped in a start token, a delimiter between its parts, and an extract token whose final hidden state feeds the linear layer. Entailment simply concatenates premise and hypothesis. Similarity has no natural order, so both orderings are processed and their representations are added element-wise. Multiple-choice tasks pair the context with each candidate answer, score each sequence independently, and normalize the scores with a softmax.
Figure 1 from Radford et al. (2018), supplied by the user. OpenAI technical report.
04
Architecture
A 12-layer Transformer decoder
GPT-1 uses a decoder-style Transformer with masked multi-head self-attention and position-wise feed-forward layers. Token embeddings are combined with learned positional embeddings. The reported model has 12 layers, 768-dimensional hidden states, 12 attention heads and approximately 117 million parameters.
05
Training
Optimization and regularization
The report uses dropout in the Transformer and classifier, along with weight decay and gradient clipping. Fine-tuning also includes the auxiliary language-model objective, which the authors found useful for improving generalization and accelerating convergence.
Training data and compute setup
Pre-training uses BooksCorpus, a collection of more than 7,000 unpublished books spanning multiple genres. Its long contiguous passages provide narrative context beyond short isolated sentences. The model is trained for 100 epochs with a 512-token context; the paper reports optimization details including Adam and learning-rate warmup.
How to reproduce the recipe
A faithful conceptual reproduction needs a text tokenizer, a causal Transformer decoder, next-token training, and a downstream fine-tuning pipeline. For each task, serialize the inputs into a single sequence with task delimiters and use the representation at the designated extraction position for prediction.
06
Results
Benchmark results
Evidence highlights
- 01State of the art on 9 of 12 evaluated tasks
- 02+8.9 points on Story Cloze
- 03+5.7 points on RACE
- 04+1.5 points on MultiNLI
- 05Some smaller-data tasks remained difficulttransfer was not universally beneficial
How to interpret the evaluation
The paper compares the pretrained-and-fine-tuned model with strong task-specific baselines across classification, entailment, similarity, question answering and commonsense reasoning. Its central evidence is cross-task transfer, not that a single untouched model solves every task. The results should be read in the context of the benchmarks and baselines available in 2018.
Evidence highlights
- 01Evaluate separately on each benchmark using its standard metric
- 02Compare against task-specific supervised baselines
- 03Track both aggregate wins and task-level regressions
- 04Distinguish transfer learning from zero-shot prompting
Natural language inference results
Table 2 compares the fine-tuned model with prior state-of-the-art systems on six entailment benchmarks; underlined numbers were the previous best and bold marks the best overall. A single GPT-1 model beats several ensembles (marked 5x and 3x): 82.1 / 81.4 on MNLI matched / mismatched, 89.9 on SNLI, 88.3 on SciTail and 88.1 on QNLI, which the authors report as absolute gains of up to 1.5% on MNLI, 5% on SciTail, 5.8% on QNLI and 0.6% on SNLI. RTE is the exception: with only about 2,490 training examples, the model's 56.0% trails the 61.7% of a multi-task biLSTM. The authors suggest multi-task training could close that gap but did not test it, so small datasets remain a weak spot for single-task fine-tuning.
Table 2 from Radford et al. (2018), supplied by the user. OpenAI technical report.
Question answering and commonsense reasoning
Story Cloze asks the model to pick the correct ending for a short story; RACE is multiple-choice reading comprehension drawn from English exams for middle-school (RACE-m) and high-school (RACE-h) students. The fine-tuned model reaches 86.5 on Story Cloze and 59.0 on RACE, gains of up to 8.9% and 5.7% overall, while the previous RACE leaders were 9-model ensembles. The authors chose RACE because it contains more reasoning-style questions than datasets such as CNN or SQuAD, and they attribute the gains to the model's ability to use long-range context, which pre-training on long, contiguous book text encourages.
Table 3 from Radford et al. (2018), supplied by the user. OpenAI technical report.
GLUE semantic similarity and classification
These tasks come from the GLUE benchmark and use different metrics: Matthews correlation for CoLA (is a sentence grammatical?), accuracy for SST-2 (sentiment), F1 for MRPC and QQP (paraphrase detection) and Pearson correlation for STS-B (graded similarity). The biggest jump is on CoLA, 45.4 against a previous 35.0, which the authors read as evidence that pre-training teaches the model linguistic acceptability. QQP improves by 4.2 points absolute over a single-task BiLSTM with ELMo, STS-B by about 1 point, and the overall GLUE score rises from 68.9 to 72.8. SST-2 (91.3) is competitive rather than best and MRPC (82.3) trails the multi-task baseline, so the gains are broad but not universal.
Table 4 from Radford et al. (2018), supplied by the user. OpenAI technical report.
07
Ablation
Why the pre-trained model helps: layer transfer and zero-shot behaviour
Both panels come from the paper's analysis section (Section 5). Left: the authors copy an increasing number of pre-trained layers into the model before fine-tuning. Dev accuracy on RACE and MultiNLI rises almost steadily with every layer transferred, up to 9% on MultiNLI for full transfer, so every layer of the pre-trained network carries useful features, not just the embeddings. Right: zero-shot performance, with no fine-tuning at all. Each task is turned into a language-modeling heuristic, for example appending "very" to an SST-2 sentence and comparing the probabilities of "positive" and "negative", or choosing the RACE answer with the highest average log-probability. Scores are normalized so 0 is random guessing and 1 is the single-model state of the art. For the Transformer (solid lines) these heuristics improve steadily as pre-training continues, suggesting that next-token prediction itself teaches task-relevant skills. The LSTM (dashed) is lower and noisier, which the authors take as evidence that the Transformer's inductive bias helps transfer.
Figure 2 from Radford et al. (2018), supplied by the user. OpenAI technical report.
Ablations: pre-training, auxiliary LM loss and architecture
Three variants are compared with the full model (74.7 average). Removing pre-training does the most damage: the average falls to 59.9, a 14.8% drop, with CoLA collapsing from 45.4 to 18.9 and STS-B from 82.0 to 30.9. Replacing the Transformer with a single-layer 2,048-unit LSTM, still pre-trained and with the auxiliary objective, costs 5.6 points on average, and the LSTM wins only on MRPC. Removing the auxiliary language-modeling loss during fine-tuning is mixed: it hurts the larger datasets (MNLI, QNLI, QQP) but helps smaller ones such as CoLA, SST-2 and MRPC, which is why that variant's average (75.0) is slightly higher. The authors conclude the auxiliary objective mainly benefits larger datasets; the clear headline is that generative pre-training drives the improvements.
Table 5 from Radford et al. (2018), supplied by the user. OpenAI technical report.
08
Limitations
Limitations and caveats
GPT-1 still relies on labeled datasets and task-specific fine-tuning; it is not a zero-shot general-purpose assistant. Its training corpus and model scale are small by later LLM standards. Performance varies across tasks, and the paper does not establish that next-token pretraining alone guarantees robust reasoning or factual reliability.
09
Conclusion
What the paper contributed
GPT-1 provided early empirical evidence that generative language-model pretraining could produce representations useful for many supervised NLP tasks. It demonstrated a practical transfer-learning recipe with a largely shared architecture and helped establish the decoder-only pretraining direction later expanded by GPT-2 and subsequent models.
Key takeaways
GPT-1 made a compelling case for learning general-purpose language features from unlabeled text before applying task supervision. The durable design pattern is a causal decoder pretrained with next-token prediction, followed by adaptation. This differs from BERT, which uses a bidirectional encoder and masked-token prediction.
Frequently asked questions
Is GPT-1 the same as ChatGPT? No. GPT-1 was a 2018 research model; ChatGPT is a later conversational product built on much more advanced models and training methods.\n\nWas GPT-1 trained to predict masked words? No. It predicts the next token using only preceding context.\n\nWas GPT-1 zero-shot? The paper studies transfer through supervised fine-tuning; it should not be confused with later zero-shot prompting systems.\n\nHow is it different from BERT? GPT-1 uses a causal decoder and autoregressive objective, while BERT uses a bidirectional encoder and masked language modeling.
10
References
Source trail
Primary papers, implementation pages, and external source records used to ground this explainer.
Improving Language Understanding by Generative Pre-Training
Radford et al., OpenAI Technical Report, 2018.
The original GPT-1 paper introducing generative pre-training followed by supervised fine-tuning.
Attention Is All You Need
Vaswani et al., NeurIPS 2017.
Introduces the Transformer architecture used as GPT-1’s backbone.
Universal Language Model Fine-tuning for Text Classification
Howard and Ruder, ACL 2018.
Related transfer-learning work that also pretrains language models before task-specific fine-tuning.
Language Models are Unsupervised Multitask Learners
Radford et al., OpenAI, 2019.
GPT-2 scales the autoregressive language-modeling approach and explores zero-shot task behavior.
01Original OpenAI technical report (PDF)02OpenAI fine-tune-transformer-lm code03OpenAI: Improving Language Understanding with Unsupervised Learning04Attention Is All You Need (Transformer)Continue reading
Related research
GPT-2: Unsupervised Multitask Learning
GPT-2 showed that scaling a decoder-only Transformer on diverse web text can produce useful zero-shot task behavior without task-specific fine-tuning.
Natural Language ProcessingBERT: Bidirectional Transformer Pre-training
BERT made deep bidirectional Transformer representations practical by pre-training on unlabeled text and fine-tuning the same model for many NLP tasks.