beomi's picture
Update README.md
1d36739 verified
|
raw
history blame
10.4 kB
metadata
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:

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

messages = [
    {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
    {"role": "user", "content": "์ด์ˆœ์‹  ์žฅ๊ตฐ์— ๋Œ€ํ•ด ์„ค๋ช…ํ•ด์ค˜."},
]
---
์ด์ˆœ์‹  ์žฅ๊ตฐ์€ ์กฐ์„  ์‹œ๋Œ€์— ํ™œ์•ฝํ•œ ์œ ๋ช…ํ•œ ์ž„์ง„์™œ๋ž€์˜ ์ „๋žต๊ฐ€์š”. ๊ทธ๊ฐ€ ํ™œ์•ฝํ•œ ์‹œ๊ธฐ๋Š” 16์„ธ๊ธฐ ๋ง์ด์—ˆ์œผ๋ฉฐ, ์ด๋•Œ๋Š” ์ผ๋ณธ์ด ์กฐ์„ ์„ ์นจ๋žตํ–ˆ๋˜ ์ž„์ง„์™œ๋ž€์ด ๋ฐœ๋ฐœํ•œ ๋•Œ์ž…๋‹ˆ๋‹ค. ์ด์ˆœ์‹  ์žฅ๊ตฐ์€ ์ด๋•Œ ์ผ๋ณธ์˜ ํ•ด๊ตฐ์œผ๋กœ ๊ตฌ์„ฑ๋œ ๊ตฐ๋Œ€๊ฐ€ ์กฐ์„ ์„ ๊ณต๊ฒฉํ•˜์ž, ์กฐ์„ ์˜ ํ•ด๊ตฐ์—์„œ ํ™œ์•ฝํ•˜๋ฉฐ ์ผ๋ณธ์„ ์ƒ๋Œ€ํ–ˆ์Šต๋‹ˆ๋‹ค. ์œ ๋ช…ํ•œ ํ•ด์ „์ธ 'ํ•œ์‚ฐ๋„๋Œ€์ฒฉ'๊ณผ '๋ช…๋Ÿ‰๋Œ€์ฒฉ'์—์„œ ์ด์ˆœ์‹  ์žฅ๊ตฐ์€ ๋›ฐ์–ด๋‚œ ์ „๋žต๊ณผ ์šฉ๊ธฐ๋กœ ์ผ๋ณธ์„ ์ƒ๋Œ€๋กœ ํฌ๊ฒŒ ์Šน๋ฆฌํ•˜๋Š” ๋“ฑ ์กฐ์„ ์„ ์œ„๊ธฐ์—์„œ ๊ตฌํ•œ ์ค‘์š”ํ•œ ์ธ๋ฌผ๋กœ ํ‰๊ฐ€๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ์˜ ์šฉ๊ธฐ์™€ ์ง€๋žต์€ ํ˜„์žฌ๊นŒ์ง€๋„ ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์˜ ๊ท€๊ฐ์œผ๋กœ ์ „ํ•ด์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค<|im_end|>
messages = [
    {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
    {"role": "user", "content": "๋…๋„์™€ ๋‹ค์ผ€์‹œ๋งˆ์˜ ์ฐจ์ด๊ฐ€ ๋ญ์•ผ?"},
]
---
"๋…๋„"์™€ "๋‹ค์ผ€์‹œ๋งˆ"๋Š” ๋™์ผํ•œ ์„ฌ์„ ๊ฐ€๋ฆฌํ‚ค๋Š” ์ด๋ฆ„์ด์ง€๋งŒ ์„œ๋กœ ๋‹ค๋ฅธ ๋‚˜๋ผ์˜ ์–ธ์–ด๋กœ ๋ถˆ๋ฆฌ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. "๋…๋„"๋Š” ๋Œ€ํ•œ๋ฏผ๊ตญ ์–ด๋กœ "็จๅณถ"๋ผ๊ณ  ๋ถ€๋ฅด๋ฉฐ, "๋‹ค์ผ€์‹œ๋งˆ"๋Š” ์ผ๋ณธ ์–ด๋กœ "็ซนๅณถ"๋ผ๊ณ  ๋ถ€๋ฆ…๋‹ˆ๋‹ค. ์ด ์„ฌ์€ ์ผ๋ณธ ๋—ํ† ๋ฆฌํ˜„๊ณผ ์‚ฌ์นด์ด๋ฏธ๋‚˜ํ† ์‹œ์— ์ธ์ ‘ํ•œ ์ผ๋ณธ์— ๊ฐ€๊นŒ์šด ๊ณณ์— ์œ„์น˜ํ•ด ์žˆ์ง€๋งŒ, ๊ตญ์ œ๋ฒ•์ ์œผ๋กœ ๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ์˜ํ† ๋กœ ์ธ์ •๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

๋Œ€ํ•œ๋ฏผ๊ตญ์€ ์ด ์„ฌ์„ ๋…๋„๋กœ ์นญํ•˜๋ฉฐ ์—ญ์‚ฌ์ ์œผ๋กœ๋ถ€ํ„ฐOwnership๋ฅผ ์ฃผ์žฅํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์—ญ์‚ฌ์  ๊ธฐ๋ก์— ๋”ฐ๋ฅด๋ฉด ๋…๋„๋Š” ์กฐ์„ ์‹œ๋Œ€์— ์ด๋ฏธ ํ•œ๊ตญ์˜ ์˜ํ† ๋กœ ์ธ์‹๋˜์—ˆ๊ณ , ์ผ๋ณธ ์ œ๊ตญ์ฃผ์˜ ์‹œ์ ˆ์— ์ž ์‹œ ๊ด€ํ• ๊ถŒ์— ์†ํ–ˆ๋‹ค๊ฐ€ ์ผ๋ณธ์ด ํŒจ์ „ํ•œ ์ดํ›„ ๋Œ€ํ•œ๋ฏผ๊ตญ ์˜ํ† ๋กœ ํ™˜์›๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ผ๋ณธ์€ ์ด ์„ฌ์„ ๋‹ค์ผ€์‹œ๋งˆ๋กœ ์นญํ•˜๋ฉฐ ์˜์œ ๊ถŒ์„ ์ฃผ์žฅํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ, ์ด๋Ÿฌํ•œ ์ฃผ์žฅ์€ ๊ตญ์ œ๋ฒ•์ƒ ์ธ์ •๋˜์ง€ ์•Š์œผ๋ฉฐ, ํ•œ๊ตญ ์ •๋ถ€๋Š” ๋…๋„๋ฅผ ๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ์˜ํ† ๋กœ์„œ ์ ˆ๋Œ€์ ์ธ ๊ถŒ๋ฆฌ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Œ์„ ๋ถ„๋ช…ํžˆ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

๊ฒฐ๋ก ์ ์œผ๋กœ, "๋…๋„"์™€ "๋‹ค์ผ€์‹œ๋งˆ"๋Š” ๋™์ผํ•œ ์„ฌ์„ ๊ฐ€๋ฆฌํ‚ค์ง€๋งŒ, ์„œ๋กœ ๋‹ค๋ฅธ ๊ตญ๊ฐ€์˜ ์—ญ์‚ฌ์ ์ด๊ณ  ์ •์น˜์  ์ƒํ™ฉ์— ๋”ฐ๋ผ ๋ถ€๋ฅด๋Š” ์ด๋ฆ„์ด ๋‹ค๋ฅด๋ฉฐ, ๊ตญ์ œ๋ฒ•์ƒ ์ด ์„ฌ์€ ๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ์˜ํ† ๋กœ ๋ถ„๋ฅ˜๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.<|im_end|>
messages = [
    {"role": "system", "content": "์นœ์ ˆํ•œ ์ฑ—๋ด‡์œผ๋กœ์„œ ์ƒ๋Œ€๋ฐฉ์˜ ์š”์ฒญ์— ์ตœ๋Œ€ํ•œ ์ž์„ธํ•˜๊ณ  ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜์ž. ๋ชจ๋“  ๋Œ€๋‹ต์€ ํ•œ๊ตญ์–ด(Korean)์œผ๋กœ ๋Œ€๋‹ตํ•ด์ค˜."},
    {"role": "user", "content": "์„ธ์ข…๋Œ€์™•์˜ ์ง‘ํ˜„์ „ ๋งฅ๋ถ ๋˜์ง ์‚ฌ๊ฑด์— ๋Œ€ํ•ด์„œ ์•Œ๊ณ  ์žˆ์–ด?"},
]
---
์„ธ์ข… ๋Œ€์™•์˜ ์ง‘ํ˜„์ „ ๋งฅ๋ถ ๋˜์ง ์‚ฌ๊ฑด์— ๋Œ€ํ•ด ๋“ค์–ด๋ณธ ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์‚ฌ๊ฑด์€ 2017๋…„ ํ•œ ๋ฐฉ์†ก์‚ฌ์˜ ๋“œ๋ผ๋งˆ์—์„œ ๋“ฑ์žฅํ•˜๋ฉฐ ๋„๋ฆฌ ์•Œ๋ ค์กŒ๋Š”๋ฐ์š”, ๋“œ๋ผ๋งˆ์—์„œ๋Š” ์ง‘ํ˜„์ „ ํ•™์ž๋“ค์ด ์ƒˆ๋กœ์šด ๋ฌธ๋ฌผ์ธ ๋งฅ๋ถ์„ ๋ณด๊ณ  ์„ธ์ข… ๋Œ€์™•์ด ์ด๋ฅผ ๋˜์ง„ ๊ฒƒ์œผ๋กœ ๋ฌ˜์‚ฌ๋˜์–ด ๋…ผ๋ž€์ด ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ์ด ๋‚ด์šฉ์€ ์—ญ์‚ฌ์  ์‚ฌ์‹ค๊ณผ ๋‹ค๋ฅด๋‹ค๋Š” ๊ฒƒ์ด ๋ฐํ˜€์กŒ์Šต๋‹ˆ๋‹ค. ์ง‘ํ˜„์ „ ํ•™์ž๋“ค์ด ์‹ค์ œ๋กœ ๋งฅ๋ถ๊ณผ ๊ฐ™์€ ์™ธ๊ณ„ ๋ฌธ๋ฌผ์„ ๋ชฉ๊ฒฉํ–ˆ์„ ๋ฆฌ ์—†๊ณ , ์„ธ์ข… ๋Œ€์™•์ด ํ•™์ž๋“ค์˜ ๋…ธ๋ ฅ์„ ํ„ํ•˜ํ•˜๊ฑฐ๋‚˜ ๋ฌผ๊ฑด์„ ๋˜์ง€๋Š” ํ–‰๋™์„ ํ–ˆ์„ ๊ฒƒ์ด๋ผ๋Š” ์ „์ œ์— ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์˜คํžˆ๋ ค ์„ธ์ข… ๋Œ€์™•์€ ์ˆ™๋ช…ํ•™์„ ์„ค๋ฆฝํ•˜๊ณ  ํ•œ๊ธ€์„ ์ฐฝ์ œํ•˜๋Š” ๋“ฑ ํ•™๋ฌธ๊ณผ ๋ฌธํ™”์— ๋Œ€ํ•œ ์ง€์›์„ ์•„๊นŒ์ง€ ์•Š์•˜๋˜ ๊ฒƒ์œผ๋กœ ์•Œ๋ ค์ ธ ์žˆ์Šต๋‹ˆ๋‹ค.

๋“œ๋ผ๋งˆ ์†์— ๋“ฑ์žฅํ•œ ์‚ฌ๊ฑด์€ ํ—ˆ๊ตฌ์ ์ธ ์„ค์ •์ผ๋ฟ, ์‹ค์ œ ์—ญ์‚ฌ์—์„œ ์ผ์–ด๋‚œ ์ผ์€ ์•„๋‹™๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜์˜ํ•˜๋“ฏ, ์ดํ›„์˜ ๋ฐฉ์†ก์—์„œ๋Š” ํ•ด๋‹น ์žฅ๋ฉด์ด ์ˆ˜์ •๋˜๊ฑฐ๋‚˜ ์‚ญ์ œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.<|im_end|>
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*.

*Yi model architecture is based on Llama2, so it can be loaded via LlamaForCausalLM class on HF.

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-5 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 ['โ–์•ˆ๋…•', 'ํ•˜์„ธ์š”', ',', 'โ–์˜ค๋Š˜์€', 'โ–๋‚ ', '์”จ๊ฐ€', 'โ–์ข‹๋„ค์š”', '.', 'ใ…Ž', 'ใ…Ž']
*Equal Korean vocab with Llama-2-Ko Series

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', '.']
*Equal Korean vocab with Llama-2-Ko Series *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.

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 program.