Taka008 commited on
Commit
723173e
·
verified ·
1 Parent(s): a44370c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +319 -0
README.md ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - ja
6
+ programming_language:
7
+ - C
8
+ - C++
9
+ - C#
10
+ - Go
11
+ - Java
12
+ - JavaScript
13
+ - Lua
14
+ - PHP
15
+ - Python
16
+ - Ruby
17
+ - Rust
18
+ - Scala
19
+ - TypeScript
20
+ pipeline_tag: text-generation
21
+ library_name: transformers
22
+ inference: false
23
+ ---
24
+ # llm-jp-3-440m-instruct2
25
+
26
+ LLM-jp-3 is the series of large language models developed by the [Research and Development Center for Large Language Models](https://llmc.nii.ac.jp/) at the [National Institute of Informatics](https://www.nii.ac.jp/en/).
27
+
28
+ This repository provides **llm-jp-3-44---
29
+ license: apache-2.0
30
+ language:
31
+ - en
32
+ - ja
33
+ programming_language:
34
+ - C
35
+ - C++
36
+ - C#
37
+ - Go
38
+ - Java
39
+ - JavaScript
40
+ - Lua
41
+ - PHP
42
+ - Python
43
+ - Ruby
44
+ - Rust
45
+ - Scala
46
+ - TypeScript
47
+ pipeline_tag: text-generation
48
+ library_name: transformers
49
+ inference: false
50
+ ---
51
+ # llm-jp-3-150m-instruct2
52
+
53
+ LLM-jp-3 is the series of large language models developed by the [Research and Development Center for Large Language Models](https://llmc.nii.ac.jp/) at the [National Institute of Informatics](https://www.nii.ac.jp/en/).
54
+
55
+ This repository provides **llm-jp-3-150m-instruct2** model.
56
+ For an overview of the LLM-jp-3 models across different parameter sizes, please refer to:
57
+ - [LLM-jp-3 Pre-trained Models](https://huggingface.co/collections/llm-jp/llm-jp-3-pre-trained-models-672c6096472b65839d76a1fa)
58
+ - [LLM-jp-3 Fine-tuned Models](https://huggingface.co/collections/llm-jp/llm-jp-3-fine-tuned-models-672c621db852a01eae939731).
59
+
60
+
61
+ Checkpoints format: Hugging Face Transformers
62
+
63
+
64
+ ## Required Libraries and Their Versions
65
+
66
+ - torch>=2.3.0
67
+ - transformers>=4.40.1
68
+ - tokenizers>=0.19.1
69
+ - accelerate>=0.29.3
70
+ - flash-attn>=2.5.8
71
+
72
+ ## Usage
73
+
74
+ ```python
75
+ import torch
76
+ from transformers import AutoTokenizer, AutoModelForCausalLM
77
+ tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-3-440m-instruct2")
78
+ model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-440m-instruct2", device_map="auto", torch_dtype=torch.bfloat16)
79
+ chat = [
80
+ {"role": "system", "content": "以下は、タスクを説明する指示です。要求を適切に満たす応答を書きなさい。"},
81
+ {"role": "user", "content": "自然言語処理とは何か"},
82
+ ]
83
+ tokenized_input = tokenizer.apply_chat_template(chat, add_generation_prompt=True, tokenize=True, return_tensors="pt").to(model.device)
84
+ with torch.no_grad():
85
+ output = model.generate(
86
+ tokenized_input,
87
+ max_new_tokens=100,
88
+ do_sample=True,
89
+ top_p=0.95,
90
+ temperature=0.7,
91
+ repetition_penalty=1.05,
92
+ )[0]
93
+ print(tokenizer.decode(output))
94
+ ```
95
+
96
+
97
+ ## Model Details
98
+
99
+ - **Model type:** Transformer-based Language Model
100
+ - **Total seen tokens:** 2.1T tokens
101
+
102
+ |Params|Layers|Hidden size|Heads|Context length|Embedding parameters|Non-embedding parameters|
103
+ |:---:|:---:|:---:|:---:|:---:|:---:|:---:|
104
+ |150M|12|512|8|4096|101,874,688|50,344,448|
105
+ |440M|16|1024|8|4096|203,749,376|243,303,424|
106
+ |980M|20|1536|8|4096|305,624,064|684,258,816|
107
+ |1.8b|24|2048|16|4096|407,498,752|1,459,718,144|
108
+ |3.7b|28|3072|24|4096|611,248,128|3,171,068,928|
109
+ |7.2b|32|4096|32|4096|814,997,504|6,476,271,616|
110
+ |13b|40|5120|40|4096|1,018,746,880|12,688,184,320|
111
+ |172b|96|12288|96|4096|2,444,992,512|169,947,181,056|
112
+
113
+ ## Tokenizer
114
+
115
+ The tokenizer of this model is based on [huggingface/tokenizers](https://github.com/huggingface/tokenizers) Unigram byte-fallback model.
116
+ The vocabulary entries were converted from [`llm-jp-tokenizer v3.0`](https://github.com/llm-jp/llm-jp-tokenizer/releases/tag/v3.0b2).
117
+ Please refer to [README.md](https://github.com/llm-jp/llm-jp-tokenizer) of `llm-jp-tokenizer` for details on the vocabulary construction procedure (the pure SentencePiece training does not reproduce our vocabulary).
118
+
119
+ ## Datasets
120
+
121
+ ### Pre-training
122
+
123
+ The models have been pre-trained using a blend of the following datasets.
124
+
125
+ | Language | Dataset | Tokens|
126
+ |:---|:---|---:|
127
+ |Japanese|[Wikipedia](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|2.6B
128
+ ||[Common Crawl](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|762.8B
129
+ ||[WARP/PDF](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|237.3B
130
+ ||[WARP/HTML](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|2.7B
131
+ ||[Kaken](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|1.8B
132
+ |English|[Wikipedia](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|4.7B
133
+ ||[Dolma/CC-head](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|608.5B
134
+ ||[Dolma/C4](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|181.6B
135
+ ||[Dolma/Reddit](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|83.1B
136
+ ||[Dolma/PeS2o](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|62.9B
137
+ ||[Dolma/Gutenberg](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|5.5B
138
+ ||[Dolma/Wiki](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|3.9B
139
+ |Code|[The Stack](https://huggingface.co/datasets/bigcode/the-stack)|114.1B
140
+ |Chinese|[Wikipedia](https://huggingface.co/datasets/bigcode/the-stack)|0.8B
141
+ |Korean|[Wikipedia](https://huggingface.co/datasets/bigcode/the-stack)|0.3B
142
+
143
+ ### Post-training
144
+
145
+ We have fine-tuned the pre-trained checkpoint with supervised fine-tuning.
146
+
147
+ #### Supervised Fine-tuning
148
+ The datasets used for supervised fine-tuning are as follows:
149
+
150
+ | Language | Dataset | Description |
151
+ |:---|:---|:---|
152
+ |Japanese|[ichikara-instruction-004-002](https://liat-aip.sakura.ne.jp/wp/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e4%bd%9c%e6%88%90/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf-%e5%85%ac%e9%96%8b/)| A manually constructed instruction dataset. |
153
+ | |[AnswerCarefully (ver2.0)](https://huggingface.co/datasets/llm-jp/AnswerCarefully)| A manually constructed instruction dataset focusing on LLMs' safety. |
154
+ | |ichikara-instruction-format| A small subset of the ichikara-instruction dataset, edited with some constraints on the output format. |
155
+ | |[AutoMultiTurnByCalm3-22B](https://huggingface.co/datasets/kanhatakeyama/AutoMultiTurnByCalm3-22B)| A synthetic instruction dataset. |
156
+ | |[ramdom-to-fixed-multiturn-Calm3](https://huggingface.co/datasets/kanhatakeyama/ramdom-to-fixed-multiturn-Calm3)| A synthetic instruction dataset. |
157
+ | |[wizardlm8x22b-logical-math-coding-sft-ja](https://huggingface.co/datasets/llm-jp/wizardlm8x22b-logical-math-coding-sft-ja)| A synthetic instruction dataset. |
158
+ | |[magpie-sft-v1.0](https://huggingface.co/datasets/llm-jp/magpie-sft-v1.0)| A synthetic instruction dataset we created. |
159
+ |English|[Daring-Anteater](https://huggingface.co/datasets/nvidia/Daring-Anteater)| - |
160
+ | |[FLAN](https://huggingface.co/datasets/llm-jp/FLAN/blob/main/README.md) | - |
161
+ |Japanese & English|[Synthetic-JP-EN-Coding-Dataset](https://huggingface.co/datasets/llm-jp/Synthetic-JP-EN-Coding-Dataset)| A synthetic instruction dataset. |
162
+
163
+
164
+ ## Evaluation
165
+
166
+ Detailed evaluation results are reported in this blog.
167
+
168
+
169
+ ## Risks and Limitations
170
+
171
+ The models released here are in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.
172
+
173
+
174
+ ## Send Questions to
175
+
176
+ llm-jp(at)nii.ac.jp
177
+
178
+
179
+ ## License
180
+
181
+ [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
182
+
183
+ ## Model Card Authors
184
+
185
+ *The names are listed in alphabetical order.*
186
+
187
+ Hirokazu Kiyomaru and Takashi Kodama.0m-instruct2** model.
188
+ For an overview of the LLM-jp-3 models across different parameter sizes, please refer to:
189
+ - [LLM-jp-3 Pre-trained Models](https://huggingface.co/collections/llm-jp/llm-jp-3-pre-trained-models-672c6096472b65839d76a1fa)
190
+ - [LLM-jp-3 Fine-tuned Models](https://huggingface.co/collections/llm-jp/llm-jp-3-fine-tuned-models-672c621db852a01eae939731).
191
+
192
+
193
+ Checkpoints format: Hugging Face Transformers
194
+
195
+
196
+ ## Required Libraries and Their Versions
197
+
198
+ - torch>=2.3.0
199
+ - transformers>=4.40.1
200
+ - tokenizers>=0.19.1
201
+ - accelerate>=0.29.3
202
+ - flash-attn>=2.5.8
203
+
204
+ ## Usage
205
+
206
+ ```python
207
+ import torch
208
+ from transformers import AutoTokenizer, AutoModelForCausalLM
209
+ tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-3-150m-instruct2")
210
+ model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-150m-instruct2", device_map="auto", torch_dtype=torch.bfloat16)
211
+ chat = [
212
+ {"role": "system", "content": "以下は、タスクを説明する指示です。要求を適切に満たす応答を書きなさい。"},
213
+ {"role": "user", "content": "自然言語処理とは何か"},
214
+ ]
215
+ tokenized_input = tokenizer.apply_chat_template(chat, add_generation_prompt=True, tokenize=True, return_tensors="pt").to(model.device)
216
+ with torch.no_grad():
217
+ output = model.generate(
218
+ tokenized_input,
219
+ max_new_tokens=100,
220
+ do_sample=True,
221
+ top_p=0.95,
222
+ temperature=0.7,
223
+ repetition_penalty=1.05,
224
+ )[0]
225
+ print(tokenizer.decode(output))
226
+ ```
227
+
228
+
229
+ ## Model Details
230
+
231
+ - **Model type:** Transformer-based Language Model
232
+ - **Total seen tokens:** 2.1T tokens
233
+
234
+ |Params|Layers|Hidden size|Heads|Context length|Embedding parameters|Non-embedding parameters|
235
+ |:---:|:---:|:---:|:---:|:---:|:---:|:---:|
236
+ |150M|12|512|8|4096|101,874,688|50,344,448|
237
+ |440M|16|1024|8|4096|203,749,376|243,303,424|
238
+ |980M|20|1536|8|4096|305,624,064|684,258,816|
239
+ |1.8b|24|2048|16|4096|407,498,752|1,459,718,144|
240
+ |3.7b|28|3072|24|4096|611,248,128|3,171,068,928|
241
+ |7.2b|32|4096|32|4096|814,997,504|6,476,271,616|
242
+ |13b|40|5120|40|4096|1,018,746,880|12,688,184,320|
243
+ |172b|96|12288|96|4096|2,444,992,512|169,947,181,056|
244
+
245
+ ## Tokenizer
246
+
247
+ The tokenizer of this model is based on [huggingface/tokenizers](https://github.com/huggingface/tokenizers) Unigram byte-fallback model.
248
+ The vocabulary entries were converted from [`llm-jp-tokenizer v3.0`](https://github.com/llm-jp/llm-jp-tokenizer/releases/tag/v3.0b2).
249
+ Please refer to [README.md](https://github.com/llm-jp/llm-jp-tokenizer) of `llm-jp-tokenizer` for details on the vocabulary construction procedure (the pure SentencePiece training does not reproduce our vocabulary).
250
+
251
+ ## Datasets
252
+
253
+ ### Pre-training
254
+
255
+ The models have been pre-trained using a blend of the following datasets.
256
+
257
+ | Language | Dataset | Tokens|
258
+ |:---|:---|---:|
259
+ |Japanese|[Wikipedia](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|2.6B
260
+ ||[Common Crawl](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|762.8B
261
+ ||[WARP/PDF](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|237.3B
262
+ ||[WARP/HTML](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|2.7B
263
+ ||[Kaken](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|1.8B
264
+ |English|[Wikipedia](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|4.7B
265
+ ||[Dolma/CC-head](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|608.5B
266
+ ||[Dolma/C4](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|181.6B
267
+ ||[Dolma/Reddit](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|83.1B
268
+ ||[Dolma/PeS2o](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|62.9B
269
+ ||[Dolma/Gutenberg](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|5.5B
270
+ ||[Dolma/Wiki](https://gitlab.llm-jp.nii.ac.jp/datasets/llm-jp-corpus-v3)|3.9B
271
+ |Code|[The Stack](https://huggingface.co/datasets/bigcode/the-stack)|114.1B
272
+ |Chinese|[Wikipedia](https://huggingface.co/datasets/bigcode/the-stack)|0.8B
273
+ |Korean|[Wikipedia](https://huggingface.co/datasets/bigcode/the-stack)|0.3B
274
+
275
+ ### Post-training
276
+
277
+ We have fine-tuned the pre-trained checkpoint with supervised fine-tuning.
278
+
279
+ #### Supervised Fine-tuning
280
+ The datasets used for supervised fine-tuning are as follows:
281
+
282
+ | Language | Dataset | Description |
283
+ |:---|:---|:---|
284
+ |Japanese|[ichikara-instruction-004-002](https://liat-aip.sakura.ne.jp/wp/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e4%bd%9c%e6%88%90/llm%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf-%e5%85%ac%e9%96%8b/)| A manually constructed instruction dataset. |
285
+ | |[AnswerCarefully (ver2.0)](https://huggingface.co/datasets/llm-jp/AnswerCarefully)| A manually constructed instruction dataset focusing on LLMs' safety. |
286
+ | |ichikara-instruction-format| A small subset of the ichikara-instruction dataset, edited with some constraints on the output format. |
287
+ | |[AutoMultiTurnByCalm3-22B](https://huggingface.co/datasets/kanhatakeyama/AutoMultiTurnByCalm3-22B)| A synthetic instruction dataset. |
288
+ | |[ramdom-to-fixed-multiturn-Calm3](https://huggingface.co/datasets/kanhatakeyama/ramdom-to-fixed-multiturn-Calm3)| A synthetic instruction dataset. |
289
+ | |[wizardlm8x22b-logical-math-coding-sft-ja](https://huggingface.co/datasets/llm-jp/wizardlm8x22b-logical-math-coding-sft-ja)| A synthetic instruction dataset. |
290
+ | |[magpie-sft-v1.0](https://huggingface.co/datasets/llm-jp/magpie-sft-v1.0)| A synthetic instruction dataset we created. |
291
+ |English|[Daring-Anteater](https://huggingface.co/datasets/nvidia/Daring-Anteater)| - |
292
+ | |[FLAN](https://huggingface.co/datasets/llm-jp/FLAN/blob/main/README.md) | - |
293
+ |Japanese & English|[Synthetic-JP-EN-Coding-Dataset](https://huggingface.co/datasets/llm-jp/Synthetic-JP-EN-Coding-Dataset)| A synthetic instruction dataset. |
294
+
295
+
296
+ ## Evaluation
297
+
298
+ Detailed evaluation results are reported in this blog.
299
+
300
+
301
+ ## Risks and Limitations
302
+
303
+ The models released here are in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.
304
+
305
+
306
+ ## Send Questions to
307
+
308
+ llm-jp(at)nii.ac.jp
309
+
310
+
311
+ ## License
312
+
313
+ [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
314
+
315
+ ## Model Card Authors
316
+
317
+ *The names are listed in alphabetical order.*
318
+
319
+ Hirokazu Kiyomaru and Takashi Kodama.