TL;DR
Large language models are only as good as the text they are trained on, and for Nigeria’s three largest indigenous languages—Hausa, Igbo, and Yorùbá—clean web text is scarce. The authors introduce NaijaWeb, a 527.4M-token web corpus built from Common Crawl, targeted news re-crawls, and FineWeb-2, filtered using both language-specific rules and a quality classifier trained on native-speaker judgements. When pretraining a 134.1M-parameter language model on a fixed token budget, NaijaWeb achieves the lowest held-out loss among six competing corpora, outperforming WURA, FineWeb-2, MADLAD-400, and HPLT 2.0.
What Problem Does This Paper Address?
Nigeria is home to 237.5 million people, with Hausa, Yorùbá, and Igbo each spoken by tens of millions. Yet in language technology, they remain low-resource languages. Existing multilingual web corpora—such as FineWeb-2, MADLAD-400, HPLT 2.0, and WURA—often suffer from severe quality issues in low-resource languages. Automated, language-agnostic pipelines struggle with:
- Language identification errors: Low-resource languages are frequently confused with closely related high-resource languages or filled with non-linguistic junk.
- Machine-translated "localisation" sites: Foreign websites often use translation plugins to serve pages under
/ha/,/ig/, or/yo/paths or subdomains, flooding web crawls with unnatural, machine-translated text.
Methods
The authors build a multi-stage filtering pipeline tailored specifically to Hausa, Igbo, and Yorùbá:
- Broad Collection: They start with 30 Common Crawl snapshots (2024–2026) and use GlotLID with a permissive 0.3 probability threshold to cast a wide net, yielding 4.1M pages (7.46B tokens).
- Heuristic & Manual Filtering: They strip repeating boilerplate, apply Gopher quality/repetition rules (minus its English stop-word rule), remove Wikipedia infrastructure pages, and apply WURA’s stop-word rule. Crucially, they manually screen top domains to block machine-translated localisation sites while protecting legitimate publishers.
- Cross-Snapshot Deduplication: Using MinHash, they deduplicate both within each snapshot and across all 30 snapshots, shrinking the pool to 660,984 documents (525.0M tokens).
- Expansion: They add a polite re-crawl of curated news and community sites (54,469 kept documents) and incorporate older Hausa, Igbo, and Yorùbá documents from FineWeb-2 (2013–2024) not already in their pool (324,797 kept documents).
- Human-Trained Quality Classifier: They recruit three paid native-speaker annotators per language to label documents as keep (correct language and usable) or drop. Using 1,901 training labels, they fine-tune
AfroXLMR-baseto score documents, retaining those with a keep probability $p > 0.5$.
Datasets
- Training/Release Corpus: NaijaWeb (856,317 documents; 527.4M tokens across 4,258 sites), released under ODC-By v1.0.
- Baselines Compared: WURA, FineWeb-2, MADLAD-400 (clean and noisy splits), and HPLT 2.0.
- Evaluation Benchmark: 12 held-out sets (4 per language): exam questions from AfriMMLU, translations from FLORES-200 (via Belebele), news from MasakhaNEWS, and Wikipedia. All training corpora are decontaminated against these sets using a 13-word overlap rule.
Key Insights and Ideas
- Deduplicating across snapshots matters: Unlike FineWeb—which found cross-snapshot deduplication unnecessary for English—the authors show that for low-resource web text, deduplicating across all 30 snapshots prevents models from overfitting to repeated documents. By epoch 10, cross-snapshot deduplication reduces held-out loss from 1.3927 to 1.2871 bits per byte.
- Quality classifiers speed up early learning: When comparing classifier-filtered text against a random sample of the same size, the classifier-selected data wins on 9 of 12 held-out sets after 1 epoch (and loses on none), though the two nearly tie by epoch 10.
- Language-specific curation beats massive scale: Generic multilingual pipelines miss domain-specific traps like translation-plugin URLs. Manual domain screening combined with a native-speaker classifier yields cleaner pretraining data than much larger automated pipelines.
Key Results
- Classifier Accuracy: On a 180-document test set (60 per language), the quality classifier matches the annotators' majority vote 81.1% of the time (86.7% Hausa, 65.0% Igbo, 91.7% Yorùbá), compared to 61.7% for keeping everything.
- Pretraining Performance: Pretraining a 134.1M-parameter model for 10 epochs on 290.4M unique tokens per corpus (matched to WURA’s size), NaijaWeb achieves the lowest mean held-out loss at 1.302 bits per byte, beating WURA (1.310), MADLAD-400 clean (1.440), FineWeb-2 (1.449), MADLAD-400 noisy (1.454), and HPLT 2.0 (1.464).
- Corpus Size: At 527.4M tokens, NaijaWeb is the largest filtered corpus among all compared datasets for these three languages.
Limitations and Future Work
The authors note several limitations:
- Evaluation is restricted to a single model size (134.1M parameters) and a single metric (bits per byte on held-out text), with no downstream task evaluations or tests on informal/code-switched text.
- The classifier test set is small (60 documents per language), and its advantage over random sampling narrows after 10 epochs.
- Machine-translated text is filtered only by URL rules, meaning some translated content may still slip through. No Unicode normalisation is applied, and Yorùbá tone-mark coverage varies across sources.
In future work, the authors plan to recruit more annotators, expand the pipeline to additional low-resource Nigerian languages, and train stronger quality classifiers on larger human-labelled datasets.
Summary updated