C4, the Colossal Clean Crawled Corpus, is a large web text dataset built by filtering a 2019 snapshot of Common Crawl down to roughly 750 GB of cleaned English prose. In artificial intelligence it belongs to the training data family of pretraining corpora, and it was introduced together with the T5 text-to-text model to test how much a carefully cleaned web corpus improves transfer learning.
The dataset matters for two reasons. It became a standard public benchmark corpus for pretraining and ablation studies, and its simple, documented heuristic filters became a template that later corpora such as RedPajama, Dolma and FineWeb either reused or explicitly improved upon.
How the C4 dataset was built from Common Crawl
C4 was produced by passing the April 2019 Common Crawl extraction through a pipeline of rule-based cleaning steps rather than a learned quality classifier. The authors started from the extracted plain text (WET files), which already removed HTML markup but still contained menus, error messages, boilerplate and duplicated content.
Each filter targets a specific kind of noise. The following table summarizes the main rules and the problem each one was designed to remove.
| Rule | What it removes | Side effect |
|---|---|---|
| Keep lines ending in terminal punctuation | Menus, buttons, navigation text | Drops lists and code |
| Discard lines with fewer than five words | Fragments and headers | Drops short legitimate lines |
| Discard pages with fewer than three sentences | Thin or empty pages | Removes short posts |
| Bad-words blocklist | Pornographic and offensive pages | Removes benign minority-related text |
| Drop pages with curly braces | Source code and templates | Removes most programming content |
| Drop lorem ipsum and policy notices | Placeholder and cookie text | Minor |
| Deduplicate repeated three-sentence spans | Mirrored and copied content | Keeps only one copy |
| Language detection at 0.99 confidence | Non-English pages | Excludes mixed-language text |
The result for the main English configuration is about 365 million documents and roughly 156 billion tokens under common tokenizers. These figures are approximate and depend on the tokenizer and on which public reproduction of the pipeline is used, because the original release was a processing script rather than a downloadable file.
Variants and configurations of C4
Several official configurations exist because the original paper ran ablations that compared cleaned and uncleaned text. A public copy hosted by the Allen Institute for AI made these variants practical, since rebuilding them required substantial distributed compute through Apache Beam.
| Configuration | Approximate size | Content |
|---|---|---|
| c4/en | About 305 GB compressed | Fully cleaned English text |
| en.noclean | About 2.3 TB compressed | Raw English text before heuristic filters |
| en.noblocklist | About 380 GB compressed | Cleaned text without the bad-words blocklist |
| realnewslike | About 15 GB compressed | Subset restricted to news-like domains |
| mC4 | Several terabytes | Multilingual version covering about 100 languages |
The mC4 multilingual corpus was created for the mT5 model by applying a similar pipeline to many Common Crawl dumps, with a line-length filter instead of the punctuation rule, because terminal punctuation is not universal across scripts.
How C4 compares with other pretraining corpora
C4 sits between unfiltered web scrapes and later corpora that combine model-based quality scoring, aggressive deduplication and curated sources. Its strength is transparency and reproducibility; its weakness is that the heuristics are coarse and English-centric.
| Corpus | Main source | Filtering approach | Typical use |
|---|---|---|---|
| C4 | One Common Crawl snapshot | Heuristic rules and blocklist | Baselines and ablations |
| OpenWebText | Links shared on Reddit | Popularity as a quality proxy | Reproducing GPT-2 style models |
| The Pile | 22 mixed sources | Source curation | Diverse academic pretraining |
| RedPajama | Web plus books, code, papers | C4 included as one slice | Open replication of large models |
| FineWeb | Many Common Crawl snapshots | Refined heuristics and deduplication | Modern open pretraining |
Because it is a single-snapshot corpus, C4 has limited temporal coverage. Models trained only on it have little knowledge of events after early 2019, which is acceptable for controlled experiments but not for current production assistants.
Practical use of C4 in model development
Researchers use C4 mainly as a fixed reference corpus. Because many published results report perplexity or downstream scores after training on it, a new architecture or optimizer can be compared fairly by training on the same data distribution.
- Pretraining small and mid-sized models in the range of tens of millions to a few billion parameters.
- Validation perplexity on the held-out C4 split as a quick quality signal during training.
- Data ablations that measure the effect of adding or removing a filter.
- Tokenizer training on a representative sample of clean English web text.
Teams usually stream the data in JSON Lines shards, apply their own tokenizer and, when the model will be evaluated on public benchmarks, run a contamination check that removes documents overlapping with evaluation sets.
Known limitations and documented biases
A later documentation study of the corpus showed that heuristic cleaning has measurable side effects. Its findings are now standard knowledge for anyone who uses C4 as training data.
| Issue | Cause | Consequence for models |
|---|---|---|
| Disproportionate removal of identity terms | Bad-words blocklist | Weaker coverage of minority-related text |
| Underrepresented dialects | Blocklist and language filter | Lower fluency in African American English |
| Machine-generated text | Patents and translated pages kept | Unnatural phrasing in training data |
| Benchmark contamination | Evaluation data published on the web | Inflated benchmark scores |
| Personal information | No dedicated removal step | Possible memorization of private details |
Licensing is a further concern. The public copy is distributed under an attribution-style database license, but the underlying pages keep their original copyrights, so organizations should treat C4 as web-derived data with unresolved rights and follow their own licensing review.
Stripped to the essentials
C4 is a huge collection of English text taken from websites. The raw pages were full of menus, ads, code and repeated text. Simple rules threw most of that away.
What was left is mostly readable sentences and paragraphs. Language models read this text to learn how English works. Think of it as a giant library assembled by a strict but imperfect cleaning crew: it is tidy, yet some useful books were thrown out by mistake.
Where it is applied
A university research group wants to test whether a new attention variant improves language modeling. The group trains two models of about 350 million parameters each, one with standard attention and one with the new design, on the same c4/en configuration for 20 billion tokens.
Both runs report validation perplexity on the C4 held-out split every few thousand steps. Because the data, tokenizer and token budget are identical, any gap between the curves can be attributed to the architecture. The new variant reaches the baseline perplexity about 8 percent sooner, and the group can compare its numbers directly with earlier published results on C4, which would be impossible with a private, undocumented corpus.