Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,86 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
|
|
|
9 |
|
|
|
|
|
|
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
|
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
|
|
31 |
|
32 |
-
-
|
33 |
-
-
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
|
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
-
|
58 |
-
## Bias, Risks, and Limitations
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
+
base_model:
|
3 |
+
- tokyotech-llm/Swallow-7b-hf
|
4 |
+
- tokyotech-llm/Swallow-7b-instruct-hf
|
5 |
+
- nitky/Superswallow-7b-v0.1
|
6 |
+
- nitky/Superswallow-7b-v0.2
|
7 |
+
- nitky/Superswallow-7b-v0.3
|
8 |
library_name: transformers
|
9 |
+
tags:
|
10 |
+
- merge
|
11 |
+
- moe
|
12 |
+
- lisa
|
13 |
+
license: cc-by-nc-sa-4.0
|
14 |
+
datasets:
|
15 |
+
- kunishou/amenokaku-code-instruct
|
16 |
+
- llm-jp/oasst1-21k-en
|
17 |
+
- hieunguyenminh/roleplay
|
18 |
+
- meta-math/MetaMathQA
|
19 |
+
- kunishou/jp-effective-instructions
|
20 |
+
language:
|
21 |
+
- ja
|
22 |
---
|
23 |
|
24 |
+
# Swallow-MoE-4x7B-lisa
|
25 |
|
26 |
+
## 概要
|
27 |
+
[tokyotech-llm/Swallow-7b-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-hf)をベースに、以下の4モデルをgate_mode=randomでMoEし、その後[LISA](https://arxiv.org/abs/2403.17919)という手法でインストラクションチューニングを施したモデルです。
|
28 |
|
29 |
+
- [tokyotech-llm/Swallow-7b-instruct-hf](https://huggingface.co/tokyotech-llm/Swallow-7b-instruct-hf)
|
30 |
+
- [nitky/Superswallow-7b-v0.1](https://huggingface.co/nitky/Superswallow-7b-v0.1)
|
31 |
+
- [nitky/Superswallow-7b-v0.2](https://huggingface.co/nitky/Superswallow-7b-v0.2)
|
32 |
+
- [nitky/Superswallow-7b-v0.3](https://huggingface.co/nitky/Superswallow-7b-v0.3)
|
33 |
|
34 |
+
お試しで作ってみたものなので、性能にはあまり期待しないでください。以下にベンチマーク結果も記載しております。
|
35 |
|
36 |
+
**なお、この学習で使ったLISAの実装には[不具合がある可能性](https://github.com/OptimalScale/LMFlow/issues/726)が指摘されており、正常に学習できていない可能性があります。**
|
37 |
|
38 |
+
## データセット
|
39 |
+
以下の合計14327件のデータを学習に利用しました。プロンプトフォーマットはAlpacaを利用しています。
|
40 |
|
41 |
+
- [kunishou/amenokaku-code-instruct](https://huggingface.co/datasets/kunishou/amenokaku-code-instruct)の各sourceから最大100件、計1475件
|
42 |
+
- [kunishou/jp-effective-instructions](https://huggingface.co/datasets/kunishou/jp-effective-instructions)のinstructionとoutputがともに11文字以上のデータ、計5050件
|
43 |
+
- [llm-jp/oasst1-21k-en](https://huggingface.co/datasets/llm-jp/oasst1-21k-en)よりランダムな1000件(英語)
|
44 |
+
- [hieunguyenminh/roleplay](https://huggingface.co/datasets/hieunguyenminh/roleplay)よりランダムな1000件(英語)
|
45 |
+
- [meta-math/MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA)よりランダムな1000件(英語)
|
46 |
+
- [ichikara-instruction](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/)より、4802件
|
47 |
|
48 |
+
なお、ichikara-instructionの利用によりCC-BY-NC-SAを継承します。
|
49 |
|
50 |
+
## 学習の設定
|
51 |
+
主な学習パラメータは以下の通りです。なお、学習途中でのエラーのため2epochs程度しか学習できておりません。
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
+
- lisa_activated_layers: 8
|
54 |
+
- lisa_interval_steps: 13
|
55 |
+
- learning_rate: 5e-5
|
56 |
+
- num_train_epochs: 約2epochs
|
57 |
+
- batch_size: 64
|
58 |
+
- max_seq_length: 2048
|
59 |
|
60 |
+
## 評価
|
61 |
+
マージに利用したモデル群と本モデルの[japanese-mt-bench](https://github.com/Stability-AI/FastChat/tree/jp-stable/fastchat/llm_judge)の結果は以下の通りです。(シングルターン)
|
62 |
|
63 |
+
Swallow-instructよりはスコアが高く、Superswallowよりは低いという何とも言えない結果になっております。
|
64 |
+
とはいえ、少量のデータセット・たった2epochsの学習でSwallow-instructを超えられているのは一定の成果とも言えるかもしれません。
|
|
|
65 |
|
66 |
+
|Model|Size|Coding|Extraction|Humanities|Math|Reasoning|Roleplay|STEM|Writing|avg_score|
|
67 |
+
|---|---|---|---|---|---|---|---|---|---|---|
|
68 |
+
| Swallow-7b-instruct-hf | 7B | 2.0 | 4.6 | 5.4 | 1.7 | 2.8 | 5.0 | 5.9 | 6.9 | 4.2875 |
|
69 |
+
| Superswallow-7b-v0.1 | 7B | 2.0 | 5.1 | 7.8 | 2.1 | 3.6 | 6.2 | 7.3 | 7.5 | 5.2000 |
|
70 |
+
| Superswallow-7b-v0.2 | 7B | 2.2 | 5.8 | 6.7 | 2.5 | 4.3 | 5.5 | 6.6 | 5.8 | 4.9250 |
|
71 |
+
| Superswallow-7b-v0.3 | 7B | 2.1 | 4.6 | 8.3 | 2.1 | 5.0 | 6.3 | 7.7 | 8.9 | 5.6250 |
|
72 |
+
| **This model** | **4x7B** | **2.0** | **3.4** | **7.5** | **1.9** | **2.6** | **5.5** | **6.3** | **7.5** | **4.5875** |
|
73 |
|
74 |
+
![レーダーチャート](./japanese_mt_bench.png)
|
75 |
|
76 |
+
同様に、jsquad(jsquad-1.1-0.3, 2-shots)、jcommonsenseqa(jcommonsenseqa-1.1-0.3, 3-shots)、jnli(jnli-1.3-0.3, 3-shots)、marc_ja(marc_ja-1.1-0.3, 3-shots)結果は以下の通りです。(jsquadは100で割り、それぞれ小数点以下第4位を四捨五入)
|
77 |
+
ここでもSwallow-instructよりはスコアが高く、Superswallowよりは低い結果になっています。なお、こちらは参考として本モデルのインストラクションチューニング前(MoEのみ)のモデルのスコアも載せてあります。
|
78 |
|
79 |
+
|Model|Size|jsquad(exact_match)|jcommonsenseqa(acc)|jnli(acc)|marc_ja(acc)|average|
|
80 |
+
|---|---|---|---|---|---|---|
|
81 |
+
| Swallow-7b-instruct-hf | 7B | 0.757 | 0.831 | 0.212 | 0.945 | 0.686 |
|
82 |
+
| Superswallow-7b-v0.1 | 7B | 0.441 | 0.846 | 0.374 | 0.966 | 0.657 |
|
83 |
+
| Superswallow-7b-v0.2 | 7B | 0.722 | 0.846 | 0.381 | 0.964 | 0.728 |
|
84 |
+
| Superswallow-7b-v0.3 | 7B | 0.721 | 0.850 | 0.362 | 0.964 | 0.724 |
|
85 |
+
| **This model without fine-tuning** | **4x7B** | **0.674** | **0.809** | **0.333** | **0.952** | **0.692** |
|
86 |
+
| **This model** | **4x7B** | **0.741** | **0.806** | **0.385** | **0.948** | **0.719** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|