MathPile: A Billion-Token-Scale Pretraining Corpus for Math

Zengzhi Wang, Rui Xia, Pengfei Liu
2/12/2026

No official code found. Best implementation: GAIR-NLP/MathPile (419 stars, Apache-2.0, last commit 2025-04-04).

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.

View on arXivView PDF

Code Implementations(1)

GAIR-NLP/MathPileCommunity100%
Apache-2.0

[NeurlPS D&B 2024] Generative AI for Math: MathPile

41920CSS, HTMLNov 27, 20231 years agoApache-2.0
corpuslanguage-modellarge-language-modelsmathpre-training

Similar Papers

Cite this paper

@article{wang2026mathpile,
  title  = {MathPile: A Billion-Token-Scale Pretraining Corpus for Math},
  author = {Zengzhi Wang and Rui Xia and Pengfei Liu},
  year   = {2026},
  eprint = {2312.17120},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2312.17120},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.17120.svg)](https://codeofpaper.com/paper/2312.17120)

Discussion