TL;DR
While model architectures have largely converged, the "recipe" for the multi-trillion token datasets that power them remains a closely guarded secret. This research from NVIDIA provides a systematic, end-to-end guide to pretraining data construction, revealing through extensive ablations how specific curation, selection, and sampling choices—such as prioritizing older web snapshots and using importance resampling—can significantly improve model performance.
The Openness Gap in LLM Development
In the world of Large Language Models (LLMs), data is the "secret sauce." While leading labs like OpenAI, Anthropic, and Google often disclose their model architectures, they remain silent on the specific methods used to filter, clean, and weight their training data. This lack of transparency creates a significant barrier for the broader research community.
To address this gap, researchers performed a systematic study of the entire pretraining data pipeline. They investigated how to transform raw, noisy web crawls into a high-quality 2-trillion-token corpus across English, multilingual text, and source code, quantifying which techniques lead to the best downstream accuracy.
The Three-Stage Pipeline
The researchers break down the construction process into three distinct stages:
- Data Curation: This stage involves removing "ill-formed" text and performing deduplication. The team used 128-bit hashing for exact deduplication and KenLM perplexity scores (trained on high-quality sources) for quality filtering.
- Data Selection: The study specifically ablated Domain Selection via Importance Resampling (DSIR). This technique uses a small, high-quality "target" dataset (like Wikipedia) to select documents from a massive "raw" pool (like Common Crawl) that share similar n-gram distributions.
- Data Sampling: This determines the "data mix"—how often the model sees each source. They compared heuristic methods like Alpha Sampling, learned methods like DoReMi, and UniMax, which caps the number of epochs any single data source can contribute to prevent overfitting on small, high-quality subsets.
Additionally, they trained DeBERTaV3 classifiers to label over 90 Common Crawl snapshots with attributes like quality, toxicity, domain, and "type of speech" (e.g., news vs. blog vs. forum).
Datasets and Evaluation
The study utilizes a massive 2-trillion-token pool comprising:
- English: A mix of Web Crawl (Common Crawl, C4), News, Conversational (Reddit), Books, and Scientific papers (arXiv, PubMed).
- Multilingual: 52 languages curated from Common Crawl and parallel corpora.
- Source Code: The Stack v1.2, covering 41 programming languages.
Performance was measured across a battery of standard benchmarks including MMLU, ARC, HellaSwag, PIQA, and HumanEval.
Strategic Insights
- The "Old is Gold" Deduplication Rule: Surprisingly, when deduplicating, prioritizing older documents over newer ones led to better model performance. This suggests that older web data might be less "polluted" by AI-generated content or have higher information density.
- Toxicity Filtering is Risky: Naive toxicity filters often accidentally remove high-quality content. For example, news articles about "sensitive subjects" (war, protests) are often flagged as toxic but are actually high-quality, well-written text. The authors found that a "low toxicity, high quality" target set for DSIR is a more effective approach.
- UniMax Wins for Text, Alpha for Code: For English and multilingual data, UniMax (which balances diversity and quality by limiting repetitions) performed best. However, for source code, simple Alpha sampling (weighting by the size of the language) was superior, likely because there is less "transfer" between programming languages than human languages.
- Attributes as "Buckets": Instead of just sampling by "source" (e.g., "all of Common Crawl"), the authors showed that sampling by attribute (e.g., "high-quality news from Common Crawl") significantly improves results. As shown in the quality distribution analysis, different domains have vastly different quality profiles, making fine-grained selection essential.
Key Results
- Curation Gains: Moving from raw text to a curated/filtered set improved average LM-Eval scores from 57.18 to 59.50.
- Selection Impact: Using DSIR to select the best 95% of web crawl data improved scores from 54.30 to 54.71 compared to a naive baseline.
- Sampling Superiority: On an 8B model, UniMax sampling achieved an MMLU of 28.30, significantly outperforming the learned DoReMi method (26.90) and hand-tuned preference weighting (27.20).
- Fine-Grained Success: Using quality-based "fine-grained" sampling buckets improved the baseline score from 56.81 to 57.88.
Limitations and Future Work
While these findings provide a robust roadmap, most ablations were performed on 2B and 8B parameter models; dynamics might shift at the 70B+ scale. Furthermore, the study focuses on "natural" data, leaving the increasingly important role of synthetic data for future research. Finally, while the current pipeline is linear, future work could explore iterative processes where model training progress informs data selection in real-time.
Summary updated