Abstract
Large volumes of text data have contributed significantly to the development of large language models (LLMs) in recent years. This data is typically acquired by scraping the internet, leading to pretraining datasets comprised of noisy web text. To date, efforts to prune these datasets down to a higher quality subset have relied on hand-crafted heuristics encoded as rule-based filters. In this work, we take a wider view and explore scalable estimates of data quality that can be used to systematically measure the quality of pretraining data. We perform a rigorous comparison at scale of the simple data quality estimator of perplexity, as well as more sophisticated and computationally intensive estimates of the Error L2-Norm and memorization. These metrics are used to rank and prune pretraining corpora, and we subsequently compare LLMs trained on these pruned datasets. Surprisingly, we find that the simple technique of perplexity outperforms our more computationally expensive scoring methods. We improve over our no-pruning baseline while training on as little as 30% of the original training dataset. Our work sets the foundation for unexplored strategies in automatically curating high quality corpora and suggests the majority of pretraining data can be removed while retaining performance.
Introduction
The reigning belief in AI development has long been that more data inevitably leads to better performance. However, as Large Language Models (LLMs) scale, they increasingly rely on massive, uncurated scrapes of the internet, such as CommonCrawl. While these datasets provide the necessary scale for emergent abilities, they are notoriously noisy, containing gibberish, duplicate text, and toxic content.
Currently, practitioners rely on "hand-crafted heuristics"—basic rules like filtering out documents with excessive special characters or blocklisted websites. However, these rules do not measure the intrinsic quality of individual training examples. This research investigates systematic, scalable methods to rank and prune pretraining data, testing the hypothesis that a smaller, "cleaner" subset can achieve superior results compared to the full, noisy corpus.
Methodology
Researchers compared three automatic metrics to rank the "importance" or "quality" of data sequences:
- Perplexity: A measure of how "surprised" a reference language model is by a piece of text. Low perplexity indicates predictable/common text, while high perplexity suggests rare or noisy content.
- EL2N (Error L2-Norm): Adapted from computer vision, this measures the distance between a model’s predicted probability and the actual ground truth during the early stages of training.
- Memorization: A score based on how much of a sequence a model can reproduce verbatim when prompted with the first few tokens.
The study utilized a 7.6 billion token subset of the May 2022 CommonCrawl snapshot. Reference models (ranging from 124M to 52B parameters) generated scores for the data. Crucially, the team tested three selection strategies for each metric: keeping the Bottom (lowest scores), Middle, or Top (highest scores) of the distribution. Performance was evaluated using test set perplexity and the GLUE benchmark suite.
Key Insights and Results
The Simplicity Paradox
Surprisingly, the simplest metric—Perplexity—consistently outperformed the more computationally expensive EL2N and Memorization metrics. The researchers found a "Goldilocks" zone for perplexity: the best results often came from keeping the middle of the distribution. Keeping only the "easiest" data (lowest perplexity) proved disastrous for performance, likely because models require a certain level of challenge to learn effectively.
Efficiency and Scalability
The results demonstrate significant efficiency gains. A model trained on just 30% of the data (selected via perplexity) outperformed the baseline model trained on 100% of the unpruned data. Pruning to the middle 50% of the perplexity distribution led to a 0.97% improvement in test perplexity compared to the no-pruning baseline. These findings held true as models scaled to 1.5B parameters, where the pruned model achieved a 1.5% improvement over the full-data baseline.
Reference Quality and Early Signals
The quality of the reference model is paramount. A reference model trained on high-quality data (Wikipedia) produced significantly better pruning signals than one trained on noisy web data. Furthermore, the study found that you do not need a fully trained model to score data; a reference model only 55% through its training provided nearly identical pruning benefits to a finished one.
Conclusion
This work suggests that the era of blindly scaling data may be reaching its limit. By being selective about training data, researchers can build more capable AI with a fraction of the compute. While this study focused on static pruning, future research into dynamic pruning—where the dataset evolves during training—may offer even higher gains. Additionally, further investigation is needed to ensure that pruning does not inadvertently remove valuable "long-tail" or niche information. Ultimately, "quality over quantity" appears to be a winning strategy for the next generation of LLMs.
Summary updated