beomi
KcELECTRA-base-v2022
๐จ Important Note: This REPO is DEPRECATED since KcELECTRA-base v2023 Released ๐จ USE `https://huggingface.co/beomi/KcELECTRA-base` and `v2022` Revision if needed. - KcELECTRA-base-v2022 (๊ตฌ v2022-dev) ๋ชจ๋ธ ์ด๋ฆ์ด ๋ณ๊ฒฝ๋์์ต๋๋ค. - ์ ๋ชจ๋ธ์ ์ธ๋ถ ์ค์ฝ์ด๋ฅผ ์ถ๊ฐํ์์ต๋๋ค. - ๊ธฐ์กด KcELECTRA-base(v2021) ๋๋น ๋๋ถ๋ถ์ downstream task์์ ~1%p ์์ค์ ์ฑ๋ฅ ํฅ์์ด ์์ต๋๋ค. ๊ณต๊ฐ๋ ํ๊ตญ์ด Transformer ๊ณ์ด ๋ชจ๋ธ๋ค์ ๋๋ถ๋ถ ํ๊ตญ์ด ์ํค, ๋ด์ค ๊ธฐ์ฌ, ์ฑ ๋ฑ ์ ์ ์ ๋ ๋ฐ์ดํฐ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ์ตํ ๋ชจ๋ธ์ ๋๋ค. ํํธ, ์ค์ ๋ก NSMC์ ๊ฐ์ User-Generated Noisy text domain ๋ฐ์ดํฐ์ ์ ์ ์ ๋์ง ์์๊ณ ๊ตฌ์ด์ฒด ํน์ง์ ์ ์กฐ์ด๊ฐ ๋ง์ผ๋ฉฐ, ์คํ์ ๋ฑ ๊ณต์์ ์ธ ๊ธ์ฐ๊ธฐ์์ ๋ํ๋์ง ์๋ ํํ๋ค์ด ๋น๋ฒํ๊ฒ ๋ฑ์ฅํฉ๋๋ค. KcELECTRA๋ ์์ ๊ฐ์ ํน์ฑ์ ๋ฐ์ดํฐ์ ์ ์ ์ฉํ๊ธฐ ์ํด, ๋ค์ด๋ฒ ๋ด์ค์์ ๋๊ธ๊ณผ ๋๋๊ธ์ ์์งํด, ํ ํฌ๋์ด์ ์ ELECTRA๋ชจ๋ธ์ ์ฒ์๋ถํฐ ํ์ตํ Pretrained ELECTRA ๋ชจ๋ธ์ ๋๋ค. ๊ธฐ์กด KcBERT ๋๋น ๋ฐ์ดํฐ์ ์ฆ๊ฐ ๋ฐ vocab ํ์ฅ์ ํตํด ์๋นํ ์์ค์ผ๋ก ์ฑ๋ฅ์ด ํฅ์๋์์ต๋๋ค. KcELECTRA๋ Huggingface์ Transformers ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํตํด ๊ฐํธํ ๋ถ๋ฌ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. (๋ณ๋์ ํ์ผ ๋ค์ด๋ก๋๊ฐ ํ์ํ์ง ์์ต๋๋ค.) - Finetune ์ฝ๋๋ https://github.com/Beomi/KcBERT-finetune ์์ ์ฐพ์๋ณด์ค ์ ์์ต๋๋ค. - ํด๋น Repo์ ๊ฐ Checkpoint ํด๋์์ Step๋ณ ์ธ๋ถ ์ค์ฝ์ด๋ฅผ ํ์ธํ์ค ์ ์์ต๋๋ค. | | Size (์ฉ๋) | NSMC (acc) | Naver NER (F1) | PAWS (acc) | KorNLI (acc) | KorSTS (spearman) | Question Pair (acc) | KorQuaD (Dev) (EM/F1) | | :----------------- | :-------------: | :----------------: | :--------------------: | :----------------: | :------------------: | :-----------------------: | :-------------------------: | :---------------------------: | | KcELECTRA-base-v2022 | 475M | 91.97 | 87.35 | 76.50 | 82.12 | 83.67 | 95.12 | 69.00 / 90.40 | | KcELECTRA-base | 475M | 91.71 | 86.90 | 74.80 | 81.65 | 82.65 | 95.78 | 70.60 / 90.11 | | KcBERT-Base | 417M | 89.62 | 84.34 | 66.95 | 74.85 | 75.57 | 93.93 | 60.25 / 84.39 | | KcBERT-Large | 1.2G | 90.68 | 85.53 | 70.15 | 76.99 | 77.49 | 94.06 | 62.16 / 86.64 | | KoBERT | 351M | 89.63 | 86.11 | 80.65 | 79.00 | 79.64 | 93.93 | 52.81 / 80.27 | | XLM-Roberta-Base | 1.03G | 89.49 | 86.26 | 82.95 | 79.92 | 79.09 | 93.53 | 64.70 / 88.94 | | HanBERT | 614M | 90.16 | 87.31 | 82.40 | 80.89 | 83.33 | 94.19 | 78.74 / 92.02 | | KoELECTRA-Base | 423M | 90.21 | 86.87 | 81.90 | 80.85 | 83.21 | 94.20 | 61.10 / 89.59 | | KoELECTRA-Base-v2 | 423M | 89.70 | 87.02 | 83.90 | 80.61 | 84.30 | 94.72 | 84.34 / 92.58 | | KoELECTRA-Base-v3 | 423M | 90.63 | 88.11 | 84.45 | 82.24 | 85.53 | 95.25 | 84.83 / 93.45 | | DistilKoBERT | 108M | 88.41 | 84.13 | 62.55 | 70.55 | 73.21 | 92.48 | 54.12 / 77.80 | \config์ ์ธํ ์ ๊ทธ๋๋ก ํ์ฌ ๋๋ฆฐ ๊ฒฐ๊ณผ์ด๋ฉฐ, hyperparameter tuning์ ์ถ๊ฐ์ ์ผ๋ก ํ ์ ๋ ์ข์ ์ฑ๋ฅ์ด ๋์ฌ ์ ์์ต๋๋ค. - `pytorch ~= 1.8.0` - `transformers ~= 4.11.3` - `emoji ~= 0.6.0` - `soynlp ~= 0.0.493` > ๐ก ์ด์ KcBERT ๊ด๋ จ ์ฝ๋๋ค์์ `AutoTokenizer`, `AutoModel` ์ ์ฌ์ฉํ ๊ฒฝ์ฐ `.frompretrained("beomi/kcbert-base")` ๋ถ๋ถ์ `.frompretrained("beomi/KcELECTRA-base")` ๋ก๋ง ๋ณ๊ฒฝํด์ฃผ์๋ฉด ์ฆ์ ์ฌ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค. - KcBERTํ์ต์ ์ฌ์ฉํ ๋ฐ์ดํฐ + ์ดํ 2021.03์ ์ด๊น์ง ์์งํ ๋๊ธ - ์ฝ 17GB - ๋๊ธ-๋๋๊ธ์ ๋ฌถ์ ๊ธฐ๋ฐ์ผ๋ก Document ๊ตฌ์ฑ - https://github.com/KLUE-benchmark/KLUE-ELECTRA Repo๋ฅผ ํตํ Pretrain - https://github.com/Beomi/KcBERT-finetune Repo๋ฅผ ํตํ Finetune ๋ฐ ์ค์ฝ์ด ๋น๊ต ํ์ต ๋ฐ์ดํฐ๋ 2019.01.01 ~ 2021.03.09 ์ฌ์ด์ ์์ฑ๋ ๋๊ธ ๋ง์ ๋ด์ค/ํน์ ์ ์ฒด ๋ด์ค ๊ธฐ์ฌ๋ค์ ๋๊ธ๊ณผ ๋๋๊ธ์ ๋ชจ๋ ์์งํ ๋ฐ์ดํฐ์ ๋๋ค. ๋ฐ์ดํฐ ์ฌ์ด์ฆ๋ ํ ์คํธ๋ง ์ถ์ถ์ ์ฝ 17.3GB์ด๋ฉฐ, 1์ต8์ฒ๋ง๊ฐ ์ด์์ ๋ฌธ์ฅ์ผ๋ก ์ด๋ค์ ธ ์์ต๋๋ค. > KcBERT๋ 2019.01-2020.06์ ํ ์คํธ๋ก, ์ ์ ํ ์ฝ 9์ฒ๋ง๊ฐ ๋ฌธ์ฅ์ผ๋ก ํ์ต์ ์งํํ์ต๋๋ค. ๋ค์ด๋ฒ ๋๊ธ์ ๊ฒฝ์ฐ, ๋น์์ด๋ ์์ฒด ํํฐ๋ง์ ํตํด `OOO` ๋ก ํ์ํฉ๋๋ค. ์ด ๋ถ๋ถ์ ๊ณต๋ฐฑ์ผ๋ก ์ ๊ฑฐํ์์ต๋๋ค. ์๋ ๋ช ๋ น์ด๋ก pip๋ก ์ค์นํ ๋ค, ์๋ cleanํจ์๋ก ํด๋ฆฌ๋์ ํ๋ฉด Downstream task์์ ๋ณด๋ค ์ฑ๋ฅ์ด ์ข์์ง๋๋ค. (`[UNK]` ๊ฐ์) Tokenizer๋ Huggingface์ Tokenizers ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํตํด ํ์ต์ ์งํํ์ต๋๋ค. ๊ทธ ์ค `BertWordPieceTokenizer` ๋ฅผ ์ด์ฉํด ํ์ต์ ์งํํ๊ณ , Vocab Size๋ `30000`์ผ๋ก ์งํํ์ต๋๋ค. Tokenizer๋ฅผ ํ์ตํ๋ ๊ฒ์๋ ์ ์ฒด ๋ฐ์ดํฐ๋ฅผ ํตํด ํ์ต์ ์งํํ๊ณ , ๋ชจ๋ธ์ General Downstream task์ ๋์ํ๊ธฐ ์ํด KoELECTRA์์ ์ฌ์ฉํ Vocab์ ๊ฒน์น์ง ์๋ ๋ถ๋ถ์ ์ถ๊ฐ๋ก ๋ฃ์ด์ฃผ์์ต๋๋ค. (์ค์ ๋ก ๋ ๋ชจ๋ธ์ด ๊ฒน์น๋ ๋ถ๋ถ์ ์ฝ 5000ํ ํฐ์ด์์ต๋๋ค.) TPU `v3-8` ์ ์ด์ฉํด ์ฝ 10์ผ ํ์ต์ ์งํํ๊ณ , ํ์ฌ Huggingface์ ๊ณต๊ฐ๋ ๋ชจ๋ธ์ 848k step์ ํ์ตํ ๋ชจ๋ธ weight๊ฐ ์ ๋ก๋ ๋์ด์์ต๋๋ค. (100k step๋ณ Checkpoint๋ฅผ ํตํด ์ฑ๋ฅ ํ๊ฐ๋ฅผ ์งํํ์์ต๋๋ค. ํด๋น ๋ถ๋ถ์ `KcBERT-finetune` repo๋ฅผ ์ฐธ๊ณ ํด์ฃผ์ธ์.) ๋ชจ๋ธ ํ์ต Loss๋ Step์ ๋ฐ๋ผ ์ด๊ธฐ 100-200k ์ฌ์ด์ ๊ธ๊ฒฉํ Loss๊ฐ ์ค์ด๋ค๋ค ํ์ต ์ข ๋ฃ๊น์ง๋ ์ง์์ ์ผ๋ก loss๊ฐ ๊ฐ์ํ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค. - ์์ ๊ฐ์ด KcBERT-base, KcBERT-large ๋๋น ๋ชจ๋ ๋ฐ์ดํฐ์ ์ ๋ํด KcELECTRA-base๊ฐ ๋ ๋์ ์ฑ๋ฅ์ ๋ณด์ ๋๋ค. - KcELECTRA pretrain์์๋ Train step์ด ๋์ด๊ฐ์ ๋ฐ๋ผ ์ ์ง์ ์ผ๋ก ์ฑ๋ฅ์ด ํฅ์๋๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค. KcELECTRA Model์ ํ์ตํ๋ GCP/TPU ํ๊ฒฝ์ TFRC ํ๋ก๊ทธ๋จ์ ์ง์์ ๋ฐ์์ต๋๋ค. - KcBERT by Beomi - BERT by Google - KoBERT by SKT - KoELECTRA by Monologg - Transformers by Huggingface - Tokenizers by Hugginface - ELECTRA train code by KLUE - Monologg๋์ KoELECTRA ํ์ต๊ธฐ - Colab์์ TPU๋ก BERT ์ฒ์๋ถํฐ ํ์ต์ํค๊ธฐ - Tensorflow/Google ver.
kcbert-base
- KcELECTRA๊ฐ ๋ฆด๋ฆฌ์ฆ ๋์์ต๋๋ค!๐ค - KcELECTRA๋ ๋ณด๋ค ๋ ๋ง์ ๋ฐ์ดํฐ์ , ๊ทธ๋ฆฌ๊ณ ๋ ํฐ General vocab์ ํตํด KcBERT ๋๋น ๋ชจ๋ ํ์คํฌ์์ ๋ ๋์ ์ฑ๋ฅ์ ๋ณด์ ๋๋ค. - ์๋ ๊นํ ๋งํฌ์์ ์ง์ ์ฌ์ฉํด๋ณด์ธ์! - https://github.com/Beomi/KcELECTRA - KcBERT Paper ์ธ์ฉ ํ๊ธฐ๋ฅผ ์ถ๊ฐํ์์ต๋๋ค.(bibtex) - KcBERT-finetune Performance score๋ฅผ ๋ณธ๋ฌธ์ ์ถ๊ฐํ์์ต๋๋ค. Huggingface Transformers๊ฐ v4.0.0์ผ๋ก ์ ๋ฐ์ดํธ๋จ์ ๋ฐ๋ผ Tutorial์ ์ฝ๋๊ฐ ์ผ๋ถ ๋ณ๊ฒฝ๋์์ต๋๋ค. KcBERT๋ฅผ Google Colab์์ TPU๋ฅผ ํตํด ํ์ตํ ์ ์๋ ํํ ๋ฆฌ์ผ์ ์ ๊ณตํฉ๋๋ค! ์๋ ๋ฒํผ์ ๋๋ฌ๋ณด์ธ์. ๋ง์ฝ ํ ํ์ผ๋ก ๋ฐ๊ณ ์ถ์ผ์๊ฑฐ๋/Kaggle์์ ๋ฐ์ดํฐ๋ฅผ ์ดํด๋ณด๊ณ ์ถ์ผ์๋ค๋ฉด ์๋์ ์บ๊ธ ๋ฐ์ดํฐ์ ์ ์ด์ฉํด์ฃผ์ธ์. - Github๋ฆด๋ฆฌ์ฆ: https://github.com/Beomi/KcBERT/releases/tag/TrainDatav1 - ์บ๊ธ: https://www.kaggle.com/junbumlee/kcbert-pretraining-corpus-korean-news-comments (ํ ํ์ผ๋ก ๋ฐ์ ์ ์์ด์. ๋จ์ผํ์ผ) Kaggle์ ํ์ต์ ์ํด ์ ์ ํ(์๋ `clean`์ฒ๋ฆฌ๋ฅผ ๊ฑฐ์น) Dataset์ ๊ณต๊ฐํ์์ต๋๋ค! ๊ณต๊ฐ๋ ํ๊ตญ์ด BERT๋ ๋๋ถ๋ถ ํ๊ตญ์ด ์ํค, ๋ด์ค ๊ธฐ์ฌ, ์ฑ ๋ฑ ์ ์ ์ ๋ ๋ฐ์ดํฐ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ์ตํ ๋ชจ๋ธ์ ๋๋ค. ํํธ, ์ค์ ๋ก NSMC์ ๊ฐ์ ๋๊ธํ ๋ฐ์ดํฐ์ ์ ์ ์ ๋์ง ์์๊ณ ๊ตฌ์ด์ฒด ํน์ง์ ์ ์กฐ์ด๊ฐ ๋ง์ผ๋ฉฐ, ์คํ์ ๋ฑ ๊ณต์์ ์ธ ๊ธ์ฐ๊ธฐ์์ ๋ํ๋์ง ์๋ ํํ๋ค์ด ๋น๋ฒํ๊ฒ ๋ฑ์ฅํฉ๋๋ค. KcBERT๋ ์์ ๊ฐ์ ํน์ฑ์ ๋ฐ์ดํฐ์ ์ ์ ์ฉํ๊ธฐ ์ํด, ๋ค์ด๋ฒ ๋ด์ค์์ ๋๊ธ๊ณผ ๋๋๊ธ์ ์์งํด, ํ ํฌ๋์ด์ ์ BERT๋ชจ๋ธ์ ์ฒ์๋ถํฐ ํ์ตํ Pretrained BERT ๋ชจ๋ธ์ ๋๋ค. KcBERT๋ Huggingface์ Transformers ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํตํด ๊ฐํธํ ๋ถ๋ฌ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. (๋ณ๋์ ํ์ผ ๋ค์ด๋ก๋๊ฐ ํ์ํ์ง ์์ต๋๋ค.) - Finetune ์ฝ๋๋ https://github.com/Beomi/KcBERT-finetune ์์ ์ฐพ์๋ณด์ค ์ ์์ต๋๋ค. | | Size (์ฉ๋) | NSMC (acc) | Naver NER (F1) | PAWS (acc) | KorNLI (acc) | KorSTS (spearman) | Question Pair (acc) | KorQuaD (Dev) (EM/F1) | | :-------------------- | :---: | :----------------: | :--------------------: | :----------------: | :------------------: | :-----------------------: | :-------------------------: | :---------------------------: | | KcBERT-Base | 417M | 89.62 | 84.34 | 66.95 | 74.85 | 75.57 | 93.93 | 60.25 / 84.39 | | KcBERT-Large | 1.2G | 90.68 | 85.53 | 70.15 | 76.99 | 77.49 | 94.06 | 62.16 / 86.64 | | KoBERT | 351M | 89.63 | 86.11 | 80.65 | 79.00 | 79.64 | 93.93 | 52.81 / 80.27 | | XLM-Roberta-Base | 1.03G | 89.49 | 86.26 | 82.95 | 79.92 | 79.09 | 93.53 | 64.70 / 88.94 | | HanBERT | 614M | 90.16 | 87.31 | 82.40 | 80.89 | 83.33 | 94.19 | 78.74 / 92.02 | | KoELECTRA-Base | 423M | 90.21 | 86.87 | 81.90 | 80.85 | 83.21 | 94.20 | 61.10 / 89.59 | | KoELECTRA-Base-v2 | 423M | 89.70 | 87.02 | 83.90 | 80.61 | 84.30 | 94.72 | 84.34 / 92.58 | | DistilKoBERT | 108M | 88.41 | 84.13 | 62.55 | 70.55 | 73.21 | 92.48 | 54.12 / 77.80 | \config์ ์ธํ ์ ๊ทธ๋๋ก ํ์ฌ ๋๋ฆฐ ๊ฒฐ๊ณผ์ด๋ฉฐ, hyperparameter tuning์ ์ถ๊ฐ์ ์ผ๋ก ํ ์ ๋ ์ข์ ์ฑ๋ฅ์ด ๋์ฌ ์ ์์ต๋๋ค. KcBERT-Base NSMC Finetuning with PyTorch-Lightning (Colab) KcBERT-Large NSMC Finetuning with PyTorch-Lightning (Colab) > ์ ๋ ์ฝ๋๋ Pretrain ๋ชจ๋ธ(base, large)์ batch size๋ง ๋ค๋ฅผ ๋ฟ, ๋๋จธ์ง ์ฝ๋๋ ์์ ํ ๋์ผํฉ๋๋ค. ํ์ต ๋ฐ์ดํฐ๋ 2019.01.01 ~ 2020.06.15 ์ฌ์ด์ ์์ฑ๋ ๋๊ธ ๋ง์ ๋ด์ค ๊ธฐ์ฌ๋ค์ ๋๊ธ๊ณผ ๋๋๊ธ์ ๋ชจ๋ ์์งํ ๋ฐ์ดํฐ์ ๋๋ค. ๋ฐ์ดํฐ ์ฌ์ด์ฆ๋ ํ ์คํธ๋ง ์ถ์ถ์ ์ฝ 15.4GB์ด๋ฉฐ, 1์ต1์ฒ๋ง๊ฐ ์ด์์ ๋ฌธ์ฅ์ผ๋ก ์ด๋ค์ ธ ์์ต๋๋ค. ์๋ ๋ช ๋ น์ด๋ก pip๋ก ์ค์นํ ๋ค, ์๋ cleanํจ์๋ก ํด๋ฆฌ๋์ ํ๋ฉด Downstream task์์ ๋ณด๋ค ์ฑ๋ฅ์ด ์ข์์ง๋๋ค. (`[UNK]` ๊ฐ์) ์๋ณธ ๋ฐ์ดํฐ๋ฅผ ์ `clean`ํจ์๋ก ์ ์ ํ 12GB๋ถ๋์ txt ํ์ผ์ ์๋ Kaggle Dataset์์ ๋ค์ด๋ฐ์ผ์ค ์ ์์ต๋๋ค :) Tokenizer๋ Huggingface์ Tokenizers ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ํตํด ํ์ต์ ์งํํ์ต๋๋ค. ๊ทธ ์ค `BertWordPieceTokenizer` ๋ฅผ ์ด์ฉํด ํ์ต์ ์งํํ๊ณ , Vocab Size๋ `30000`์ผ๋ก ์งํํ์ต๋๋ค. Tokenizer๋ฅผ ํ์ตํ๋ ๊ฒ์๋ `1/10`๋ก ์ํ๋งํ ๋ฐ์ดํฐ๋ก ํ์ต์ ์งํํ๊ณ , ๋ณด๋ค ๊ณจ๊ณ ๋ฃจ ์ํ๋งํ๊ธฐ ์ํด ์ผ์๋ณ๋ก stratify๋ฅผ ์ง์ ํ ๋ค ํ์ต์ ์งํํ์ต๋๋ค. BERT Model Config๋ Base, Large ๊ธฐ๋ณธ ์ธํ ๊ฐ์ ๊ทธ๋๋ก ์ฌ์ฉํ์ต๋๋ค. (MLM 15% ๋ฑ) TPU `v3-8` ์ ์ด์ฉํด ๊ฐ๊ฐ 3์ผ, N์ผ(Large๋ ํ์ต ์งํ ์ค)์ ์งํํ๊ณ , ํ์ฌ Huggingface์ ๊ณต๊ฐ๋ ๋ชจ๋ธ์ 1m(100๋ง) step์ ํ์ตํ ckpt๊ฐ ์ ๋ก๋ ๋์ด์์ต๋๋ค. ๋ชจ๋ธ ํ์ต Loss๋ Step์ ๋ฐ๋ผ ์ด๊ธฐ 200k์ ๊ฐ์ฅ ๋น ๋ฅด๊ฒ Loss๊ฐ ์ค์ด๋ค๋ค 400k์ดํ๋ก๋ ์กฐ๊ธ์ฉ ๊ฐ์ํ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค. ํ์ต์ GCP์ TPU v3-8์ ์ด์ฉํด ํ์ต์ ์งํํ๊ณ , ํ์ต ์๊ฐ์ Base Model ๊ธฐ์ค 2.5์ผ์ ๋ ์งํํ์ต๋๋ค. Large Model์ ์ฝ 5์ผ์ ๋ ์งํํ ๋ค ๊ฐ์ฅ ๋ฎ์ loss๋ฅผ ๊ฐ์ง ์ฒดํฌํฌ์ธํธ๋ก ์ ํ์ต๋๋ค. HuggingFace kcbert-base ๋ชจ๋ธ ์์ ์๋์ ๊ฐ์ด ํ ์คํธ ํด ๋ณผ ์ ์์ต๋๋ค. ๋ค์ด๋ฒ ์ํํ ์ฝํผ์ค ๋ฐ์ดํฐ์ ์ ๋์์ผ๋ก Fine Tuning์ ์งํํด ์ฑ๋ฅ์ ๊ฐ๋จํ ํ ์คํธํด๋ณด์์ต๋๋ค. - GPU๋ P100 x1๋ ๊ธฐ์ค 1epoch์ 2-3์๊ฐ, TPU๋ 1epoch์ 1์๊ฐ ๋ด๋ก ์์๋ฉ๋๋ค. - GPU RTX Titan x4๋ ๊ธฐ์ค 30๋ถ/epoch ์์๋ฉ๋๋ค. - ์์ ์ฝ๋๋ pytorch-lightning์ผ๋ก ๊ฐ๋ฐํ์ต๋๋ค. - ๋ ผ๋ฌธ์ง ๋ค์ด๋ก๋ ๋งํฌ: http://hclt.kr/dwn/?v=bG5iOmNvbmZlcmVuY2U7aWR4OjMy (ํน์ http://hclt.kr/symp/?lnb=conference ) KcBERT Model์ ํ์ตํ๋ GCP/TPU ํ๊ฒฝ์ TFRC ํ๋ก๊ทธ๋จ์ ์ง์์ ๋ฐ์์ต๋๋ค. - BERT by Google - KoBERT by SKT - KoELECTRA by Monologg - Transformers by Huggingface - Tokenizers by Hugginface - BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding - Monologg๋์ KoELECTRA ํ์ต๊ธฐ - Colab์์ TPU๋ก BERT ์ฒ์๋ถํฐ ํ์ต์ํค๊ธฐ - Tensorflow/Google ver.
Llama-3-Open-Ko-8B
KcELECTRA-base
llama-2-ko-7b
Llama-3-Open-Ko-8B-Instruct-preview
> Update @ 2024.05.01: Pre-Release Llama-3-KoEn-8B model & Llama-3-KoEn-8B-Instruct-preview > Update @ 2024.04.24: Release Llama-3-Open-Ko-8B model & Llama-3-Open-Ko-8B-Instruct-preview Llama-3-Open-Ko-8B model is continued pretrained language model based on Llama-3-8B. This model is trained fully with publicily available resource, with 60GB+ of deduplicated texts. With the new Llama-3 tokenizer, the pretraining conducted with 17.7B+ tokens, which slightly more than Korean tokenizer(Llama-2-Ko tokenizer). The train was done on TPUv5e-256, with the warm support from TRC program by Google. With applying the idea from Chat Vector paper, I released Instruction model named Llama-3-Open-Ko-8B-Instruct-preview. Since it is NOT finetuned with any Korean instruction set(indeed `preview`), but it would be great starting point for creating new Chat/Instruct models. ์ฌ๋ฌ๋ถ๊ป์๋ ๋ฌผ๋ก ์์๋์ง๋ผ๋ ์ค๋ช ์ ๋๋ฆฌ๊ฒ ์ต๋๋ค! ํผ๋ณด๋์น(Piconacci) ์์ด์ ๋ค์๊ณผ ๊ฐ์ ์์ด์ ๋งํฉ๋๋ค: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233,.... ์ด๋ ๊ฒ ๊ณ์๋๊ณ ์์ต๋๋ค. ์ด ์์ด์ ์ผ๋ฐ์ ์ผ๋ก๋ ์ํ์์ ๋ฌดํํ ์ง์๋ฉ๋๋ค. ๊ฐ ์๋ ์ด์ ์์ ๋ ๋ฐฐ๊ฐ ๋๋ ์์ด์ ๋๋ค. ์ด ์์ด์ ํ์ด์ฌ(Python)์ผ๋ก ๊ตฌํํ๊ณ ์ ํ์ ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ต๋๋ค. ์ด ์ฝ๋์์๋ `n`์ด ์ ๋ ฅ๋ฐ์ ์๋ฅผ ๋ํ๋ด๋ ๋ณ์๋ก, ํผ๋ณด๋์น ์์ด์ ๊ตฌํํฉ๋๋ค. ์ด ์ฝ๋๋ฅผ ์คํ์ํค๋ฉด ์ ๋ ฅ๋ฐ์ ์์ ๋ฐ๋ผ ํผ๋ณด๋์น ์์ด์ ํด๋น ํญ์ ๋ฐํํฉ๋๋ค. ์๋ฅผ ๋ค์ด, `fibonacci(10)` ํ๋ฉด 55๋ฅผ ๋ฐํํฉ๋๋ค. ์ด ์ฝ๋๋ ์ฌ๊ท์ ํจ์์ด๊ธฐ ๋๋ฌธ์ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ์ด ์ค์ด๋ค ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ฌ๊ท์ ํจ์๋ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋์ด ๋ง์์ง ์ ์์ต๋๋ค. ์ด๋ฅผ ์ค์ด๊ธฐ ์ํด ์ดํฐ๋ ์ดํฐ๋ธ ํจ์๋ก ๊ตฌํํ ์๋ ์์ต๋๋ค. ์ด ์ฝ๋์์๋ ์ดํฐ๋ ์ดํฐ๋ธ ํจ์๋ก ํผ๋ณด๋์น ์์ด์ ๊ตฌํํฉ๋๋ค. ์ด ์ฝ๋๋ฅผ ์คํ์ํค๋ฉด ์ ๋ ฅ๋ฐ์ ์์ ๋ฐ๋ผ ํผ๋ณด๋์น ์์ด์ ํด๋น ํญ์ ๋ฐํํฉ๋๋ค. ์ด ์ฝ๋๋ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋์ ์ค์ ๋๋ค. ๋ค๋ง, ์ด ์ฝ๋๋ ๋ ๋ณต์กํฉ๋๋ค. ์ด ์ฝ๋๋ฅผ ๋ ๊ฐ๋จํ๊ฒ ํ๋ ค๋ฉด ์ดํฐ๋ ์ดํฐ๋ธ ํจ์๋ฅผ ๋ ์ ๊ตฌํํ ์ ์์ต๋๋ค. > I used same system prompt, but you could change on your own.
OPEN-SOLAR-KO-10.7B
- 2024.01.08: Initial Test version Release of Solar-Ko Solar-Ko represents an advanced iteration of the upstage/SOLAR-10.7B-v1.0 model, featuring an expanded vocabulary and the inclusion of a Korean corpus for enhanced pretraining. Open-Solar-Ko exclusively utilizes publicly accessible Korean corpora, including sources such as AI Hub, Modu Corpus, ๋ชจ๋์ ๋ง๋ญ์น, and Korean Wikipedia. As training was conducted solely with publicly available corpora, this model is open for unrestricted use by everyone, adhering to the Apache2.0 open source License. Variations: Solar-Ko is available with one parameter sizes โ 10B with Continual Pretrained version. Output: The model produces text output exclusively. SOLAR-KO-10.7B is an auto-regressive language model that leverages an optimized transformer architecture derived from Llama-2. | |Training Data|Parameters|Content Length|GQA|Tokens|Learning Rate| |---|---|---|---|---|---|---| |SOLAR-KO-10.7B|A curated mix of Publicly Accessible Korean Corpora|10.7B|4k|O|>15B|5e -5 | The model was trained using selected datasets from AIHub and Modu Corpus. Detailed information about the training datasets is available below: - AI Hub: corpus/AIHUB - Only the `Training` segment of the data was used. - The `Validation` and `Test` segments were deliberately excluded. - Modu Corpus: corpus/MODUCORPUS The final JSONL dataset used to train this model is approximately 61GB in size. Total token count: Approximately 15 billion tokens (using the expanded tokenizer. With the original SOLAR tokenizer, >60 billion tokens.) | Model Name | Vocabulary Size | Description | | --- | --- | --- | | Original Solar | 32000 | Sentencepiece BPE | | Expanded SOLAR-KO-10.7B | 46592 | Sentencepiece BPE. Added Korean vocab and merges | - SOLAR-10.7B: 26 tokens - SOLAR-KO-10.7b: 8 tokens | Model | Tokens | | --- | --- | | SOLAR-10.7B | `['โ', '์', ' ', ' ', ' ', 'ํ', '์ธ', '์', ',', 'โ', '์ค', ' ', ' ', ' ', '์', 'โ', '๋ ', ' ', ' ', ' ', '๊ฐ', 'โ', '์ข', '๋ค', '์', '.']` | | SOLAR-KO-10.7B | `['โ์๋ ', 'ํ์ธ์', ',', 'โ์ค๋์', 'โ๋ ', '์จ๊ฐ', 'โ์ข๋ค์', '.']` | Tokenizing "Meet 10.7B Solar: Elevating Performance with Upstage Depth UP Scaling!" - SOLAR-10.7B: 22 tokens - SOLAR-KO-10.7b: 22 tokens | Model | Tokens | | --- | --- | | SOLAR-10.7B | `['โMeet', 'โ', '1', '0', '.', '7', 'B', 'โSolar', ':', 'โE', 'lev', 'ating', 'โPerformance', 'โwith', 'โUp', 'stage', 'โDep', 'th', 'โUP', 'โScal', 'ing', '!']` | | SOLAR-KO-10.7B | `['โMeet', 'โ', '1', '0', '.', '7', 'B', 'โSolar', ':', 'โE', 'lev', 'ating', 'โPerformance', 'โwith', 'โUp', 'stage', 'โDep', 'th', 'โUP', 'โScal', 'ing', '!']` | - Used EleutherAI's lm-evaluation-harness https://github.com/EleutherAI/lm-evaluation-harness/tree/polyglot | | 0 | 5 | 10 | 50 | |:---------------------------------|---------:|---------:|---------:|---------:| | kobestboolq (macrof1) | 0.853949 | 0.88098 | 0.898139 | 0.902354 | | kobestcopa (macrof1) | 0.804531 | 0.826736 | 0.837656 | 0.860899 | | kobesthellaswag (macrof1) | 0.507174 | 0.500983 | 0.487287 | 0.512182 | | kobestsentineg (macrof1) | 0.3517 | 0.972291 | 0.977321 | 0.984884 | | kohatespeech (macrof1) | 0.258111 | 0.403957 | 0.386808 | 0.462393 | | kohatespeechapeach (macrof1) | 0.337667 | 0.651697 | 0.705337 | 0.827757 | | kohatespeechgenbias (macrof1) | 0.124535 | 0.503464 | 0.498501 | 0.443218 | | korunsmile (f1) | 0.3814 | 0.356939 | 0.369989 | 0.296193 | | nsmc (acc) | 0.5356 | 0.87162 | 0.88654 | 0.89632 | | pawsxko (acc) | 0.5435 | 0.5245 | 0.5315 | 0.5385 | - Training support was provided by the TPU Research Cloud program. - The training corpus includes data from AI Hub, Modu Corpus, and Korean Wikipedia.
KoRWKV-6B
KoAlpaca-Polyglot-5.8B
KoAlpaca-Polyglot-12.8B
- Add Safetensor sharded model weight (max shard = 1GB) This model is a fine-tuned version of EleutherAI/polyglot-ko-12.8b on a KoAlpaca Dataset v1.1b Detail Codes are available at KoAlpaca Github Repository The following hyperparameters were used during training: - learningrate: 5e-05 - trainbatchsize: 1 - seed: 42 - distributedtype: multi-GPU (A100 80G) - numdevices: 4 - gradientaccumulationsteps: 64 - totaltrainbatchsize: 256 - totalevalbatchsize: 32 - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 - lrschedulertype: linear - numepochs: 2.0 - Transformers 4.28.1 - Pytorch 2.0.0+cu117 - Datasets 2.11.0 - Tokenizers 0.13.3
Yi-Ko-6B
Qwen2.5-7B-Instruct-kowiki-qa
gemma-ko-2b
kcbert-large
KcELECTRA-small-v2022
Llama-3-KoEn-8B
KoAlpaca-llama-1-7b
beep-KcELECTRA-base-hate
kollama-7b
korean-hatespeech-multilabel
gemma-ko-7b
open-llama-2-ko-7b
polyglot-ko-12.8b-safetensors
KoAlpaca-RealQA-Solar-Ko-Recovery-11B-Q8_0-GGUF
beomi/KoAlpaca-RealQA-Solar-Ko-Recovery-11B-Q80-GGUF This LoRA adapter was converted to GGUF format from `beomi/KoAlpaca-RealQA-Solar-Ko-Recovery-11B` via the ggml.ai's GGUF-my-lora space. Refer to the original adapter repository for more details. To know more about LoRA usage with llama.cpp server, refer to the llama.cpp server documentation.
Llama-3-KoEn-8B-Instruct-preview
Llama-3-KoEn-8B-xtuner-llava-preview
kollama-13b
KoAlpaca-KoRWKV-6B
korean-hatespeech-classifier
KoRWKV-1.5B
kcgpt2
EXAONE-3.5-2.4B-Instruct-Llamafied
llama-2-koen-13b
kobert
kcbert-large-dev
Yi-Ko-DUS-9B
KoAlpaca-KoRWKV-1.5B
Yi-Ko-34B-Chat-Preview
KoAlpaca-RealQA-Solar-Ko-Recovery-11B-LoRA-ChatML-Q8_0-GGUF
beomi/KoAlpaca-RealQA-Solar-Ko-Recovery-11B-LoRA-ChatML-Q80-GGUF This LoRA adapter was converted to GGUF format from `beomi/KoAlpaca-RealQA-Solar-Ko-Recovery-11B-LoRA-ChatML` via the ggml.ai's GGUF-my-lora space. Refer to the original adapter repository for more details. To know more about LoRA usage with llama.cpp server, refer to the llama.cpp server documentation.