# Quality filtering of web corpora

Quality filtering of web corpora is the set of methods that score documents in web-scale text collections (chiefly [Common Crawl](https://www.edgepedia.org/common-crawl)) for training usefulness and discard the low-scoring ones before a language model is pretrained on them. Since 2019 it has developed in three families: hand-written heuristic rules, perplexity (A language model's uncertainty score; lower means more predictable text) scoring against a reference language model, and learned classifiers, which can be trained in various ways, including on annotations produced by large language models.<sup>[1](https://ar5iv.labs.arxiv.org/html/1911.00359)</sup><sup> • </sup><sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup>

The motivation is the state of raw crawl data. Common Crawl, the public crawl archive, is the source from which corpora such as CCNet's are built; CCNet's authors proposed filtering it explicitly because much of it is low quality, and their February 2019 pipeline produced 1.5 billion documents in 174 languages after processing.<sup>[1](https://ar5iv.labs.arxiv.org/html/1911.00359)</sup> What counts as "quality" has never been formally defined; each family operationalizes it differently, and the choice has measurable effects on both model performance and whose text survives.

| Key fact | Figure |
|---|---|
| FineWeb-Edu retention | 1.3T of 15T tokens kept; ~91% discarded by the educational classifier<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> |
| DCLM retention | 3.8T tokens kept from 89 Common Crawl dumps<sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup> |
| Compute cost of LLM-classifier filtering | ~6,000 H100 GPU hours for 15T tokens, vs 80 CPUs / 1,000 hours for fastText<sup>[4](https://arxiv.org/html/2505.05427)</sup> |
| Vendor-reported ablation gains | MMLU 33%→37%, ARC 46%→57% (FineWeb→FineWeb-Edu)<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> |
| CCNet throughput | 8.5 hours per Common Crawl snapshot on 5,000 CPU cores<sup>[1](https://ar5iv.labs.arxiv.org/html/1911.00359)</sup> |
| Documented bias | C4-style filtering disproportionately removed documents with dialect features of minority communities (University of Washington measurements)<sup>[5](https://mbrenndoerfer.com/writing/quality-filtering-heuristic-perplexity-classifier-thresholds)</sup> |
| FLUX compute saving | 50.48% aggregate score at 3B scale with ~34.4% fewer FLOPs than DCLM<sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup> |

## How it works: the three filtering families

**Heuristic rules.** Rule-based filters such as the Gopher rules judge documents on surface features: punctuation density, ratios of special characters, line-length distributions, and similar statistics.<sup>[6](https://arxiv.org/html/2607.22662v1)</sup> A document is rejected when it trips thresholds on these features. The approach is cheap and fast, but it has a documented failure mode: STEM documents containing formulas, [chemical symbols](https://www.edgepedia.org/chemical-symbol), or code systematically trip the same signals that flag spam, so pure rule-based methods misclassify them as low quality.<sup>[6](https://arxiv.org/html/2607.22662v1)</sup> The rules are also language-specific. FineWeb2's multilingual ablations note that in Chinese, words have fewer characters on average, so an average-characters-per-word rule tuned on English misfires.<sup>[7](https://arxiv.org/html/2506.20920)</sup>

**Perplexity scoring.** CCNet, introduced in November 2019, proposed computing the perplexity of each document under a language model trained on a targeted domain such as [Wikipedia](https://www.edgepedia.org/wikipedia) and using that perplexity as the quality score; low perplexity means the document resembles the reference corpus.<sup>[1](https://ar5iv.labs.arxiv.org/html/1911.00359)</sup> For efficiency CCNet uses a 5-gram Kneser-Ney model implemented in KenLM, and each language's data is split into three even parts, head, middle, and tail, by perplexity score, with the tail discarded.<sup>[1](https://ar5iv.labs.arxiv.org/html/1911.00359)</sup> The method's weakness is circularity: if the reference model is trained on text that excludes certain dialects or styles, those texts get high perplexity and are removed, so the reference model's biases become the corpus's biases.<sup>[5](https://mbrenndoerfer.com/writing/quality-filtering-heuristic-perplexity-classifier-thresholds)</sup> [Perplexity](https://www.edgepedia.org/perplexity) filters can also be too aggressive about domain: a Wikipedia-trained model assigns high perplexity to legal documents, poetry, and code, which are valid text but unlike Wikipedia.<sup>[5](https://mbrenndoerfer.com/writing/quality-filtering-heuristic-perplexity-classifier-thresholds)</sup>

**Learned classifiers.** The most recent families train a small classifier by employing various labeling approaches, including annotations produced by a large language model acting as a judge.<sup>[10](https://aclanthology.org/2024.lrec-main.1372/)</sup> FineWeb-Edu (June 2024) is the public reference point: its creators had Llama-3-70B-Instruct rate web pages for educational value on a 0–5 scale, then fine-tuned a linear regressor on Snowflake-arctic-embed-m embeddings over 410,000 of those synthetic annotations for 20 epochs at learning rate 3e-4, with 50,000 held-out validation samples.<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> A minimum score threshold of 3 was chosen as the best trade-off, giving an F1 of 82% on validation.<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> The annotation prompt deliberately steered the judge away from highly technical pages such as arXiv abstracts, focusing on grade-school and middle-school level knowledge, an explicit and contestable definition of "educational".<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> A cheaper variant uses fastText classifiers on n-gram features, the lineage of [DataComp-LM (DCLM)](https://www.edgepedia.org/datacomp-lm-dclm), against the high cost of LLM-based scorers.<sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup><sup> • </sup><sup>[4](https://arxiv.org/html/2505.05427)</sup>

## Origin and timeline

CCNet (Wenzek et al., November 2019) introduced perplexity filtering against a targeted-domain reference model.<sup>[1](https://ar5iv.labs.arxiv.org/html/1911.00359)</sup> [Heuristic](https://www.edgepedia.org/heuristic) rule sets followed, including the Gopher rules, which judge documents on surface features such as punctuation density, special-character ratios, and line-length distributions.<sup>[6](https://arxiv.org/html/2607.22662v1)</sup> (The evidence base here does not cover C4's own 2019 release or the Gopher rules' original publication in detail; both are named only through later papers.)

Classifier filtering on synthetic LLM annotations was used privately before it was public: the FineWeb-Edu authors state the technique had been used in the non-public pretraining datasets of Llama 3 and Phi-3, but its large-scale impact on web filtering had not been publicly explored before FineWeb-Edu in June 2024.<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> Ultra-FineWeb (May 2025) counts FineWeb-Edu (2024), Chinese FineWeb-Edu (2025), CCI3-HQ (2024), and DCLM (2024) among the datasets that have adopted model-driven classifier filtering after heuristic preprocessing, each reporting measurable downstream improvements.<sup>[4](https://arxiv.org/html/2505.05427)</sup> Successors through 2026 include Ultra-FineWeb, FineWeb2 (June 2025), FinerWeb-10BT (NoDaLiDa 2025), FLUX (2026), and [CuraWeb](https://www.edgepedia.org/curaweb) (2026).<sup>[4](https://arxiv.org/html/2505.05427)</sup><sup> • </sup><sup>[7](https://arxiv.org/html/2506.20920)</sup><sup> • </sup><sup>[8](https://aclanthology.org/2025.nodalida-1.27.pdf)</sup><sup> • </sup><sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup><sup> • </sup><sup>[6](https://arxiv.org/html/2607.22662v1)</sup>

## By the numbers: retention, cost and downstream gains

**Retention.** Aggressive classifier filtering keeps a small fraction of the web. FineWeb-Edu kept 1.3 trillion of FineWeb's 15 trillion tokens, discarding roughly 91%.<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> FLUX's authors note that FineWeb-Edu-style LLM-annotator filtering typically retains below 10% of documents, and that DCLM retains only 3.8 trillion tokens from 89 Common Crawl dumps, which they read as substantial data loss.<sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup> On a single recent dump (CC-MAIN-2025-51), FLUX's line-level pipeline extracted 50B usable tokens versus 40B under DCLM, a 25% retention improvement.<sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup> CuraWeb reports that its rule stage keeps 87.3% of documents (39.1B to 34.2B), against only 32.6% retention under traditional uniform rule thresholds, with 90% overall precision and 90–95% recall for high-quality documents.<sup>[6](https://arxiv.org/html/2607.22662v1)</sup>

**Compute cost.** Filtering is not free relative to pretraining. Ultra-FineWeb quantifies the two lineages: processing 15T tokens with an LLM-based classifier requires approximately 6,000 H100 GPU hours, while fastText completes the same task on 80 CPUs in 1,000 hours with no GPUs.<sup>[4](https://arxiv.org/html/2505.05427)</sup> At the training end, FLUX reports that DCLM needs 1.227×10²¹ FLOPs to reach a 50.48% aggregate score at 3B scale, while FLUX reaches the same score with 8.044×10²⁰ FLOPs, about 34.4% less compute.<sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup>

**Downstream gains.** The strongest ablation numbers are vendor-reported. [Hugging Face](https://www.edgepedia.org/hugging-face)'s FineWeb-Edu ablations show MMLU rising from 33% to 37% (about 12% relative) and ARC from 46% to 57% (about 24% relative) versus FineWeb.<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> In a 1.71B-parameter ablation trained on 350B tokens, FineWeb-Edu matched the final MMLU performance of the Matrix dataset with almost 10x fewer tokens.<sup>[2](https://doi.org/10.48550/arxiv.2406.17557)</sup> Line-level filtering shows similar economics: GPT-2 models trained on FinerWeb-10BT reached higher [HellaSwag](https://www.edgepedia.org/hellaswag) accuracy with up to 25% less data, and hit the original dataset's best score about 6,000 steps earlier, a 32% reduction in training time.<sup>[8](https://aclanthology.org/2025.nodalida-1.27.pdf)</sup> CuraWeb reports beating DCLM by 1.82 absolute points at a strict 200B-token budget (48.07% average) and holding a stable ~1.95% margin up to 1T tokens, which it attributes to preserved diversity avoiding saturation.<sup>[6](https://arxiv.org/html/2607.22662v1)</sup> Cross-dataset comparisons carry a caveat: the FineWeb dataset card's claim that FineWeb outperforms C4, Dolma-v1.6, The Pile, SlimPajama, RedPajama2, and [RefinedWeb](https://www.edgepedia.org/refinedweb) is measured on the creators' own aggregate benchmark group, a vendor-reported result.<sup>[9](https://huggingface.co/datasets/HuggingFaceFW/fineweb)</sup>

## What changed in 2025–2026

Three shifts define the current generation of pipelines. First, the center of gravity moved from hand-written rules to LLM-scored classifiers: FineWeb-Edu's approach was adopted by Chinese FineWeb-Edu, CCI3-HQ, and DCLM, and refined by successors.<sup>[4](https://arxiv.org/html/2505.05427)</sup> Second, filtering moved from document level to line level. FinerWeb-10BT used GPT-4o mini to line-label a 20,000-document sample of a 10B-token FineWeb subset, grouped the labels into nine categories with o1-preview, and trained a DeBERTa-v3 classifier (micro F1 0.80–0.81, macro F1 0.63–0.67) to scale the filtering; FLUX (2026) removes individual low-quality lines rather than rejecting whole documents, retaining 9.7% more tokens than DCLM and 11.1% more than FineWeb after deduplication while outperforming both on aggregate score at 530M scale.<sup>[8](https://aclanthology.org/2025.nodalida-1.27.pdf)</sup><sup> • </sup><sup>[3](https://www.arxiv.org/pdf/2603.13972)</sup> Third, pipelines now optimize quality jointly with redundancy and diversity: CuraWeb's hybrid rule-plus-model stage removes an additional 31.9% of documents beyond pure rule filtering, raising the STEM document share from 19.74% to 33.58% and math-related documents from 1.656% to 3.832%, an example of filtering tuned toward reasoning-relevant data.<sup>[6](https://arxiv.org/html/2607.22662v1)</sup> The fastText lineage persists as the low-cost alternative: Ultra-FineWeb frames the field as split between LLM-based classifiers (FineWeb-Edu lineage) and fastText-based ones (DCLM lineage).<sup>[4](https://arxiv.org/html/2505.05427)</sup>

## References

1. CCNet: Extracting High Quality Monolingual Datasets from Web Crawl Data (Wenzek et al., 2019; LREC 2020) — https://ar5iv.labs.arxiv.org/html/1911.00359
2. The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale (Penedo et al., 2024) — https://doi.org/10.48550/arxiv.2406.17557
3. FLUX: line-level filtering pipeline (arXiv, 2026) — https://www.arxiv.org/pdf/2603.13972
4. Ultra-FineWeb: Efficient Data Filtering and Verification for High-Quality LLM Training Data (May 2025) — https://arxiv.org/html/2505.05427
5. Quality Filtering: Heuristics, Perplexity, and Classifiers (mbrenndoerfer.com) — https://mbrenndoerfer.com/writing/quality-filtering-heuristic-perplexity-classifier-thresholds
6. CuraWeb: Joint Optimization of Quality, Redundancy, and Diversity for Web-Scale Pretraining Data (2026) — https://arxiv.org/html/2607.22662v1
7. FineWeb2: One Pipeline to Scale Them All (June 2025) — https://arxiv.org/html/2506.20920
8. FinerWeb-10BT: Refining Web Data with LLM-Based Line-Level Filtering (NoDaLiDa 2025) — https://aclanthology.org/2025.nodalida-1.27.pdf
9. HuggingFaceFW/fineweb dataset card — https://huggingface.co/datasets/HuggingFaceFW/fineweb
10. Text Filtering Classifiers for Medium-Resource Languages, https://aclanthology.org/2024.lrec-main.1372/

---
*Topic: Encyclopedia › Technology and the built world › Computing and digital systems › Modern AI: foundation models, generative AI, and the AI industry › Foundation-model methods and training › Pretraining data and corpora*

*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 11, 2026 · Last review: Sep 30, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
