yuccaaa commited on
Commit
f480c6b
·
verified ·
1 Parent(s): f36064f

Upload nan/math_thinking/README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. nan/math_thinking/README.md +171 -0
nan/math_thinking/README.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ configs:
6
+ - config_name: all
7
+ data_files:
8
+ - split: train
9
+ path: all/train-*
10
+ - config_name: default
11
+ data_files:
12
+ - split: train
13
+ path: data/train-*
14
+ - config_name: extended
15
+ data_files:
16
+ - split: train
17
+ path: extended/train-*
18
+ dataset_info:
19
+ - config_name: all
20
+ features:
21
+ - name: problem
22
+ dtype: string
23
+ - name: solution
24
+ dtype: string
25
+ - name: answer
26
+ dtype: string
27
+ - name: problem_type
28
+ dtype: string
29
+ - name: question_type
30
+ dtype: string
31
+ - name: source
32
+ dtype: string
33
+ - name: uuid
34
+ dtype: string
35
+ - name: is_reasoning_complete
36
+ sequence: bool
37
+ - name: generations
38
+ sequence: string
39
+ - name: correctness_math_verify
40
+ sequence: bool
41
+ - name: correctness_llama
42
+ sequence: bool
43
+ - name: finish_reasons
44
+ sequence: string
45
+ - name: correctness_count
46
+ dtype: int64
47
+ - name: messages
48
+ list:
49
+ - name: content
50
+ dtype: string
51
+ - name: role
52
+ dtype: string
53
+ splits:
54
+ - name: train
55
+ num_bytes: 9734110026.0
56
+ num_examples: 225129
57
+ download_size: 4221672067
58
+ dataset_size: 9734110026.0
59
+ - config_name: default
60
+ features:
61
+ - name: problem
62
+ dtype: string
63
+ - name: solution
64
+ dtype: string
65
+ - name: answer
66
+ dtype: string
67
+ - name: problem_type
68
+ dtype: string
69
+ - name: question_type
70
+ dtype: string
71
+ - name: source
72
+ dtype: string
73
+ - name: uuid
74
+ dtype: string
75
+ - name: is_reasoning_complete
76
+ sequence: bool
77
+ - name: generations
78
+ sequence: string
79
+ - name: correctness_math_verify
80
+ sequence: bool
81
+ - name: correctness_llama
82
+ sequence: bool
83
+ - name: finish_reasons
84
+ sequence: string
85
+ - name: correctness_count
86
+ dtype: int64
87
+ - name: messages
88
+ list:
89
+ - name: content
90
+ dtype: string
91
+ - name: role
92
+ dtype: string
93
+ splits:
94
+ - name: train
95
+ num_bytes: 4964543659
96
+ num_examples: 93733
97
+ download_size: 2149897914
98
+ dataset_size: 4964543659
99
+ - config_name: extended
100
+ features:
101
+ - name: problem
102
+ dtype: string
103
+ - name: solution
104
+ dtype: string
105
+ - name: answer
106
+ dtype: string
107
+ - name: problem_type
108
+ dtype: string
109
+ - name: question_type
110
+ dtype: string
111
+ - name: source
112
+ dtype: string
113
+ - name: uuid
114
+ dtype: string
115
+ - name: is_reasoning_complete
116
+ sequence: bool
117
+ - name: generations
118
+ sequence: string
119
+ - name: correctness_math_verify
120
+ sequence: bool
121
+ - name: correctness_llama
122
+ sequence: bool
123
+ - name: finish_reasons
124
+ sequence: string
125
+ - name: correctness_count
126
+ dtype: int64
127
+ - name: messages
128
+ list:
129
+ - name: content
130
+ dtype: string
131
+ - name: role
132
+ dtype: string
133
+ splits:
134
+ - name: train
135
+ num_bytes: 4769566550
136
+ num_examples: 131396
137
+ download_size: 2063936457
138
+ dataset_size: 4769566550
139
+ ---
140
+
141
+
142
+ # OpenR1-Math-220k
143
+
144
+ ## Dataset description
145
+ OpenR1-Math-220k is a large-scale dataset for mathematical reasoning. It consists of 220k math problems with two to four reasoning traces generated by [DeepSeek R1](https://huggingface.co/deepseek-ai/DeepSeek-R1) for problems from NuminaMath 1.5.
146
+ The traces were verified using [Math Verify](https://github.com/huggingface/Math-Verify) for most samples and [Llama-3.3-70B-Instruct](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct) as a judge for 12% of the samples, and each problem contains at least one reasoning trace with a correct answer.
147
+
148
+ The dataset consists of two splits:
149
+ - `default` with 94k problems and that achieves the best performance after SFT.
150
+ - `extended` with 131k samples where we add data sources like `cn_k12`. This provides more reasoning traces, but we found that the performance after SFT to be lower than the `default` subset, likely because the questions from `cn_k12` are less difficult than other sources.
151
+
152
+ You can load the dataset as follows:
153
+
154
+ ```python
155
+ from datasets import load_dataset
156
+
157
+ ds = load_dataset("open-r1/OpenR1-Math-220k", "default")
158
+ ```
159
+
160
+ ## Dataset curation
161
+ To build OpenR1-Math-220k, we prompt [DeepSeek R1](https://huggingface.co/deepseek-ai/DeepSeek-R1) model to generate solutions for 400k problems from [NuminaMath 1.5](https://huggingface.co/datasets/AI-MO/NuminaMath-1.5) using [SGLang](https://github.com/sgl-project/sglang), the generation code is available [here](https://github.com/huggingface/open-r1/tree/main/slurm). We follow the model card’s recommended generation parameters and prepend the following instruction to the user prompt:
162
+
163
+ `"Please reason step by step, and put your final answer within \boxed{}."`
164
+
165
+ We set a 16k token limit per generation, as our analysis showed that only 75% of problems could be solved in under 8k tokens, and most of the remaining problems required the full 16k tokens. We were able to generate 25 solutions per hour per H100, enabling us to generate 300k problem solutions per day on 512 H100s.
166
+
167
+ We generate two solutions per problem—and in some cases, four—to provide flexibility in filtering and training. This approach allows for rejection sampling, similar to DeepSeek R1’s methodology, and also makes the dataset suitable for preference optimisation methods like DPO.
168
+
169
+ ## License
170
+ The dataset is licensed under Apache 2.0
171
+