Upload README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,166 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
2 |
license: cc-by-nc-sa-4.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- ko
|
5 |
+
pipeline_tag: text-generation
|
6 |
license: cc-by-nc-sa-4.0
|
7 |
---
|
8 |
+
|
9 |
+
# **Twice-KoSOLAR-16.1B-instruct-test**
|
10 |
+
|
11 |
+
## Model Details
|
12 |
+
|
13 |
+
**Model Developers** Kyujin Han (kyujinpy)
|
14 |
+
|
15 |
+
**๋ชจ๋ธ ๋ชฉ์ **
|
16 |
+
<img src='./solar.png'>
|
17 |
+
|
18 |
+
์ต๊ทผ, SOLAR-10.7B ๋ชจ๋ธ์ด [Depth-Up-Scaling](https://arxiv.org/pdf/2312.15166.pdf)(์์ ์ฌ์ง) ๋ฐฉ๋ฒ๋ก ์ ๋ด์ธ์์ LLM ๋ฆฌ๋๋ณด๋์์ ์ข์ ์ฑ๋ฅ์ ๋ณด์ด๊ณ ์๋ค. ๋๋ถ์ด์ `์ผ๋์`์์ ๋ง๋ `seungduk/KoSOLAR-10.7B-v0.1` ๋ชจ๋ธ์ Ko-LLM ๋ฆฌ๋๋ณด๋์ ํฐ ํ๊ธ๋ ฅ์ ๋ถ๋ฌ์ค๋ฉด์, ์์ผ๋ก์ ๋ฆฌ๋๋ณด๋์ ํ๋ฆ๋ ๋ฐ๋ ๊ฒ์ผ๋ก ์์๋๋ค.
|
19 |
+
|
20 |
+
์ฌ๊ธฐ์ ๋จ์ํ ํธ๊ธฐ์ฌ์ด ๋ค์๋ค. **Upstage์์ ๋ฐํํ Depth-Up-Scaling(DUS) ๋ฐฉ๋ฒ๋ก ์ mistral-7B ๋ชจ๋ธ 2๊ฐ๋ฅผ merge(passthrough)ํ ๋ฐฉ๋ฒ**์ด๋ค.
|
21 |
+
์ด๋ ๋๋๊ฒ๋, DUS ๋ฐฉ๋ฒ๋ก ์ ์ ์ฉํ `upstage/SOLAR-10.7B-v1.0`๋ชจ๋ธ์ ๊ธฐ์กด์ mistral-7B ๋ชจ๋ธ๋ณด๋ค ๋ฆฌ๋๋ณด๋์์ ๋์ ์ฑ๋ฅ์ ๊ธฐ๋กํ๋ค. (์๋์ ํ
์ด๋ธ ์ฐธ๊ณ )
|
22 |
+
๊ทธ๋ ๋ค๋ฉด, DUS ๋ฐฉ๋ฒ๋ก ์ ์ ํ์์ด, ๋ค๋ฅธ ๋ชจ๋ธ์ ์ ์ฉํ๋ฉด ๋๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ๋ฐ์ํ ์ง ๋๋ฌด๋ ๊ถ๊ธํ๋ค. ๐
|
23 |
+
์คํ์ ํตํด์ ๋์ ํธ๊ธฐ์ฌ์ ๋ํ ๊ฒฐ๋ก ์ ๋ด๋ ค๋ณด๊ณ ์ ํ๋ค. ๐๐
|
24 |
+
|
25 |
+
| Model | Average | ARC | HellaSwag | MMLU | TruthfulQA | Winogrande | GSM8K |
|
26 |
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
27 |
+
| [seungduk/KoSOLAR-10.7B-v0.1](https://huggingface.co/seungduk/KoSOLAR-10.7B-v0.1) | **66.04** | 62.03 | 84.54 | 65.56 | 45.03 | 83.58 | 55.50 |
|
28 |
+
| [upstage/SOLAR-10.7B-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-v1.0) | **66.04** | 61.95 | 84.60 | 65.48 | 45.04 | 83.66 | 55.50 |
|
29 |
+
| [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) | 60.97 | 59.98 | 83.31 | 64.16 | 42.15 | 78.37 | 37.83 |
|
30 |
+
> Follow up as [En-link](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
|
31 |
+
|
32 |
+
**Method**
|
33 |
+
Instruction-tuning.
|
34 |
+
|
35 |
+
**Hyperparameters**
|
36 |
+
```python
|
37 |
+
python finetune.py \
|
38 |
+
--base_model PracticeLLM/Twice-KoSOLAR-16.1B-test \
|
39 |
+
--data-path kyujinpy/KOR-OpenOrca-Platypus-v3 \
|
40 |
+
--output_dir ./Twice-KoSOLAR-16.1B-instruct-test \
|
41 |
+
--batch_size 64 \
|
42 |
+
--micro_batch_size 1 \
|
43 |
+
--num_epochs 1 \
|
44 |
+
--learning_rate 3e-5 \
|
45 |
+
--cutoff_len 4096 \
|
46 |
+
--val_set_size 0 \
|
47 |
+
--lora_r 16 \
|
48 |
+
--lora_alpha 16 \
|
49 |
+
--lora_dropout 0.05 \
|
50 |
+
--lora_target_modules '[q_proj, k_proj, v_proj, o_proj, gate_proj, down_proj, up_proj, lm_head]' \
|
51 |
+
--train_on_inputs False \
|
52 |
+
--add_eos_token False \
|
53 |
+
--group_by_length False \
|
54 |
+
--prompt_template_name user_prompt \
|
55 |
+
--lr_scheduler 'cosine' \
|
56 |
+
#--warmup_steps 100 \
|
57 |
+
```
|
58 |
+
> Share all of things. It is my belief.
|
59 |
+
|
60 |
+
# **Model Benchmark**
|
61 |
+
|
62 |
+
## Open Ko-LLM leaderboard & lm-evaluation-harness(zero-shot)
|
63 |
+
- Follow up as [Ko-link](https://huggingface.co/spaces/upstage/open-ko-llm-leaderboard).
|
64 |
+
| Model | Average | ARC | HellaSwag | MMLU | TruthfulQA | Ko-CommonGenV2 |
|
65 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
66 |
+
| PracticeLLM/Twice-KoSOLAR-16.1B-instruct-test | NaN | NaN | NaN | NaN | NaN | NaN |
|
67 |
+
| PracticeLLM/Twice-KoSOLAR-16.1B-test | 50.20 | 45.65 | 57.14 | 51.39 | 42.99 | 53.84 |
|
68 |
+
| [Megastudy/M-SOLAR-10.7B-v1.1-beta](https://huggingface.co/Megastudy/M-SOLAR-10.7B-v1.1-beta) | 55.25 | 51.71 | 60.86 | 54.24 | 47.12 | 62.34 |
|
69 |
+
| [jjourney1125/M-SOLAR-10.7B-v1.0](https://huggingface.co/jjourney1125/M-SOLAR-10.7B-v1.0) | 55.15 | 49.57 | 60.12 | 54.60 | 49.23 | 62.22 |
|
70 |
+
| [seungduk/KoSOLAR-10.7B-v0.1](https://huggingface.co/seungduk/KoSOLAR-10.7B-v0.1) | 52.40 | 47.18 | 59.54 | 52.04 | 41.84 | 61.39 |
|
71 |
+
|
72 |
+
- Follow up as [beomi/LM-Harness](https://github.com/Beomi/ko-lm-evaluation-harness)
|
73 |
+
```
|
74 |
+
gpt2 (pretrained=PracticeLLM/Twice-KoSOLAR-16.1B-test), limit: None, provide_description: False, num_fewshot: 0, batch_size: None
|
75 |
+
| Task |Version| Metric |Value | |Stderr|
|
76 |
+
|----------------|------:|--------|-----:|---|-----:|
|
77 |
+
|kobest_boolq | 0|acc |0.7201|ยฑ |0.0120|
|
78 |
+
| | |macro_f1|0.7073|ยฑ |0.0124|
|
79 |
+
|kobest_copa | 0|acc |0.6510|ยฑ |0.0151|
|
80 |
+
| | |macro_f1|0.6506|ยฑ |0.0151|
|
81 |
+
|kobest_hellaswag| 0|acc |0.4520|ยฑ |0.0223|
|
82 |
+
| | |acc_norm|0.5820|ยฑ |0.0221|
|
83 |
+
| | |macro_f1|0.4475|ยฑ |0.0222|
|
84 |
+
|kobest_sentineg | 0|acc |0.7078|ยฑ |0.0229|
|
85 |
+
| | |macro_f1|0.7071|ยฑ |0.0229|
|
86 |
+
|
87 |
+
gpt2 (pretrained=Megastudy/M-SOLAR-10.7B-v1.1-beta), limit: None, provide_description: False, num_fewshot: 0, batch_size: None
|
88 |
+
| Task |Version| Metric |Value | |Stderr|
|
89 |
+
|----------------|------:|--------|-----:|---|-----:|
|
90 |
+
|kobest_boolq | 0|acc |0.7137|ยฑ |0.0121|
|
91 |
+
| | |macro_f1|0.6878|ยฑ |0.0128|
|
92 |
+
|kobest_copa | 0|acc |0.7060|ยฑ |0.0144|
|
93 |
+
| | |macro_f1|0.7054|ยฑ |0.0145|
|
94 |
+
|kobest_hellaswag| 0|acc |0.4620|ยฑ |0.0223|
|
95 |
+
| | |acc_norm|0.5360|ยฑ |0.0223|
|
96 |
+
| | |macro_f1|0.4595|ยฑ |0.0223|
|
97 |
+
|kobest_sentineg | 0|acc |0.7431|ยฑ |0.0220|
|
98 |
+
| | |macro_f1|0.7295|ยฑ |0.0230|
|
99 |
+
|
100 |
+
gpt2 (pretrained=jjourney1125/M-SOLAR-10.7B-v1.0), limit: None, provide_description: False, num_fewshot: 0, batch_size: None
|
101 |
+
| Task |Version| Metric |Value | |Stderr|
|
102 |
+
|----------------|------:|--------|-----:|---|-----:|
|
103 |
+
|kobest_boolq | 0|acc |0.5228|ยฑ |0.0133|
|
104 |
+
| | |macro_f1|0.3788|ยฑ |0.0097|
|
105 |
+
|kobest_copa | 0|acc |0.6860|ยฑ |0.0147|
|
106 |
+
| | |macro_f1|0.6858|ยฑ |0.0147|
|
107 |
+
|kobest_hellaswag| 0|acc |0.4580|ยฑ |0.0223|
|
108 |
+
| | |acc_norm|0.5380|ยฑ |0.0223|
|
109 |
+
| | |macro_f1|0.4552|ยฑ |0.0222|
|
110 |
+
|kobest_sentineg | 0|acc |0.6474|ยฑ |0.0240|
|
111 |
+
| | |macro_f1|0.6012|ยฑ |0.0257|
|
112 |
+
|
113 |
+
gpt2 (pretrained=yanolja/KoSOLAR-10.7B-v0.1), limit: None, provide_description: False, num_fewshot: 0, batch_size: None
|
114 |
+
| Task |Version| Metric |Value | |Stderr|
|
115 |
+
|----------------|------:|--------|-----:|---|-----:|
|
116 |
+
|kobest_boolq | 0|acc |0.8725|ยฑ |0.0089|
|
117 |
+
| | |macro_f1|0.8722|ยฑ |0.0089|
|
118 |
+
|kobest_copa | 0|acc |0.6850|ยฑ |0.0147|
|
119 |
+
| | |macro_f1|0.6844|ยฑ |0.0147|
|
120 |
+
|kobest_hellaswag| 0|acc |0.4340|ยฑ |0.0222|
|
121 |
+
| | |acc_norm|0.5840|ยฑ |0.0221|
|
122 |
+
| | |macro_f1|0.4296|ยฑ |0.0221|
|
123 |
+
|kobest_sentineg | 0|acc |0.7506|ยฑ |0.0217|
|
124 |
+
| | |macro_f1|0.7505|ยฑ |0.0217|
|
125 |
+
```
|
126 |
+
|
127 |
+
# Implementation Code
|
128 |
+
```python
|
129 |
+
### KO-Platypus
|
130 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
131 |
+
import torch
|
132 |
+
|
133 |
+
repo = "PracticeLLM/Twice-KoSOLAR-16.1B-instruct-test"
|
134 |
+
OpenOrca = AutoModelForCausalLM.from_pretrained(
|
135 |
+
repo,
|
136 |
+
return_dict=True,
|
137 |
+
torch_dtype=torch.float16,
|
138 |
+
device_map='auto'
|
139 |
+
)
|
140 |
+
OpenOrca_tokenizer = AutoTokenizer.from_pretrained(repo)
|
141 |
+
```
|
142 |
+
|
143 |
+
--- Refereces (Model Card)
|
144 |
+
# yanolja/KoSOLAR-10.7B-v0.1
|
145 |
+
|
146 |
+
This model is a Korean vocabulary-extended version of [upstage/SOLAR-10.7B-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-v1.0), trained on various Korean web-crawled datasets that are publicly available on HuggingFace.
|
147 |
+
The hypothesis was that while maintaining the original performance of the base model, we could add more tokens to the base model's vocabulary by training the embeddings for the new tokens only. The evaluation results seem to indicate that both English and Korean performances were preserved.
|
148 |
+
|
149 |
+
## Model Description
|
150 |
+
|
151 |
+
Most parameters of [upstage/SOLAR-10.7B-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-v1.0) were frozen except for the embed_tokens layer and the lm_head layer. Embeddings for the existing tokens in those layers were frozen during training. The embeddings for the new tokens have been tuned.
|
152 |
+
|
153 |
+
---
|
154 |
+
# **Meet 10.7B Solar: Elevating Performance with Upstage Depth UP Scaling!**
|
155 |
+
|
156 |
+
|
157 |
+
# **Introduction**
|
158 |
+
We introduce SOLAR-10.7B, an advanced large language model (LLM) with 10.7 billion parameters, demonstrating superior performance in various natural language processing (NLP) tasks. It's compact, yet remarkably powerful, and demonstrates unparalleled state-of-the-art performance in models with parameters under 30B.
|
159 |
+
|
160 |
+
We present a methodology for scaling LLMs called depth up-scaling (DUS) , which encompasses architectural modifications and continued pretraining. In other words, we integrated Mistral 7B weights into the upscaled layers, and finally, continued pre-training for the entire model.
|
161 |
+
|
162 |
+
|
163 |
+
SOLAR-10.7B has remarkable performance. It outperforms models with up to 30B parameters, even surpassing the recent Mixtral 8X7B model. For detailed information, please refer to the experimental table.
|
164 |
+
Solar 10.7B is an ideal choice for fine-tuning. SOLAR-10.7B offers robustness and adaptability for your fine-tuning needs. Our simple instruction fine-tuning using the SOLAR-10.7B pre-trained model yields significant performance improvements ([SOLAR-10.7B-Instruct-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0)).
|
165 |
+
|
166 |
+
For full details of this model please read our [paper](https://arxiv.org/abs/2312.15166).
|