Paper commentary
Don't Stop Pretraining: Adapt Language Models to Domains and Tasks
Further pretraining on domain and task text still helps language models
- Problem Language models pretrained on broad mixed corpora may no longer need extra training for particular fields or tasks. Earlier studies covered one domain each, so it was unclear whether the gains still hold.
- Method DAPT keeps training RoBERTa on a large unlabeled domain corpus. TAPT instead trains only on the unlabeled training split of one task, which is much smaller but closer to the classifier's data.
- Results DAPT raises RoBERTa on all tasks except AGN EWS. Combining DAPT with TAPT gives the best reported score on most tasks.
Why further pretraining still needs testing
ROBERTA is pretrained on a corpus that mixes encyclopedic and news articles, literary works and web content, so it covers a broad range of English without targeting any single field. Whether that breadth removes the need for separate pretrained models for particular fields is the open question. Earlier studies showed gains from continued pretraining on domain text, but each covered one domain and started from an older model trained on a smaller, less diverse corpus.
The study asks how the benefit changes with the amount of labeled task data and with how far the target domain is from the original pretraining corpus.
The work separates two levels of further pretraining. The first, domain-adaptive pretraining (DAPT), keeps training on a large unlabeled corpus drawn from the target domain. The second, task-adaptive pretraining (TAPT), uses only the unlabeled training split of a single task, which is much smaller but closer to the data the classifier sees.
Both levels are compared with each other and also combined, so the results show what a domain step and a task step each contribute.
Continued pretraining on four domains
The four domains are biomedical papers (BIOMED), computer science papers (CS), news (NEWS) and Amazon reviews (REVIEWS), chosen because earlier work used them and classification datasets exist for each. Each domain model is trained for 12.5K steps, which the authors set so that every domain receives about the same amount of data.
Before adapting, the authors measure how far each domain sits from ROBERTA's pretraining data by comparing vocabularies of the top 10K unigrams, excluding stopwords. NEWS and REVIEWS share the most vocabulary with ROBERTA's pretraining domain, while CS and BIOMED differ most from the other domains. The overlap is not clean-cut, since 40% of unigrams are shared between REVIEWS and NEWS.
Masked LM loss on held-out documents measures how well a model fits a domain. After DAPT the BIOMED loss falls from 1.32 to 0.99, and the CS loss falls from 1.63 to 1.34. NEWS is the exception, with its loss rising slightly from 1.08 to 1.16. The authors also note that a cross-domain version of this loss is a noisy guide to domain similarity.
Domain gains and the irrelevant-domain control
Each task's baseline is an off-the-shelf ROBERTA-base model fine-tuned directly, with a task-specific feedforward layer on the final [CLS] representation. Test scores are macro-F1 for most tasks and micro-F1 for CHEM PROT and RCT, averaged over five random seeds. DAPT lifts the baseline on every task except AGN EWS, where the score stays the same.
The gains are smallest on RCT and IMDB and largest on ACL-ARC, a CS task with 1688 labeled training examples.
The authors report the same pattern in high-resource and low-resource settings, where the low-resource tasks have 5K or fewer labeled examples and no extra unlabeled data. They read the HYPER PARTISAN gain as evidence that domain adaptation can help even for tasks that align closely with ROBERTA's source domain.
To check that gains come from domain match rather than from more text, each task is also adapted to a mismatched domain: CS for NEWS, BIOMED for REVIEWS, NEWS for CS and REVIEWS for BIOMED. The vocabulary overlap statistics guided these pairings. DAPT outperforms the mismatched adaptation on each task. The mismatched adaptation is usually worse than ROBERTA itself, which the authors read as a sign that extra data without domain relevance tends to hurt end-task performance.
SCIERC and ACL-ARC are the two exceptions, where the mismatched adaptation slightly improves on ROBERTA, and HELPFULNESS matches the baseline.
Adapting to NEWS is also not as harmful to the REVIEWS tasks as the domain labels alone would suggest, which the authors connect to the vocabulary overlap between the two domains.
Task-adaptive pretraining on the task's own text
TAPT continues ROBERTA's masked training on only the unlabeled training split of one task. The run lasts 100 epochs, and the words that are masked change from epoch to epoch with a masking probability of 0.15. The trade-off is a corpus that is far smaller but more relevant to the task, on the assumption that the training set represents the task well.
TAPT improves ROBERTA on every task across the four domains. This includes NEWS, whose text was already part of ROBERTA's pretraining corpus. On RCT, HYPER PARTISAN, AGN EWS, HELPFULNESS and IMDB, TAPT exceeds DAPT, and on SCIERC it roughly matches DAPT.
Running DAPT and then TAPT gives the best reported score on most tasks. On HYPER PARTISAN the combined setting matches TAPT within one standard deviation across the five seeds. The authors speculate that the reverse order would risk catastrophic forgetting of the task corpus and leave other orderings to future work.
The combined setting has three pretraining phases and is the most expensive of the settings, but a domain-adapted model can be reused for several tasks in that domain, each needing only one TAPT phase.
Whether task adaptation carries over to other tasks
Transfer-TAPT further pretrains on one task's unlabeled data and then fine-tunes on a different labeled task in the same domain. For example, the unlabeled RCT data is used for pretraining before fine-tuning on the CHEM PROT labeled data.
Every Transfer-TAPT score in Table 6 is below its TAPT counterpart, with drops ranging from 0.2 to 7.7. The authors take this to mean that task distributions differ even within one domain, so adapting to a broad domain alone is not sufficient. The development results are less uniform: ACL-ARC rises slightly under transfer (↑ 1.2). The transfer results cover only the task pairs shown in these tables, not every possible pair.
Human-curated task data
Dataset creators often collect a large unlabeled corpus and downsample it for annotation, so the unused part shares the task's distribution. For HYPER PARTISAN the authors use 5K documents from the high-resource track as unlabeled Curated-TAPT data, and for IMDB they use the unlabeled reviews that annotators curated.
Curated-TAPT beats TAPT on all three of these tasks, and the largest boost comes when DAPT is applied before it. On HYPER PARTISAN, DAPT followed by Curated-TAPT is within one standard deviation of Curated-TAPT alone. With 500 labeled examples, Curated-TAPT reaches about 95% of the performance of DAPT + TAPT trained on the fully labeled RCT corpus, using 0.3% of the labeled data.
The authors recommend that task designers release a large unlabeled pool alongside their tasks.
Retrieving in-domain sentences for task adaptation
The retrieval embedding must be cheap enough to run over millions of sentences, which is why the authors use VAMPIRE, a lightweight bag-of-words language model. VAMPIRE is pretrained on a deduplicated sample of 1M domain sentences, then embeds both the task sentences and the domain sentences. For each task sentence, the nearest domain sentences in that shared space become candidates, and deduplication keeps different sentences from sharing the same neighbours.
Candidates are either the nearest neighbours (kNN-TAPT) or random domain sentences (RAND-TAPT), and ROBERTA is pretrained on the task data together with the chosen pool. kNN-TAPT outperforms TAPT in every setting the authors ran. RAND-TAPT is generally below kNN-TAPT and within one standard deviation for RCT and ACL-ARC.
As the number of neighbours grows, kNN-TAPT keeps improving and approaches DAPT. This comparison covers only CHEM PROT, RCT-500 and ACL-ARC, and the authors leave a closer study of selection methods, and of the trade-off between diversity and task relevance, to future work.
Training cost of each adaptation
Table 9 compares training steps, documents and storage for RCT-500 in BIOMED. TAPT takes 0.2K steps on 500 documents and 80KB of storage, while DAPT takes 12.5K steps on 25M documents and 47GB. TAPT trains nearly 60 times faster than DAPT on a single v3-8 TPU, and DAPT's storage requirement is 5.8M times that of TAPT on this task.
Curated-TAPT takes 8.8K steps on 180K documents at 27MB, and kNN-TAPT with 500 neighbours takes 9.0K steps on 185K documents at 24MB. The authors note that curating a large pool has its own cost, so Curated-TAPT is cheaper to train than DAPT but not free to obtain. Automatic selection of this kind is much cheaper than DAPT.
Limitations
Only ROBERTA-base is adapted in the reported experiments, although the authors argue that the approaches apply to any pretrained language model. The study covers four domains and eight tasks, two per domain. The authors also note that domain boundaries are fuzzy, and they leave going beyond conventional domain boundaries to future work.
The cross-domain masked LM loss is a noisy predictor of domain similarity. Variance across seeds is high on HYPER PARTISAN because the dataset is very small, so degenerate seeds were discarded and resampled. Transfer-TAPT and kNN-TAPT are tested on a limited set of tasks, and the best selection methods are left open.
Paper info
- Authors
- Suchin Gururangan, Ana Marasović, Swabha Swayamdipta, Kyle Lo, Iz Beltagy, Doug Downey, Noah A. Smith
- Venue
- arXiv · Preprint
- First published
- 2020-4-23
- Added
- 2026-11-12
- Updated
- 2020-5-5
- Version
- v3
- arXiv
- 2004.10964
- Category
- cs.CL · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Suchin Gururangan, Ana Marasović, Swabha Swayamdipta, Kyle Lo, Iz Beltagy, Doug Downey, Noah A. Smith (2020). Don't Stop Pretraining: Adapt Language Models to Domains and Tasks. arXiv:2004.10964v3. https://arxiv.org/abs/2004.10964v3
BibTeX
@misc{gururangan2020stop,
title = {{Don't Stop Pretraining: Adapt Language Models to Domains and Tasks}},
author = {Suchin Gururangan and Ana Marasović and Swabha Swayamdipta and Kyle Lo and Iz Beltagy and Doug Downey and Noah A. Smith},
year = {2020},
eprint = {2004.10964},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2004.10964v3}
}