Generative AI for Math (OpenWebMath / MathPile)

Releases a diverse, high-quality math-centric corpus of ~9.5B tokens designed for training math-capable foundation models.
Ask this paper
9.5B-token corpus: Curated from mathematical content across the web, textbooks, papers, and Q&A, rebalanced for math-specific token distribution.
Quality filtering: Applies math-specific filtering to surface content dense in symbolic notation, proofs, and problem solutions rather than surface-level mentions of math.
Diverse sources: Explicitly mixes proof-heavy formal math with applied problem-solving to avoid over-fitting to any single mathematical register.
Training signal: Positioned as a drop-in pretraining or continual-pretraining corpus to lift math reasoning in existing LLMs without changing the architecture.
Abstract
High-quality, large-scale corpora are the cornerstone of building foundation models. In this work, we introduce MathPile, a diverse and high-quality math-centric corpus comprising about 9.5 billion tokens. Throughout its creation, we adhered to the principle of "less is more", firmly believing in the supremacy of data quality over quantity, even in the pre-training phase. Our meticulous data collection and processing efforts included a complex suite of preprocessing, prefiltering, language identification, cleaning, filtering, and deduplication, ensuring the high quality of our corpus. Furthermore, we performed data contamination detection on downstream benchmark test sets to eliminate duplicates and conducted continual pre-training experiments, booting the performance on common mathematical reasoning benchmarks. We aim for our MathPile to boost language models' mathematical reasoning abilities and open-source its different versions and processing scripts to advance the field.