chenggong commited on
Commit
4667cd9
·
verified ·
1 Parent(s): 4f2b7b7

Model save

Browse files
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Qwen/Qwen2.5-Math-7B
3
+ library_name: transformers
4
+ model_name: Qwen-2.5-Math-7B-test1
5
+ tags:
6
+ - generated_from_trainer
7
+ - trl
8
+ - grpo
9
+ licence: license
10
+ ---
11
+
12
+ # Model Card for Qwen-2.5-Math-7B-test1
13
+
14
+ This model is a fine-tuned version of [Qwen/Qwen2.5-Math-7B](https://huggingface.co/Qwen/Qwen2.5-Math-7B).
15
+ It has been trained using [TRL](https://github.com/huggingface/trl).
16
+
17
+ ## Quick start
18
+
19
+ ```python
20
+ from transformers import pipeline
21
+
22
+ question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
23
+ generator = pipeline("text-generation", model="chenggong1995/Qwen-2.5-Math-7B-test1", device="cuda")
24
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
25
+ print(output["generated_text"])
26
+ ```
27
+
28
+ ## Training procedure
29
+
30
+ [<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/gongc1995-city-university-of-hong-kong/huggingface/runs/o0kq9n2f)
31
+
32
+
33
+ This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://huggingface.co/papers/2402.03300).
34
+
35
+ ### Framework versions
36
+
37
+ - TRL: 0.16.0.dev0
38
+ - Transformers: 4.49.0
39
+ - Pytorch: 2.5.1
40
+ - Datasets: 3.3.2
41
+ - Tokenizers: 0.21.0
42
+
43
+ ## Citations
44
+
45
+ Cite GRPO as:
46
+
47
+ ```bibtex
48
+ @article{zhihong2024deepseekmath,
49
+ title = {{DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models}},
50
+ author = {Zhihong Shao and Peiyi Wang and Qihao Zhu and Runxin Xu and Junxiao Song and Mingchuan Zhang and Y. K. Li and Y. Wu and Daya Guo},
51
+ year = 2024,
52
+ eprint = {arXiv:2402.03300},
53
+ }
54
+
55
+ ```
56
+
57
+ Cite TRL as:
58
+
59
+ ```bibtex
60
+ @misc{vonwerra2022trl,
61
+ title = {{TRL: Transformer Reinforcement Learning}},
62
+ author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
63
+ year = 2020,
64
+ journal = {GitHub repository},
65
+ publisher = {GitHub},
66
+ howpublished = {\url{https://github.com/huggingface/trl}}
67
+ }
68
+ ```
all_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "total_flos": 0.0,
3
+ "train_loss": -0.0030980921536684037,
4
+ "train_runtime": 7058.3489,
5
+ "train_samples": 100,
6
+ "train_samples_per_second": 0.028,
7
+ "train_steps_per_second": 0.014
8
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "eos_token_id": 151643,
4
+ "max_new_tokens": 2048,
5
+ "transformers_version": "4.49.0"
6
+ }
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "total_flos": 0.0,
3
+ "train_loss": -0.0030980921536684037,
4
+ "train_runtime": 7058.3489,
5
+ "train_samples": 100,
6
+ "train_samples_per_second": 0.028,
7
+ "train_steps_per_second": 0.014
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 2.0,
5
+ "eval_steps": 49,
6
+ "global_step": 100,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "clip_ratio": 0.0,
13
+ "completion_length": 379.71429443359375,
14
+ "epoch": 0.02,
15
+ "grad_norm": 2.3801450729370117,
16
+ "kl": 0.0,
17
+ "learning_rate": 5e-08,
18
+ "loss": -0.0295,
19
+ "reward": 0.8928571939468384,
20
+ "reward_std": 0.26375192403793335,
21
+ "rewards/accuracy_reward": 0.8571429252624512,
22
+ "rewards/format_reward": 0.0,
23
+ "rewards/tag_count_reward": 0.0357142873108387,
24
+ "step": 1
25
+ },
26
+ {
27
+ "clip_ratio": 0.0,
28
+ "completion_length": 602.6250305175781,
29
+ "epoch": 0.1,
30
+ "grad_norm": 1.251340627670288,
31
+ "kl": 0.0002231597900390625,
32
+ "learning_rate": 2.5e-07,
33
+ "loss": -0.004,
34
+ "reward": 0.5044643133878708,
35
+ "reward_std": 0.4692006930708885,
36
+ "rewards/accuracy_reward": 0.5000000298023224,
37
+ "rewards/format_reward": 0.0,
38
+ "rewards/tag_count_reward": 0.004464285913854837,
39
+ "step": 5
40
+ },
41
+ {
42
+ "clip_ratio": 0.0,
43
+ "completion_length": 700.3143188476563,
44
+ "epoch": 0.2,
45
+ "grad_norm": 3.892239809036255,
46
+ "kl": 0.00029048919677734377,
47
+ "learning_rate": 5e-07,
48
+ "loss": -0.0521,
49
+ "reward": 0.5571428656578064,
50
+ "reward_std": 0.30040043592453003,
51
+ "rewards/accuracy_reward": 0.5285714507102967,
52
+ "rewards/format_reward": 0.0,
53
+ "rewards/tag_count_reward": 0.02857142984867096,
54
+ "step": 10
55
+ },
56
+ {
57
+ "clip_ratio": 0.0,
58
+ "completion_length": 622.2857299804688,
59
+ "epoch": 0.3,
60
+ "grad_norm": 1.9563440084457397,
61
+ "kl": 0.000347137451171875,
62
+ "learning_rate": 4.96201938253052e-07,
63
+ "loss": -0.0156,
64
+ "reward": 0.5642857372760772,
65
+ "reward_std": 0.4562141001224518,
66
+ "rewards/accuracy_reward": 0.5000000238418579,
67
+ "rewards/format_reward": 0.01428571492433548,
68
+ "rewards/tag_count_reward": 0.05000000074505806,
69
+ "step": 15
70
+ },
71
+ {
72
+ "clip_ratio": 0.0,
73
+ "completion_length": 623.8857543945312,
74
+ "epoch": 0.4,
75
+ "grad_norm": 3.7430624961853027,
76
+ "kl": 0.0006534576416015625,
77
+ "learning_rate": 4.849231551964771e-07,
78
+ "loss": -0.0311,
79
+ "reward": 0.5000000238418579,
80
+ "reward_std": 0.39751608967781066,
81
+ "rewards/accuracy_reward": 0.4428571581840515,
82
+ "rewards/format_reward": 0.01428571492433548,
83
+ "rewards/tag_count_reward": 0.04285714328289032,
84
+ "step": 20
85
+ },
86
+ {
87
+ "clip_ratio": 0.0,
88
+ "completion_length": 519.84287109375,
89
+ "epoch": 0.5,
90
+ "grad_norm": 2.7288520336151123,
91
+ "kl": 0.007835006713867188,
92
+ "learning_rate": 4.6650635094610966e-07,
93
+ "loss": 0.083,
94
+ "reward": 0.6428571701049804,
95
+ "reward_std": 0.4448284685611725,
96
+ "rewards/accuracy_reward": 0.5714285880327225,
97
+ "rewards/format_reward": 0.02857142984867096,
98
+ "rewards/tag_count_reward": 0.04285714626312256,
99
+ "step": 25
100
+ },
101
+ {
102
+ "clip_ratio": 0.0,
103
+ "completion_length": 572.8857360839844,
104
+ "epoch": 0.6,
105
+ "grad_norm": 8.5879487991333,
106
+ "kl": 0.0009708404541015625,
107
+ "learning_rate": 4.415111107797445e-07,
108
+ "loss": -0.056,
109
+ "reward": 0.8035714507102967,
110
+ "reward_std": 0.42971263229846957,
111
+ "rewards/accuracy_reward": 0.7142857491970063,
112
+ "rewards/format_reward": 0.01428571492433548,
113
+ "rewards/tag_count_reward": 0.07500000335276127,
114
+ "step": 30
115
+ },
116
+ {
117
+ "clip_ratio": 0.0,
118
+ "completion_length": 606.6429016113282,
119
+ "epoch": 0.7,
120
+ "grad_norm": 1.614426612854004,
121
+ "kl": 0.00061492919921875,
122
+ "learning_rate": 4.106969024216348e-07,
123
+ "loss": 0.0218,
124
+ "reward": 0.7428571701049804,
125
+ "reward_std": 0.49451608657836915,
126
+ "rewards/accuracy_reward": 0.6571428775787354,
127
+ "rewards/format_reward": 0.02857142984867096,
128
+ "rewards/tag_count_reward": 0.05714286118745804,
129
+ "step": 35
130
+ },
131
+ {
132
+ "clip_ratio": 0.0,
133
+ "completion_length": 659.6000305175781,
134
+ "epoch": 0.8,
135
+ "grad_norm": 0.00019049388356506824,
136
+ "kl": 0.008877372741699219,
137
+ "learning_rate": 3.75e-07,
138
+ "loss": 0.0187,
139
+ "reward": 0.45714287757873534,
140
+ "reward_std": 0.3365379124879837,
141
+ "rewards/accuracy_reward": 0.4285714507102966,
142
+ "rewards/format_reward": 0.0,
143
+ "rewards/tag_count_reward": 0.02857142984867096,
144
+ "step": 40
145
+ },
146
+ {
147
+ "clip_ratio": 0.0,
148
+ "completion_length": 681.0714599609375,
149
+ "epoch": 0.9,
150
+ "grad_norm": 3.8056037425994873,
151
+ "kl": 0.0019466400146484375,
152
+ "learning_rate": 3.355050358314172e-07,
153
+ "loss": 0.0472,
154
+ "reward": 0.5178571701049804,
155
+ "reward_std": 0.3290700912475586,
156
+ "rewards/accuracy_reward": 0.4571428894996643,
157
+ "rewards/format_reward": 0.0,
158
+ "rewards/tag_count_reward": 0.06071428954601288,
159
+ "step": 45
160
+ },
161
+ {
162
+ "epoch": 0.98,
163
+ "eval_clip_ratio": 0.0,
164
+ "eval_completion_length": 594.2248850097657,
165
+ "eval_kl": 0.003310443878173828,
166
+ "eval_loss": -0.02919997088611126,
167
+ "eval_reward": 0.534714311145246,
168
+ "eval_reward_std": 0.3895806306153536,
169
+ "eval_rewards/accuracy_reward": 0.4940000242590904,
170
+ "eval_rewards/format_reward": 0.006000000268220901,
171
+ "eval_rewards/tag_count_reward": 0.03471428740769625,
172
+ "eval_runtime": 2236.5694,
173
+ "eval_samples_per_second": 0.224,
174
+ "eval_steps_per_second": 0.016,
175
+ "step": 49
176
+ },
177
+ {
178
+ "clip_ratio": 0.0,
179
+ "completion_length": 594.1571655273438,
180
+ "epoch": 1.0,
181
+ "grad_norm": 0.0004400305333547294,
182
+ "kl": 0.001186370849609375,
183
+ "learning_rate": 2.934120444167326e-07,
184
+ "loss": -0.0472,
185
+ "reward": 0.4107142984867096,
186
+ "reward_std": 0.2270268350839615,
187
+ "rewards/accuracy_reward": 0.40000001192092893,
188
+ "rewards/format_reward": 0.0,
189
+ "rewards/tag_count_reward": 0.01071428656578064,
190
+ "step": 50
191
+ },
192
+ {
193
+ "clip_ratio": 0.0,
194
+ "completion_length": 699.0428955078125,
195
+ "epoch": 1.1,
196
+ "grad_norm": 0.6008018851280212,
197
+ "kl": 0.0012775421142578124,
198
+ "learning_rate": 2.5e-07,
199
+ "loss": -0.0518,
200
+ "reward": 0.5821428835391999,
201
+ "reward_std": 0.44157396256923676,
202
+ "rewards/accuracy_reward": 0.5428571760654449,
203
+ "rewards/format_reward": 0.01428571492433548,
204
+ "rewards/tag_count_reward": 0.02500000111758709,
205
+ "step": 55
206
+ },
207
+ {
208
+ "clip_ratio": 0.0,
209
+ "completion_length": 676.3571655273438,
210
+ "epoch": 1.2,
211
+ "grad_norm": 0.7341341376304626,
212
+ "kl": 0.0003894805908203125,
213
+ "learning_rate": 2.065879555832674e-07,
214
+ "loss": -0.0145,
215
+ "reward": 0.6964286088943481,
216
+ "reward_std": 0.32321630120277406,
217
+ "rewards/accuracy_reward": 0.685714328289032,
218
+ "rewards/format_reward": 0.0,
219
+ "rewards/tag_count_reward": 0.010714286193251609,
220
+ "step": 60
221
+ },
222
+ {
223
+ "clip_ratio": 0.0,
224
+ "completion_length": 484.5143188476562,
225
+ "epoch": 1.3,
226
+ "grad_norm": 2.903294086456299,
227
+ "kl": 0.003038787841796875,
228
+ "learning_rate": 1.6449496416858282e-07,
229
+ "loss": -0.0505,
230
+ "reward": 0.6428571611642837,
231
+ "reward_std": 0.3603375285863876,
232
+ "rewards/accuracy_reward": 0.5857143193483353,
233
+ "rewards/format_reward": 0.02857142984867096,
234
+ "rewards/tag_count_reward": 0.02857142984867096,
235
+ "step": 65
236
+ },
237
+ {
238
+ "clip_ratio": 0.0,
239
+ "completion_length": 664.8000244140625,
240
+ "epoch": 1.4,
241
+ "grad_norm": 10.34648609161377,
242
+ "kl": 0.0013919830322265624,
243
+ "learning_rate": 1.2500000000000005e-07,
244
+ "loss": 0.0629,
245
+ "reward": 0.4928571581840515,
246
+ "reward_std": 0.5296794831752777,
247
+ "rewards/accuracy_reward": 0.45714287757873534,
248
+ "rewards/format_reward": 0.01428571492433548,
249
+ "rewards/tag_count_reward": 0.021428572386503218,
250
+ "step": 70
251
+ },
252
+ {
253
+ "clip_ratio": 0.0,
254
+ "completion_length": 597.857177734375,
255
+ "epoch": 1.5,
256
+ "grad_norm": 1.6099767684936523,
257
+ "kl": 0.0036956787109375,
258
+ "learning_rate": 8.930309757836516e-08,
259
+ "loss": 0.0399,
260
+ "reward": 0.4571428716182709,
261
+ "reward_std": 0.3776773989200592,
262
+ "rewards/accuracy_reward": 0.4571428716182709,
263
+ "rewards/format_reward": 0.0,
264
+ "rewards/tag_count_reward": 0.0,
265
+ "step": 75
266
+ },
267
+ {
268
+ "clip_ratio": 0.0,
269
+ "completion_length": 570.3000366210938,
270
+ "epoch": 1.6,
271
+ "grad_norm": 0.7647049427032471,
272
+ "kl": 0.0009387969970703125,
273
+ "learning_rate": 5.848888922025552e-08,
274
+ "loss": -0.0569,
275
+ "reward": 0.6071428894996643,
276
+ "reward_std": 0.3395166456699371,
277
+ "rewards/accuracy_reward": 0.5714285969734192,
278
+ "rewards/format_reward": 0.0,
279
+ "rewards/tag_count_reward": 0.035714288055896756,
280
+ "step": 80
281
+ },
282
+ {
283
+ "clip_ratio": 0.0,
284
+ "completion_length": 619.4714538574219,
285
+ "epoch": 1.7,
286
+ "grad_norm": 1.8258100748062134,
287
+ "kl": 0.002353668212890625,
288
+ "learning_rate": 3.349364905389032e-08,
289
+ "loss": 0.0276,
290
+ "reward": 0.44642859399318696,
291
+ "reward_std": 0.27503437697887423,
292
+ "rewards/accuracy_reward": 0.4428571656346321,
293
+ "rewards/format_reward": 0.0,
294
+ "rewards/tag_count_reward": 0.00357142873108387,
295
+ "step": 85
296
+ },
297
+ {
298
+ "clip_ratio": 0.0,
299
+ "completion_length": 535.4000244140625,
300
+ "epoch": 1.8,
301
+ "grad_norm": 3.521362066268921,
302
+ "kl": 0.0031871795654296875,
303
+ "learning_rate": 1.507684480352292e-08,
304
+ "loss": 0.0045,
305
+ "reward": 0.5464286029338836,
306
+ "reward_std": 0.48063153624534605,
307
+ "rewards/accuracy_reward": 0.5000000238418579,
308
+ "rewards/format_reward": 0.01428571492433548,
309
+ "rewards/tag_count_reward": 0.03214285895228386,
310
+ "step": 90
311
+ },
312
+ {
313
+ "clip_ratio": 0.0,
314
+ "completion_length": 741.9714477539062,
315
+ "epoch": 1.9,
316
+ "grad_norm": 2.457162857055664,
317
+ "kl": 0.0006832122802734375,
318
+ "learning_rate": 3.798061746947995e-09,
319
+ "loss": 0.0415,
320
+ "reward": 0.5500000238418579,
321
+ "reward_std": 0.369550421833992,
322
+ "rewards/accuracy_reward": 0.5285714507102967,
323
+ "rewards/format_reward": 0.0,
324
+ "rewards/tag_count_reward": 0.02142857201397419,
325
+ "step": 95
326
+ },
327
+ {
328
+ "epoch": 1.96,
329
+ "eval_clip_ratio": 0.0,
330
+ "eval_completion_length": 588.6673402709961,
331
+ "eval_kl": 0.004097911834716797,
332
+ "eval_loss": -0.02776484563946724,
333
+ "eval_reward": 0.5458571693897247,
334
+ "eval_reward_std": 0.39641910094022753,
335
+ "eval_rewards/accuracy_reward": 0.5062857375442982,
336
+ "eval_rewards/format_reward": 0.006285714566707611,
337
+ "eval_rewards/tag_count_reward": 0.03328571600466967,
338
+ "eval_runtime": 2226.3251,
339
+ "eval_samples_per_second": 0.225,
340
+ "eval_steps_per_second": 0.016,
341
+ "step": 98
342
+ },
343
+ {
344
+ "clip_ratio": 0.0,
345
+ "completion_length": 761.4000244140625,
346
+ "epoch": 2.0,
347
+ "grad_norm": 0.7996540069580078,
348
+ "kl": 0.0015918731689453125,
349
+ "learning_rate": 0.0,
350
+ "loss": -0.0241,
351
+ "reward": 0.6500000298023224,
352
+ "reward_std": 0.4324204444885254,
353
+ "rewards/accuracy_reward": 0.5571428954601287,
354
+ "rewards/format_reward": 0.042857144773006436,
355
+ "rewards/tag_count_reward": 0.05000000223517418,
356
+ "step": 100
357
+ },
358
+ {
359
+ "epoch": 2.0,
360
+ "step": 100,
361
+ "total_flos": 0.0,
362
+ "train_loss": -0.0030980921536684037,
363
+ "train_runtime": 7058.3489,
364
+ "train_samples_per_second": 0.028,
365
+ "train_steps_per_second": 0.014
366
+ }
367
+ ],
368
+ "logging_steps": 5,
369
+ "max_steps": 100,
370
+ "num_input_tokens_seen": 0,
371
+ "num_train_epochs": 2,
372
+ "save_steps": 500,
373
+ "stateful_callbacks": {
374
+ "TrainerControl": {
375
+ "args": {
376
+ "should_epoch_stop": false,
377
+ "should_evaluate": false,
378
+ "should_log": false,
379
+ "should_save": true,
380
+ "should_training_stop": true
381
+ },
382
+ "attributes": {}
383
+ }
384
+ },
385
+ "total_flos": 0.0,
386
+ "train_batch_size": 2,
387
+ "trial_name": null,
388
+ "trial_params": null
389
+ }