aashish1904 commited on
Commit
b3cfc3f
Β·
verified Β·
1 Parent(s): e96f2d2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +299 -0
README.md ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ license: mit
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ datasets:
8
+ - yulan-team/YuLan-Mini-Datasets
9
+ - HuggingFaceFW/fineweb-edu
10
+ - bigcode/the-stack-v2
11
+ - mlfoundations/dclm-baseline-1.0
12
+ - math-ai/AutoMathText
13
+ - gair-prox/open-web-math-pro
14
+ - RUC-AIBOX/long_form_thought_data_5k
15
+ - internlm/Lean-Workbook
16
+ - internlm/Lean-Github
17
+ - deepseek-ai/DeepSeek-Prover-V1
18
+ - ScalableMath/Lean-STaR-base
19
+ - ScalableMath/Lean-STaR-plus
20
+ - ScalableMath/Lean-CoT-base
21
+ - ScalableMath/Lean-CoT-plus
22
+ - opencsg/chinese-fineweb-edu
23
+ - liwu/MNBVC
24
+ - vikp/textbook_quality_programming
25
+ - HuggingFaceTB/smollm-corpus
26
+ - OpenCoder-LLM/opc-annealing-corpus
27
+ - OpenCoder-LLM/opc-sft-stage1
28
+ - OpenCoder-LLM/opc-sft-stage2
29
+ - XinyaoHu/AMPS_mathematica
30
+ - deepmind/math_dataset
31
+ - mrfakename/basic-math-10m
32
+ - microsoft/orca-math-word-problems-200k
33
+ - AI-MO/NuminaMath-CoT
34
+ - HuggingFaceTB/cosmopedia
35
+ - MU-NLPC/Calc-ape210k
36
+ - manu/project_gutenberg
37
+ - storytracer/LoC-PD-Books
38
+ - allenai/dolma
39
+ language:
40
+ - en
41
+ - zh
42
+ tags:
43
+ - code
44
+ - math
45
+ arxiv: 2412.17743
46
+ model-index:
47
+ - name: YuLan-Mini
48
+ results:
49
+ - task:
50
+ type: text-generation
51
+ dataset:
52
+ type: openai_humaneval
53
+ name: HumanEval
54
+ metrics:
55
+ - name: pass@1
56
+ type: pass@1
57
+ value: 0.640
58
+ verified: false
59
+ - task:
60
+ type: text-generation
61
+ dataset:
62
+ type: mbpp
63
+ name: MBPP
64
+ metrics:
65
+ - name: pass@1
66
+ type: pass@1
67
+ value: 0.659
68
+ verified: false
69
+ - task:
70
+ type: text-generation
71
+ dataset:
72
+ type: math-500
73
+ name: MATH-500
74
+ metrics:
75
+ - name: maj@1
76
+ type: maj@1
77
+ value: 0.378
78
+ verified: false
79
+ - task:
80
+ type: text-generation
81
+ dataset:
82
+ type: gsm8k
83
+ name: GSM8K
84
+ metrics:
85
+ - name: maj@1
86
+ type: maj@1
87
+ value: 0.684
88
+ verified: false
89
+
90
+ ---
91
+
92
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
93
+
94
+
95
+ # QuantFactory/YuLan-Mini-GGUF
96
+ This is quantized version of [yulan-team/YuLan-Mini](https://huggingface.co/yulan-team/YuLan-Mini) created using llama.cpp
97
+
98
+ # Original Model Card
99
+
100
+
101
+ # Important Notice: This is a pre-trained **base model** without instruction-following capabilities. The **SFT version** will be released within a few weeks.
102
+
103
+
104
+ <div align=center>
105
+ <img src="assets/YuLan-logo.jpg" width="400px">
106
+ <h1>YuLan-Mini: An Open Data-efficient Language Model</h1>
107
+ <a href="https://github.com/RUC-GSAI/YuLan-Mini/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue" alt="license"></a>
108
+ <a href="https://arxiv.org/abs/2412.17743" target="_blank"><img src=https://img.shields.io/badge/arXiv-b5212f.svg?logo=arxiv></a>
109
+ <a href="https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3"><img alt="Static Badge" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-blue?color=8A2BE2"></a>
110
+ <a href="https://github.com/RUC-GSAI/YuLan-Mini" target="_blank"><img src="https://img.shields.io/github/stars/RUC-GSAI/YuLan-Mini"></a>
111
+ </div>
112
+
113
+ YuLan-Mini is a lightweight language model with 2.4 billion parameters. It achieves performance comparable to industry-leading models trained on significantly more data, despite being pre-trained on only 1.08T tokens. The model excels particularly in the domains of **mathematics** and **code**. To facilitate reproducibility, we will open-source the relevant pre-training resources.
114
+
115
+ ---
116
+
117
+ ## Model Downloads πŸ”—
118
+
119
+ > Model weights will be uploaded after final preparations.
120
+
121
+ | Model | Context Length | SFT |
122
+ |---------|----------------|-----|
123
+ | [YuLan-Mini](https://huggingface.co/yulan-team/YuLan-Mini) (Recommended) | 28K | ❎ |
124
+ | [YuLan-Mini-2.4B-4K](https://huggingface.co/yulan-team/YuLan-Mini-Intermediate-4K) | 4K | ❎ |
125
+ | YuLan-Mini-Instruct | Comming soon | βœ… |
126
+
127
+ ---
128
+
129
+ ## Features 🌟
130
+
131
+ <div align=center>
132
+ <img src="assets/main.png">
133
+ </div>
134
+
135
+ Our pre-training methodology improves training efficiency through three key innovations:
136
+
137
+ 1. an elaborately designed **data pipeline** that combines data cleaning with data schedule strategies;
138
+ 2. a systematic **optimization method** that can effectively mitigate training instability;
139
+ 3. an effective **annealing approach** that integrate targeted data selection and long context training.
140
+
141
+
142
+ ---
143
+ ## Behchmarks 🌟
144
+
145
+ | Models | Model Size | # Train Tokens | Context Length | MATH 500 | GSM 8K | Human Eval | MBPP | RACE Middle | RACE High | RULER |
146
+ |:----------------|----------:|--------------:|--------------:|:--------|:------|:----------|:------|:-----------|:---------|:------|
147
+ | MiniCPM | 2.6B | 1.06T | 4K | 15.00 | 53.83 | 50.00* | 47.31 | 56.61 | 44.27 | N/A |
148
+ | Qwen-2 | 1.5B | 7T | 128K | 22.60 | 46.90* | 34.80* | 46.90* | 55.77 | 43.69 | 60.16 |
149
+ | Qwen2.5 | 0.5B | 18T | 128K | 23.60 | 41.60* | 30.50* | 39.30* | 52.36 | 40.31 | 49.23 |
150
+ | Qwen2.5 | 1.5B | 18T | 128K | **45.40** | **68.50\*** | 37.20* | 60.20* | **58.77** | 44.33 | <ins>68.26</ins> |
151
+ | Gemma2 | 2.6B | 2T | 8K | 18.30* | 30.30* | 19.50* | 42.10* | - | - | N/A |
152
+ | StableLM2 | 1.7B | 2T | 4K | - | 20.62 | 8.50* | 17.50 | 56.33 | **45.06** | N/A |
153
+ | SmolLM2 | 1.7B | 11T | 8K | 11.80 | - | 23.35 | 45.00 | 55.77 | 43.06 | N/A |
154
+ | Llama3.2 | 3.2B | 9T | 128K | 7.40 | - | 29.30 | 49.70 | 55.29 | 43.34 | **77.06** |
155
+ | YuLan-Mini | 2.4B | 1.04T | 4K | 32.60 | 66.65 | <ins>61.60</ins> | **66.70** | 55.71 | 43.58 | N/A |
156
+ | YuLan-Mini | 2.4B | 1.08T | 28K | <ins>37.80</ins> | <ins>68.46</ins> | **64.00** | <ins>65.90</ins>| <ins>57.18</ins> | <ins>44.57</ins> | 51.48 |
157
+
158
+
159
+ | Models | LAMBADA | MMLU | CMMLU | CEval | HellaSwag | WinoGrande | StoryCloze | ARC-e | ARC-c |
160
+ |:----------------|:-------|:-----|:-----|:-----|:----------|:-----------|:-----------|:-----|:-----|
161
+ | MiniCPM-2.6B | 61.91 | 53.37 | 48.97 | 48.24 | 67.92 | 65.74 | 78.51 | 55.51 | 43.86 |
162
+ | Qwen2-1.5B | 64.68 | 55.90 | **70.76** | **71.94** | 66.11 | 66.14 | 77.60 | 62.21 | 42.92 |
163
+ | Qwen2.5-0.5B | 52.00 | 47.50 | 52.17 | 54.27 | 50.54 | 55.88 | 71.67 | 56.10 | 39.51 |
164
+ | Qwen2.5-1.5B | 62.12 | <ins>60.71</ins> | <ins>67.82</ins> | <ins>69.05</ins> | 67.18 | 64.48 | 76.80 | **71.51** | <ins>53.41</ins> |
165
+ | Gemma2-2.6B | - | 52.20*| - | 28.00*| <ins>74.60*</ins> | **71.50\*** | - | - | **55.70\***|
166
+ | StableLM2-1.7B | 66.15 | 40.37 | 29.29 | 26.99 | 69.79 | 64.64 | <ins>78.56</ins> | 54.00 | 40.78 |
167
+ | SmolLM2-1.7B | <ins>67.42</ins> | 51.91 | 33.46 | 35.10 | 72.96 | 67.40 | **79.32** | 44.82 | 35.49 |
168
+ | Llama3.2-3B | **69.08** | **63.40** | 44.44 | 44.49 | **75.62** | <ins>67.48</ins> | 76.80 | <ins>70.12</ins> | 48.81 |
169
+ | YuLan-Mini | 64.72 | 51.79 | 48.35 | 51.47 | 68.65 | 67.09 | 76.37 | 69.87 | 50.51 |
170
+ | YuLan-Mini | 65.67 | 49.10 | 45.45 | 48.23 | 67.22 | 67.24 | 75.89 | 67.47 | 49.32 |
171
+
172
+
173
+ ---
174
+
175
+ ## Pre-Training Resources πŸ”§
176
+
177
+ To enhance research transparency and reproducibility, we are open-sourcing relevant [pre-training resources](https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain):
178
+
179
+ <details><summary>1. Pre-training and Evaluation Code</summary>
180
+
181
+ The pre-training and evaluation code will be released in a future update.
182
+ </details>
183
+
184
+
185
+
186
+ <details><summary>2. Intermediate Stage Checkpoints</summary>
187
+ The intermediate stage checkpoints are released in <a href="https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3">YuLan-Mini</a>.
188
+
189
+ </details>
190
+
191
+ <details><summary>3. Optimizer States Before Annealing</summary>
192
+
193
+ <a href="https://huggingface.co/yulan-team/YuLan-Mini-Before-Annealing">YuLan-Mini-Before-Annealing</a>
194
+ </details>
195
+
196
+
197
+ <details><summary>4. The Used Open-Source Datasets </summary>
198
+
199
+ <a href="https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/datasets-list.md">Used-Datasets-List</a>
200
+
201
+ </details>
202
+
203
+ <details><summary>5. Data Distribution for every phase</summary>
204
+
205
+ <a href="https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/final.pdf">
206
+ <div align=center>
207
+ <img src="assets/data_distribution_for_every_phase.png">
208
+ </div>
209
+ </a>
210
+
211
+
212
+ </details>
213
+
214
+ <details><summary>6. Synthetic Data</summary>
215
+
216
+ Data cleaning and synthesis pipeline:
217
+ <div align=center>
218
+ <img src="assets/data-pipeline.png">
219
+ </div>
220
+
221
+ The synthetic data we are using is released in <a href="https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3">YuLan-Mini-Datasets</a>
222
+
223
+ </details>
224
+
225
+ <details><summary>7. Intermediate Optimizer States</summary>
226
+
227
+ Intermediate optimizer states will be released in a future update.
228
+ </details>
229
+
230
+ ### What you can do with these pre-training resources
231
+
232
+ 1. **Pre-train** your own LLM. You can use [our data](https://huggingface.co/yulan-team/YuLan-Mini-Datasets) and curriculum to train a model that's just as powerful as YuLan-Mini.
233
+ 2. Perform your own **learning rate annealing**. During the annealing phase, YuLan-Mini's learning ability is at its peak. You can resume training from [the checkpoint before annealing](https://huggingface.co/yulan-team/YuLan-Mini-Before-Annealing) and use your own dataset for learning rate annealing.
234
+ 3. **Fine-tune** the Instruct version of the LLM. You can use the YuLan-Mini base model to train your own Instruct version.
235
+ 4. **Training dynamics** research. You can use YuLan-Mini's intermediate checkpoints to explore internal changes during the pre-training process.
236
+ 5. **Synthesize** your own data. You can use YuLan-Mini's [data pipeline](https://github.com/RUC-GSAI/YuLan-Mini) to clean and generate your own dataset.
237
+
238
+ ---
239
+
240
+ ## Quick Start πŸ’»
241
+
242
+ Below is a simple example for inference using Huggingface:
243
+
244
+ **Huggingface Inference Example**
245
+ ```python
246
+ import torch
247
+ from transformers import AutoTokenizer, AutoModelForCausalLM
248
+
249
+ # Load model and tokenizer
250
+ tokenizer = AutoTokenizer.from_pretrained("yulan-team/YuLan-Mini")
251
+ model = AutoModelForCausalLM.from_pretrained("yulan-team/YuLan-Mini", torch_dtype=torch.bfloat16)
252
+
253
+ # Input text
254
+ input_text = "Renmin University of China is"
255
+ inputs = tokenizer(input_text, return_tensors="pt")
256
+
257
+ # Completion
258
+ output = model.generate(inputs["input_ids"], max_new_tokens=100)
259
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
260
+ ```
261
+
262
+ **vLLM Serve Example**
263
+ ```bash
264
+ vllm serve yulan-team/YuLan-Mini --dtype bfloat16
265
+ ```
266
+
267
+ **SGLang Serve Example**
268
+ ```bash
269
+ python -m sglang.launch_server --model-path yulan-team/YuLan-Mini --port 30000 --host 0.0.0.0
270
+ ```
271
+
272
+ ---
273
+
274
+ ## The Team
275
+
276
+ YuLan-Mini is developed and maintained by [AI Box, Renmin University of China](http://aibox.ruc.edu.cn/).
277
+
278
+ ## License
279
+
280
+ - The code in this repository is released under the [MIT License](./LICENSE).
281
+ - Policies regarding the use of model weights, intermediate optimizer states, and training data will be announced in future updates.
282
+ - Limitations: Despite our efforts to mitigate safety concerns and encourage the generation of ethical and lawful text, the probabilistic nature of language models may still lead to unexpected outputs. For instance, responses might contain bias, discrimination, or other harmful content. Please refrain from disseminating such content. We are not liable for any consequences arising from the spread of harmful information.
283
+
284
+ ## Citation
285
+
286
+ If you find YuLan-Mini helpful for your research or development, please cite [our technical report](https://arxiv.org/abs/2412.17743):
287
+
288
+ ```
289
+ @misc{hu2024yulanmini,
290
+ title={YuLan-Mini: An Open Data-efficient Language Model},
291
+ author={Yiwen Hu and Huatong Song and Jia Deng and Jiapeng Wang and Jie Chen and Kun Zhou and Yutao Zhu and Jinhao Jiang and Zican Dong and Wayne Xin Zhao and Ji-Rong Wen},
292
+ year={2024},
293
+ eprint={2412.17743},
294
+ archivePrefix={arXiv},
295
+ primaryClass={cs.CL},
296
+ url={https://arxiv.org/abs/2412.17743},
297
+ }
298
+ ```
299
+