ExplainerData services

What data is used to train language models

What data is used to train LLMs, stage by stage: filtered web crawls, code, papers and books, then demonstrations, preference pairs, synthetic and checkable tasks, and what must be disclosed.

Cover of the full report: What data is used to train language models
The research behind this article, with every source listed. 21 pages.

Key points

From the Summary of the full report

  1. Pretraining uses trillions of tokens, the units a tokenizer splits text into, mostly from filtered web text. Llama 3, one open-weight model family, pretrained on about 15 trillion multilingual tokens [1], and the OLMo 2 pretraining mix of about 3.9 trillion tokens took over 95% from web data [2].
  2. The open web corpora C4, RefinedWeb, FineWeb, DCLM and RedPajama-V2 are all built from Common Crawl, a free, open repository of web crawl data [5, 9, 11, 12, 15, 17]. Its October 2026 crawl held 2.16 billion pages [7].
  3. Curation keeps a fraction of the raw text. After heuristic filters and deduplication, a classifier kept the top 10% of DCLM's remaining documents, the 3.8 trillion token DCLM-Baseline [15], and Dolma was curated from about 200 TB of raw text down to 11 TB [19].
  4. Curated sources add code, scientific papers, books, encyclopedias, forums and math. The Pile combined 22 subsets [18], and the final Llama 3 mix was roughly 50% general knowledge, 25% math and reasoning, 17% code and 8% multilingual tokens [1].

What data is used to train LLMs depends on the stage of training. A language model first reads trillions of tokens of filtered web pages, code, scientific papers, books and encyclopedias. Much smaller sets of written demonstrations, ranked answers and tasks with checkable answers then shape how it responds. Commercial models "rarely detail their data", as the Dolma authors put it [19], so the figures here come from open reports and dataset cards.

What data is used to train LLMs, stage by stage

Stage What the data is One published example
Pretraining Filtered web text plus code, papers, books, encyclopedias and math OLMo 2: about 3.9 trillion tokens, over 95% from web data [2]
Mid-training or annealing Up-sampled high-quality documents, curated sources, synthetic math OLMo 2: mixes of 50, 100 and 300 billion tokens [2]
Supervised fine-tuning Prompts paired with written demonstrations About 13,000 training prompts in a 2022 study [3]
Preference tuning Rankings or pairs of model outputs 33,000 reward model prompts in the same study [3]
Reinforcement learning with verifiable rewards Tasks whose answers a program can check Math and precise instruction following in Tulu 3 [4]

Llama 3, one open-weight model family, follows the same arc in its 2024 report. It pretrained on about 15 trillion multilingual tokens, then annealed on small amounts of high-quality code and math [1]. In a test that added the GSM8k and MATH training sets to annealing, an 8B model's scores on those validation sets rose by 24.0% and 6.4%, while the 405B model's gains were negligible [1]. Post-training ran six rounds of supervised fine-tuning and Direct Preference Optimization, on examples from human annotation or generated synthetically [1].

Web text from Common Crawl, filtered

The open web corpora C4, RefinedWeb, FineWeb, DCLM and RedPajama-V2 are all built from Common Crawl [9, 11, 12, 15, 17], a free, open repository of web crawl data whose home page counts "Over 300 billion pages spanning 15 years" [5]. Its October 2026 crawl holds 2.16 billion pages, or 371.19 TiB of uncompressed content, including 830.1 million URLs not visited before [7].

Raw crawl text needs heavy cleaning. The C4 authors wrote that "the majority of the resulting text is not natural language" [9]. Their rules, applied to an April 2019 snapshot, kept only lines ending in terminal punctuation, dropped pages with fewer than three sentences or with listed bad words, kept one copy of any repeated three-sentence span and required an English probability of at least 0.99 [9]. About 750 GB remained [9].

FineWeb re-extracted text from Common Crawl's raw WARC files, because the text-only WET files kept too much boilerplate [12]. It removed near-duplicates with MinHash within each snapshot, which improved the average score where deduplicating all snapshots together gave only a modest gain [12]. The paper reports 15 trillion tokens from 96 snapshots [12], and the dataset card lists more than 18.5 trillion since version 1.4.0 of 11 July 2025 [13].

Model-based classifiers decide what stays in several recent corpora. For FineWeb-Edu, an instruction model of the Llama 3 family rated 460,000 pages for educational quality on a scale of 0 to 5, and a classifier trained on those ratings kept 1.3 trillion tokens [12]. DCLM applied heuristic filters and deduplication to a 240 trillion token pool, then kept the top 10% of the remaining documents by a fastText classifier's score, which produced the 3.8 trillion token DCLM-Baseline [15]. RedPajama-V2 ships raw text with quality signals for each document, so its users choose the filter [16].

Code, papers, books and other curated sources

The Pile combined 22 subsets into 825 GiB of English text [18]. By share of bytes, its components included Common Crawl web pages at 18.11%, PubMed Central papers at 14.40%, books at 12.07%, arXiv papers at 8.96% and GitHub code at 7.59%, and English Wikipedia was seen three times per pass [18]. Dolma's three trillion tokens include 2,479 billion Llama tokens of web pages, 411 billion of GitHub code, 89 billion of Reddit, 70 billion of academic papers, 6.0 billion of Project Gutenberg books and 4.3 billion of Wikipedia and Wikibooks [19].

Specialist sets fill single domains. The Stack v2 draws on the Software Heritage archive across 619 programming languages [20]. OpenWebMath, a math corpus, filtered more than 200 billion HTML files down to 6.3 million documents and 14.7 billion tokens [21]. Llama 3's final mix was roughly 50% general knowledge, 25% math and reasoning, 17% code and 8% multilingual tokens [1].

LLM training data size

A 2022 scaling study found that model size and training tokens should grow in equal proportion for compute-optimal training, and trained a 70B model on 1.4 trillion tokens [22]. Llama 3 used about 15 trillion tokens, against 1.8 trillion for Llama 2 [1]. Up to four epochs of repeated data changed loss negligibly compared with unique data, and with more repetition the value of added compute eventually decayed to zero [23].

A study revised in June 2024 put the stock of Common Crawl text at about 130 trillion tokens, as a median [24]. It projected that, if trends continued, models would be trained on datasets roughly equal in size to the stock of public human text between 2026 and 2032 [24]. Counts do not compare exactly across sources: Dolma uses the Llama tokenizer [19] and DCLM the GPT-NeoX tokenizer [15].

Post-training data: demonstrations, preferences and checkable tasks

The 2022 instruction-following study collected labeler demonstrations for fine-tuning and rankings of model outputs for reinforcement learning, and its tuned 1.3B model's outputs were preferred to those of the 175B base model [3]. Tulu 3's supervised mixture holds 939,344 samples, and its card says different licenses apply to subsets, some of them non-commercial [25]. UltraFeedback has 64,000 prompts, 256,000 responses and 380,000 pieces of feedback written by a model acting as the annotator, and its card warns that this annotator also makes mistakes [26]. Reinforcement learning with verifiable rewards gives a reward only when a completion is verified to be correct [4].

Synthetic data and its limits

Self-Instruct generated instructions, inputs and outputs from a language model, filtered out invalid or similar ones and reported a 33% absolute improvement on Super-NaturalInstructions [27]. Cosmopedia holds 25 billion tokens of synthetic textbooks, blog posts, stories and how-to articles, about 75% of them prompted from web samples [28]. Tulu 3 conditioned synthetic prompts on about 250,000 personas [4].

A 2024 Nature study found that indiscriminate use of model-generated content in training made the tails of the original distribution disappear, an effect it named model collapse [29]. Keeping a random 10% of the original data in each generation led to only minor degradation [29]. The study covers recursive training on generated data in controlled settings.

An audit of more than 1,800 text datasets found license omission rates above 70% and error rates above 50% on widely used hosting sites [31]. A 2024 audit of 14,000 web domains found that restrictions added between 2023 and 2024 left about 5% or more of C4's tokens fully restricted from use [32]. The Stack v2 removed 22,066 files from 1,561 repositories after developers opted out [20].

Two corpora use only open text: the Common Pile v0.1, eight terabytes of public-domain and openly licensed text [33], and Common Corpus, about two trillion tokens that are uncopyrighted or under open licenses [34]. What a license permits for model training is the subject of what a training data license grants, and collecting training data covers source terms, opt-out signals and capture records.

What developers must disclose

The EU AI Act requires providers of general-purpose AI models to publish a summary of the content used for training, on a template from the AI Office [35]. The template of 24 July 2025 sorts sources into publicly available datasets, private datasets from third parties, data crawled and scraped from online sources, user data, synthetic data and other sources [36]. Text size is given as a range: less than 1 billion tokens, 1 billion to 10 trillion, or more than 10 trillion [36]. The obligation applies from 2 August 2025, and models placed on the market before that date have until 2 August 2027 [36].

Duplicates and benchmark contamination

One 61-word sentence appeared more than 60,000 times in C4, and models trained on deduplicated data emitted memorized text ten times less often [30]. A 2021 audit of C4 found inputs from GLUE test sets in the corpus at rates from under 2% to over 50%, depending on the dataset and input field, with both extremes in QNLI [10]. Tulu 3 removed training sets that overlapped its held-out evaluations, found by 8-gram matching [4]. Audits of agent benchmarks report contamination flaws too, as what agent benchmarks measure describes. When corpora are combined, the same document or company can arrive from several sources, and entity resolution decides which records describe the same entity.

Data that no published corpus covers raises the same questions of source type, rights and disclosure. Rillor's data services collect, license, label and clean source data into training and evaluation data for models and agents, and every record keeps its source, its rights and its history.

Read the full report

The full report adds each web corpus's filtering rules, the published mixes in tables, the post-training and synthetic sets, the EU template's source types in full and all 36 sources.

The full report

What data is used to train language models

The research behind this article, with every source listed. 21 pages.

  1. Summary
  2. Background
  3. Method
  4. Findings
  5. Implications
  6. Limits of this analysis
  7. Sources

Sources

  1. The Llama 3 Herd of Models. Aaron Grattafiori, Abhimanyu Dubey and others, arXiv:2407.21783, version 3, 23 November 2024, viewed 8 November 2026. https://arxiv.org/abs/2407.21783
  2. 2 OLMo 2 Furious. Team OLMo, Pete Walsh, Luca Soldaini and others, COLM 2025, arXiv:2501.00656, version 3, 8 October 2025, viewed 8 November 2026. https://arxiv.org/abs/2501.00656
  3. Training language models to follow instructions with human feedback. Long Ouyang, Jeff Wu, Xu Jiang and others, arXiv:2203.02155, 4 March 2022, viewed 8 November 2026. https://arxiv.org/abs/2203.02155
  4. Tulu 3: Pushing Frontiers in Open Language Model Post-Training. Nathan Lambert, Jacob Morrison, Valentina Pyatkin and others, arXiv:2411.15124, version 5, 14 April 2025, viewed 8 November 2026. https://arxiv.org/abs/2411.15124
  5. Common Crawl. Common Crawl Foundation, home page, undated, viewed 8 November 2026. https://commoncrawl.org/
  6. October 2026 Crawl Archive Now Available. Hande Çelikkanat, Common Crawl Foundation, 21 October 2026, viewed 8 November 2026. https://commoncrawl.org/blog/october-2026-crawl-archive-now-available
  7. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. Colin Raffel, Noam Shazeer, Adam Roberts and others, Journal of Machine Learning Research 21 (2020), arXiv:1910.10683, version 4, 19 September 2023, viewed 8 November 2026. https://arxiv.org/abs/1910.10683
  8. Documenting Large Webtext Corpora: A Case Study on the Colossal Clean Crawled Corpus. Jesse Dodge, Maarten Sap, Ana Marasović and others, EMNLP 2021, arXiv:2104.08758, version 2, 30 September 2021, viewed 8 November 2026. https://arxiv.org/abs/2104.08758
  9. The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Only. Guilherme Penedo, Quentin Malartic, Daniel Hesslow and others, arXiv:2306.01116, 1 June 2023, viewed 8 November 2026. https://arxiv.org/abs/2306.01116
  10. The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale. Guilherme Penedo, Hynek Kydlíček, Loubna Ben Allal and others, NeurIPS 2024 Datasets and Benchmarks Track, arXiv:2406.17557, version 2, 31 October 2024, viewed 8 November 2026. https://arxiv.org/abs/2406.17557
  11. FineWeb dataset card. Hugging Face, last modified 11 July 2025, viewed 8 November 2026. https://huggingface.co/datasets/HuggingFaceFW/fineweb
  12. DataComp-LM: In search of the next generation of training sets for language models. Jeffrey Li, Alex Fang, Georgios Smyrnis and others, arXiv:2406.11794, version 4, 21 April 2025, viewed 8 November 2026. https://arxiv.org/abs/2406.11794
  13. RedPajama: an Open Dataset for Training Large Language Models. Maurice Weber, Daniel Fu, Quentin Anthony and others, NeurIPS 2024 Datasets and Benchmarks Track, arXiv:2411.12372, 19 November 2024, viewed 8 November 2026. https://arxiv.org/abs/2411.12372
  14. RedPajama-Data-V2 dataset card. Hugging Face, last modified 21 November 2024, viewed 8 November 2026. https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2
  15. The Pile: An 800GB Dataset of Diverse Text for Language Modeling. Leo Gao, Stella Biderman, Sid Black and others, arXiv:2101.00027, 31 December 2020, viewed 8 November 2026. https://arxiv.org/abs/2101.00027
  16. Dolma: an Open Corpus of Three Trillion Tokens for Language Model Pretraining Research. Luca Soldaini, Rodney Kinney, Akshita Bhagia and others, ACL 2024, arXiv:2402.00159, version 2, 6 June 2024, viewed 8 November 2026. https://arxiv.org/abs/2402.00159
  17. StarCoder 2 and The Stack v2: The Next Generation. Anton Lozhkov, Raymond Li, Loubna Ben Allal and others, arXiv:2402.19173, 29 February 2024, viewed 8 November 2026. https://arxiv.org/abs/2402.19173
  18. OpenWebMath dataset card. Hugging Face, last modified 17 October 2023, viewed 8 November 2026. https://huggingface.co/datasets/open-web-math/open-web-math
  19. Training Compute-Optimal Large Language Models. Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch and others, arXiv:2203.15556, 29 March 2022, viewed 8 November 2026. https://arxiv.org/abs/2203.15556
  20. Scaling Data-Constrained Language Models. Niklas Muennighoff, Alexander M. Rush, Boaz Barak and others, arXiv:2305.16264, version 5, 28 June 2025, viewed 8 November 2026. https://arxiv.org/abs/2305.16264
  21. Will we run out of data? Limits of LLM scaling based on human-generated data. Pablo Villalobos, Anson Ho, Jaime Sevilla, Tamay Besiroglu, Lennart Heim and Marius Hobbhahn, arXiv:2211.04325, version 2, 4 June 2024, viewed 8 November 2026. https://arxiv.org/abs/2211.04325
  22. Tulu 3 SFT mixture dataset card. Hugging Face, last modified 2 December 2024, viewed 8 November 2026. https://huggingface.co/datasets/allenai/tulu-3-sft-mixture
  23. UltraFeedback dataset card. Hugging Face, last modified 29 December 2023, viewed 8 November 2026. https://huggingface.co/datasets/openbmb/UltraFeedback
  24. Self-Instruct: Aligning Language Models with Self-Generated Instructions. Yizhong Wang, Yeganeh Kordi, Swaroop Mishra and others, ACL 2023, arXiv:2212.10560, version 2, 25 May 2023, viewed 8 November 2026. https://arxiv.org/abs/2212.10560
  25. Cosmopedia dataset card. Hugging Face, last modified 12 August 2024, viewed 8 November 2026. https://huggingface.co/datasets/HuggingFaceTB/cosmopedia
  26. AI models collapse when trained on recursively generated data. Ilia Shumailov, Zakhar Shumaylov, Yiren Zhao, Nicolas Papernot and others, Nature 631, 755, 24 July 2024, viewed 8 November 2026. https://www.nature.com/articles/s41586-024-07566-y
  27. Deduplicating Training Data Makes Language Models Better. Katherine Lee, Daphne Ippolito, Andrew Nystrom and others, ACL 2022, arXiv:2107.06499, version 2, 24 March 2022, viewed 8 November 2026. https://arxiv.org/abs/2107.06499
  28. The Data Provenance Initiative: A Large Scale Audit of Dataset Licensing & Attribution in AI. Shayne Longpre, Robert Mahari, Anthony Chen and others, arXiv:2310.16787, version 3, 4 November 2023, viewed 8 November 2026. https://arxiv.org/abs/2310.16787
  29. Consent in Crisis: The Rapid Decline of the AI Data Commons. Shayne Longpre, Robert Mahari, Ariel Lee and others, arXiv:2407.14933, version 2, 24 July 2024, viewed 8 November 2026. https://arxiv.org/abs/2407.14933
  30. The Common Pile v0.1: An 8TB Dataset of Public Domain and Openly Licensed Text. Nikhil Kandpal, Brian Lester, Colin Raffel and others, arXiv:2506.05209, 5 June 2025, viewed 8 November 2026. https://arxiv.org/abs/2506.05209
  31. Common Corpus: The Largest Collection of Ethical Data for LLM Pre-Training. Pierre-Carl Langlais, Pavel Chizhov, Catherine Arnett and others, ICLR 2026, arXiv:2506.01732, version 4, 5 October 2026, viewed 8 November 2026. https://arxiv.org/abs/2506.01732
  32. Regulation (EU) 2024/1689 laying down harmonised rules on artificial intelligence (Artificial Intelligence Act), Article 53 and recital 107. Official Journal of the European Union, OJ L, 12 July 2024 (regulation of 13 June 2024), via EUR-Lex, viewed 8 November 2026. https://eur-lex.europa.eu/eli/reg/2024/1689/oj/eng
  33. Explanatory Notice and Template for the Public Summary of Training Content for general-purpose AI models. European Commission, AI Office, published 24 July 2025, English notice C(2025) 8311 final of 5 December 2025, page last updated 26 March 2026, viewed 8 November 2026. https://digital-strategy.ec.europa.eu/en/library/explanatory-notice-and-template-public-summary-training-content-general-purpose-ai-models

Tell us what your data must cover.

Send the question the data should answer, the sources you know of, the coverage you need and how often it should update.

Outline a dataset