TL;DR
While model-based data filtering has driven massive performance gains for English LLMs, multilingual corpora have lagged behind, mostly relying on heuristic rules. This paper introduces an efficient, embedding-based data curation pipeline that selects structured, knowledge-rich web documents across diverse languages. Pretraining 1B-parameter models on the filtered data matches baseline benchmark scores with as little as 15% of the original tokens and even reverses the dreaded "curse of multilinguality."
What Problem Does This Paper Address?
Pretraining data quality is one of the biggest levers for LLM capability. While recent English datasets like FineWeb-Edu and DataComp-LM (DCLM) rely on machine learning classifiers to isolate high-quality educational text, non-English web crawl filtering remains predominantly heuristic (e.g., word length, punctuation checks, perplexity filtering). Because over half of web content is non-English, this gap widens multilingual performance disparities.
Filtering non-English text at web scale is difficult: language families, writing systems, and data availability vary wildly, and running large multilingual LLMs as judges over hundreds of millions of documents is computationally prohibitive.
Methods
The authors build a simple, scalable classifier pipeline to score documents from Common Crawl (FineWeb-2) per language:
- Proxy Reference Datasets (MKC / MKC+): Rather than hand-labeling web data, the authors curate positive reference sets embodying structured, informative knowledge:
- MKC: High-quality human-curated and translated benchmarks/instructions (Include-Base-44, OpenAssistant-2, human-translated MMLU, and the Aya Dataset).
- MKC+: MKC combined with the larger, template-generated Aya Collection to test the impact of diversity and scale.
- Negative samples are randomly sampled from raw FineWeb-2.
- Classifiers:
- FastText (FT): An n-gram linear classifier running entirely on CPU (2-grams for Latin/Arabic scripts, 4-grams for Chinese).
- Transformer Embeddings + MLP: XLM-RoBERTa base (279M parameters) generates 768-dimensional mean-pooled embeddings from the first 512 tokens of each document, fed into a single-hidden-layer MLP (hidden dim 256).
- Cosine Similarity (CS): Scored by maximum cosine similarity against 8,192 randomly sampled positive embeddings.
- Filtering & Pretraining: Documents are scored, retaining the top $k$% (e.g., 10% for high-resource languages like Chinese, French, and German; 56% for Arabic; 65% for Danish). 1B-parameter Llama models are then trained from scratch on 70B and 119B tokens.
Datasets
- Base Pretraining Corpora: FineWeb-2 (and English FineWeb for validation).
- Classifier Training: Include-Base-44, OpenAssistant-2, translated MMLU, Aya Dataset, and Aya Collection.
- Evaluation Suites: FineTasks (covering Belebele, HellaSwag, XNLI 2.0, FQuAD, MMLU/CMMLU/ArabicMMLU, ARC, etc.) for non-English languages, and the SmolLM suite for English.
- Artifact Released: FineWeb2-HQ, containing high-quality subsets for 20 languages (spanning Russian, Chinese, German, Indonesian, Arabic, and more), along with precomputed XLM-RoBERTa embeddings.
Key Insights and Ideas
- Transformer Embeddings Win, but FastText Holds Its Ground: The XLM-RoBERTa + MLP classifier trained on MKC+ consistently ranked best across benchmarks. However, FastText remains remarkably competitive at a fraction of the compute, offering a strong option for resource-constrained pipelines.
- Scale and Diversity Beat Purity in Quality Classifiers: Even though the synthetic Aya Collection lacked human verification, adding it to the positive pool (MKC+) consistently outperformed classifiers trained only on clean, curated benchmarks (MKC).
- Overcoming the "Curse of Multilinguality": In standard multilingual pretraining, sharing model capacity across languages typically degrades per-language performance compared to monolingual training ("the curse"). Surprisingly, when trained on quality-filtered data, a 5-language multilingual model (595B tokens total, 119B/language) outperformed the monolingual 119B models across nearly all languages.
- Strict Filtering is Optimal: Retaining only the top 10% of high-resource documents yielded the best downstream results. Furthermore, replaying 5–10% of unfiltered data did not improve downstream performance, demonstrating that the 10% slice preserved sufficient linguistic diversity.
Key Results
- Token Efficiency: On Chinese (CMMLU), German (MMLU), and French (MMLU), 1B models trained on MLP MKC+ data matched the full FineWeb-2 baseline after seeing only ~20B tokens (~16.7% of total training).
- Model Selection Ranking: Across Chinese, German, French, Arabic, and Danish, MLP MKC+ achieved the top overall average rank (4.35) versus the unfiltered FineWeb-2 baseline (8.72).
- English Generalization: When applied to English FineWeb, the MLP MKC+ filter achieved an average SmolLM benchmark rank of 1.83, beating DCLM (2.39), FineWeb-Edu (2.44), and base FineWeb (3.33).
- Decontamination: 13-gram benchmark decontamination confirmed that the performance leaps were driven by intrinsic data quality rather than benchmark leakage.
Limitations and Future Work
- Model Scale: Experiments were restricted to 1B-parameter models trained on a single seed due to compute budgets.
- Context Length in Filtering: The embedding classifier only evaluated the first 512 tokens of each document, assuming the opening represents overall document quality.
- Classifier Generalization: While the pipeline generalized across the 5 primary test languages, the positive training datasets may exhibit uneven coverage or cultural biases across all 20 target languages. Future work could investigate full-document representations and dynamic language-specific mixture weighting.
Summary updated