alexayers XXsongLALA commited on
Commit
a4692da
·
0 Parent(s):

Duplicate from yulan-team/YuLan-Mini

Browse files

Co-authored-by: Song Huatong <XXsongLALA@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/data_distribution_for_every_phase.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: transformers
4
+ pipeline_tag: text-generation
5
+ datasets:
6
+ - yulan-team/YuLan-Mini-Datasets
7
+ - HuggingFaceFW/fineweb-edu
8
+ - bigcode/the-stack-v2
9
+ - mlfoundations/dclm-baseline-1.0
10
+ - math-ai/AutoMathText
11
+ - gair-prox/open-web-math-pro
12
+ - RUC-AIBOX/long_form_thought_data_5k
13
+ - internlm/Lean-Workbook
14
+ - internlm/Lean-Github
15
+ - deepseek-ai/DeepSeek-Prover-V1
16
+ - ScalableMath/Lean-STaR-base
17
+ - ScalableMath/Lean-STaR-plus
18
+ - ScalableMath/Lean-CoT-base
19
+ - ScalableMath/Lean-CoT-plus
20
+ - opencsg/chinese-fineweb-edu
21
+ - liwu/MNBVC
22
+ - vikp/textbook_quality_programming
23
+ - HuggingFaceTB/smollm-corpus
24
+ - OpenCoder-LLM/opc-annealing-corpus
25
+ - OpenCoder-LLM/opc-sft-stage1
26
+ - OpenCoder-LLM/opc-sft-stage2
27
+ - XinyaoHu/AMPS_mathematica
28
+ - deepmind/math_dataset
29
+ - mrfakename/basic-math-10m
30
+ - microsoft/orca-math-word-problems-200k
31
+ - AI-MO/NuminaMath-CoT
32
+ - HuggingFaceTB/cosmopedia
33
+ - MU-NLPC/Calc-ape210k
34
+ - manu/project_gutenberg
35
+ - storytracer/LoC-PD-Books
36
+ - allenai/dolma
37
+ language:
38
+ - en
39
+ - zh
40
+ tags:
41
+ - code
42
+ - math
43
+ arxiv: 2412.17743
44
+ model-index:
45
+ - name: YuLan-Mini
46
+ results:
47
+ - task:
48
+ type: text-generation
49
+ dataset:
50
+ type: openai_humaneval
51
+ name: HumanEval
52
+ metrics:
53
+ - name: pass@1
54
+ type: pass@1
55
+ value: 0.640
56
+ verified: false
57
+ - task:
58
+ type: text-generation
59
+ dataset:
60
+ type: mbpp
61
+ name: MBPP
62
+ metrics:
63
+ - name: pass@1
64
+ type: pass@1
65
+ value: 0.659
66
+ verified: false
67
+ - task:
68
+ type: text-generation
69
+ dataset:
70
+ type: math-500
71
+ name: MATH-500
72
+ metrics:
73
+ - name: maj@1
74
+ type: maj@1
75
+ value: 0.378
76
+ verified: false
77
+ - task:
78
+ type: text-generation
79
+ dataset:
80
+ type: gsm8k
81
+ name: GSM8K
82
+ metrics:
83
+ - name: maj@1
84
+ type: maj@1
85
+ value: 0.684
86
+ verified: false
87
+ ---
88
+
89
+ # Important Notice: This is a pre-trained **base model** without instruction-following capabilities.
90
+
91
+
92
+ <div align=center>
93
+ <img src="assets/YuLan-logo.jpg" width="400px">
94
+ <h1>YuLan-Mini: An Open Data-efficient Language Model</h1>
95
+ <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>
96
+ <a href="https://arxiv.org/abs/2412.17743" target="_blank"><img src=https://img.shields.io/badge/arXiv-b5212f.svg?logo=arxiv></a>
97
+ <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>
98
+ <a href="https://github.com/RUC-GSAI/YuLan-Mini" target="_blank"><img src="https://img.shields.io/github/stars/RUC-GSAI/YuLan-Mini"></a>
99
+ </div>
100
+
101
+ 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](https://github.com/RUC-GSAI/YuLan-Mini/tree/main/pretrain).
102
+
103
+ ---
104
+
105
+ ## Model Downloads 🔗
106
+
107
+ | Model | Context Length | SFT | DPO | 🤗 Hugging Face | ModelScope | Wise Model |
108
+ |---------|----------------|-----|-----|-----------------|------------|------------|
109
+ | YuLan-Mini | 28K | ❎ | ❎ | [`Base`](https://huggingface.co/yulan-team/YuLan-Mini) | [`Base`](https://modelscope.cn/models/yulan-team/YuLan-Mini) | [`Base`](https://wisemodel.cn/models/yulan-team/YuLan-Mini) |
110
+ | YuLan-Mini-Instruct | 28K | ✅ | ✅ | [`Instruct`](https://huggingface.co/yulan-team/YuLan-Mini-Instruct) | | |
111
+
112
+
113
+
114
+ ---
115
+
116
+ ## Features 🌟
117
+
118
+ <div align=center>
119
+ <img src="assets/main.png">
120
+ </div>
121
+
122
+ Our pre-training methodology improves training efficiency through three key innovations:
123
+
124
+ 1. an elaborately designed **data pipeline** that combines data cleaning with data schedule strategies;
125
+ 2. a systematic **optimization method** that can effectively mitigate training instability;
126
+ 3. an effective **annealing approach** that integrate targeted data selection and long context training.
127
+
128
+
129
+ ---
130
+ ## Behchmarks 🌟
131
+
132
+ | Models | Model Size | # Train Tokens | Context Length | MATH 500 | GSM 8K | Human Eval | MBPP | RACE Middle | RACE High | RULER |
133
+ |:----------------|----------:|--------------:|--------------:|:--------|:------|:----------|:------|:-----------|:---------|:------|
134
+ | MiniCPM | 2.6B | 1.06T | 4K | 15.00 | 53.83 | 50.00* | 47.31 | 56.61 | 44.27 | N/A |
135
+ | Qwen-2 | 1.5B | 7T | 128K | 22.60 | 46.90* | 34.80* | 46.90* | 55.77 | 43.69 | 60.16 |
136
+ | Qwen2.5 | 0.5B | 18T | 128K | 23.60 | 41.60* | 30.50* | 39.30* | 52.36 | 40.31 | 49.23 |
137
+ | Qwen2.5 | 1.5B | 18T | 128K | **45.40** | **68.50\*** | 37.20* | 60.20* | **58.77** | 44.33 | <ins>68.26</ins> |
138
+ | Gemma2 | 2.6B | 2T | 8K | 18.30* | 30.30* | 19.50* | 42.10* | - | - | N/A |
139
+ | StableLM2 | 1.7B | 2T | 4K | - | 20.62 | 8.50* | 17.50 | 56.33 | **45.06** | N/A |
140
+ | SmolLM2 | 1.7B | 11T | 8K | 11.80 | - | 23.35 | 45.00 | 55.77 | 43.06 | N/A |
141
+ | Llama3.2 | 3.2B | 9T | 128K | 7.40 | - | 29.30 | 49.70 | 55.29 | 43.34 | **77.06** |
142
+ | YuLan-Mini | 2.4B | 1.04T | 4K | 32.60 | 66.65 | <ins>61.60</ins> | **66.70** | 55.71 | 43.58 | N/A |
143
+ | 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 |
144
+
145
+
146
+ | Models | LAMBADA | MMLU | CMMLU | CEval | HellaSwag | WinoGrande | StoryCloze | ARC-e | ARC-c |
147
+ |:----------------|:-------|:-----|:-----|:-----|:----------|:-----------|:-----------|:-----|:-----|
148
+ | MiniCPM-2.6B | 61.91 | 53.37 | 48.97 | 48.24 | 67.92 | 65.74 | 78.51 | 55.51 | 43.86 |
149
+ | Qwen2-1.5B | 64.68 | 55.90 | **70.76** | **71.94** | 66.11 | 66.14 | 77.60 | 62.21 | 42.92 |
150
+ | Qwen2.5-0.5B | 52.00 | 47.50 | 52.17 | 54.27 | 50.54 | 55.88 | 71.67 | 56.10 | 39.51 |
151
+ | 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> |
152
+ | Gemma2-2.6B | - | 52.20*| - | 28.00*| <ins>74.60*</ins> | **71.50\*** | - | - | **55.70\***|
153
+ | StableLM2-1.7B | 66.15 | 40.37 | 29.29 | 26.99 | 69.79 | 64.64 | <ins>78.56</ins> | 54.00 | 40.78 |
154
+ | SmolLM2-1.7B | <ins>67.42</ins> | 51.91 | 33.46 | 35.10 | 72.96 | 67.40 | **79.32** | 44.82 | 35.49 |
155
+ | 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 |
156
+ | YuLan-Mini | 64.72 | 51.79 | 48.35 | 51.47 | 68.65 | 67.09 | 76.37 | 69.87 | 50.51 |
157
+ | YuLan-Mini | 65.67 | 49.10 | 45.45 | 48.23 | 67.22 | 67.24 | 75.89 | 67.47 | 49.32 |
158
+
159
+
160
+ ---
161
+
162
+ ## Pre-Training Resources 🔧
163
+
164
+ To enhance research transparency and reproducibility, we are open-sourcing relevant [pre-training resources](https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain):
165
+
166
+ <details><summary>1. Pre-training and Evaluation Code</summary>
167
+
168
+ The pre-training and evaluation code will be released in a future update.
169
+ </details>
170
+
171
+
172
+
173
+ <details><summary>2. Intermediate Stage Checkpoints</summary>
174
+ The intermediate stage checkpoints are released in <a href="https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3">YuLan-Mini</a>.
175
+
176
+ <table>
177
+ <thead>
178
+ <tr>
179
+ <th>Stage</th>
180
+ <th>Curriculum Phase</th>
181
+ <th>4K Context</th>
182
+ <th>28K Context</th>
183
+ <th>Optimizer</th>
184
+ <th>Inference Architecture</th>
185
+ <th>LAMBADA <code>Acc</code></th>
186
+ <th>GSM8K <code>Acc</code></th>
187
+ <th>HumanEval <code>pass@1</code></th>
188
+ </tr>
189
+ </thead>
190
+ <tbody>
191
+ <tr>
192
+ <td>Stable</td>
193
+ <td>5</td>
194
+ <td><a href="https://huggingface.co/yulan-team/YuLan-Mini-Phase5">YuLan-Mini-Phase5</a></td>
195
+ <td></td>
196
+ <td></td>
197
+ <td><code>yulanmini</code></td>
198
+ <td>53.85</td>
199
+ <td>3.41</td>
200
+ <td>12.26</td>
201
+ </tr>
202
+ <tr>
203
+ <td>Stable</td>
204
+ <td>10</td>
205
+ <td><a href="https://huggingface.co/yulan-team/YuLan-Mini-Phase10">YuLan-Mini-Phase10</a></td>
206
+ <td></td>
207
+ <td></td>
208
+ <td><code>yulanmini</code></td>
209
+ <td>55.00</td>
210
+ <td>9.57</td>
211
+ <td>15.95</td>
212
+ </tr>
213
+ <tr>
214
+ <td>Stable</td>
215
+ <td>15</td>
216
+ <td><a href="https://huggingface.co/yulan-team/YuLan-Mini-Phase15">YuLan-Mini-Phase15</a></td>
217
+ <td></td>
218
+ <td>✅</td>
219
+ <td><code>yulanmini</code></td>
220
+ <td>55.81</td>
221
+ <td>13.81</td>
222
+ <td>16.99</td>
223
+ </tr>
224
+ <tr>
225
+ <td>Stable</td>
226
+ <td>20</td>
227
+ <td><a href="https://huggingface.co/yulan-team/YuLan-Mini-Phase20">YuLan-Mini-Phase20</a></td>
228
+ <td></td>
229
+ <td>✅</td>
230
+ <td><code>yulanmini</code></td>
231
+ <td>55.81</td>
232
+ <td>21.39</td>
233
+ <td>20.79</td>
234
+ </tr>
235
+ <tr>
236
+ <td>Stable</td>
237
+ <td>25 (1T tokens)</td>
238
+ <td><a href="https://huggingface.co/yulan-team/YuLan-Mini-Before-Annealing">YuLan-Mini-Before-Annealing</a></td>
239
+ <td></td>
240
+ <td>✅</td>
241
+ <td><code>yulanmini</code></td>
242
+ <td>55.67</td>
243
+ <td>29.94</td>
244
+ <td>34.06</td>
245
+ </tr>
246
+ <tr>
247
+ <td></td>
248
+ <td></td>
249
+ <td></td>
250
+ <td></td>
251
+ <td></td>
252
+ <td></td>
253
+ <td></td>
254
+ <td></td>
255
+ <td></td>
256
+ </tr>
257
+ <tr>
258
+ <td>Annealing</td>
259
+ <td>26</td>
260
+ <td>YuLan-Mini-4K</td>
261
+ <td></td>
262
+ <td></td>
263
+ <td><code>llama</code>*</td>
264
+ <td>64.72</td>
265
+ <td>66.65</td>
266
+ <td>61.60</td>
267
+ </tr>
268
+ <tr>
269
+ <td>Annealing</td>
270
+ <td>27</td>
271
+ <td></td>
272
+ <td><a href="https://huggingface.co/yulan-team/YuLan-Mini">YuLan-Mini</a></td>
273
+ <td></td>
274
+ <td><code>llama</code>*</td>
275
+ <td>65.67</td>
276
+ <td>68.46</td>
277
+ <td>64.00</td>
278
+ </tr>
279
+ </tbody>
280
+ </table>
281
+
282
+ \*: For easier inference and deployment, we merged the re-parameterized added parameters and scaling factors into the final released models ([**YuLan-Mini**](https://huggingface.co/yulan-team/YuLan-Mini) and **YuLan-Mini-Intermediate-4K**), enabling it to run on the Llama architecture. However, these parameters are still retained in the intermediate checkpoints from the training process.
283
+
284
+ </details>
285
+
286
+ <details><summary>3. Optimizer States Before Annealing</summary>
287
+
288
+ <a href="https://huggingface.co/yulan-team/YuLan-Mini-Before-Annealing">YuLan-Mini-Before-Annealing</a>
289
+ </details>
290
+
291
+
292
+ <details><summary>4. The Used Open-Source Datasets </summary>
293
+
294
+ <a href="https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/datasets">Used-Datasets-List</a>
295
+
296
+ </details>
297
+
298
+ <details><summary>5. Data Distribution for every phase</summary>
299
+
300
+ <a href="https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/datasets/final.pdf">
301
+ <div align=center>
302
+ <img src="assets/data_distribution_for_every_phase.png">
303
+ </div>
304
+ </a>
305
+
306
+ </details>
307
+
308
+ <details><summary>6. Synthetic Data</summary>
309
+
310
+ Data cleaning and synthesis pipeline:
311
+ <div align=center>
312
+ <img src="https://github.com/RUC-GSAI/YuLan-Mini/blob/main/assets/data-pipeline.png">
313
+ </div>
314
+
315
+ The synthetic data we are using is released in <a href="https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3">YuLan-Mini-Datasets</a>
316
+
317
+ </details>
318
+
319
+
320
+ ### What you can do with these pre-training resources
321
+
322
+ 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.
323
+ 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.
324
+ 3. **Fine-tune** the Instruct version of the LLM. You can use the [YuLan-Mini](https://huggingface.co/yulan-team/YuLan-Mini) base model to train your own Instruct version.
325
+ 4. **Training dynamics** research. You can use YuLan-Mini's [intermediate checkpoints](https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3) to explore internal changes during the pre-training process.
326
+ 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.
327
+
328
+ ---
329
+
330
+ ## Quick Start 💻
331
+
332
+ Below is a simple example for inference using Huggingface:
333
+
334
+ **Huggingface Inference Example**
335
+ ```python
336
+ import torch
337
+ from transformers import AutoTokenizer, AutoModelForCausalLM
338
+
339
+ # Load model and tokenizer
340
+ tokenizer = AutoTokenizer.from_pretrained("yulan-team/YuLan-Mini")
341
+ model = AutoModelForCausalLM.from_pretrained("yulan-team/YuLan-Mini", torch_dtype=torch.bfloat16)
342
+
343
+ # Input text
344
+ input_text = "Renmin University of China is"
345
+ inputs = tokenizer(input_text, return_tensors="pt")
346
+
347
+ # Completion
348
+ output = model.generate(inputs["input_ids"], max_new_tokens=100)
349
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
350
+ ```
351
+
352
+ **vLLM Serve Example**
353
+ ```bash
354
+ vllm serve yulan-team/YuLan-Mini --dtype bfloat16
355
+ ```
356
+
357
+ **SGLang Serve Example**
358
+ ```bash
359
+ python -m sglang.launch_server --model-path yulan-team/YuLan-Mini --port 30000 --host 0.0.0.0
360
+ ```
361
+
362
+ ---
363
+
364
+ ## The Team
365
+
366
+ YuLan-Mini is developed and maintained by [AI Box, Renmin University of China](http://aibox.ruc.edu.cn/).
367
+
368
+ ## License
369
+
370
+ - The code in this repository is released under the [MIT License](./LICENSE).
371
+ - Policies regarding the use of model weights, intermediate optimizer states, and training data will be announced in future updates.
372
+ - 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.
373
+
374
+ ## Citation
375
+
376
+ If you find YuLan-Mini helpful for your research or development, please cite [our technical report](https://arxiv.org/abs/2412.17743):
377
+
378
+ ```
379
+ @misc{hu2024yulanmini,
380
+ title={YuLan-Mini: An Open Data-efficient Language Model},
381
+ 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},
382
+ year={2024},
383
+ eprint={2412.17743},
384
+ archivePrefix={arXiv},
385
+ primaryClass={cs.CL},
386
+ url={https://arxiv.org/abs/2412.17743},
387
+ }
388
+ ```
assets/YuLan-logo.jpg ADDED
assets/data-pipeline.png ADDED
assets/data-preview.png ADDED
assets/data_distribution_for_every_phase.png ADDED

Git LFS Details

  • SHA256: 8fd87217ffffb02e4674d1399f0b5cd3b3d947e0016c6bf21d8aa599cbe66abf
  • Pointer size: 132 Bytes
  • Size of remote file: 1.54 MB
assets/main.png ADDED
assets/training-stability.png ADDED
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": true,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "head_dim": 64,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 1920,
12
+ "initializer_range": 5e-05,
13
+ "intermediate_size": 4800,
14
+ "max_position_embeddings": 28723,
15
+ "mlp_bias": false,
16
+ "model_type": "llama",
17
+ "num_attention_heads": 30,
18
+ "num_hidden_layers": 56,
19
+ "num_key_value_heads": 6,
20
+ "pad_token_id": 102,
21
+ "pretraining_tp": 1,
22
+ "rms_norm_eps": 1e-06,
23
+ "rope_scaling": null,
24
+ "rope_theta": 490000.0,
25
+ "tie_word_embeddings": false,
26
+ "torch_dtype": "bfloat16",
27
+ "transformers_version": "4.47.1",
28
+ "use_cache": true,
29
+ "vocab_size": 99000
30
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.47.1"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b8cd6aa5571fa57d75255dcc627d0279a640335424797f75c9660918f94623e
3
+ size 4848833776
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<pad>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ },
30
+ "102": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "103": {
39
+ "content": "<reasoning_step>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": true
45
+ },
46
+ "104": {
47
+ "content": "<|start_header_id|>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": true
53
+ },
54
+ "105": {
55
+ "content": "<|end_header_id|>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": true
61
+ },
62
+ "106": {
63
+ "content": "<|eot_id|>",
64
+ "lstrip": false,
65
+ "normalized": false,
66
+ "rstrip": false,
67
+ "single_word": false,
68
+ "special": true
69
+ }
70
+ },
71
+ "bos_token": "<s>",
72
+ "chat_template": "{% if messages[0]['role'] == 'system' %}\n {% set offset = 1 %}\n{% else %}\n {% set offset = 0 %}\n{% endif %}\n\n{{ bos_token }}\n{% for message in messages %}\n {% if (message['role'] == 'user') != (loop.index0 % 2 == offset) %}\n {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}\n {% endif %}\n\n {{ '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' + message['content'] | trim + '<|eot_id|>' }}\n{% endfor %}\n\n{% if add_generation_prompt %}\n {{ '<|start_header_id|>' + 'assistant' + '<|end_header_id|>\n\n' }}\n{% endif %}",
73
+ "clean_up_tokenization_spaces": false,
74
+ "eos_token": "</s>",
75
+ "extra_special_tokens": {},
76
+ "legacy": true,
77
+ "model_max_length": 1000000000000000019884624838656,
78
+ "pad_token": "<pad>",
79
+ "padding_side": "right",
80
+ "sp_model_kwargs": {},
81
+ "spaces_between_special_tokens": false,
82
+ "tokenizer_class": "LlamaTokenizer",
83
+ "unk_token": "<unk>",
84
+ "use_default_system_prompt": false
85
+ }