C4 · dataset

Also known as: Colossal Clean Crawled Corpus

On this page 7

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.

RuleWhat it removesSide effect
Keep lines ending in terminal punctuationMenus, buttons, navigation textDrops lists and code
Discard lines with fewer than five wordsFragments and headersDrops short legitimate lines
Discard pages with fewer than three sentencesThin or empty pagesRemoves short posts
Bad-words blocklistPornographic and offensive pagesRemoves benign minority-related text
Drop pages with curly bracesSource code and templatesRemoves most programming content
Drop lorem ipsum and policy noticesPlaceholder and cookie textMinor
Deduplicate repeated three-sentence spansMirrored and copied contentKeeps only one copy
Language detection at 0.99 confidenceNon-English pagesExcludes mixed-language text
Main cleaning rules applied to build C4

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.

ConfigurationApproximate sizeContent
c4/enAbout 305 GB compressedFully cleaned English text
en.nocleanAbout 2.3 TB compressedRaw English text before heuristic filters
en.noblocklistAbout 380 GB compressedCleaned text without the bad-words blocklist
realnewslikeAbout 15 GB compressedSubset restricted to news-like domains
mC4Several terabytesMultilingual version covering about 100 languages
Commonly used C4 configurations

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.

CorpusMain sourceFiltering approachTypical use
C4One Common Crawl snapshotHeuristic rules and blocklistBaselines and ablations
OpenWebTextLinks shared on RedditPopularity as a quality proxyReproducing GPT-2 style models
The Pile22 mixed sourcesSource curationDiverse academic pretraining
RedPajamaWeb plus books, code, papersC4 included as one sliceOpen replication of large models
FineWebMany Common Crawl snapshotsRefined heuristics and deduplicationModern open pretraining
C4 compared with related corpora

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.

IssueCauseConsequence for models
Disproportionate removal of identity termsBad-words blocklistWeaker coverage of minority-related text
Underrepresented dialectsBlocklist and language filterLower fluency in African American English
Machine-generated textPatents and translated pages keptUnnatural phrasing in training data
Benchmark contaminationEvaluation data published on the webInflated benchmark scores
Personal informationNo dedicated removal stepPossible memorization of private details
Documented problems in C4 and their consequences

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.