MegaMath
收藏MegaMath: 开放数学预训练数据集(370B Tokens)
数据集概述
- 规模:包含370B tokens的大规模数学预训练数据集
- 特点:专为数学领域设计的高质量预训练数据
- 组成:通过三种方式构建:
- 重新处理网络数据:从Common Crawl重新提取数学文档,采用数学导向的HTML优化、基于fasttext的过滤和去重
- 精选数学相关代码:从大型代码训练语料库Stack-V2中识别高质量数学相关代码
- 合成数据探索:从网络数据或代码数据合成QA风格文本、数学相关代码和交错文本-代码块
数据变体
- MegaMath-Web:完整网络数据集,适用于从头训练LLM
- MegaMath-Web-Pro:高质量网络数据子集,适用于从强基础模型进行持续预训练
- MegaMath-Code:数学相关代码数据,可增强LLM通过Python代码解决数学相关任务的能力
- 合成数据:包含超过80B tokens的合成数据,用于进一步增强LLM在数学相关任务上的表现
使用方式
python
下载完整网络数据
from huggingface_hub import snapshot_download snapshot_download( repo_id="LLM360/MegaMath", local_dir="./", repo_type="dataset", allow_patterns=["megamath-web/*"] )
下载高质量网络数据子集
snapshot_download( repo_id="LLM360/MegaMath", local_dir="./", repo_type="dataset", allow_patterns=["megamath-web-pro/*"] )
下载代码和合成数据
snapshot_download( repo_id="LLM360/MegaMath", local_dir="./", repo_type="dataset", allow_patterns=[ "megamath-qa/", "megamath-translated-code/", "megamath-text-code-block/", "megamath-code/" ] )
引用
bibtex @article{zhou2025megamath, title = {MegaMath: Pushing the Limits of Open Math Corpora}, author = {Zhou, Fan and Wang, Zengzhi and Ranjan, Nikhil and Cheng, Zhoujun and Tang, Liping and He, Guowei and Liu, Zhengzhong and Xing, Eric P.}, journal = {arXiv preprint arXiv:2504.02807}, year = {2025}, note = {Preprint} }




