{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/generative-ai-for-math-part-i-mathpile-a","title":"MathPile: A Billion-Token-Scale Pretraining Corpus for Math","arxiv_id":"2312.17120","date":"2023-12-28","proceeding":null,"authors":["Zengzhi Wang","Xuefeng Li","Rui Xia","PengFei Liu"],"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.","url_abs":"https://arxiv.org/abs/2312.17120v2","url_pdf":"https://arxiv.org/pdf/2312.17120v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"generative-ai-for-math-part-i-mathpile-a","repo_url":"https://github.com/gair-nlp/mathpile","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"language-identification","task_name":"Language Identification"},{"task_slug":"math","task_name":"Math"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.17120","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.17120"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/GAIR-NLP/MathPile","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gair-nlp/mathpile","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":9,"ran_honours":1,"unverified":2},"by_repo_kind":{"official":{"samples":12,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"7f4b7b76cf10ce84","entry":"contains_lorem_ipsum","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/filtering/filtering.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/filtering/filtering.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7f4b7b76cf10ce84"}},{"code_sha256_prefix":"629a0c060c52153c","entry":"convert_file_type_to_extension","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/preprocessing/arXiv/copy_to_merge_math_tex_data.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/preprocessing/arXiv/copy_to_merge_math_tex_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"629a0c060c52153c"}},{"code_sha256_prefix":"b15edd651b375141","entry":"count_char","repo":"gair-nlp/mathpile","repo_kind":"official","path":"src/preprocessing/arXiv/processing_tex_at_scale.py","file_url":"https://github.com/gair-nlp/mathpile/blob/HEAD/src/preprocessing/arXiv/processing_tex_at_scale.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b15edd651b375141"}},{"code_sha256_prefix":"f1a635ded00c11d8","entry":"count_sentences","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/filtering/filtering.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/filtering/filtering.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f1a635ded00c11d8"}},{"code_sha256_prefix":"338e8f82ff616aa5","entry":"filter_lorem_ipsum","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/filtering/filtering.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/filtering/filtering.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"338e8f82ff616aa5"}},{"code_sha256_prefix":"e2fc4d7da17d9ff4","entry":"load_data_from_jsonl","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/utils.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e2fc4d7da17d9ff4"}},{"code_sha256_prefix":"f360e77521c0e511","entry":"obtain_language_detection_probs","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/language-identification/fasttext_id.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/language-identification/fasttext_id.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f360e77521c0e511"}},{"code_sha256_prefix":"b40e45d2f17838f2","entry":"read_file","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/utils.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b40e45d2f17838f2"}},{"code_sha256_prefix":"8f55e3ae760c0bfc","entry":"read_pickle_file","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/utils.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8f55e3ae760c0bfc"}},{"code_sha256_prefix":"bf5aeddf512b9720","entry":"split_large_file","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/global_data_processing/filtering/utils.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/global_data_processing/filtering/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bf5aeddf512b9720"}},{"code_sha256_prefix":"c711156b147a6c28","entry":"obtain_file_type","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/preprocessing/arXiv/copy_to_merge_math_tex_data.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/preprocessing/arXiv/copy_to_merge_math_tex_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c711156b147a6c28"}},{"code_sha256_prefix":"fda91082fd4c0134","entry":"obtain_file_type","repo":"GAIR-NLP/MathPile","repo_kind":"official","path":"src/preprocessing/arXiv/file_type_rename_and_move.py","file_url":"https://github.com/GAIR-NLP/MathPile/blob/HEAD/src/preprocessing/arXiv/file_type_rename_and_move.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fda91082fd4c0134"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}