Commit ·
ad42b89
0
Parent(s):
Duplicate from zwhe99/DeepMath-103K
Browse filesCo-authored-by: Zhiwei He <zwhe99@users.noreply.huggingface.co>
Files changed (18)
- .gitattributesAdded+59
- README.mdAdded+212
- assets/github-contamination-case.pngAdded
- assets/github-data-sample.pngAdded
- assets/github-difficulty.pngAdded
- assets/github-domain.pngAdded
- assets/github-main.pngAdded
- assets/github-tsne.pngAdded
- data/train-00000-of-00010.parquetAdded+3
- data/train-00001-of-00010.parquetAdded+3
- data/train-00002-of-00010.parquetAdded+3
- data/train-00003-of-00010.parquetAdded+3
- data/train-00004-of-00010.parquetAdded+3
- data/train-00005-of-00010.parquetAdded+3
- data/train-00006-of-00010.parquetAdded+3
- data/train-00007-of-00010.parquetAdded+3
- data/train-00008-of-00010.parquetAdded+3
- data/train-00009-of-00010.parquetAdded+3
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.lz4 filter=lfs diff=lfs merge=lfs -text*.mds filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text# Audio files - uncompressed*.pcm filter=lfs diff=lfs merge=lfs -text*.sam filter=lfs diff=lfs merge=lfs -text*.raw filter=lfs diff=lfs merge=lfs -text# Audio files - compressed*.aac filter=lfs diff=lfs merge=lfs -text*.flac filter=lfs diff=lfs merge=lfs -text*.mp3 filter=lfs diff=lfs merge=lfs -text*.ogg filter=lfs diff=lfs merge=lfs -text*.wav filter=lfs diff=lfs merge=lfs -text# Image files - uncompressed*.bmp filter=lfs diff=lfs merge=lfs -text*.gif filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.tiff filter=lfs diff=lfs merge=lfs -text# Image files - compressed*.jpg filter=lfs diff=lfs merge=lfs -text*.jpeg filter=lfs diff=lfs merge=lfs -text*.webp filter=lfs diff=lfs merge=lfs -text# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212---license: mitconfigs:- config_name: default data_files: - split: train path: data/train-*dataset_info: features: - name: question dtype: string - name: final_answer dtype: string - name: difficulty dtype: float64 - name: topic dtype: string - name: r1_solution_1 dtype: string - name: r1_solution_2 dtype: string - name: r1_solution_3 dtype: string splits: - name: train num_bytes: 4959744761.05883 num_examples: 103022 download_size: 2136106260 dataset_size: 4959744761.05883task_categories:- text-generation- text2text-generationlanguage:- entags:- math- reasoning- rlpretty_name: deepmath-103ksize_categories:- 100K<n<1M---# DeepMath-103K<table> <tr> <td style="padding: 0;"> <a href="https://huggingface.co/datasets/zwhe99/DeepMath-103K"> <img src="https://img.shields.io/badge/Data-4d5eff?style=for-the-badge&logo=huggingface&logoColor=ffffff&labelColor" alt="Data"> </a> </td> <td style="padding: 0;"> <a href="https://huggingface.co/collections/zwhe99/deepmath-6816e139b7f467f21a459a9a"> <img src="https://img.shields.io/badge/Model-4d5eff?style=for-the-badge&logo=huggingface&logoColor=ffffff&labelColor" alt="Data"> </a> </td> <td style="padding: 0;"> <a href="https://github.com/zwhe99/DeepMath"> <img src="https://img.shields.io/badge/Code-000000?style=for-the-badge&logo=github&logoColor=white" alt="Code"> </a> </td> <td style="padding: 0;"> <a href="https://arxiv.org/abs/2504.11456"> <img src="https://img.shields.io/badge/arXiv-2504.11456-b31b1b.svg?style=for-the-badge" alt="arXiv"> </a> </td> </tr></table>
## 🔥 News- **May 8, 2025**: We found that 48 samples contained hints that revealed the answers. The relevant questions have now been revised to remove the leaked answers.- **April 14, 2025**: We release **`DeepMath-103K`**, a large-scale dataset featuring challenging, verifiable, and decontaminated math problems tailored for RL and SFT. We open source:
## 📦 Resource
- 🤗 Training data: [`DeepMath-103K`](https://huggingface.co/datasets/zwhe99/DeepMath-103K)- 🤗 Model weights: [`DeepMath-Zero-7B`](https://huggingface.co/zwhe99/DeepMath-Zero-7B), [`DeepMath-Zero-Math-7B`](https://huggingface.co/zwhe99/DeepMath-Zero-Math-7B), [`DeepMath-1.5B`](https://huggingface.co/zwhe99/DeepMath-1.5B), [`DeepMath-Omn-1.5B`](https://huggingface.co/zwhe99/DeepMath-Omn-1.5B)- 💻 Code: [`DeepMath`](https://github.com/zwhe99/DeepMath)- 📝 Paper: [`arXiv:2504.11456`](https://arxiv.org/abs/2504.11456)
## 📖 Overview
**`DeepMath-103K`** is meticulously curated to push the boundaries of mathematical reasoning in language models. Key features include:
**1. Challenging Problems**: DeepMath-103K has a strong focus on difficult mathematical problems (primarily Levels 5-9), significantly raising the complexity bar compared to many existing open datasets.
<div align="center"> <img src="./assets/github-difficulty.png" width="600"/>
<sub>Difficulty distribution comparison.</sub> </div>
**2. Data Diversity and Novelty**: DeepMath-103K spans a wide spectrum of mathematical subjects, including Algebra, Calculus, Number Theory, Geometry, Probability, and Discrete Mathematics.
<div align="center"> <img src="./assets/github-domain.png" width="400"/>
<sub>Hierarchical breakdown of mathematical topics covered in DeepMath-103K.</sub></div>
The problems in DeepMath-103K are novel and unique, whereas many existing datasets are similar and overlap.<div align="center"> <img src="./assets/github-tsne.png" width="600"/>
<sub>Embedding distributions of different datasets.</sub></div>
**3. Rigorous Decontamination**: Built from diverse sources, DeepMath-103K underwent meticulous decontamination against common benchmarks using semantic matching. This minimizes test set leakage and promotes fair model evaluation.
<div align="center"> <img src="./assets/github-contamination-case.png" width="600"/>
<sub>Detected contamination examples. Subtle conceptual overlaps can also be identified.</sub> </div>
**4. Rich Data Format**: Each sample in DeepMath-103K is structured with rich information to support various research applications:
<div align="center"> <img src="./assets/github-data-sample.png" width="600"/>
<sub>An example data sample from DeepMath-103K.</sub> </div>
- **Question**: The mathematical problem statement.- **Final Answer**: A reliably verifiable final answer, enabling robust rule-based reward functions for RL.- **Difficulty**: A numerical score for difficulty-aware training or analysis.- **Topic**: Hierarchical classification for topic-specific applications.- **R1 Solutions**: Three distinct reasoning paths from DeepSeek-R1, valuable for supervised fine-tuning (SFT) or knowledge distillation.
## 📊Main Results
DeepMath serise models achieve many **SOTA** results on challenging math benchmarks:
<div align="center"> <img src="./assets/github-main.png" width="100%"/>
<sub>Math reasoning performance.</sub> </div>
## 🎯Quick Start
#### Environment Preparation
```shellgit clone --recurse-submodules https://github.com/zwhe99/DeepMath.git && cd DeepMath
conda create -y -n deepmath python=3.12.2 && conda activate deepmathpip3 install ray[default]pip3 install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124pip3 install flash-attn==2.7.4.post1 --no-build-isolationpip3 install omegaconf==2.4.0.dev3 hydra-core==1.4.0.dev1 antlr4-python3-runtime==4.11.0 vllm==0.7.3pip3 install math-verify[antlr4_11_0]==0.7.0 fire deepspeed tensorboardX prettytable datasets transformers==4.49.0pip3 install -e verl```
#### Evaluation
```shellVLLM_ALLOW_LONG_MAX_MODEL_LEN=1 VLLM_ATTENTION_BACKEND=XFORMERS VLLM_USE_V1=1 VLLM_WORKER_MULTIPROC_METHOD=spawn python3 uni_eval.py \ --base_model zwhe99/DeepMath-Zero-7B \ --chat_template_name orz \ --system_prompt_name simplerl \ --output_dir \ --bf16 True \ --tensor_parallel_size 8 \ --data_id zwhe99/MATH \ --split math500 \ --max_model_len 32768 \ --temperature 0.6 \ --top_p 0.95 \ --n 16```
#### Training
* Data Preparation
```shell DATA_DIR=/path/to/your/data python3 verl/examples/data_preprocess/deepmath_103k.py --local_dir $DATA_DIR ```
* Start Ray
```shell # Head node (×1) ray start --head --port=6379 --node-ip-address=$HEAD_ADDR --num-gpus=8 # Worker nodes (×7 or ×11) ray start --address=$HEAD_ADDR:6379 --node-ip-address=$WORKER_ADDR --num-gpus=8 ```
* Launch training at head node. See `scripts/train` for training scripts.
## 🙏 Acknowledgements
This work can not be done without the help of the following works:
- **[verl](https://github.com/volcengine/verl)**: A very fast reinforcement learning framework.- **[Vivacem/MMIQC](https://huggingface.co/datasets/Vivacem/MMIQC)**: A mixture of question-response pairs extracted from Mathematics Stack Exchange pages.- **[TIGER-Lab/WebInstructSub](https://huggingface.co/datasets/TIGER-Lab/WebInstructSub)**: Instruction data from MathStackExchange and ScienceStackExchange.- **[AI-MO/NuminaMath-CoT](https://huggingface.co/datasets/AI-MO/NuminaMath-CoT)**: Approximately 860k math problems.
## 📚 Citation```bibtex@article{deepmath, title={DeepMath-103K: A Large-Scale, Challenging, Decontaminated, and Verifiable Mathematical Dataset for Advancing Reasoning}, author={He, Zhiwei and Liang, Tian and Xu, Jiahao and Liu, Qiuzhi and Chen, Xingyu and Wang, Yue and Song, Linfeng and Yu, Dian and Liang, Zhenwen and Wang, Wenxuan and Zhang, Zhuosheng and Wang, Rui and Tu, Zhaopeng and Mi, Haitao and Yu, Dong}, year={2025}, eprint={2504.11456}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2504.11456}, }```123version https://git-lfs.github.com/spec/v1oid sha256:d6412432f30425e848a224dc641e681eb1ed51b970d52536eda7daefc01d8c8bsize 216818587123version https://git-lfs.github.com/spec/v1oid sha256:eef9d3012456239eb0f4cd462ac7bebb7d6c4f675c41329c680ef8a506ded512size 212374597123version https://git-lfs.github.com/spec/v1oid sha256:20e4dc6527d94c2057a9b727f8b58994395de602e284b3294f7d2451f75d681asize 213616309123version https://git-lfs.github.com/spec/v1oid sha256:c5b20135f93e7890da191973ad77d88e67c95144ccc169ec592489f044e7c38asize 208137532123version https://git-lfs.github.com/spec/v1oid sha256:4153e531d78ca278d2e12e6d08099b66126b26b99ca6a92b3d6f95c156818749size 207032084123version https://git-lfs.github.com/spec/v1oid sha256:110586bdc6f35b0434bccbd582f1e97e8328da0752ccd36590a50178885f0360size 207744721123version https://git-lfs.github.com/spec/v1oid sha256:e39c00ed42a6a1af74ddc042840884a59adcb9139a23f535e399ddf0c292ef76size 207048095123version https://git-lfs.github.com/spec/v1oid sha256:fdeb213b5c2d0bb50f1081ae48b7ce4fa38147efe623de5d6d836a32f4044dadsize 207374607123version https://git-lfs.github.com/spec/v1oid sha256:d8e5b1417f0364312896d259efbea0600c1fac22eacb2f71187c5b0e9704f388size 273432098123version https://git-lfs.github.com/spec/v1oid sha256:67639c6620cabce348e91c2cc331c4877307ed1a5d8fbd1c0d7dcca561cea8dfsize 182527630.gitattributesAdded+59
README.mdAdded+212
assets/github-contamination-case.pngAdded

Large File Pointer Details
- SHA256: ee68cf8039b340bf7f966b5524ddf6807ac70256d20e7ffc55bc7f0025725c0f
- Pointer size: 131 Bytes
- Size of remote file: 496 kB
assets/github-data-sample.pngAdded

Large File Pointer Details
- SHA256: c73b736a266f868ae7b065b2732911576d609c0612c724e7ba8fe86fa2409ed0
- Pointer size: 132 Bytes
- Size of remote file: 2.86 MB
assets/github-difficulty.pngAdded

Large File Pointer Details
- SHA256: 0460f9f283958ac9f3024208eb498d978cd0b1cb7cad5dc93e7207f09c1d2b8c
- Pointer size: 131 Bytes
- Size of remote file: 257 kB
assets/github-domain.pngAdded

Large File Pointer Details
- SHA256: c0c3699f642bd1b5a59686d22bc71cc9fb0c4564154e142a8b26eb0abff6181e
- Pointer size: 132 Bytes
- Size of remote file: 2.69 MB
assets/github-main.pngAdded

Large File Pointer Details
- SHA256: a5e580dcd1607eec727bb971d20fddcc6fe55e53c252b2375a2904bf11b1a2b9
- Pointer size: 131 Bytes
- Size of remote file: 654 kB
assets/github-tsne.pngAdded

Large File Pointer Details
- SHA256: 4e2991c03a9481762a7b56369d3b479115644f98442eb09b3765d1491dad6013
- Pointer size: 132 Bytes
- Size of remote file: 3.06 MB
data/train-00000-of-00010.parquetAdded+3
data/train-00001-of-00010.parquetAdded+3
data/train-00002-of-00010.parquetAdded+3
data/train-00003-of-00010.parquetAdded+3
data/train-00004-of-00010.parquetAdded+3
data/train-00005-of-00010.parquetAdded+3
data/train-00006-of-00010.parquetAdded+3
data/train-00007-of-00010.parquetAdded+3
data/train-00008-of-00010.parquetAdded+3
data/train-00009-of-00010.parquetAdded+3