RichardErkhov commited on
Commit
1d786a1
·
verified ·
1 Parent(s): a9ea90c

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +229 -0
README.md ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ dart-math-llama3-8b-prop2diff - GGUF
11
+ - Model creator: https://huggingface.co/hkust-nlp/
12
+ - Original model: https://huggingface.co/hkust-nlp/dart-math-llama3-8b-prop2diff/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [dart-math-llama3-8b-prop2diff.Q2_K.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q2_K.gguf) | Q2_K | 2.96GB |
18
+ | [dart-math-llama3-8b-prop2diff.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.IQ3_XS.gguf) | IQ3_XS | 3.28GB |
19
+ | [dart-math-llama3-8b-prop2diff.IQ3_S.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.IQ3_S.gguf) | IQ3_S | 3.43GB |
20
+ | [dart-math-llama3-8b-prop2diff.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q3_K_S.gguf) | Q3_K_S | 3.41GB |
21
+ | [dart-math-llama3-8b-prop2diff.IQ3_M.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.IQ3_M.gguf) | IQ3_M | 3.53GB |
22
+ | [dart-math-llama3-8b-prop2diff.Q3_K.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q3_K.gguf) | Q3_K | 3.74GB |
23
+ | [dart-math-llama3-8b-prop2diff.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q3_K_M.gguf) | Q3_K_M | 3.74GB |
24
+ | [dart-math-llama3-8b-prop2diff.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q3_K_L.gguf) | Q3_K_L | 4.03GB |
25
+ | [dart-math-llama3-8b-prop2diff.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.IQ4_XS.gguf) | IQ4_XS | 4.18GB |
26
+ | [dart-math-llama3-8b-prop2diff.Q4_0.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q4_0.gguf) | Q4_0 | 4.34GB |
27
+ | [dart-math-llama3-8b-prop2diff.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.IQ4_NL.gguf) | IQ4_NL | 4.38GB |
28
+ | [dart-math-llama3-8b-prop2diff.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q4_K_S.gguf) | Q4_K_S | 4.37GB |
29
+ | [dart-math-llama3-8b-prop2diff.Q4_K.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q4_K.gguf) | Q4_K | 4.58GB |
30
+ | [dart-math-llama3-8b-prop2diff.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q4_K_M.gguf) | Q4_K_M | 4.58GB |
31
+ | [dart-math-llama3-8b-prop2diff.Q4_1.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q4_1.gguf) | Q4_1 | 4.78GB |
32
+ | [dart-math-llama3-8b-prop2diff.Q5_0.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q5_0.gguf) | Q5_0 | 5.22GB |
33
+ | [dart-math-llama3-8b-prop2diff.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q5_K_S.gguf) | Q5_K_S | 5.22GB |
34
+ | [dart-math-llama3-8b-prop2diff.Q5_K.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q5_K.gguf) | Q5_K | 5.34GB |
35
+ | [dart-math-llama3-8b-prop2diff.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q5_K_M.gguf) | Q5_K_M | 5.34GB |
36
+ | [dart-math-llama3-8b-prop2diff.Q5_1.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q5_1.gguf) | Q5_1 | 5.65GB |
37
+ | [dart-math-llama3-8b-prop2diff.Q6_K.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q6_K.gguf) | Q6_K | 6.14GB |
38
+ | [dart-math-llama3-8b-prop2diff.Q8_0.gguf](https://huggingface.co/RichardErkhov/hkust-nlp_-_dart-math-llama3-8b-prop2diff-gguf/blob/main/dart-math-llama3-8b-prop2diff.Q8_0.gguf) | Q8_0 | 7.95GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ language:
46
+ - en
47
+ license: llama3
48
+ library_name: transformers
49
+ tags:
50
+ - mathematics
51
+ datasets:
52
+ - hkust-nlp/dart-math-hard
53
+ metrics:
54
+ - accuracy
55
+ pipeline_tag: text-generation
56
+ base_model: meta-llama/Meta-Llama-3-8B
57
+ model-index:
58
+ - name: dart-math-llama3-8b-prop2diff
59
+ results:
60
+ - task:
61
+ type: text-generation
62
+ name: Mathematical Problem-Solving
63
+ dataset:
64
+ type: hendrycks/competition_math
65
+ name: MATH
66
+ split: test
67
+ metrics:
68
+ - type: accuracy
69
+ name: Pass@1 (0-shot CoT)
70
+ value: 46.6
71
+ - task:
72
+ type: text-generation
73
+ name: Mathematical Problem-Solving
74
+ dataset:
75
+ type: openai/gsm8k
76
+ name: GSM8K
77
+ config: main
78
+ split: test
79
+ metrics:
80
+ - type: accuracy
81
+ name: Pass@1 (0-shot CoT)
82
+ value: 81.1
83
+ - task:
84
+ type: text-generation
85
+ name: Mathematical Problem-Solving
86
+ dataset:
87
+ type: college-math
88
+ name: CollegeMath
89
+ metrics:
90
+ - type: accuracy
91
+ name: Pass@1 (0-shot CoT)
92
+ value: 28.8
93
+ - task:
94
+ type: text-generation
95
+ name: Mathematical Problem-Solving
96
+ dataset:
97
+ type: deepmind-mathematics
98
+ name: DeepMind-Mathematics
99
+ metrics:
100
+ - type: accuracy
101
+ name: Pass@1 (0-shot CoT)
102
+ value: 48.0
103
+ - task:
104
+ type: text-generation
105
+ name: Mathematical Problem-Solving
106
+ dataset:
107
+ type: Hothan/OlympiadBench
108
+ name: OlympiadBench-OE_TO_maths_en_COMP
109
+ config: OE_TO_maths_en_COMP
110
+ split: train
111
+ metrics:
112
+ - type: accuracy
113
+ name: Pass@1 (0-shot CoT)
114
+ value: 14.5
115
+ - task:
116
+ type: text-generation
117
+ name: Mathematical Problem-Solving
118
+ dataset:
119
+ type: TIGER-Lab/TheoremQA
120
+ name: TheoremQA
121
+ split: test
122
+ metrics:
123
+ - type: accuracy
124
+ name: Pass@1 (0-shot CoT)
125
+ value: 19.4
126
+ ---
127
+
128
+ # DART-Math: Difficulty-Aware Rejection Tuning for Mathematical Problem-Solving
129
+
130
+ 📝 [Paper@arXiv](https://arxiv.org/abs/2407.13690) | 🤗 [Datasets&Models@HF](https://huggingface.co/collections/hkust-nlp/dart-math-665704599b35de59f8fdf6c1) | 🐱 [Code@GitHub](https://github.com/hkust-nlp/dart-math)
131
+
132
+ 🐦 [Thread@X(Twitter)](https://x.com/tongyx361/status/1811413243350454455) | 🐶 [中文博客@知乎](https://zhuanlan.zhihu.com/p/708371895) | 📊 [Leaderboard@PapersWithCode](https://paperswithcode.com/paper/dart-math-difficulty-aware-rejection-tuning#results) | 📑 [BibTeX](https://github.com/hkust-nlp/dart-math?tab=readme-ov-file#citation)
133
+
134
+ ## Models: `DART-Math`
135
+
136
+ `DART-Math` models achieve performance **superior or competitive to previous SOTAs** on 2 in-domain and 4 challenging out-of-domain mathematical reasoning benchmarks, despite using **much smaller datasets** and **no proprietary model like GPT-4**.
137
+
138
+ | Model | [MATH](https://huggingface.co/datasets/hendrycks/competition_math) | [GSM8K](https://huggingface.co/datasets/gsm8k) | [College](https://github.com/hkust-nlp/dart-math/tree/main/data/eval-dsets/mwpbench/college-math-test.jsonl) | [DM](https://github.com/hkust-nlp/dart-math/tree/main/data/eval-dsets/deepmind-mathematics.json) | [Olympiad](https://github.com/hkust-nlp/dart-math/tree/main/data/eval-dsets/olympiadbench/OE_TO_maths_en_COMP.json) | [Theorem](https://github.com/hkust-nlp/dart-math/tree/main/data/eval-dsets/theoremqa.json) | AVG |
139
+ | :----------------------------------------------------------------------------------------------------- | -----------------------------------------------------------------: | ---------------------------------------------: | -----------------------------------------------------------------------------------------------------------: | -----------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------: | -----------------------------------------------------------------------------------------: | -------: |
140
+ | GPT-4 (0314) | [52.6](https://arxiv.org/abs/2403.04706) | [94.7](https://arxiv.org/abs/2403.04706) | [24.4](https://arxiv.org/abs/2403.02884) | -- | -- | -- | -- |
141
+ | Llama-3-70B-MetaMath | 44.9 | 88.0 | 31.9 | 53.2 | 11.6 | 21.9 | 41.9 |
142
+ | [`DART-Math-Llama-3-70B` (Uniform)](https://huggingface.co/hkust-nlp/dart-math-llama3-70b-uniform) | 54.9 | **90.4** | **38.5** | **64.1** | 19.1 | 27.4 | 49.1 |
143
+ | [`DART-Math-Llama-3-70B` (Prop2Diff)](https://huggingface.co/hkust-nlp/dart-math-llama3-70b-prop2diff) | **56.1** | 89.6 | 37.9 | **64.1** | **20.0** | **28.2** | **49.3** |
144
+ | DeepSeekMath-7B-MetaMath | 43.7 | 81.8 | 33.7 | 53.0 | 13.6 | 23.2 | 41.5 |
145
+ | [DeepSeekMath-7B-RL](https://huggingface.co/deepseek-ai/deepseek-math-7b-rl) | 53.1 | 88.4 | 41.3 | 58.3 | 18.7 | 35.9 | 49.3 |
146
+ | [`DART-Math-DSMath-7B` (Uniform)](https://huggingface.co/hkust-nlp/dart-math-dsmath-7b-uniform) | 52.9 | **88.2** | 40.1 | 60.2 | 21.3 | **32.5** | 49.2 |
147
+ | [`DART-Math-DSMath-7B` (Prop2Diff)](https://huggingface.co/hkust-nlp/dart-math-dsmath-7b-prop2diff) | **53.6** | 86.8 | **40.7** | **61.6** | **21.7** | 32.2 | **49.4** |
148
+ | Mistral-7B-MetaMath | 29.8 | 76.5 | 19.3 | 28.0 | 5.9 | 14.0 | 28.9 |
149
+ | [`DART-Math-Mistral-7B` (Uniform)](https://huggingface.co/hkust-nlp/dart-math-mistral-7b-uniform) | 43.5 | **82.6** | 26.9 | 42.0 | 13.2 | 16.4 | 27.4 |
150
+ | [`DART-Math-Mistral-7B` (Prop2Diff)](https://huggingface.co/hkust-nlp/dart-math-mistral-7b-prop2diff) | **45.5** | 81.1 | **29.4** | **45.1** | **14.7** | **17.0** | **38.8** |
151
+ | Llama-3-8B-MetaMath | 32.5 | 77.3 | 20.6 | 35.0 | 5.5 | 13.8 | 30.8 |
152
+ | [`DART-Math-Llama-3-8B` (Uniform)](https://huggingface.co/hkust-nlp/dart-math-llama3-8b-uniform) | 45.3 | **82.5** | 27.1 | **48.2** | 13.6 | 15.4 | 38.7 |
153
+ | [`DART-Math-Llama-3-8B` (Prop2Diff)](https://huggingface.co/hkust-nlp/dart-math-llama3-8b-prop2diff) | **46.6** | 81.1 | **28.8** | 48.0 | **14.5** | **19.4** | **39.7** |
154
+
155
+ ***Abbreviations**: College (CollegeMath), DM (DeepMind Mathematics), Olympiad (OlympiadBench-Math), Theorem (TheoremQA).
156
+ **Bold** means the best score by SFT on the respective base model here.
157
+ To reproduce our results, please refer to [the `DART-Math` GitHub repository](https://github.com/hkust-nlp/dart-math).*
158
+
159
+ ## Prompt Template
160
+
161
+ All the `DART-Math` models use the [Alpaca](https://github.com/tatsu-lab/stanford_alpaca) prompt template:
162
+
163
+ ```
164
+
165
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n###Instruction:\n{query}\n\n### Response:\n
166
+
167
+ ```
168
+
169
+ ## Training Dataset
170
+
171
+ We construct our traning datasets by applying **Difficulty-Aware Rejection Sampling** (`DARS`) to the **MATH and GSM8K** training sets.
172
+
173
+ `DARS` tackle **severe biases towards easy queries, with frequent failures to generate any correct response for the most challenging queries**, in previous datasets.
174
+
175
+ These biases are primarily caused by vanilla rejection sampling, where **the same number of responses is
176
+ sampled for each query**, yet the likelihood of obtaining correct responses for difficult queries is significantly lower, sometimes even zero.
177
+
178
+ Please refer to [`DART-Math-Hard`](https://huggingface.co/datasets/hkust-nlp/dart-math-hard) / [`DART-Math-Uniform`](https://huggingface.co/datasets/hkust-nlp/dart-math-uniform) for more details.
179
+
180
+ ## Training Setup
181
+
182
+ We perform standard instruction tuning to several base models including Llama3-8B & Mistral-7B & Llama3-70B as representatives of general models and DeepSeekMath-
183
+ 7B as the representative of math-specialized model
184
+ on our synthetic datasets [`DART-Math-Hard`](https://huggingface.co/datasets/hkust-nlp/dart-math-hard) & [`DART-Math-Uniform`](https://huggingface.co/datasets/hkust-nlp/dart-math-uniform),
185
+ leading to `DART-Math (Prop2Diff)` & `DART-Math (Uniform)` respectively.
186
+
187
+ For simplicity, we keep most hyper-parameters the same across different models and datasets:
188
+
189
+ - Model max length (of [packed](https://github.com/MeetKai/functionary/tree/main/functionary/train/packing) sequence): 4096
190
+ - Batch size: 64
191
+ - Warm-up ratio: 0.03
192
+ - Learning rate scheduler: cosine
193
+ - Prompt template: [Alpaca](https://github.com/tatsu-lab/stanford_alpaca)
194
+
195
+ Several other key hyper-parameters are tuned as follow:
196
+
197
+ | Base Model | Max. L.R. | # of Epochs | # of Grad. Acc. Steps | # of A100 GPUs |
198
+ |:--------------- | ---------:| -----------:| ---------------------:| --------------:|
199
+ | Mistral-7B | `1e-5` | 3 | 1 | 8 |
200
+ | Llama3-8B | `5e-5` | 1 | 2 | 8 |
201
+ | Llama3-70B | `2e-5` | 1 | 1 | 32 |
202
+ | DeepSeekMath-7B | `5e-5` | 3 | 1 | 8 |
203
+
204
+ - For **maximum learning rate**, we determine the values by **searching** through `1e-6,5e-6,1e-5,2e-5,5e-5,1e-4` according to the MATH performance after training on MMIQC for 1 epoch, except for Llama3-70B that is so expensive to search for that we derive from Llama3-8B’s learning rate in analogy to the relationship of (per-training) learning rates between [Llama2-7B](https://huggingface.co/meta-llama/Llama-2-7b-hf) and [Llama2-70B](https://huggingface.co/meta-llama/Llama-2-70b-hf) (\~2:1).
205
+ - For **Llama3** models, preliminary experiments indicate that **training for 1 epoch consistently outperforms 3 epochs**.
206
+
207
+ Please refer to [Appendix A.1 of our paper](https://tongyx361.github.io/assets/dart-math/paper-dart-math.pdf) for more details.
208
+
209
+ ## Other Details
210
+
211
+ - For Mistral-7B-based models, we disable `sliding_window` by default following [the newest Mistral-7B-Instruct](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3/blob/main/config.json) (Flash Attention 2 does not support `sliding_window` and XFormer backend in vLLM has throughput \~10% lower in our experiments.)
212
+
213
+ ## Citation
214
+
215
+ If you find our data, model or code useful for your work, please kindly cite [our paper](https://arxiv.org/abs/2407.13690):
216
+
217
+ ```latex
218
+ @article{tong2024dartmath,
219
+ title={DART-Math: Difficulty-Aware Rejection Tuning for Mathematical Problem-Solving},
220
+ author={Yuxuan Tong and Xiwen Zhang and Rui Wang and Ruidong Wu and Junxian He},
221
+ year={2024},
222
+ eprint={2407.13690},
223
+ archivePrefix={arXiv},
224
+ primaryClass={cs.CL},
225
+ url={https://arxiv.org/abs/2407.13690},
226
+ }
227
+ ```
228
+
229
+