Commit
•
b1835fc
1
Parent(s):
8ed9f00
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-sa-4.0
|
3 |
+
datasets:
|
4 |
+
- OpenAssistant/oasst2
|
5 |
+
- nvidia/HelpSteer
|
6 |
+
language:
|
7 |
+
- ja
|
8 |
+
- en
|
9 |
+
library_name: transformers
|
10 |
+
base_model: karakuri-ai/karakuri-lm-70b-v0.1
|
11 |
+
pipeline_tag: conversational
|
12 |
+
tags:
|
13 |
+
- llama
|
14 |
+
- llama-2
|
15 |
+
- steerlm
|
16 |
+
model-index:
|
17 |
+
- name: karakuri-ai/karakuri-lm-70b-chat-v0.1
|
18 |
+
results:
|
19 |
+
- task:
|
20 |
+
type: text-generation
|
21 |
+
name: Text Generation
|
22 |
+
dataset:
|
23 |
+
name: MT-Bench
|
24 |
+
type: unknown
|
25 |
+
metrics:
|
26 |
+
- type: unknown
|
27 |
+
name: score
|
28 |
+
value: 6.609375
|
29 |
+
source:
|
30 |
+
url: https://huggingface.co/spaces/lmsys/mt-bench
|
31 |
+
- task:
|
32 |
+
type: text-generation
|
33 |
+
name: Text Generation
|
34 |
+
dataset:
|
35 |
+
name: MT-Bench-jp
|
36 |
+
type: unknown
|
37 |
+
metrics:
|
38 |
+
- type: unknown
|
39 |
+
name: score
|
40 |
+
value: 6.43125
|
41 |
+
source:
|
42 |
+
url: https://api.wandb.ai/links/wandb-japan/6ff86bp3
|
43 |
+
---
|
44 |
+
|
45 |
+
# KARAKURI LM
|
46 |
+
|
47 |
+
KARAKURI LM is a pretrained language model that builds upon Llama 2.
|
48 |
+
Our model enhances Llama 2's capabilities by incorporating additional Japanese vocabulary and further pretraining on a mixture of Japanese and multilingual corpora.
|
49 |
+
|
50 |
+
KARAKURI LM Chat is a fine-tuned version of KARAKURI LM, which was trained on a mixture of publicly available and closed datasets using the [SteerLM](https://aclanthology.org/2023.findings-emnlp.754/) technique.
|
51 |
+
During fine-tuning, our model employed a continual learning approach.
|
52 |
+
Unlike the common practice of relying solely on structured conversational datasets, we also incorporated unstructured corpora, similar to what was used during its pretraining phase.
|
53 |
+
|
54 |
+
Despite the conversational datasets containing only 2.5% Japanese tokens, our model has shown remarkable performance.
|
55 |
+
It achieves the highest performance among Japanese open models on the [MT-Bench-jp](https://api.wandb.ai/links/wandb-japan/6ff86bp3) at the time of release.
|
56 |
+
Furthermore, it achieves performance comparable to Llama 2 70B Chat on the original English [MT-Bench](https://huggingface.co/spaces/lmsys/mt-bench).
|
57 |
+
|
58 |
+
You can find more details in our blog post (coming soon).
|
59 |
+
If you are curious about our model, give our [demo](https://lm.karakuri.cc/) a try.
|
60 |
+
|
61 |
+
## Model Details
|
62 |
+
|
63 |
+
- **Developed by**: [KARAKURI Inc.](https://about.karakuri.ai/)
|
64 |
+
- **Model type**: Causal decoder-only transformer language model
|
65 |
+
- **Languages**: English and Japanese
|
66 |
+
- **Finetuned from**: [karakuri-ai/karakuri-lm-70b-v0.1](https://huggingface.co/karakuri-ai/karakuri-lm-70b-v0.1)
|
67 |
+
- **Contact**: For questions and comments about the model, please email `karakuri-rd@karakuri.ai`
|
68 |
+
|
69 |
+
## Performance
|
70 |
+
|
71 |
+
At the time of release, KARAKURI LM 70B Chat v0.1 achieves the highest performance among Japanese open models on the [MT-Bench-jp](https://api.wandb.ai/links/wandb-japan/6ff86bp3):
|
72 |
+
|
73 |
+
| Model | Size | Alignment | MT-Bench-jp |
|
74 |
+
| :---------------------------------- | :-----: | :---------: | ----------: |
|
75 |
+
| GPT-4 | - | RLHF | 8.78 |
|
76 |
+
| GPT-3.5-Turbo | - | RLHF | 8.24 |
|
77 |
+
| Claude 2.1 | - | RLHF | 8.18 |
|
78 |
+
| Gemini Pro | - | RLHF | 7.17 |
|
79 |
+
| **KARAKURI LM 70B Chat v0.1** | **70B** | **SteerLM** | **6.43** |
|
80 |
+
| Qarasu-14B-Chat-Plus-Unleashed | 14B | SFT | 6.26 |
|
81 |
+
| Llama 2 70B Chat | 70B | RLHF | 5.23 |
|
82 |
+
| ELYZA-Japanese-Llama-2-13B | 13B | SFT | 5.05 |
|
83 |
+
| Japanese-StableLM-Instruct-Beta-70B | 70B | SFT | 5.03 |
|
84 |
+
| Swallow-70B-Instruct | 70B | SFT | 4.39 |
|
85 |
+
|
86 |
+
It also achieves performance comparable to Llama 2 70B Chat on the original English [MT-Bench](https://huggingface.co/spaces/lmsys/mt-bench):
|
87 |
+
|
88 |
+
| Model | Average | MT-Bench | MT-Bench-jp |
|
89 |
+
| :---------------------------- | -------: | -------: | ----------: |
|
90 |
+
| **KARAKURI LM 70B Chat v0.1** | **6.52** | **6.61** | **6.43** |
|
91 |
+
| Llama 2 70B Chat | 6.04 | 6.86 | 5.23 |
|
92 |
+
|
93 |
+
## Use in 🤗 Transformers
|
94 |
+
|
95 |
+
You can run the model using the `pipeline()` function from 🤗 Transformers:
|
96 |
+
|
97 |
+
```python
|
98 |
+
from transformers import pipeline, Conversation
|
99 |
+
|
100 |
+
chatbot = pipeline("conversational", model="karakuri-ai/karakuri-lm-70b-chat-v0.1", device_map="auto", torch_dtype="auto")
|
101 |
+
|
102 |
+
conversation = Conversation("週末に日帰りで東京に遊びに行こうと思っています。日帰りなので、短時間で回れるおすすめの観光プランを教えてください。")
|
103 |
+
conversation = chatbot(conversation, max_new_tokens=512)
|
104 |
+
conversation.messages[-1]["content"]
|
105 |
+
```
|
106 |
+
|
107 |
+
We use the following prompt template of multi-turn conversation in the Llama format, which includes an encoded string of multiple attribute values.
|
108 |
+
|
109 |
+
```python
|
110 |
+
messages = [
|
111 |
+
{"role": "system", "content": "System prompt"},
|
112 |
+
{"role": "user", "content": "User prompt"},
|
113 |
+
{"role": "assistant", "content": "Model response"},
|
114 |
+
{"role": "user", "content": "User prompt"},
|
115 |
+
]
|
116 |
+
chatbot.tokenizer.apply_chat_template(messages, tokenize=False)
|
117 |
+
# <s>[INST] <<SYS>>
|
118 |
+
# System prompt
|
119 |
+
# <</SYS>>
|
120 |
+
#
|
121 |
+
# User prompt [ATTR] helpfulness: 4 correctness: 4 coherence: 4 complexity: 4 verbosity: 4 quality: 4 toxicity: 0 humor: 0 creativity: 0 [/ATTR] [/INST] Model response </s><s>[INST] User prompt [ATTR] helpfulness: 4 correctness: 4 coherence: 4 complexity: 4 verbosity: 4 quality: 4 toxicity: 0 humor: 0 creativity: 0 [/ATTR] [/INST]
|
122 |
+
```
|
123 |
+
|
124 |
+
The prompt template contains nine attributes.
|
125 |
+
The first five are derived from HelpSteer, while the remaining four are derived from OASST2.
|
126 |
+
The values are represented by integers ranging from 0 to 4, with 0 being the lowest and 4 being the highest.
|
127 |
+
|
128 |
+
- helpfulness (default: 4)
|
129 |
+
- correctness (default: 4)
|
130 |
+
- coherence (default: 4)
|
131 |
+
- complexity (default: 4)
|
132 |
+
- verbosity (default: 4)
|
133 |
+
- quality (default: 4)
|
134 |
+
- toxicity (default: 0)
|
135 |
+
- humor (default: 0)
|
136 |
+
- creativity (default: 0)
|
137 |
+
|
138 |
+
You can change the attribute values by replacing the default values specified in the chat template:
|
139 |
+
|
140 |
+
```python
|
141 |
+
chatbot.tokenizer.chat_template = chatbot.tokenizer.chat_template.replace("complexity: 4", "complexity: 0")
|
142 |
+
```
|
143 |
+
|
144 |
+
## Training
|
145 |
+
|
146 |
+
### Training Datasets
|
147 |
+
|
148 |
+
- [OASST2](https://huggingface.co/datasets/OpenAssistant/oasst2)
|
149 |
+
- Our internal conversational datasets
|
150 |
+
|
151 |
+
### Training Infrastructure
|
152 |
+
|
153 |
+
- **Hardware**: KARAKURI LM 70B was trained on 32 nodes of an Amazon EC2 trn1.32xlarge instance.
|
154 |
+
- **Software**: We use code based on [neuronx-nemo-megatron](https://github.com/aws-neuron/neuronx-nemo-megatron).
|
155 |
+
|
156 |
+
## Acknowledgements
|
157 |
+
|
158 |
+
We gratefully acknowledge the support from AWS Japan through the [AWS LLM Development Support Program](https://aws.amazon.com/jp/local/llm-development-support-program/).
|
159 |
+
|
160 |
+
## License
|
161 |
+
|
162 |
+
Llama 2 is licensed under the [LLAMA 2 Community License](https://ai.meta.com/llama/license/), Copyright © Meta Platforms, Inc. All Rights Reserved.
|
163 |
+
|
164 |
+
KARAKURI LM is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)).
|
165 |
+
Under this license, you are free to share and adapt this model, even for commercial purposes, as long as you provide appropriate credit and distribute your contributions under the same license.
|
166 |
+
|
167 |
+
However, if you wish to use KARAKURI LM for commercial purposes, we require that you contact us directly, regardless of the terms of the CC BY-SA 4.0 license.
|
168 |
+
If you have any questions regarding the interpretation of its terms, please also feel free to contact us.
|