CLAILGApr 3, 2025

MegaMath: Pushing the Limits of Open Math Corpora

arXiv:2504.02807v138 citationsh-index: 14
Originality Synthesis-oriented
AI Analysis

This provides a valuable resource for researchers and developers working on mathematical reasoning in LLMs, though it is incremental as it builds on existing data curation methods.

The authors tackled the lack of a large-scale, high-quality open dataset for math-centric LLM pre-training by creating MegaMath, which integrates web data, code data, and synthetic data to deliver 371B tokens, achieving the largest quantity and top quality among existing open math datasets.

Mathematical reasoning is a cornerstone of human intelligence and a key benchmark for advanced capabilities in large language models (LLMs). However, the research community still lacks an open, large-scale, high-quality corpus tailored to the demands of math-centric LLM pre-training. We present MegaMath, an open dataset curated from diverse, math-focused sources through following practices: (1) Revisiting web data: We re-extracted mathematical documents from Common Crawl with math-oriented HTML optimizations, fasttext-based filtering and deduplication, all for acquiring higher-quality data on the Internet. (2) Recalling Math-related code data: We identified high quality math-related code from large code training corpus, Stack-V2, further enhancing data diversity. (3) Exploring Synthetic data: We synthesized QA-style text, math-related code, and interleaved text-code blocks from web data or code data. By integrating these strategies and validating their effectiveness through extensive ablations, MegaMath delivers 371B tokens with the largest quantity and top quality among existing open math pre-training datasets.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes