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

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

28 Dec 2023arXiv:2312.17120archive 2025-07-28

Zengzhi Wang, Xuefeng Li, Rui Xia, PengFei Liu

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2312.17120")

Code

Syntology Ran 10 of 12 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 1 ran · honoured contract; 9 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

gair-nlp/mathpile officialmentioned in paperApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 10 ran; 1 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
9ran
2unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from GAIR-NLP/MathPile. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

contains_lorem_ipsum GAIR-NLP/MathPile/src/global_data_processing/filtering/filtering.py official repository ran Apache-2.0 (permissive) · 7f4b7b76cf10ce84 · report
convert_file_type_to_extension GAIR-NLP/MathPile/src/preprocessing/arXiv/copy_to_merge_math_tex_data.py official repository ran fingerprinted Apache-2.0 (permissive) · 629a0c060c52153c · report
count_char gair-nlp/mathpile/src/preprocessing/arXiv/processing_tex_at_scale.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · b15edd651b375141 · report
count_sentences GAIR-NLP/MathPile/src/global_data_processing/filtering/filtering.py official repository ran fingerprinted Apache-2.0 (permissive) · f1a635ded00c11d8 · report
filter_lorem_ipsum GAIR-NLP/MathPile/src/global_data_processing/filtering/filtering.py official repository ran fingerprinted Apache-2.0 (permissive) · 338e8f82ff616aa5 · report
load_data_from_jsonl GAIR-NLP/MathPile/src/global_data_processing/utils.py official repository ran Apache-2.0 (permissive) · e2fc4d7da17d9ff4 · report
obtain_language_detection_probs GAIR-NLP/MathPile/src/global_data_processing/language-identification/fasttext_id.py official repository ran Apache-2.0 (permissive) · f360e77521c0e511 · report
read_file GAIR-NLP/MathPile/src/global_data_processing/utils.py official repository ran Apache-2.0 (permissive) · b40e45d2f17838f2 · report
read_pickle_file GAIR-NLP/MathPile/src/global_data_processing/utils.py official repository ran Apache-2.0 (permissive) · 8f55e3ae760c0bfc · report
split_large_file GAIR-NLP/MathPile/src/global_data_processing/filtering/utils.py official repository ran Apache-2.0 (permissive) · bf5aeddf512b9720 · report
obtain_file_type GAIR-NLP/MathPile/src/preprocessing/arXiv/copy_to_merge_math_tex_data.py official repository unverified Apache-2.0 (permissive) · c711156b147a6c28 · report
obtain_file_type GAIR-NLP/MathPile/src/preprocessing/arXiv/file_type_rename_and_move.py official repository unverified Apache-2.0 (permissive) · fda91082fd4c0134 · report

Tasks

Language IdentificationMathMathematical Reasoning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections