The Pile · dataset

On this page 7

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.

ComponentContent typeRaw sizeEffective share
Pile-CCFiltered web pages from Common Crawlabout 227 GiBabout 18%
PubMed CentralFull-text biomedical articlesabout 90 GiBabout 14%
Books3Books from a shadow libraryabout 101 GiBabout 12%
OpenWebText2Web pages linked from Redditabout 63 GiBabout 10%
ArXivPreprints in LaTeX-derived textabout 56 GiBabout 9%
GitHubSource code repositoriesabout 95 GiBabout 8%
FreeLawUnited States court opinionsabout 51 GiBabout 6%
Stack ExchangeTechnical questions and answersabout 32 GiBabout 5%
Largest components of The Pile

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.

CorpusMain sourceApproximate scaleKey difference
C4Filtered Common Crawlabout 750 GBWeb only, heuristic filters
The Pile22 mixed sources825 GiBDomain mix with weighting
RedPajamaWeb, code, books, papersover 1 trillion tokensReplicates a published recipe
DolmaWeb, code, papers, booksabout 3 trillion tokensDocumented open toolkit
FineWebCommon Crawlabout 15 trillion tokensLarge-scale quality filtering
The Pile and related open text corpora

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.

UseWhat is measured or producedPractical value
PretrainingBase language model weightsBroad general and technical knowledge
Language modeling benchmarkBits per byte on the test splitComparison across tokenizers
Interpretability researchMemorization and training dynamicsReproducible data order in Pythia
Data ablationsEffect of removing or reweighting subsetsEvidence for mixture design
Typical uses of The Pile

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.
RiskCauseMitigation
Copyright claimsBooks3 and other unlicensed textUse the version without Books3
Test contaminationOverlap with evaluation setsRun n-gram overlap checks
Privacy leakageEmails and personal postsApply PII filtering
Duplicate textPartial deduplication onlyUse the deduplicated variant
Risks and mitigations when reusing The Pile

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.