A Pretrainer's Guide to Training Data: Measuring the Effects of Data Age, Domain Coverage, Quality, & Toxicity

Shayne Longpre, Gregory Yauney, Emily Reif, Katherine Lee, Adam Roberts, Barret Zoph, Denny Zhou, Jason Wei, Kevin Robinson, David Mimno, Daphne Ippolito

Abstract

Pretraining data design is critically under-documented and often guided by empirically unsupported intuitions. We pretrain models on data curated (1) at different collection times, (2) with varying toxicity and quality filters, and (3) with different domain compositions. First, we find that temporal shift between evaluation data and pretraining data leads to performance degradation, which is not overcome by finetuning. Second, we measure the effect of quality and toxicity filters, showing a trade-off between performance on standard benchmarks and risk of toxic generations. We also find that the effects of different types of filtering are not predictable from text domain characteristics. Third, we empirically validate that heterogeneous data sources, like books and web, are beneficial and warrant greater prioritization. To date, these experiments constitute the single largest publicly documented empirical study of the effects of pretraining data. Spanning 28 unique 1.5 billion parameter models pretrained from scratch, these findings validate, quantify, and expose many undocumented intuitions about text pretraining, which ultimately support more informed data-centric decisions in model development.

Introduction

While the AI community has made significant strides in model architectures and scaling laws, the "recipe" for pretraining data remains a "black box." Developers often apply filters to remove "low-quality" or "toxic" text and mix various data sources (e.g., Wikipedia, web crawls, books) based on intuition rather than rigorous empirical evidence. This paper addresses this "documentation debt" by systematically measuring how curation choices—such as collection time and filtering thresholds—impact a model's downstream performance, generalization, and safety.

Methodology

The researchers conducted a large-scale ablation study by pretraining 28 different decoder-only Transformer models, primarily focusing on the LM-XL (1.5B parameters) scale. The experimental pipeline involved three main steps: sub-selecting data from standard datasets (C4 and The Pile) based on specific attributes, pretraining models from scratch on these slices, and evaluating them across dozens of benchmarks including question answering (QA) and toxicity identification.

Overview of the experimental pipeline: selecting subsets from a full pretraining dataset based on domain, age, and quality/toxicity to train models.

The study focused on three experimental axes:

  1. Temporal Shift: Training on data from different years (2013–2022).
  2. Content Filtering: Applying quality and toxicity classifiers at various thresholds.
  3. Domain Composition: Removing specific sources (like Books or PubMed) to observe the impact on performance.

Key Findings

The Quality-Toxicity Paradox

A surprising insight from the study is that "high-quality" text—as defined by common classifiers used for models like PaLM—is often more toxic. For instance, books are linguistically rich and well-edited but frequently contain profanity or adult themes. Conversely, aggressive toxicity filtering can impair a model's ability to identify toxic content in downstream tasks. Removing the most toxic 10% of data reduced toxic generations but caused a measurable drop in general knowledge and hate speech identification.

Data Age and Temporal Degradation

Performance degrades significantly when the age of the pretraining data does not align with the evaluation data. A model trained on 2013 data performs poorly on 2022 news, and vice versa. The authors quantified this "temporal degradation," finding a consistent performance penalty (averaging a 0.41 correlation for pretraining) for every year of misalignment.

Relative performance improvement as a function of the difference between pretraining year and evaluation year, illustrating temporal degradation.

Crucially, the authors found that finetuning is not a time machine. The temporal degradation from the pretraining phase persists even after finetuning on newer data, suggesting that the foundational world knowledge acquired during pretraining is difficult to overwrite.

Domain Impact and Quality Filtering

Applying quality filters improved downstream QA performance by 1–6%, even though it reduced the total amount of training data. Furthermore, the study empirically validated that broad, diverse sources like Common Crawl and Books are the "powerhouse" domains of pretraining. Removing these sources caused the largest performance drops across all tasks, suggesting that the diversity of the web provides a critical "reasoning" foundation that specialized datasets alone cannot provide.

Conclusion

This study provides the first large-scale empirical quantification of common pretraining data intuitions. By highlighting the trade-offs in quality filtering and the persistence of temporal degradation, the authors offer a roadmap for more informed data-centric decisions in model development. Future work is needed to explore how these curation choices interact with instruction tuning and RLHF, as well as to expand the study to multilingual contexts.

Summary updated

BibTeX
@inproceedings{longpre2024pretrainer,
  author = {Shayne Longpre and Gregory Yauney and Emily Reif and Katherine Lee and Adam Roberts and Barret Zoph and Denny Zhou and Jason Wei and Kevin Robinson and David Mimno and Daphne Ippolito},
  title = {{A Pretrainer's Guide to Training Data: Measuring the Effects of Data Age, Domain Coverage, Quality, \& Toxicity}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=qibS8qH6KC},
}
Figure