Commit
ยท
a8e8473
1
Parent(s):
e63579e
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,99 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
# mDeBERTa-v3-base-kor-further
|
5 |
+
|
6 |
+
---
|
7 |
+
|
8 |
+
## What is DeBERTa?
|
9 |
+
|
10 |
+
- [DeBERTa](https://arxiv.org/abs/2006.03654)๋ `Disentangled Attention` + `Enhanced Mask Decoder` ๋ฅผ ์ ์ฉํ์ฌ ๋จ์ด์ positional information์ ํจ๊ณผ์ ์ผ๋ก ํ์ตํฉ๋๋ค. ์ด์ ๊ฐ์ ์์ด๋์ด๋ฅผ ํตํด, ๊ธฐ์กด์ BERT, RoBERTa์์ ์ฌ์ฉํ๋ absolute position embedding๊ณผ๋ ๋ฌ๋ฆฌ DeBERTa๋ ๋จ์ด์ ์๋์ ์ธ ์์น ์ ๋ณด๋ฅผ ํ์ต ๊ฐ๋ฅํ ๋ฒกํฐ๋ก ํํํ์ฌ ๋ชจ๋ธ์ ํ์ตํ๊ฒ ๋ฉ๋๋ค. ๊ฒฐ๊ณผ์ ์ผ๋ก, BERT, RoBERTA ์ ๋น๊ตํ์ ๋ ๋ ์ค์ํ ์ฑ๋ฅ์ ๋ณด์ฌ์ฃผ์์ต๋๋ค.
|
11 |
+
- [DeBERTa-v3](https://arxiv.org/abs/2111.09543)์์๋, ์ด์ ๋ฒ์ ์์ ์ฌ์ฉํ๋ MLM (Masked Language Model) ์ RTD (Replaced Token Detection) Task ๋ก ๋์ฒดํ ELECTRA ์คํ์ผ์ ์ฌ์ ํ์ต ๋ฐฉ๋ฒ๊ณผ, Gradient-Disentangled Embedding Sharing ์ ์ ์ฉํ์ฌ ๋ชจ๋ธ ํ์ต์ ํจ์จ์ฑ์ ๊ฐ์ ํ์์ต๋๋ค.
|
12 |
+
- DeBERTa์ ์ํคํ
์ฒ๋ก ํ๋ถํ ํ๊ตญ์ด ๋ฐ์ดํฐ๋ฅผ ํ์ตํ๊ธฐ ์ํด์, `mDeBERTa-v3-base-kor-further` ๋ microsoft ๊ฐ ๋ฐํํ `mDeBERTa-v3-base` ๋ฅผ ์ฝ 40GB์ ํ๊ตญ์ด ๋ฐ์ดํฐ์ ๋ํด์ **์ถ๊ฐ์ ์ธ ์ฌ์ ํ์ต**์ ์งํํ ์ธ์ด ๋ชจ๋ธ์
๋๋ค.
|
13 |
+
|
14 |
+
## How to Use
|
15 |
+
|
16 |
+
- Requirements
|
17 |
+
|
18 |
+
```
|
19 |
+
pip install transformers
|
20 |
+
pip install sentencepiece
|
21 |
+
```
|
22 |
+
|
23 |
+
- Huggingface Hub
|
24 |
+
|
25 |
+
```python
|
26 |
+
from transformers import AutoModel, AutoTokenizer
|
27 |
+
|
28 |
+
model = AutoModel.from_pretrained("lighthouse/mdeberta-v3-base-kor-further") # DebertaV2ForModel
|
29 |
+
tokenizer = AutoTokenizer.from_pretrained("lighthouse/mdeberta-v3-base-kor-further") # DebertaV2Tokenizer (SentencePiece)
|
30 |
+
```
|
31 |
+
|
32 |
+
|
33 |
+
## Pre-trained Models
|
34 |
+
|
35 |
+
- ๋ชจ๋ธ์ ์ํคํ
์ฒ๋ ๊ธฐ์กด microsoft์์ ๋ฐํํ `mdeberta-v3-base`์ ๋์ผํ ๊ตฌ์กฐ์
๋๋ค.
|
36 |
+
|
37 |
+
|
38 |
+
| | Vocabulary(K) | Backbone Parameters(M) | Hidden Size | Layers | Note |
|
39 |
+
| --- | --- | --- | --- | --- | --- |
|
40 |
+
| mdeberta-v3-base-kor-further
|
41 |
+
(mdeberta-v3-base์ ๋์ผ) | 250 | 86 | 768 | 12 | 250K new SPM vocab |
|
42 |
+
|
43 |
+
## Further Pretraing Details (MLM Task)
|
44 |
+
|
45 |
+
- `KPMG-mDeBERTa-v3-base-kor-further` ๋ `microsoft/mDeBERTa-v3-base` ๋ฅผ ์ฝ 40GB์ ํ๊ตญ์ด ๋ฐ์ดํฐ์ ๋ํด์ MLM Task๋ฅผ ์ ์ฉํ์ฌ ์ถ๊ฐ์ ์ธ ์ฌ์ ํ์ต์ ์งํํ์์ต๋๋ค.
|
46 |
+
|
47 |
+
|
48 |
+
| | Max length | Learning Rate | Batch Size | Train Steps | Warm-up Steps |
|
49 |
+
| --- | --- | --- | --- | --- | --- |
|
50 |
+
| mdeberta-v3-base-kor-further | 512 | 2e-5 | 8 | 5M | 50k |
|
51 |
+
|
52 |
+
|
53 |
+
## Datasets
|
54 |
+
|
55 |
+
- ๋ชจ๋์ ๋ง๋ญ์น(์ ๋ฌธ, ๊ตฌ์ด, ๋ฌธ์ด), ํ๊ตญ์ด Wiki, ๊ตญ๋ฏผ์ฒญ์ ๋ฑ ์ฝ 40 GB ์ ํ๊ตญ์ด ๋ฐ์ดํฐ์
์ด ์ถ๊ฐ์ ์ธ ์ฌ์ ํ์ต์ ์ฌ์ฉ๋์์ต๋๋ค.
|
56 |
+
- Train: 10M lines, 5B tokens
|
57 |
+
- Valid: 2M lines, 1B tokens
|
58 |
+
- cf) ๊ธฐ์กด mDeBERTa-v3์ XLM-R ๊ณผ ๊ฐ์ด [cc-100 ๋ฐ์ดํฐ์
](https://data.statmt.org/cc-100/)์ผ๋ก ํ์ต๋์์ผ๋ฉฐ, ๊ทธ ์ค ํ๊ตญ์ด ๋ฐ์ดํฐ์
์ ํฌ๊ธฐ๋ 54GB์
๋๋ค.
|
59 |
+
|
60 |
+
|
61 |
+
## Fine-tuning on NLU Tasks - Base Model
|
62 |
+
|
63 |
+
| Model | Size | NSMC(acc) | Naver NER(F1) | PAWS (acc) | KorNLI (acc) | KorSTS (spearman) | Question Pair (acc) | KorQuaD (Dev) (EM/F1) | Korean-Hate-Speech (Dev) (F1) |
|
64 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
65 |
+
| XLM-Roberta-Base | 1.03G | 89.03 | 86.65 | 82.80 | 80.23 | 78.45 | 93.80 | 64.70 / 88.94 | 64.06 |
|
66 |
+
| mdeberta-base | 534M | 90.01 | 87.43 | 85.55 | 80.41 | 82.65 | 94.06 | 65.48 / 89.74 | 62.91 |
|
67 |
+
| mdeberta-base-kor-further | 534M | 90.52 | 87.87 | 85.85 | 80.65 | 81.90 | 94.98 | 66.07 / 90.35 | 68.16 |
|
68 |
+
|
69 |
+
### Citation
|
70 |
+
|
71 |
+
```
|
72 |
+
@misc{he2021debertav3,
|
73 |
+
title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing},
|
74 |
+
author={Pengcheng He and Jianfeng Gao and Weizhu Chen},
|
75 |
+
year={2021},
|
76 |
+
eprint={2111.09543},
|
77 |
+
archivePrefix={arXiv},
|
78 |
+
primaryClass={cs.CL}
|
79 |
+
}
|
80 |
+
```
|
81 |
+
|
82 |
+
```
|
83 |
+
@inproceedings{
|
84 |
+
he2021deberta,
|
85 |
+
title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
|
86 |
+
author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
|
87 |
+
booktitle={International Conference on Learning Representations},
|
88 |
+
year={2021},
|
89 |
+
url={https://openreview.net/forum?id=XPZIaotutsD}
|
90 |
+
}
|
91 |
+
```
|
92 |
+
|
93 |
+
## Reference
|
94 |
+
|
95 |
+
- [DeBERTa](https://github.com/microsoft/DeBERTa)
|
96 |
+
- [Huggingface Transformers](https://github.com/huggingface/transformers)
|
97 |
+
- [๋ชจ๋์ ๋ง๋ญ์น](https://corpus.korean.go.kr/)
|
98 |
+
- [Korpora: Korean Corpora Archives](https://github.com/ko-nlp/Korpora)
|
99 |
+
- [sooftware/Korean PLM](https://github.com/sooftware/Korean-PLM)
|