RichardErkhov commited on
Commit
8dcc09a
·
verified ·
1 Parent(s): 6b7698b

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +231 -0
README.md ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ llama-3-youko-8b-instruct - GGUF
11
+ - Model creator: https://huggingface.co/rinna/
12
+ - Original model: https://huggingface.co/rinna/llama-3-youko-8b-instruct/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [llama-3-youko-8b-instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q2_K.gguf) | Q2_K | 2.96GB |
18
+ | [llama-3-youko-8b-instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.IQ3_XS.gguf) | IQ3_XS | 3.28GB |
19
+ | [llama-3-youko-8b-instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.IQ3_S.gguf) | IQ3_S | 3.43GB |
20
+ | [llama-3-youko-8b-instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q3_K_S.gguf) | Q3_K_S | 3.41GB |
21
+ | [llama-3-youko-8b-instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.IQ3_M.gguf) | IQ3_M | 3.52GB |
22
+ | [llama-3-youko-8b-instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q3_K.gguf) | Q3_K | 3.74GB |
23
+ | [llama-3-youko-8b-instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q3_K_M.gguf) | Q3_K_M | 3.74GB |
24
+ | [llama-3-youko-8b-instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q3_K_L.gguf) | Q3_K_L | 4.03GB |
25
+ | [llama-3-youko-8b-instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.IQ4_XS.gguf) | IQ4_XS | 4.18GB |
26
+ | [llama-3-youko-8b-instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q4_0.gguf) | Q4_0 | 4.34GB |
27
+ | [llama-3-youko-8b-instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.IQ4_NL.gguf) | IQ4_NL | 4.38GB |
28
+ | [llama-3-youko-8b-instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q4_K_S.gguf) | Q4_K_S | 4.37GB |
29
+ | [llama-3-youko-8b-instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q4_K.gguf) | Q4_K | 4.58GB |
30
+ | [llama-3-youko-8b-instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q4_K_M.gguf) | Q4_K_M | 4.58GB |
31
+ | [llama-3-youko-8b-instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q4_1.gguf) | Q4_1 | 4.78GB |
32
+ | [llama-3-youko-8b-instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q5_0.gguf) | Q5_0 | 5.21GB |
33
+ | [llama-3-youko-8b-instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q5_K_S.gguf) | Q5_K_S | 5.21GB |
34
+ | [llama-3-youko-8b-instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q5_K.gguf) | Q5_K | 5.34GB |
35
+ | [llama-3-youko-8b-instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q5_K_M.gguf) | Q5_K_M | 5.34GB |
36
+ | [llama-3-youko-8b-instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q5_1.gguf) | Q5_1 | 5.65GB |
37
+ | [llama-3-youko-8b-instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q6_K.gguf) | Q6_K | 6.14GB |
38
+ | [llama-3-youko-8b-instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/rinna_-_llama-3-youko-8b-instruct-gguf/blob/main/llama-3-youko-8b-instruct.Q8_0.gguf) | Q8_0 | 7.95GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ thumbnail: https://github.com/rinnakk/japanese-pretrained-models/blob/master/rinna.png
46
+ license: llama3
47
+ datasets:
48
+ - CohereForAI/aya_dataset
49
+ - kunishou/databricks-dolly-15k-ja
50
+ - kunishou/HelpSteer-35k-ja
51
+ - kunishou/HelpSteer2-20k-ja
52
+ - kunishou/hh-rlhf-49k-ja
53
+ - kunishou/oasst1-chat-44k-ja
54
+ - kunishou/oasst2-chat-68k-ja
55
+ - meta-math/MetaMathQA
56
+ - OpenAssistant/oasst1
57
+ - OpenAssistant/oasst2
58
+ - sahil2801/CodeAlpaca-20k
59
+ language:
60
+ - ja
61
+ - en
62
+ tags:
63
+ - llama
64
+ - llama-3
65
+ inference: false
66
+ ---
67
+
68
+ # `Llama 3 Youko 8B Instruct (rinna/llama-3-youko-8b-instruct)`
69
+
70
+ ![rinna-icon](./rinna.png)
71
+
72
+ # Overview
73
+
74
+ The model is the instruction-tuned version of [rinna/llama-3-youko-8b](https://huggingface.co/rinna/llama-3-youko-8b), using supervised fine-tuning (SFT), Chat Vector, and direct preference optimization (DPO). It adpots the Llama-3 chat format.
75
+
76
+ | Size | Continual Pre-Training | Instruction-Tuning |
77
+ | :- | :- | :- |
78
+ | 8B | Llama 3 Youko 8B [[HF]](https://huggingface.co/rinna/llama-3-youko-8b) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-8b-gptq) | Llama 3 Youko 8B Instruct [[HF]](https://huggingface.co/rinna/llama-3-youko-8b-instruct) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-8b-instruct-gptq) |
79
+ | 70B | Llama 3 Youko 70B [[HF]](https://huggingface.co/rinna/llama-3-youko-70b) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-70b-gptq) | Llama 3 Youko 70B Instruct [[HF]](https://huggingface.co/rinna/llama-3-youko-70b-instruct) [[GPTQ]](https://huggingface.co/rinna/llama-3-youko-70b-instruct-gptq) |
80
+
81
+ * **Model architecture**
82
+
83
+ A 32-layer, 4096-hidden-size transformer-based language model. Refer to the [Llama 3 Model Card](https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md) for architecture details.
84
+
85
+ * **Training: Built with Meta Llama 3**
86
+
87
+ **Supervised fine-tuning.** The supervised fine-tuning data is a subset of the following datasets.
88
+
89
+ - [CohereForAI/aya_dataset](https://huggingface.co/datasets/CohereForAI/aya_dataset)
90
+ - The JPN subset was used.
91
+ - [FLAN](https://github.com/google-research/FLAN/tree/main/flan/v2)
92
+ - [kunishou/databricks-dolly-15k-ja](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja)
93
+ - [kunishou/hh-rlhf-49k-ja](https://huggingface.co/datasets/kunishou/hh-rlhf-49k-ja)
94
+ - [kunishou/oasst1-chat-44k-ja](https://huggingface.co/datasets/kunishou/oasst1-chat-44k-ja)
95
+ - [kunishou/oasst2-chat-68k-ja](https://huggingface.co/datasets/kunishou/oasst2-chat-68k-ja)
96
+ - [meta-math/MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA)
97
+ - The following sections were used: MATH_AnsAug, MATH_Rephrased, MATH_SV, and MATH_FOBAR.
98
+ - The remaining sections, containing augmented data from commonly used evaluation corpora, were skipped for preventing any possibility of data leak.
99
+ - [OpenAssistant/oasst1](https://huggingface.co/datasets/OpenAssistant/oasst1)
100
+ - The EN and JA subsets were used.
101
+ - [OpenAssistant/oasst2](https://huggingface.co/datasets/OpenAssistant/oasst2)
102
+ - The EN and JA subsets were used.
103
+ - [sahil2801/CodeAlpaca-20k](https://huggingface.co/datasets/sahil2801/CodeAlpaca-20k)
104
+ - rinna Dataset
105
+
106
+ **Model merging.** The fine-tuned model (llama-3-youko-8b-sft) has been enhanced through the following chat vector addition. The chat vector was obtained by subtracting the parameter vectors of [meta-llama/Meta-Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B) from those of [meta-llama/Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct).
107
+
108
+ ~~~~text
109
+ llama-3-youko-8b-sft + 0.5 * (meta-llama/Meta-Llama-3-8B-Instruct - meta-llama/Meta-Llama-3-8B)
110
+ ~~~~
111
+
112
+ Here, the embedding layer was skipped while subtracting and adding the parameter vectors.
113
+
114
+ **Direct preference optimization** was then applied with a subset of the following datasets to build this instruct model.
115
+
116
+ - [kunishou/HelpSteer-35k-ja](https://huggingface.co/datasets/kunishou/HelpSteer-35k-ja)
117
+ - [kunishou/HelpSteer2-20k-ja](https://huggingface.co/datasets/kunishou/HelpSteer2-20k-ja)
118
+ - rinna Dataset
119
+
120
+ * **Contributors**
121
+
122
+ - [Xinqi Chen](https://huggingface.co/Keely0419)
123
+ - [Koh Mitsuda](https://huggingface.co/mitsu-koh)
124
+ - [Toshiaki Wakatsuki](https://huggingface.co/t-w)
125
+ - [Kei Sawada](https://huggingface.co/keisawada)
126
+
127
+ ---
128
+
129
+ # Benchmarking
130
+
131
+ Please refer to [rinna's LM benchmark page](https://rinnakk.github.io/research/benchmarks/lm/index.html).
132
+
133
+ ---
134
+
135
+ # How to use the model
136
+
137
+ We found this instruction-tuned model tends to generate repeated text more often than its base counterpart, and thus we set repetition_penalty=1.1 for better generation performance. The same repetition penalty was applied to the instruction-tuned model in the aforementioned evaluation experiments.
138
+
139
+ ~~~~python
140
+ import torch
141
+ from transformers import AutoTokenizer, AutoModelForCausalLM
142
+
143
+ model_id = "rinna/llama-3-youko-8b-instruct"
144
+
145
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
146
+ model = AutoModelForCausalLM.from_pretrained(
147
+ model_id,
148
+ torch_dtype=torch.bfloat16,
149
+ device_map="auto",
150
+ )
151
+
152
+ messages = [
153
+ {"role": "system", "content": "あなたは誠実で優秀なアシスタントです。どうか、簡潔かつ正直に答えてください。"},
154
+ {"role": "user", "content": "西田幾多郎とはどんな人物ですか?"},
155
+ ]
156
+
157
+ input_ids = tokenizer.apply_chat_template(
158
+ messages,
159
+ add_generation_prompt=True,
160
+ return_tensors="pt"
161
+ ).to(model.device)
162
+
163
+ terminators = [
164
+ tokenizer.convert_tokens_to_ids("<|end_of_text|>"),
165
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
166
+ ]
167
+
168
+ outputs = model.generate(
169
+ input_ids,
170
+ max_new_tokens=512,
171
+ eos_token_id=terminators,
172
+ do_sample=True,
173
+ temperature=0.6,
174
+ top_p=0.9,
175
+ repetition_penalty=1.1,
176
+ )
177
+
178
+ response = outputs[0][input_ids.shape[-1]:]
179
+ response = tokenizer.decode(response, skip_special_tokens=True)
180
+ print(response)
181
+ ~~~~
182
+
183
+ ---
184
+
185
+ # Tokenization
186
+ The model uses the original [meta-llama/Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) tokenizer.
187
+
188
+ ---
189
+
190
+ # How to cite
191
+ ```bibtex
192
+ @misc{rinna-llama-3-youko-8b-instruct,
193
+ title = {rinna/llama-3-youko-8b-instruct},
194
+ author = {Chen, Xinqi and Mitsuda, Koh and Wakatsuki, Toshiaki and Sawada, Kei},
195
+ url = {https://huggingface.co/rinna/llama-3-youko-8b-instruct}
196
+ }
197
+
198
+ @inproceedings{sawada2024release,
199
+ title = {Release of Pre-Trained Models for the {J}apanese Language},
200
+ author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
201
+ booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
202
+ month = {5},
203
+ year = {2024},
204
+ pages = {13898--13905},
205
+ url = {https://aclanthology.org/2024.lrec-main.1213},
206
+ note = {\url{https://arxiv.org/abs/2404.01657}}
207
+ }
208
+ ```
209
+ ---
210
+
211
+ # References
212
+ ```bibtex
213
+ @article{llama3modelcard,
214
+ title = {Llama 3 Model Card},
215
+ author = {AI@Meta},
216
+ year = {2024},
217
+ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
218
+ }
219
+
220
+ @article{huang2023chat,
221
+ title = {Chat Vector: A Simple Approach to Equip LLMs with Instruction Following and Model Alignment in New Languages},
222
+ author = {Huang, Shih-Cheng and Li, Pin-Zu and Hsu, Yu-Chi and Chen, Kuang-Ming and Lin, Yu Tung and Hsiao, Shih-Kai and Tzong-Han Tsai, Richard and Lee, Hung-yi},
223
+ year = {2023},
224
+ url = {https://arxiv.org/abs/2310.04799}
225
+ }
226
+ ```
227
+ ---
228
+
229
+ # License
230
+ [Meta Llama 3 Community License](https://llama.meta.com/llama3/license/)
231
+