Improving language understanding with unsupervised learning
OpenAI, 2018: the first GPT.
Article
- Said here alone: 32
What it says
- A task-agnostic system built from a transformer and unsupervised pre-training reaches state-of-the-art results on a broad suite of language tasks. The model is first trained on a very large amount of unlabeled text, with language modeling as the training signal, and then fine-tuned on much smaller supervised datasets for each task, with minimal adaptation and very little tuning. It sets new results on textual entailment datasets such as QNLI and SciTail and on the GLUE multi-task benchmark, where it scores 72.8 against a previous 68.9. The largest margins come on commonsense reasoning and reading comprehension datasets such as COPA, RACE and ROCStories, which the author reads as evidence that unsupervised learning builds these skills. The language model can also perform some tasks before any fine-tuning; for sentiment it reaches about 80 percent accuracy. The author lists drawbacks: pre-training takes a month on 8 GPUs, text gives incomplete and sometimes inaccurate knowledge of the world, and generalization remains brittle under adversarial tests. Future work could scale compute and data, use more intricate fine-tuning, and find out whether the gains come from broader context or from world knowledge.
- On QNLI the model scores 88.1, against a prior best of 82.3. u7 The prior best is the SOTA column of the source's comparison table.
- On RTE the model scores 56.0, below the prior best of 61.7. u8 This is one of the few tasks in the table where the model scores below the prior best.
- On ROCStories the model scores 86.5, against a prior best of 77.6. u13 The prior best is the SOTA column of the source's comparison table.
- On the GLUE multi-task benchmark the model scores 72.8, against a prior best of 68.9. u17 The prior best is the SOTA column of the source's comparison table.
- Using the language model alone, without adapting it to the task, sentiment classification reaches about 80% accuracy. u27 The source describes this as performing on par with classic baselines on the Stanford Sentiment Treebank.
- Pre-training takes one month on 8 GPUs, and the model is released so others can avoid repeating it. u32 The source says this pre-training only has to be done once.
- The model is a 37-layer (12 block) Transformer that trains on sequences of up to 512 tokens. u32
- On the dataset introduced by Glockner et al. (2018) the model achieves 83.75%, performing similarly to KIM, which uses WordNet. u34
- The pre-training corpus is a few thousand books, about 5GB of text. u36
- The total compute used to train the model was 0.96 petaflop days. u42
- Applying the pairing of supervised learning with unsupervised pre-training to larger and more diverse datasets is proposed for further research. u1
- The pre-trained model should be released so that others can skip the expensive pre-training step. u32
- More intricate adaptation and transfer techniques, such as those in ULMFiT, are likely to bring substantial improvements over the simple fine-tuning used. u37
- Gains on commonsense and reading datasets suggest the model learns these skills mainly through unsupervised learning. u21 The source offers this as a suggestion that rests on the size of the gains, not on a direct test.
- Unsupervised learning removes the bottleneck of explicit human labeling, so it scales with more compute and raw data. u24 This is why the author sees unsupervised methods as a way around the cost of labeled datasets.
- Randomly initialized networks with no information about the task perform no better than random on these heuristics, which the author reads as insight into why generative pre-training helps. u26 It points to what the language model learns in pre-training as the source of its ability on these tasks.
- Downstream task gains track improvements in the language model, which suggests that more compute and data should keep helping. u36 This correlation is the basis for the author's expectation that scaling will help.
- A single task-agnostic transformer, pre-trained on unlabeled text and then fine-tuned, reaches state-of-the-art results on many language tasks. u1–18
- Very little tuning was needed: all datasets use a single forward language model without ensembling, and most results share the same hyperparameters. u20
- The largest gains are on COPA, RACE and ROCStories, tasks thought to require multi-sentence reasoning and significant world knowledge. u21
- The approach has real costs and limits: heavy pre-training compute, incomplete knowledge from text, and brittle generalization. u32–34
- Can one model, trained unsupervised on a large amount of data and then fine-tuned, perform well on many different tasks? u18 The results indicate yes: the same core model is fine-tuned for very different tasks.
- How much of the benefit of generative pre-training comes from better processing of broad context versus improved world knowledge? u38
- The authors say the same core model adapts to very different tasks with little change. u18 It states the core claim of the work in one line.
- The author says the transformer is flexible enough for many tasks without task-specific customization. u28 It sums up why the author sees the transformer as a robust choice.
- The author argues that the approach has significant room for improvement with more compute and data. u36 It is the clearest statement of the author's expectation about scaling.
- Strong results across many tasks came with very little tuning and mostly identical hyperparameters. u20 Results this broad would usually be expected to need per-task tuning.
- A language model used without any task adaptation performs on par with classic baselines on sentiment, at about 80% accuracy. u27 One would expect a model never trained on the task to do poorly on it.
- The approach needs a large, compute-heavy model, while many prior NLP methods train small models on a single GPU from scratch. u32 The source partly settles it: pre-training is done once and the model fine-tunes to new tasks quickly.
- Learning from text gives incomplete or biased knowledge of the world, and the model still generalizes brittlely under adversarial or out-of-distribution tests. u33–34 The source names these as limits and does not resolve them.
- Pairing a transformer with unsupervised language-model pre-training and supervised fine-tuning yields one task-agnostic model that reaches state-of-the-art results on many diverse language tasks. Can one model, pre-trained unsupervised on a large amount of data and then fine-tuned, perform well on many different language tasks?
How it argues
- thesis One pre-trained transformer, fine-tuned, wins across many tasks Can one model, pre-trained unsupervised on a large amount of data and then fine-tuned, perform well on many different language tasks?
- theme One model reaches broad state of the art The source argues that a single task-agnostic transformer, pre-trained unsupervised and fine-tuned with little tuning, beats prior bests on many benchmarks, with some exceptions.
- idea One task-agnostic model reaches state of the art
- theme Gains concentrate on reasoning and commonsense The largest gains come on multi-sentence reasoning and world-knowledge tasks, which the source attributes to skills learned through unsupervised pre-training.
- theme Unsupervised learning scales with compute and data The source argues that removing the labeling bottleneck lets gains keep growing with more compute, data and better adaptation methods.
- theme Costs, limits and open questions The source acknowledges heavy compute cost, incomplete knowledge and brittle generalization, and raises an open question about what drives the benefit.
- theme One model reaches broad state of the art The source argues that a single task-agnostic transformer, pre-trained unsupervised and fine-tuned with little tuning, beats prior bests on many benchmarks, with some exceptions.
The source, passage by passage
- u1 We’ve obtained state-of-the-art results on a suite of diverse language tasks with a scalable, task-agnostic system, which we’re also releasing. Our approach is a combination of two existing ideas: transformers and unsupervised pre-training. These results provide a convincing example that pairing supervised learning methods with unsupervised pre-training works very well; this is an idea that many have explored in the past, and we hope our result motivates further research into applying this idea on larger and more diverse datasets.
- u2 Dataset | Task | SOTA | Ours
- u3 SNLI | Textual entailment | 89.3 | 89.9
- u4 MNLI matched | Textual entailment | 80.6 | 82.1
- u5 MNLI mismatched | Textual entailment | 80.1 | 81.4
- u6 SciTail | Textual entailment | 83.3 | 88.3
- u7 QNLI | Textual entailment | 82.3 | 88.1
- u8 RTE | Textual entailment | 61.7 | 56.0
- u9 STS-B | Semantic similarity | 81.0 | 82.0
- u10 QQP | Semantic similarity | 66.1 | 70.3
- u11 MRPC | Semantic similarity | 86.0 | 82.3
- u12 RACE | Reading comprehension | 53.3 | 59.0
- u13 ROCStories | Commonsense reasoning | 77.6 | 86.5
- u14 COPA | Commonsense reasoning | 71.2 | 78.6
- u15 SST-2 | Sentiment analysis | 93.2 | 91.3
- u16 CoLA | Linguistic acceptability | 35.0 | 45.4
- u17 GLUE | Multi task benchmark | 68.9 | 72.8
- u18 Our system works in two stages; first we train a transformer model on a very large amount of data in an unsupervised manner—using language modeling as a training signal—then we fine-tune this model on much smaller supervised datasets to help it solve specific tasks. We developed this approach following our sentiment neuron work, in which we noted that unsupervised learning techniques can yield surprisingly discriminative features when trained on enough data. Here, we wanted to further explore this idea: can we develop one model, train it in an unsupervised way on a large amount of data, and then fine-tune the model to achieve good performance on many different tasks? Our results indicate that this approach works surprisingly well; the same core model can be fine-tuned for very different tasks with minimal adaptation.
- u19 This work builds on the approach introduced in Semi-supervised Sequence Learning, which showed how to improve document classification performance by using unsupervised pre-training of an LSTM followed by supervised fine-tuning. It also extends ULMFiT, research that shows how a single dataset-agnostic LSTM language model can be fine-tuned to get state-of-the-art performance on a variety of document classification datasets; our work shows how a Transformer-based model can be used in this approach to succeed at a broader range of tasks beyond document classification, such as commonsense reasoning, semantic similarity, and reading comprehension. It is also similar to but more task-agnostic than ELMo, which incorporates pre-training but uses task-customized architectures to get state-of-the-art results on a broad suite of tasks.
- u20 Very little tuning was used to achieve our results. All datasets use a single forward language model, without any ensembling, and the majority of the reported results use the exact same hyperparameter settings.
- u21 A result we are particularly excited about is the performance of our approach on three datasets—COPA, RACE, and ROCStories—designed to test commonsense reasoning and reading comprehension. Our model obtains new state-of-the-art results on these datasets by a wide margin. These datasets are thought to require multi-sentence reasoning and significant world knowledge to solve suggesting that our model improves these skills predominantly via unsupervised learning. This suggests there’s hope for developing complex language understanding capabilities via unsupervised techniques.
- u22 Language Unsupervised (photo)
Language Unsupervised - u23 Why unsupervised learning?
- u24 Supervised learning is at the core of most of the recent success of machine learning. However, it can require large, carefully cleaned, and expensive to create datasets to work well. Unsupervised learning is attractive because of its potential to address these drawbacks. Since unsupervised learning removes the bottleneck of explicit human labeling it also scales well with current trends of increasing compute and availability of raw data. Unsupervised learning is a very active area of research but practical uses of it are often still limited.
- u25 There’s been a recent push to try to further language capabilities by using unsupervised learning to augment systems with large amounts of unlabeled data; representations of words trained via unsupervised techniques can use large datasets consisting of terabytes of information and, when integrated with supervised learning, improve performance on a wide range of NLP tasks. Until recently, these unsupervised techniques for NLP (for example, GLoVe and word2vec) used simple models (word vectors) and training signals (the local co-occurence of words). Skip-Thought Vectors is a notable early demonstration of the potential improvements more complex approaches can realize. But new techniques are now being used which are further boosting performance. These include the use of pre-trained sentence representation models, contextualized word vectors (notably ELMo and CoVE), and approaches which use customized architectures to fuse unsupervised pre-training with supervised fine-tuning, like our own.
- u26 We also noticed we can use the underlying language model to begin to perform tasks without ever training on them. For example, performance on tasks like picking the right answer to a multiple choice question steadily increases as the underlying language model improves. While the absolute performance of these methods is still often quite low compared to the supervised state-of-the-art (for question answering it still outperformed by a simple sliding-window baseline) it is encouraging that this behavior is robust across a broad set of tasks. Randomly initialized networks containing no information about the task and the world perform no-better than random using these heuristics. This provides some insight into why generative pre-training can improve performance on downstream tasks.
- u27 We can also use the existing language functionality in the model to perform sentiment analysis. For the Stanford Sentiment Treebank dataset, which consists of sentences from positive and negative movie reviews, we can use the language model to guess whether a review is positive or negative by inputting the word “very” after the sentence and seeing whether the model predicts the word “positive” or “negative” as more likely. This approach, without adapting the model at all to the task, performs on par with classic baselines ~80% accuracy.
- u28 Our work is also a validation of the robustness and usefulness of the transformer architecture, indicating that it is sufficiently flexible to achieve state-of-the-art results on a wide range of tasks without requiring complicated task-specific customization or hyperparameter tuning.
- u29 Two side-by-side graphs demonstrating how Zero Shot Transfer can directly accelerate Supervised Fine-Tuning (photo)
Two side-by-side graphs demonstrating how Zero Shot Transfer can directly accelerate Supervised Fine-Tuning - u30 Drawbacks
- u31 This project has a few outstanding issues which are worth noting:
- u32 Compute Requirements: Many previous approaches to NLP tasks train relatively small models on a single GPU from scratch. Our approach requires an expensive pre-training step—1 month on 8 GPUs. Luckily, this only has to be done once and we’re releasing our model so others can avoid it. It is also a large model (in comparison to prior work) and consequently uses more compute and memory—we used a 37-layer (12 block) Transformer architecture, and we train on sequences of up to 512 tokens. Most experiments were conducted on 4 and 8 GPU systems. The model does fine-tune to new tasks very quickly which helps mitigate the additional resource requirements.
- u33 The limits and bias of learning about the world through text: Books and text readily available on the internet do not contain complete or even accurate information about the world. Recent work has shown that certain kinds of information are difficult to learn via just text and other work has shown that models learn and exploit biases in data distributions.
- u34 Still brittle generalization: Although our approach improves performance across a broad range of tasks, current deep learning NLP models still exhibit surprising and counterintuitive behavior - especially when evaluated in a systematic, adversarial, or out-of-distribution way. Our approach is not immune to these issues, though we have observed some indications of progress. Our approach shows improved lexical robustness over previous purely neural approaches to textual entailment. On the dataset introduced in Glockner et al. (2018) our model achieves 83.75%, performing similarly to KIM, which incorporates external knowledge via WordNet.
- u35 Future
- u36 Scaling the approach: We’ve observed that improvements in the performance of the language model are well correlated with improvements on downstream tasks. We’re currently using commodity hardware (a single 8 GPU machine) and a training dataset of only a few thousand books (~5GB of text). This suggests there is significant room for improvement using the well-validated approach of more compute and data.
- u37 Improved fine-tuning: Our approach is currently very simple. It is likely that substantial improvements can be made using more intricate adaptation and transfer techniques such as those explored in ULMFiT.
- u38 Better understanding of why generative pre-training helps: Although we’ve discussed some ideas we are partial to here, more targeted experiments and research will help distinguish between competing explanations. For instance, how much of the benefits we observe are due to improved ability to process broader context versus improved world knowledge?
- u39 Appendix: Dataset examples
- u40 Loading...
- u41 Compute
- u42 We’re increasingly interested in understanding the relationship between the compute we expend on training models and the resulting output. The total compute used to train this model was 0.96 petaflop days (pfs-days).
- u43 1 8 P600 GPU's * 30 days * 12 TFLOPS/GPU * 0.33 utilization = 2 = .96 pfs-days
Around it
Stanford CME295 Transformers & LLMs | Autumn 2026 | Lecture 2 - Large Language Models
Large language models build on transformers, with decoder-only generation becoming dominant alongside representation-based approaches such as BERT. Their effectiveness depends on balancing model size and training data, using efficient architectures, and choosing suitable decoding methods. Prompting and reasoning techniques can improve responses without changing weights, but longer contexts can impair retrieval and increase costs.
Video
This text is written with AI.
Placed in: Now