# The Pile: An 800GB Dataset of Diverse Text for Language Modeling

The Pile combines 22 diverse English sources into one training corpus

Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster and 6 more · arXiv · 2020-12-31

- **Problem** Most large language models train mostly on Common Crawl, whose text quality varies widely and whose domain coverage is narrow. Earlier work suggested that more diverse training data generalizes better, but no such corpus existed at this scale.
- **Method** The Pile mixes 22 curated sources and repeats higher-quality ones more often.
- **Results** Models trained on the Pile score 0.9433 BPB on its held-out test split, compared to 1.3293 for CC-100 (en). They also improve over both CC-100 (en) and Raw CC on every component of the Pile.

## Why Common Crawl alone falls short

Most large language models of this period draw most or all of their data from Common Crawl. Common Crawl spans many domains, but its quality varies widely, so it needs careful extraction and filtering before training. Earlier work found that a more diverse training set generalizes better, and that models can learn a new domain from fairly small amounts of text.

That points to a different route: many smaller, higher-quality, diverse sources instead of a handful of broad web scrapes.

The authors turn this into a concrete target, a single English corpus of 825.18 GiB built from 22 sub-datasets. They intend the corpus both for training large models and as a broad benchmark of cross-domain generalization. The open question is whether this mix actually helps, and the authors test it with models trained on the Pile.

## How the Pile is assembled

The key idea is to mix 22 sources that differ in domain and style, and to repeat the higher-quality ones more often. The new sources include PubMed Central, ArXiv, GitHub and a filtered Common Crawl subset called Pile-CC, while Books3, Project Gutenberg and English Wikipedia are existing corpora. Following Brown et al. (2020), higher-quality components get larger weights, so Wikipedia is seen up to 3 times in a full epoch.

Table 1 lists, for each component, its raw size, its weight in the final bytes, its number of epochs and its effective size. The weight and the epoch count measure different things: weight is a share of final bytes, while epochs count how many passes a component gets in one full epoch over the Pile. Pile-CC, for example, has 18.11% weight at 1.0 epoch, while Wikipedia (en) has 1.53% weight at 3.0 epochs.

For Pile-CC the authors used jusText on Web Archive files, which are the raw HTTP responses with page HTML, rather than the plain-text WET files. They judged that extraction from the raw responses gives higher quality output than the WET extracts. This choice matters because the quality of Common Crawl text depends on the extraction step.

## How GPT-2 and GPT-3 score on the Pile

The authors measure test perplexity of GPT-2 and GPT-3 on each Pile component and report it as bits per UTF-8 encoded byte. Each document is scored on its own rather than concatenated with others, and most components use one-tenth of the test set because of the cost of the OpenAI API. All models are used zero-shot, so none of them was fine-tuned on Pile data.

The Pile row falls from 1.2253 BPB for GPT-2 small to 1.0468 for GPT-2 xl, and from 0.9631 for GPT-3 ada to 0.7177 for GPT-3 davinci. The fitted line over the GPT-3 family has a coefficient of -0.1674 and an intercept of 2.5516. The authors read this as a scaling law without visible diminishing returns, and they attribute it to general generalization ability, which they leave for future study.

GPT-2 and GPT-3 were never trained on the Pile, so these scores test how well general models transfer to its domains. The authors assume that ada, babbage, curie and davinci correspond to 2.7B, 6.7B, 13B and 175B parameters, because OpenAI never published those sizes.

## Where GPT-3 falls short relative to OpenWebText2

Raw perplexity can't rank components against each other, because the entropy of each dataset differs. The ideal test would train GPT-3 on the Pile, but because of resource limits the authors used a GPT2-Pile model trained from scratch on the Pile as a stand-in. The measure is the change from GPT2-Pile to GPT-3 on each component, minus the same change on OpenWebText2, written as \\\[ \\Delta\_{set} = (L^{GPT3}\_{set} - L^{GPT3}\_{owt2}) - (L^{GPT2Pile}\_{set} - L^{GPT2Pile}\_{owt2}) \\\] The second term is meant to capture the difference in intrinsic difficulty, because GPT2-Pile was trained on both OpenWebText2 and the evaluated dataset.

Books3, Wikipedia (en), Pile-CC and Project Gutenberg score close to zero, which fits text that GPT-3 already resembles. GPT-3 looks weakest on PubMed Central, PubMed Abstracts and ArXiv, and on GitHub and DM Mathematics. The authors expect a GPT-3 sized model trained on the Pile to perform better on research, software and symbol manipulation tasks.

The authors caution that the metric is only a proxy for similarity and could be confounded by dataset-specific scaling effects. Some results are puzzling, such as components where GPT-3 scored better than GPT2-Pile, which the authors put down to GPT-3 already mastering them.

## Pile-trained models against CC-100 and Raw CC

The authors train architecturally identical 1.3 billion parameter models on each corpus, and score them on WikiText, LAMBADA and the Pile test split. Each corpus is downsampled to about 40GB, and evaluation sets are decontaminated with the same 13-gram overlap filtering used by Brown et al. (2020). Matching size this way favors CC-100 (en), which is about one third the size of the Pile in reality.

On the held-out Pile test split the Pile model scored 0.9433 BPB, compared to 1.3293 for CC-100 (en) and 1.1275 for Raw CC. The authors read this as evidence of better cross-domain generalization without losing performance on the traditional benchmarks. On WikiText the Pile model reached perplexity 5.59, compared to 8.27 for CC-100 (en) and 11.75 for Raw CC.

On LAMBADA it sits close to CC-100 (en), with 12.78 perplexity against 11.78 and accuracy 50.1 against 49.7.

Table 4 breaks this down by component, and the Pile model scores lower BPB than both alternatives on every component. For ArXiv it scored 0.7945 BPB, compared to 1.8159 for CC-100 and 1.2642 for Raw CC. For Pile-CC the gap is small, 0.9989 against 1.0873 for CC-100 (en), which fits the expectation that a Common Crawl component gains little.

Raw CC scores lower BPB than CC-100 on the Pile test set, even though it trails on LAMBADA and WikiText. The authors hypothesize that the perplexity filter used for CC-100 explains this. That filter trains a Wikipedia model and discards data that is too similar to or too different from it, which the authors argue limits diversity. They conclude that future Common Crawl work should filter with care to keep diversity.

## Consent and content concerns

The authors document the Pile with the datasheets methodology and the data statements methodology. They sort availability into three tiers: public data, ToS compliant data and data with authorial consent. They adopt a strict consent model, so ambiguous or unknown consent counts as non-consensual.

Apart from YouTube Subtitles, these datasets were published by researchers and circulate freely on the internet. The authors built the YouTube Subtitles dataset themselves with a popular unofficial API, and they argue that their processing adds little harm beyond what widespread publication already caused.

In the gender co-occurrence analysis, words such as military and criminal lean toward men, while little and married lean toward women. The authors read these as patterns of online discourse rather than settled bias.

## Limitations

The validation and test splits each hold 0.1% of the data, and some documents may still appear in more than one split. GPT-3 was scored on one-tenth of the test sets for most components, so those numbers rest on smaller samples. The GPT-3 proxy is a similarity measure rather than a direct training result, and the authors note it could be confounded by scaling effects.

The 97.4% English share is a rough fasttext estimate, and no reliable conclusion can be drawn for low-resource languages. Copyright status can only be judged per component, because the authors lack per-text metadata, so the exclusion code is a heuristic.

## Paper info

- **Authors**: Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, Connor Leahy
- **Venue**: arXiv · Preprint
- **First published**: 2020-12-31
- **Added**: 2026-11-12
- **Updated**: 2020-12-31
- **Version**: v1
- **arXiv**: 2101.00027
- **Category**: cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2101.00027v1) · [PDF ↗](https://arxiv.org/pdf/2101.00027v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, Shawn Presser, Connor Leahy (2020). The Pile: An 800GB Dataset of Diverse Text for Language Modeling. arXiv:2101.00027v1. https://arxiv.org/abs/2101.00027v1

**BibTeX**

```
@misc{gao2020pile,
  title = {{The Pile: An 800GB Dataset of Diverse Text for Language Modeling}},
  author = {Leo Gao and Stella Biderman and Sid Black and Laurence Golding and Travis Hoppe and Charles Foster and Jason Phang and Horace He and Anish Thite and Noa Nabeshima and Shawn Presser and Connor Leahy},
  year = {2020},
  eprint = {2101.00027},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.00027v1}
}
```

## Related papers

- [Language Models are Few-Shot Learners](https://refivu.com/en/papers/82602214-e941-40a1-bc42-5b92c1268a53-language-models-are-few-shot-learners.md)
- [GPT-4o System Card](https://refivu.com/en/papers/7f73de51-bae5-43e2-85f2-6decfe19e7c4-gpt-4o-system-card.md)
- [Large Language Models: A Survey](https://refivu.com/en/papers/d8a3f692-1bfe-4a26-b530-c20397434b3c-large-language-models-a-survey.md)
- [PaLM: Scaling Language Modeling with Pathways](https://refivu.com/en/papers/31a94910-97f3-470b-a240-6c8b698de722-palm-scaling-language-modeling-with-pathways.md)

## Other paper commentary

- [Gemma 2: Improving Open Language Models at a Practical Size](https://refivu.com/en/papers/aaf9911d-9b96-4e9e-be15-d3cdb554211a-gemma-2-improving-open-language-models-at-a.md)
- [A Survey on Large Language Model based Autonomous Agents](https://refivu.com/en/papers/9d1600e9-9099-49ab-b9f8-7e2c2083c79f-a-survey-on-large-language-model-based-autonomous.md)
- [Lost in the Middle: How Language Models Use Long Contexts](https://refivu.com/en/papers/990be3e6-ce8b-473a-94d1-735a4cb6a76f-lost-in-the-middle-how-language-models-use.md)
- [MiniGPT-4: Enhancing Vision-Language Understanding with Advanced Large Language Models](https://refivu.com/en/papers/f07e6e3f-3ab5-42dc-98c8-a32fe7d8820d-minigpt-4-enhancing-vision-language-understanding-with.md)
- [Learning to Prompt for Vision-Language Models](https://refivu.com/en/papers/c492cb20-7c19-4275-b139-f97eecec7359-learning-to-prompt-for-vision-language-models.md)
- [Universal and Transferable Adversarial Attacks on Aligned Language Models](https://refivu.com/en/papers/6bc6f22f-cd10-41c0-ba7c-3e3d376cf3b9-universal-and-transferable-adversarial-attacks-on-aligned.md)
- [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation](https://refivu.com/en/papers/d3d2ade6-3bed-4a94-9439-088b61554b00-autogen-enabling-next-gen-llm-applications-via-multi.md)
- [Swin Transformer V2: Scaling Up Capacity and Resolution](https://refivu.com/en/papers/376ea342-9ea9-46f8-8c71-84f23e529d90-swin-transformer-v2-scaling-up-capacity-and-resolution.md)
- [Deeper Insights into Graph Convolutional Networks for Semi-Supervised Learning](https://refivu.com/en/papers/a2134edc-a5ef-48b2-9ec4-982cfed2a085-deeper-insights-into-graph-convolutional-networks-for-semi.md)
- [Pointer Sentinel Mixture Models](https://refivu.com/en/papers/8f7d0844-f517-4c18-ba24-8cd7dc616a74-pointer-sentinel-mixture-models.md)
- [Conditional Image Synthesis With Auxiliary Classifier GANs](https://refivu.com/en/papers/cbb27823-75f1-4fb6-b4c8-dcc645b1f162-conditional-image-synthesis-with-auxiliary-classifier-gans.md)
- [RepVGG: Making VGG-style ConvNets Great Again](https://refivu.com/en/papers/b7578ec8-e378-4286-b3a9-984d13d073c3-repvgg-making-vgg-style-convnets-great-again.md)

## Terms in this paper

- [perplexity](https://refivu.com/en/terms/2b204e513801-perplexity)
- [GPT-3](https://refivu.com/en/terms/d95e818ac9ce-gpt-3)
- [Common Crawl](https://refivu.com/en/terms/c9d39c3d6336-common-crawl)
- [GPT-2](https://refivu.com/en/terms/3c130f2029b4-gpt-2)
- [fastText](https://refivu.com/en/terms/91d8f0ba972f-fasttext)
- [LAMBADA](https://refivu.com/en/terms/b86e10054a54-lambada)
- [The Pile](https://refivu.com/en/terms/fd2fd47693ec-the-pile)
- [WikiText](https://refivu.com/en/terms/b2db4641e2db-wikitext)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/1672f861-b9aa-408b-8aba-b2d5d642c8c9-the-pile-an-800gb-dataset-of-diverse-text)
