RichardErkhov commited on
Commit
9b6088e
β€’
1 Parent(s): 5ed04a8

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +189 -0
README.md ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ rho-math-1b-interpreter-v0.1 - GGUF
11
+ - Model creator: https://huggingface.co/microsoft/
12
+ - Original model: https://huggingface.co/microsoft/rho-math-1b-interpreter-v0.1/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [rho-math-1b-interpreter-v0.1.Q2_K.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q2_K.gguf) | Q2_K | 0.4GB |
18
+ | [rho-math-1b-interpreter-v0.1.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.IQ3_XS.gguf) | IQ3_XS | 0.44GB |
19
+ | [rho-math-1b-interpreter-v0.1.IQ3_S.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.IQ3_S.gguf) | IQ3_S | 0.47GB |
20
+ | [rho-math-1b-interpreter-v0.1.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q3_K_S.gguf) | Q3_K_S | 0.47GB |
21
+ | [rho-math-1b-interpreter-v0.1.IQ3_M.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.IQ3_M.gguf) | IQ3_M | 0.48GB |
22
+ | [rho-math-1b-interpreter-v0.1.Q3_K.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q3_K.gguf) | Q3_K | 0.51GB |
23
+ | [rho-math-1b-interpreter-v0.1.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q3_K_M.gguf) | Q3_K_M | 0.51GB |
24
+ | [rho-math-1b-interpreter-v0.1.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q3_K_L.gguf) | Q3_K_L | 0.55GB |
25
+ | [rho-math-1b-interpreter-v0.1.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.IQ4_XS.gguf) | IQ4_XS | 0.57GB |
26
+ | [rho-math-1b-interpreter-v0.1.Q4_0.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q4_0.gguf) | Q4_0 | 0.59GB |
27
+ | [rho-math-1b-interpreter-v0.1.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.IQ4_NL.gguf) | IQ4_NL | 0.6GB |
28
+ | [rho-math-1b-interpreter-v0.1.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q4_K_S.gguf) | Q4_K_S | 0.6GB |
29
+ | [rho-math-1b-interpreter-v0.1.Q4_K.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q4_K.gguf) | Q4_K | 0.62GB |
30
+ | [rho-math-1b-interpreter-v0.1.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q4_K_M.gguf) | Q4_K_M | 0.62GB |
31
+ | [rho-math-1b-interpreter-v0.1.Q4_1.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q4_1.gguf) | Q4_1 | 0.65GB |
32
+ | [rho-math-1b-interpreter-v0.1.Q5_0.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q5_0.gguf) | Q5_0 | 0.71GB |
33
+ | [rho-math-1b-interpreter-v0.1.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q5_K_S.gguf) | Q5_K_S | 0.71GB |
34
+ | [rho-math-1b-interpreter-v0.1.Q5_K.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q5_K.gguf) | Q5_K | 0.73GB |
35
+ | [rho-math-1b-interpreter-v0.1.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q5_K_M.gguf) | Q5_K_M | 0.73GB |
36
+ | [rho-math-1b-interpreter-v0.1.Q5_1.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q5_1.gguf) | Q5_1 | 0.77GB |
37
+ | [rho-math-1b-interpreter-v0.1.Q6_K.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q6_K.gguf) | Q6_K | 0.84GB |
38
+ | [rho-math-1b-interpreter-v0.1.Q8_0.gguf](https://huggingface.co/RichardErkhov/microsoft_-_rho-math-1b-interpreter-v0.1-gguf/blob/main/rho-math-1b-interpreter-v0.1.Q8_0.gguf) | Q8_0 | 1.09GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ license: mit
46
+ tags:
47
+ - nlp
48
+ - math
49
+ language:
50
+ - en
51
+ pipeline_tag: text-generation
52
+ ---
53
+
54
+
55
+ <h1 align="center">
56
+ Rho-1: Not All Tokens Are What You Need
57
+ </h1>
58
+
59
+
60
+ <p align="center">
61
+ <a href="https://arxiv.org/abs/2404.07965"><b>[πŸ“œ Arxiv]</b></a> β€’
62
+ <a href="https://huggingface.co/papers/2404.07965"><b>[πŸ’¬ HF Paper]</b></a> β€’
63
+ <a href="https://huggingface.co/microsoft/rho-math-1b-v0.1"><b>[πŸ€— Models]</b></a> β€’
64
+ <a href="https://github.com/microsoft/rho"><b>[🐱 GitHub]</b></a>
65
+ </p>
66
+
67
+ <p align="center">
68
+ <img src="https://github.com/microsoft/rho/blob/main/docs/static/images/acc_vs_tokens_1b_7b.png?raw=true" width="1000">
69
+ <br>
70
+ <em>Figure 1: Rho-1 is pre-trained with Selective Language Modeling (SLM). SLM improves average few-shot accuracy on GSM8k and MATH by over 16%, achieving the baseline performance 5-10x faster.</em>
71
+ </p>
72
+
73
+
74
+ ## πŸ”₯ News
75
+
76
+ - [2024/04/12] πŸ”₯πŸ”₯πŸ”₯ Rho-Math-v0.1 models released at πŸ€— HuggingFace!
77
+ - [Rho-Math-1B](https://huggingface.co/microsoft/rho-math-1b-v0.1) and [Rho-Math-7B](https://huggingface.co/microsoft/rho-math-7b-v0.1) achieve 15.6% and 31.0% few-shot accuracy on MATH dataset, respectively β€” matching DeepSeekMath with only 3\% of the pretraining tokens.
78
+ - [Rho-Math-1B-Interpreter](https://huggingface.co/microsoft/rho-math-1b-interpreter-v0.1) is the first 1B LLM that achieves over 40% accuracy on MATH.
79
+ - [Rho-Math-7B-Interpreter](https://huggingface.co/microsoft/rho-math-7b-interpreter-v0.1) achieves 52% on MATH dataset, using only 69k samples for fine-tuning.
80
+ - [2024/04/11] Rho-1 paper and repo released.
81
+
82
+
83
+
84
+ ## πŸ’‘ Introduction
85
+
86
+ Rho-1 base models employ Selective Language Modeling (SLM) for pretraining, which selectively trains on clean and useful tokens that aligned with the desired distribution.
87
+
88
+
89
+ ### Selective Lanugage Modeling (SLM)
90
+
91
+ <p align="center">
92
+ <img src="https://github.com/microsoft/rho/blob/main/docs/static/images/example.png?raw=true" width="1000">
93
+ <br>
94
+ <em>Figure 2:
95
+ <b>Upper:</b> Even an extensively filtered pretraining corpus contains token-level noise.
96
+ <b>Left:</b> Previous Causal Language Modeling (CLM) trains on all tokens.
97
+ <b>Right:</b> Our proposed Selective Language Modeling (SLM) selectively applies loss on those useful and clean tokens.</em>
98
+ </p>
99
+
100
+ <p align="center">
101
+ <img src="https://github.com/microsoft/rho/blob/main/docs/static/images/pipeline.png?raw=true" width="1000">
102
+ <br>
103
+ <em>Figure 3: <b>The pipeline of Selective Language Modeling.</b>
104
+ SLM optimizes language model performance by concentrating on valuable, clean tokens during pre-training.
105
+ It involves three steps:
106
+ (Step 1) Initially, train a reference model on high-quality data.
107
+ (Step 2) Then, score each token's loss in a corpus using the reference model.
108
+ (Step 3) Finally, train the language model selectively on tokens that show higher excess loss compared to the reference loss.</em>
109
+ </p>
110
+
111
+ <!-- results: -->
112
+
113
+ ### Evaluation Results
114
+
115
+ Base models (Few-shot CoT):
116
+
117
+ | **Model** | **Size** | **Data** | **Uniq. Token** | **Train Token** | **GSM8K** | **MATH** | **MMLU STEM** | **SAT** |
118
+ |:-----------------:|:--------:|:--------:|:---------------:|:---------------:|:---------:|:--------:|:-------------:|:--------:|
119
+ | 1-2B Base Models | | | | | | | | |
120
+ | Qwen1.5 | 1.8B | - | - | - | 36.1 | 6.8 | 31.3 | 40.6 |
121
+ | Gemma | 2.0B | - | - | - | 18.8 | 11.4 | **34.4** | 50.0 |
122
+ | DeepSeekMath | 1.3B | - | 120B | 150B | 23.8 | 13.6 | 33.1 | **56.3** |
123
+ | [Rho-Math-1B-v0.1](https://huggingface.co/microsoft/rho-math-1b-v0.1) | 1.1B | OWM | 14B | 30B | **36.2** | **15.6** | 23.3 | 28.1 |
124
+ | >= 7B Base Models | | | | | | | | |
125
+ | Mistral | 7B | | - | - | 41.2 | 11.6 | 49.5 | 59.4 |
126
+ | Minerva | 540B | - | 39B | 26B | 58.8 | 33.6 | **63.9** | - |
127
+ | LLemma | 34B | PPile | 55B | 50B | 54.2 | 23.0 | 54.7 | 68.8 |
128
+ | InternLM2-Math | 20B | - | 31B | 125B | 65.4 | 30.0 | 53.1 | 71.9 |
129
+ | DeepSeekMath | 7B | - | 120B | 500B | 64.1 | **34.2** | 56.4 | **84.4** |
130
+ | [Rho-Math-7B-v0.1](https://huggingface.co/microsoft/rho-math-7b-v0.1) | 7B | OWM | 14B | 10.5B | **66.9** | 31.0 | 54.6 | **84.4** |
131
+
132
+
133
+ [Tool-integrated reasoning](https://github.com/microsoft/ToRA) (Code Interpreter):
134
+
135
+ | **Model** | **Size** | **SFT Data** | **GSM8k** | **MATH** | **SVAMP** | **ASDiv** | **MAWPS** | **TabMWP** | **GSM-Hard** | **AVG** |
136
+ |------------------------------|----------|--------------|-----------|----------|-----------|-----------|-----------|------------|--------------|----------|
137
+ | gpt4-early (pal) | - | - | 94.2 | 51.8 | 94.8 | 92.6 | 97.7 | 95.9 | 77.6 | 86.4 |
138
+ | gpt-4-turbo-2024-04-09 (cot) | - | - | - | 73.4 | - | - | - | - | - |
139
+ | Open-Source Small Models | | | | | | | | | |
140
+ | MAmmoTH | 70B | MI-260k | 76.9 | 41.8 | 82.4 | - | - | - | - | - |
141
+ | ToRA | 7B | ToRA-69k | 68.8 | 40.1 | 68.2 | 73.9 | 88.8 | 42.4 | 54.6 | 62.4 |
142
+ | ToRA | 70B | ToRA-69k | 84.3 | 49.7 | **82.7** | 86.8 | 93.8 | 74.0 | **67.2** | **76.9** |
143
+ | DeepSeekMath | 7B | ToRA-69k | 79.8 | **52.0** | 80.1 | **87.1** | 93.8 | **85.8** | 63.1 | 77.4 |
144
+ | [Rho-Math-1B-Interpreter-v0.1](https://huggingface.co/microsoft/rho-math-1b-interpreter-v0.1) | 1B | ToRA-69k | 59.4 | 40.6 | 60.7 | 74.2 | 88.6 | 26.7 | 48.1 | 56.9 |
145
+ | [Rho-Math-7B-Interpreter-v0.1](https://huggingface.co/microsoft/rho-math-7b-interpreter-v0.1) | 7B | ToRA-69k | 81.3 | **51.8** | 80.8 | 85.5 | **94.5** | 70.1 | 63.1 | 75.3 |
146
+
147
+
148
+ ## πŸš€ Quick Start
149
+
150
+
151
+ ### Evaluation
152
+
153
+ ```sh
154
+ git clone git@github.com:microsoft/rho.git
155
+ cd rho-1/math-evaluation-harness
156
+ ```
157
+
158
+ Base model few-shot evaluation:
159
+
160
+ ```sh
161
+ bash scripts/run_eval.sh cot microsoft/rho-math-7b-v0.1
162
+ ```
163
+
164
+ SFT model (code-interpreter) evaluation:
165
+
166
+ ```sh
167
+ bash scripts/run_eval.sh tora microsoft/rho-math-7b-interpreter-v0.1
168
+ ```
169
+
170
+ Our reproduced outputs are provided in `rho-1/outputs.zip`.
171
+
172
+
173
+
174
+ ## β˜•οΈ Citation
175
+
176
+ If you find this repository helpful, please consider citing our paper:
177
+
178
+ ```
179
+ @misc{lin2024rho1,
180
+ title={Rho-1: Not All Tokens Are What You Need},
181
+ author={Zhenghao Lin and Zhibin Gou and Yeyun Gong and Xiao Liu and Yelong Shen and Ruochen Xu and Chen Lin and Yujiu Yang and Jian Jiao and Nan Duan and Weizhu Chen},
182
+ year={2024},
183
+ eprint={2404.07965},
184
+ archivePrefix={arXiv},
185
+ primaryClass={cs.CL}
186
+ }
187
+ ```
188
+
189
+