RichardErkhov commited on
Commit
7443640
β€’
1 Parent(s): a5ae31f

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +163 -0
README.md ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-7b-v0.1 - bnb 8bits
11
+ - Model creator: https://huggingface.co/microsoft/
12
+ - Original model: https://huggingface.co/microsoft/rho-math-7b-v0.1/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ license: mit
20
+ tags:
21
+ - nlp
22
+ - math
23
+ language:
24
+ - en
25
+ pipeline_tag: text-generation
26
+ ---
27
+
28
+
29
+ <h1 align="center">
30
+ Rho-1: Not All Tokens Are What You Need
31
+ </h1>
32
+
33
+
34
+ <p align="center">
35
+ <a href="https://arxiv.org/abs/2404.07965"><b>[πŸ“œ Arxiv]</b></a> β€’
36
+ <a href="https://huggingface.co/papers/2404.07965"><b>[πŸ’¬ HF Paper]</b></a> β€’
37
+ <a href="https://huggingface.co/microsoft/rho-math-1b-v0.1"><b>[πŸ€— Models]</b></a> β€’
38
+ <a href="https://github.com/microsoft/rho"><b>[🐱 GitHub]</b></a>
39
+ </p>
40
+
41
+ <p align="center">
42
+ <img src="https://github.com/microsoft/rho/blob/main/docs/static/images/acc_vs_tokens_1b_7b.png?raw=true" width="1000">
43
+ <br>
44
+ <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>
45
+ </p>
46
+
47
+
48
+ ## πŸ”₯ News
49
+
50
+ - [2024/04/12] πŸ”₯πŸ”₯πŸ”₯ Rho-Math-v0.1 models released at πŸ€— HuggingFace!
51
+ - [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.
52
+ - [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.
53
+ - [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.
54
+ - [2024/04/11] Rho-1 paper and repo released.
55
+
56
+
57
+
58
+ ## πŸ’‘ Introduction
59
+
60
+ 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.
61
+
62
+
63
+ ### Selective Lanugage Modeling (SLM)
64
+
65
+ <p align="center">
66
+ <img src="https://github.com/microsoft/rho/blob/main/docs/static/images/example.png?raw=true" width="1000">
67
+ <br>
68
+ <em>Figure 2:
69
+ <b>Upper:</b> Even an extensively filtered pretraining corpus contains token-level noise.
70
+ <b>Left:</b> Previous Causal Language Modeling (CLM) trains on all tokens.
71
+ <b>Right:</b> Our proposed Selective Language Modeling (SLM) selectively applies loss on those useful and clean tokens.</em>
72
+ </p>
73
+
74
+ <p align="center">
75
+ <img src="https://github.com/microsoft/rho/blob/main/docs/static/images/pipeline.png?raw=true" width="1000">
76
+ <br>
77
+ <em>Figure 3: <b>The pipeline of Selective Language Modeling.</b>
78
+ SLM optimizes language model performance by concentrating on valuable, clean tokens during pre-training.
79
+ It involves three steps:
80
+ (Step 1) Initially, train a reference model on high-quality data.
81
+ (Step 2) Then, score each token's loss in a corpus using the reference model.
82
+ (Step 3) Finally, train the language model selectively on tokens that show higher excess loss compared to the reference loss.</em>
83
+ </p>
84
+
85
+ <!-- results: -->
86
+
87
+ ### Evaluation Results
88
+
89
+ Base models (Few-shot CoT):
90
+
91
+ | **Model** | **Size** | **Data** | **Uniq. Token** | **Train Token** | **GSM8K** | **MATH** | **MMLU STEM** | **SAT** |
92
+ |:-----------------:|:--------:|:--------:|:---------------:|:---------------:|:---------:|:--------:|:-------------:|:--------:|
93
+ | 1-2B Base Models | | | | | | | | |
94
+ | Qwen1.5 | 1.8B | - | - | - | 36.1 | 6.8 | 31.3 | 40.6 |
95
+ | Gemma | 2.0B | - | - | - | 18.8 | 11.4 | **34.4** | 50.0 |
96
+ | DeepSeekMath | 1.3B | - | 120B | 150B | 23.8 | 13.6 | 33.1 | **56.3** |
97
+ | [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 |
98
+ | >= 7B Base Models | | | | | | | | |
99
+ | Mistral | 7B | | - | - | 41.2 | 11.6 | 49.5 | 59.4 |
100
+ | Minerva | 540B | - | 39B | 26B | 58.8 | 33.6 | **63.9** | - |
101
+ | LLemma | 34B | PPile | 55B | 50B | 54.2 | 23.0 | 54.7 | 68.8 |
102
+ | InternLM2-Math | 20B | - | 31B | 125B | 65.4 | 30.0 | 53.1 | 71.9 |
103
+ | DeepSeekMath | 7B | - | 120B | 500B | 64.1 | **34.2** | 56.4 | **84.4** |
104
+ | [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** |
105
+
106
+
107
+ [Tool-integrated reasoning](https://github.com/microsoft/ToRA) (Code Interpreter):
108
+
109
+ | **Model** | **Size** | **SFT Data** | **GSM8k** | **MATH** | **SVAMP** | **ASDiv** | **MAWPS** | **TabMWP** | **GSM-Hard** | **AVG** |
110
+ |------------------------------|----------|--------------|-----------|----------|-----------|-----------|-----------|------------|--------------|----------|
111
+ | gpt4-early (pal) | - | - | 94.2 | 51.8 | 94.8 | 92.6 | 97.7 | 95.9 | 77.6 | 86.4 |
112
+ | gpt-4-turbo-2024-04-09 (cot) | - | - | - | 73.4 | - | - | - | - | - |
113
+ | Open-Source Small Models | | | | | | | | | |
114
+ | MAmmoTH | 70B | MI-260k | 76.9 | 41.8 | 82.4 | - | - | - | - | - |
115
+ | ToRA | 7B | ToRA-69k | 68.8 | 40.1 | 68.2 | 73.9 | 88.8 | 42.4 | 54.6 | 62.4 |
116
+ | ToRA | 70B | ToRA-69k | 84.3 | 49.7 | **82.7** | 86.8 | 93.8 | 74.0 | **67.2** | **76.9** |
117
+ | DeepSeekMath | 7B | ToRA-69k | 79.8 | **52.0** | 80.1 | **87.1** | 93.8 | **85.8** | 63.1 | 77.4 |
118
+ | [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 |
119
+ | [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 |
120
+
121
+
122
+ ## πŸš€ Quick Start
123
+
124
+
125
+ ### Evaluation
126
+
127
+ ```sh
128
+ git clone [email protected]:microsoft/rho.git
129
+ cd rho-1/math-evaluation-harness
130
+ ```
131
+
132
+ Base model few-shot evaluation:
133
+
134
+ ```sh
135
+ bash scripts/run_eval.sh cot microsoft/rho-math-7b-v0.1
136
+ ```
137
+
138
+ SFT model (code-interpreter) evaluation:
139
+
140
+ ```sh
141
+ bash scripts/run_eval.sh tora microsoft/rho-math-7b-interpreter-v0.1
142
+ ```
143
+
144
+ Our reproduced outputs are provided in `rho-1/outputs.zip`.
145
+
146
+
147
+
148
+ ## β˜•οΈ Citation
149
+
150
+ If you find this repository helpful, please consider citing our paper:
151
+
152
+ ```
153
+ @misc{lin2024rho1,
154
+ title={Rho-1: Not All Tokens Are What You Need},
155
+ 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},
156
+ year={2024},
157
+ eprint={2404.07965},
158
+ archivePrefix={arXiv},
159
+ primaryClass={cs.CL}
160
+ }
161
+ ```
162
+
163
+