The Pile is an 825 GiB English-language text dataset assembled by the research collective EleutherAI and released at the end of 2020 as an open pretraining corpus for large language models. In the field of training data for artificial intelligence, it is known for combining 22 diverse, high-quality subsets, from academic papers and source code to legal opinions and books, instead of relying on filtered web crawl alone.
The dataset became a reference corpus for open models such as GPT-Neo, GPT-J, GPT-NeoX-20B and the Pythia suite, and its held-out split served for years as a standard perplexity benchmark. It also became a central case in the debate on training data licensing, because one of its subsets contained copyrighted books.
How The Pile was assembled
The Pile was built on the premise that data diversity improves general knowledge and downstream generalization. Its authors argued that web text, even when well filtered, underrepresents specialized registers such as scientific prose, mathematics, programming and formal legal language. They therefore combined a cleaned Common Crawl extract with many domain-specific collections.
The web component, called Pile-CC, was extracted from raw Common Crawl WARC files with the jusText boilerplate remover, which yields cleaner text than the preextracted WET files used by many earlier corpora. Other subsets were downloaded from public archives, converted to plain text and lightly cleaned. Several components, including OpenWebText2, received near-duplicate removal, but the corpus as a whole was not globally deduplicated.
A distinctive design choice is per-component weighting. Instead of sampling each subset once, the authors assigned epoch counts, so that sources judged to be of higher quality, such as Wikipedia, appear up to three times in one pass over the training mix, while large but noisier sources appear once.
Composition of The Pile
The largest components account for roughly 80 percent of the effective training mix. The following table lists the main subsets with their approximate raw size and their effective share after weighting.
| Component | Content type | Raw size | Effective share |
|---|---|---|---|
| Pile-CC | Filtered web pages from Common Crawl | about 227 GiB | about 18% |
| PubMed Central | Full-text biomedical articles | about 90 GiB | about 14% |
| Books3 | Books from a shadow library | about 101 GiB | about 12% |
| OpenWebText2 | Web pages linked from Reddit | about 63 GiB | about 10% |
| ArXiv | Preprints in LaTeX-derived text | about 56 GiB | about 9% |
| GitHub | Source code repositories | about 95 GiB | about 8% |
| FreeLaw | United States court opinions | about 51 GiB | about 6% |
| Stack Exchange | Technical questions and answers | about 32 GiB | about 5% |
The remaining smaller subsets include USPTO patent backgrounds, PubMed abstracts, Project Gutenberg books, OpenSubtitles, English Wikipedia, DeepMind Mathematics, Ubuntu IRC logs, BookCorpus2, EuroParl, Hacker News, YouTube subtitles, PhilPapers, NIH grant abstracts and the Enron emails. Together they add breadth of register rather than volume.
The Pile compared with other pretraining corpora
The Pile sits between early web-only corpora and the much larger curated web datasets that followed. Its strength is source diversity at moderate scale; its weakness is size by current standards, since modern models train on several trillion tokens.
| Corpus | Main source | Approximate scale | Key difference |
|---|---|---|---|
| C4 | Filtered Common Crawl | about 750 GB | Web only, heuristic filters |
| The Pile | 22 mixed sources | 825 GiB | Domain mix with weighting |
| RedPajama | Web, code, books, papers | over 1 trillion tokens | Replicates a published recipe |
| Dolma | Web, code, papers, books | about 3 trillion tokens | Documented open toolkit |
| FineWeb | Common Crawl | about 15 trillion tokens | Large-scale quality filtering |
Tokenized with the GPT-2 style vocabulary, one pass over the weighted mix corresponds to roughly 300 billion tokens. This figure explains why many models of the 2021 to 2023 period trained for about one epoch of The Pile.
Use in model training and evaluation
The Pile served two roles: a training corpus and an evaluation benchmark. As a training corpus, it underpinned GPT-Neo, GPT-J-6B and GPT-NeoX-20B, and subsets were included in the training mixtures of other large models. The Pythia suite trained models of many sizes on the same data in the same order, which made The Pile a controlled environment for studying memorization and learning dynamics.
As a benchmark, its test split is reported in bits per byte, a tokenizer-independent measure of how well a model predicts text. The table below summarizes the typical uses.
| Use | What is measured or produced | Practical value |
|---|---|---|
| Pretraining | Base language model weights | Broad general and technical knowledge |
| Language modeling benchmark | Bits per byte on the test split | Comparison across tokenizers |
| Interpretability research | Memorization and training dynamics | Reproducible data order in Pythia |
| Data ablations | Effect of removing or reweighting subsets | Evidence for mixture design |
Licensing, risks and known limitations
The most serious issue is copyright exposure. The Books3 subset contained about 197,000 books taken from a shadow library, and in 2023 it was removed from public hosting after a takedown request from rights holders. Several lawsuits against model developers later cited Books3, so organizations that retain the original release face legal and reputational risk.
Other limitations follow from the construction method and require careful auditing before reuse:
- English-only coverage, which limits multilingual capability.
- Incomplete deduplication, which raises memorization risk and benchmark contamination.
- Personal data, for example in the Enron emails and forum posts.
- Documented biases in gender, religion and ethnicity, analyzed in the original datasheet.
- Outdated content, since most sources were collected before 2021.
| Risk | Cause | Mitigation |
|---|---|---|
| Copyright claims | Books3 and other unlicensed text | Use the version without Books3 |
| Test contamination | Overlap with evaluation sets | Run n-gram overlap checks |
| Privacy leakage | Emails and personal posts | Apply PII filtering |
| Duplicate text | Partial deduplication only | Use the deduplicated variant |
In 2025 EleutherAI and partners released the Common Pile, a successor built only from openly licensed and public domain text, which addresses the licensing problem directly.
Stripped to the essentials
The Pile is a huge collection of text used to teach language models. It mixes web pages, science papers, code, court rulings and books. The idea is simple. A model that reads many kinds of writing learns more than one that reads only websites.
It worked well and helped many open models get started. It also had a flaw. Some books were copied without permission, so that part was later removed. Today it is mostly a well-known reference point and a lesson in careful data sourcing.
Where it is applied
A university research group wants to study how a language model memorizes rare facts during training. Training a large model from scratch is too expensive, so the group uses a Pythia checkpoint trained on The Pile. Because the data order is fixed and public, the researchers can locate the exact training step at which a given passage was seen.
They select 5,000 sentences from the PubMed Central subset, test each saved checkpoint, and measure when the model starts to complete each sentence verbatim. The result is a clear curve that links repetition count to memorization. The group excludes Books3 from all analyses and reports the bits per byte on the test split to compare checkpoints, which keeps the study reproducible and legally clean.