File size: 10,351 Bytes
b79583c 00ea4b9 e7119ce 00ea4b9 e7119ce b79583c 563dcd6 b79583c 00ea4b9 b79583c 00ea4b9 1d36739 00ea4b9 b79583c 649768a 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 b79583c 00ea4b9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
---
language:
- en
- ko
license: cc-by-nc-sa-4.0
library_name: transformers
tags:
- pytorch
- Yi-Ko
- 01-ai
- Yi
extra_gated_heading: Access beomi/Yi-Ko-34B on Hugging Face
extra_gated_button_content: Submit
extra_gated_fields:
I agree to share my name, email address and username: checkbox
? I confirm that I understand this project is for research purposes only, and confirm
that I agree to follow the LICENSE of this model
: checkbox
pipeline_tag: text-generation
inference: false
---
# **beomi/Yi-Ko-34B-Chat-Preview (feat. ChatVector)**
This repo is naive ChatVector applied using these 3 models:
```python
ko_model_id = 'beomi/Yi-Ko-34B'
chat_model = '01-ai/Yi-34B-Chat'
base_model = '01-ai/Yi-34B'
```
## Benchmarks
| Tasks |Version|Filter|n-shot| Metric |Value | |Stderr|
|----------------------------------------------------------|-------|------|-----:|-----------|-----:|---|------|
|kobest_boolq | 1|none | 5|acc |0.9174|ยฑ |0.0074|
| | |none | 5|f1 |0.9174|ยฑ |N/A |
|kobest_copa | 1|none | 5|acc |0.8620|ยฑ |0.0109|
| | |none | 5|f1 |0.8618|ยฑ |N/A |
|kobest_hellaswag | 1|none | 5|acc |0.5260|ยฑ |0.0224|
| | |none | 5|f1 |0.5243|ยฑ |N/A |
| | |none | 5|acc_norm |0.5920|ยฑ |0.0220|
|kobest_sentineg | 1|none | 5|acc |0.9874|ยฑ |0.0056|
| | |none | 5|f1 |0.9874|ยฑ |N/A |
## Samples
```python
messages = [
{"role": "system", "content": "์น์ ํ ์ฑ๋ด์ผ๋ก์ ์๋๋ฐฉ์ ์์ฒญ์ ์ต๋ํ ์์ธํ๊ณ ์น์ ํ๊ฒ ๋ตํ์. ๋ชจ๋ ๋๋ต์ ํ๊ตญ์ด(Korean)์ผ๋ก ๋๋ตํด์ค."},
{"role": "user", "content": "์ด์์ ์ฅ๊ตฐ์ ๋ํด ์ค๋ช
ํด์ค."},
]
---
์ด์์ ์ฅ๊ตฐ์ ์กฐ์ ์๋์ ํ์ฝํ ์ ๋ช
ํ ์์ง์๋์ ์ ๋ต๊ฐ์. ๊ทธ๊ฐ ํ์ฝํ ์๊ธฐ๋ 16์ธ๊ธฐ ๋ง์ด์์ผ๋ฉฐ, ์ด๋๋ ์ผ๋ณธ์ด ์กฐ์ ์ ์นจ๋ตํ๋ ์์ง์๋์ด ๋ฐ๋ฐํ ๋์
๋๋ค. ์ด์์ ์ฅ๊ตฐ์ ์ด๋ ์ผ๋ณธ์ ํด๊ตฐ์ผ๋ก ๊ตฌ์ฑ๋ ๊ตฐ๋๊ฐ ์กฐ์ ์ ๊ณต๊ฒฉํ์, ์กฐ์ ์ ํด๊ตฐ์์ ํ์ฝํ๋ฉฐ ์ผ๋ณธ์ ์๋ํ์ต๋๋ค. ์ ๋ช
ํ ํด์ ์ธ 'ํ์ฐ๋๋์ฒฉ'๊ณผ '๋ช
๋๋์ฒฉ'์์ ์ด์์ ์ฅ๊ตฐ์ ๋ฐ์ด๋ ์ ๋ต๊ณผ ์ฉ๊ธฐ๋ก ์ผ๋ณธ์ ์๋๋ก ํฌ๊ฒ ์น๋ฆฌํ๋ ๋ฑ ์กฐ์ ์ ์๊ธฐ์์ ๊ตฌํ ์ค์ํ ์ธ๋ฌผ๋ก ํ๊ฐ๋ฐ๊ณ ์์ต๋๋ค. ๊ทธ์ ์ฉ๊ธฐ์ ์ง๋ต์ ํ์ฌ๊น์ง๋ ๋ง์ ์ฌ๋๋ค์ ๊ท๊ฐ์ผ๋ก ์ ํด์ง๊ณ ์์ต๋๋ค<|im_end|>
```
```python
messages = [
{"role": "system", "content": "์น์ ํ ์ฑ๋ด์ผ๋ก์ ์๋๋ฐฉ์ ์์ฒญ์ ์ต๋ํ ์์ธํ๊ณ ์น์ ํ๊ฒ ๋ตํ์. ๋ชจ๋ ๋๋ต์ ํ๊ตญ์ด(Korean)์ผ๋ก ๋๋ตํด์ค."},
{"role": "user", "content": "๋
๋์ ๋ค์ผ์๋ง์ ์ฐจ์ด๊ฐ ๋ญ์ผ?"},
]
---
"๋
๋"์ "๋ค์ผ์๋ง"๋ ๋์ผํ ์ฌ์ ๊ฐ๋ฆฌํค๋ ์ด๋ฆ์ด์ง๋ง ์๋ก ๋ค๋ฅธ ๋๋ผ์ ์ธ์ด๋ก ๋ถ๋ฆฌ๊ณ ์์ต๋๋ค. "๋
๋"๋ ๋ํ๋ฏผ๊ตญ ์ด๋ก "็จๅณถ"๋ผ๊ณ ๋ถ๋ฅด๋ฉฐ, "๋ค์ผ์๋ง"๋ ์ผ๋ณธ ์ด๋ก "็ซนๅณถ"๋ผ๊ณ ๋ถ๋ฆ
๋๋ค. ์ด ์ฌ์ ์ผ๋ณธ ๋ํ ๋ฆฌํ๊ณผ ์ฌ์นด์ด๋ฏธ๋ํ ์์ ์ธ์ ํ ์ผ๋ณธ์ ๊ฐ๊น์ด ๊ณณ์ ์์นํด ์์ง๋ง, ๊ตญ์ ๋ฒ์ ์ผ๋ก ๋ํ๋ฏผ๊ตญ์ ์ํ ๋ก ์ธ์ ๋ฐ๊ณ ์์ต๋๋ค.
๋ํ๋ฏผ๊ตญ์ ์ด ์ฌ์ ๋
๋๋ก ์นญํ๋ฉฐ ์ญ์ฌ์ ์ผ๋ก๋ถํฐOwnership๋ฅผ ์ฃผ์ฅํ๊ณ ์์ต๋๋ค. ์ญ์ฌ์ ๊ธฐ๋ก์ ๋ฐ๋ฅด๋ฉด ๋
๋๋ ์กฐ์ ์๋์ ์ด๋ฏธ ํ๊ตญ์ ์ํ ๋ก ์ธ์๋์๊ณ , ์ผ๋ณธ ์ ๊ตญ์ฃผ์ ์์ ์ ์ ์ ๊ดํ ๊ถ์ ์ํ๋ค๊ฐ ์ผ๋ณธ์ด ํจ์ ํ ์ดํ ๋ํ๋ฏผ๊ตญ ์ํ ๋ก ํ์๋์์ต๋๋ค.
์ผ๋ณธ์ ์ด ์ฌ์ ๋ค์ผ์๋ง๋ก ์นญํ๋ฉฐ ์์ ๊ถ์ ์ฃผ์ฅํ๊ณ ์์ต๋๋ค. ํ์ง๋ง, ์ด๋ฌํ ์ฃผ์ฅ์ ๊ตญ์ ๋ฒ์ ์ธ์ ๋์ง ์์ผ๋ฉฐ, ํ๊ตญ ์ ๋ถ๋ ๋
๋๋ฅผ ๋ํ๋ฏผ๊ตญ์ ์ํ ๋ก์ ์ ๋์ ์ธ ๊ถ๋ฆฌ๋ฅผ ๊ฐ์ง๊ณ ์์์ ๋ถ๋ช
ํ ํ๊ณ ์์ต๋๋ค.
๊ฒฐ๋ก ์ ์ผ๋ก, "๋
๋"์ "๋ค์ผ์๋ง"๋ ๋์ผํ ์ฌ์ ๊ฐ๋ฆฌํค์ง๋ง, ์๋ก ๋ค๋ฅธ ๊ตญ๊ฐ์ ์ญ์ฌ์ ์ด๊ณ ์ ์น์ ์ํฉ์ ๋ฐ๋ผ ๋ถ๋ฅด๋ ์ด๋ฆ์ด ๋ค๋ฅด๋ฉฐ, ๊ตญ์ ๋ฒ์ ์ด ์ฌ์ ๋ํ๋ฏผ๊ตญ์ ์ํ ๋ก ๋ถ๋ฅ๋๊ณ ์์ต๋๋ค.<|im_end|>
```
```python
messages = [
{"role": "system", "content": "์น์ ํ ์ฑ๋ด์ผ๋ก์ ์๋๋ฐฉ์ ์์ฒญ์ ์ต๋ํ ์์ธํ๊ณ ์น์ ํ๊ฒ ๋ตํ์. ๋ชจ๋ ๋๋ต์ ํ๊ตญ์ด(Korean)์ผ๋ก ๋๋ตํด์ค."},
{"role": "user", "content": "์ธ์ข
๋์์ ์งํ์ ๋งฅ๋ถ ๋์ง ์ฌ๊ฑด์ ๋ํด์ ์๊ณ ์์ด?"},
]
---
์ธ์ข
๋์์ ์งํ์ ๋งฅ๋ถ ๋์ง ์ฌ๊ฑด์ ๋ํด ๋ค์ด๋ณธ ์ ์ด ์์ต๋๋ค. ์ด ์ฌ๊ฑด์ 2017๋
ํ ๋ฐฉ์ก์ฌ์ ๋๋ผ๋ง์์ ๋ฑ์ฅํ๋ฉฐ ๋๋ฆฌ ์๋ ค์ก๋๋ฐ์, ๋๋ผ๋ง์์๋ ์งํ์ ํ์๋ค์ด ์๋ก์ด ๋ฌธ๋ฌผ์ธ ๋งฅ๋ถ์ ๋ณด๊ณ ์ธ์ข
๋์์ด ์ด๋ฅผ ๋์ง ๊ฒ์ผ๋ก ๋ฌ์ฌ๋์ด ๋
ผ๋์ด ๋์์ต๋๋ค.
ํ์ง๋ง ์ด ๋ด์ฉ์ ์ญ์ฌ์ ์ฌ์ค๊ณผ ๋ค๋ฅด๋ค๋ ๊ฒ์ด ๋ฐํ์ก์ต๋๋ค. ์งํ์ ํ์๋ค์ด ์ค์ ๋ก ๋งฅ๋ถ๊ณผ ๊ฐ์ ์ธ๊ณ ๋ฌธ๋ฌผ์ ๋ชฉ๊ฒฉํ์ ๋ฆฌ ์๊ณ , ์ธ์ข
๋์์ด ํ์๋ค์ ๋
ธ๋ ฅ์ ํํํ๊ฑฐ๋ ๋ฌผ๊ฑด์ ๋์ง๋ ํ๋์ ํ์ ๊ฒ์ด๋ผ๋ ์ ์ ์ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค. ์คํ๋ ค ์ธ์ข
๋์์ ์๋ช
ํ์ ์ค๋ฆฝํ๊ณ ํ๊ธ์ ์ฐฝ์ ํ๋ ๋ฑ ํ๋ฌธ๊ณผ ๋ฌธํ์ ๋ํ ์ง์์ ์๊น์ง ์์๋ ๊ฒ์ผ๋ก ์๋ ค์ ธ ์์ต๋๋ค.
๋๋ผ๋ง ์์ ๋ฑ์ฅํ ์ฌ๊ฑด์ ํ๊ตฌ์ ์ธ ์ค์ ์ผ๋ฟ, ์ค์ ์ญ์ฌ์์ ์ผ์ด๋ ์ผ์ ์๋๋๋ค. ์ด๋ฌํ ์ค๋ฅ๋ฅผ ๋ฐ์ํ๋ฏ, ์ดํ์ ๋ฐฉ์ก์์๋ ํด๋น ์ฅ๋ฉด์ด ์์ ๋๊ฑฐ๋ ์ญ์ ๋์์ต๋๋ค.<|im_end|>
```
```python
messages = [
{"role": "system", "content": "์น์ ํ ์ฑ๋ด์ผ๋ก์ ์๋๋ฐฉ์ ์์ฒญ์ ์ต๋ํ ์์ธํ๊ณ ์น์ ํ๊ฒ ๋ตํ์. ๋ชจ๋ ๋๋ต์ ํ๊ตญ์ด(Korean)์ผ๋ก ๋๋ตํด์ค."},
{"role": "user", "content": "๋๋ ์ค๋ ์ฌ๊ณผ 5๊ฐ๋ฅผ ๊ฐ๊ณ ์์ด. ๊ทธ๋ฆฌ๊ณ ์ด์ ๋๋ ์ฌ๊ณผ 2๊ฐ๋ฅผ ๋จน์์ง. ๋ด๊ฐ ์ง๊ธ ๊ฐ์ง ์ฌ๊ณผ๋ ๋ช ๊ฐ์ง?"},
]
---
์ง๋ ๋ฒ์๋ ์ฌ๊ณผ 2๊ฐ๋ฅผ ๋จน์๊ณ , ์ง๊ธ์ ์ฌ๊ณผ 5๊ฐ๋ฅผ ๊ฐ๊ณ ์๋ค๊ณ ํ์ผ๋, ์ง๊ธ ๊ฐ์ง ์ฌ๊ณผ์ ๊ฐ์๋ 5๊ฐ์
๋๋ค. ๊ทธ๋ฐ๋ฐ, ์ฌ๊ณผ 2๊ฐ๋ฅผ ๋จน์ด์ ์ด ์ฌ๊ณผ๋ฅผ 5๊ฐ์์ 2๊ฐ ๋นผ๋ฉด, ๋จ์ ์ฌ๊ณผ์ ๊ฐ์๋ 5 - 2 = 3๊ฐ์
๋๋ค. ๊ทธ๋ฌ๋๊น, ์ง๊ธ ๊ฐ์ง ์ฌ๊ณผ๋ 3๊ฐ์
๋๋ค.<|im_end|>
```
# beomi/Yi-Ko-34B-Preview
Yi-Ko series models serve as advanced iterations of 01-ai/Yi models,
benefiting from an expanded vocabulary and the inclusion of Korean/English corpus in its further pretraining.
Just like its predecessor, Yi-Ko series models operate within the broad range of generative text models that stretch from 6 billion to 34 billion parameters.
This repository focuses on the **34B** pretrained version,
which is tailored to fit the Hugging Face Transformers format.
For access to the other models, feel free to consult the index provided below.
## Model Details
**Model Developers** Junbum Lee (Beomi)
**Variations** Yi-Ko-34B will come in a range of parameter sizes โ 6B and 34B โ with Ko(Korean Only)/KoEn(Korean+English)/KoEnCo(Korean+English+Code) variations.
**Input** Models input text only.
**Output** Models generate text only.
**Model Architecture**
Yi-Ko series models are an auto-regressive language model that uses an optimized transformer architecture based on Llama-2*.
<small>*Yi model architecture is based on Llama2, so it can be loaded via `LlamaForCausalLM` class on HF.</small>
|Model Name|Training Data|Params|Context Length|GQA|Trained Tokens|LR|Batch Size(per step)|
|---|---|---|---|---|---|---|---|
|Yi-Ko-34B|*A mix of Korean + English online data*|34B|4k|O|TBD(under training)|5e<sup>-5</sup>|2048|
**Vocab Expansion**
| Model Name | Vocabulary Size | Description |
| --- | --- | --- |
| Original Yi-Series | 64000 | Sentencepiece BPE |
| **Expanded Yi-Ko Series** | 78464 | Sentencepiece BPE. Added Korean vocab and merges |
**Tokenizing "์๋
ํ์ธ์, ์ค๋์ ๋ ์จ๊ฐ ์ข๋ค์.ใ
ใ
"**
| Model | # of tokens | Tokens |
| --- | --- | --- |
| Original Yi-Series | 47 | `['<0xEC>', '<0x95>', '<0x88>', '<0xEB>', '<0x85>', '<0x95>', 'ํ', '<0xEC>', '<0x84>', '<0xB8>', '<0xEC>', '<0x9A>', '<0x94>', ',', 'โ', '<0xEC>', '<0x98>', '<0xA4>', '<0xEB>', '<0x8A>', '<0x98>', '์', 'โ', '<0xEB>', '<0x82>', '<0xA0>', '<0xEC>', '<0x94>', '<0xA8>', '๊ฐ', 'โ', '<0xEC>', '<0xA2>', '<0x8B>', '<0xEB>', '<0x84>', '<0xA4>', '<0xEC>', '<0x9A>', '<0x94>', '.', '<0xE3>', '<0x85>', '<0x8E>', '<0xE3>', '<0x85>', '<0x8E>']` |
| **Expanded Yi-Ko Series** | 10 | `['โ์๋
', 'ํ์ธ์', ',', 'โ์ค๋์', 'โ๋ ', '์จ๊ฐ', 'โ์ข๋ค์', '.', 'ใ
', 'ใ
']` |
|<small>*Equal Korean vocab with Llama-2-Ko Series</small>||
**Tokenizing "Llama 2: Open Foundation and Fine-Tuned Chat Models"**
| Model | # of tokens | Tokens |
| --- | --- | --- |
| Original Yi-Series | 21 | `['The', 'โY', 'i', 'โseries', 'โmodels', 'โare', 'โlarge', 'โlanguage', 'โmodels', 'โtrained', 'โfrom', 'โscratch', 'โby', 'โdevelopers', 'โat', 'โ', '0', '1', '.', 'AI', '.']` |
| **Expanded Yi-Ko Series** | 21 | `['โThe', 'โY', 'i', 'โseries', 'โmodels', 'โare', 'โlarge', 'โlanguage', 'โmodels', 'โtrained', 'โfrom', 'โscratch', 'โby', 'โdevelopers', 'โat', 'โ', '0', '1', '.', 'AI', '.']` |
|<small>*Equal Korean vocab with Llama-2-Ko Series</small>| | <small>*Since **Expanded Yi-Ko Series** prepends `_` at the beginning of the text(to ensure same tokenization for Korean sentences), it shows negilible difference for the first token on English tokenization. </small>|
# **Model Benchmark**
## LM Eval Harness - Korean (polyglot branch)
TBD
## LICENSE
CC-BY-NC-SA-4.0 under Yi license
## Citation
TBD
## Acknowledgement
The training is supported by [TPU Research Cloud](https://sites.research.google/trc/) program. |