File size: 6,605 Bytes
17c6d62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!--Copyright 2020 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
rendered properly in your Markdown viewer.

-->

# DeBERTa-v2

## κ°œμš”


DeBERTa λͺ¨λΈμ€ Pengcheng He, Xiaodong Liu, Jianfeng Gao, Weizhu Chen이 μž‘μ„±ν•œ [DeBERTa: λΆ„λ¦¬λœ μ–΄ν…μ…˜μ„ ν™œμš©ν•œ λ””μ½”λ”© κ°•ν™” BERT](https://arxiv.org/abs/2006.03654)μ΄λΌλŠ” λ…Όλ¬Έμ—μ„œ μ œμ•ˆλ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이 λͺ¨λΈμ€ 2018λ…„ Google이 λ°œν‘œν•œ BERT λͺ¨λΈκ³Ό 2019λ…„ Facebook이 λ°œν‘œν•œ RoBERTa λͺ¨λΈμ„ 기반으둜 ν•©λ‹ˆλ‹€.
DeBERTaλŠ” RoBERTaμ—μ„œ μ‚¬μš©λœ λ°μ΄ν„°μ˜ μ ˆλ°˜λ§Œμ„ μ‚¬μš©ν•˜μ—¬ λΆ„λ¦¬λœ(disentangled) μ–΄ν…μ…˜κ³Ό ν–₯μƒλœ 마슀크 디코더 ν•™μŠ΅μ„ 톡해 RoBERTaλ₯Ό κ°œμ„ ν–ˆμŠ΅λ‹ˆλ‹€.

λ…Όλ¬Έμ˜ μ΄ˆλ‘μ€ λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:

*사전 ν•™μŠ΅λœ 신경망 μ–Έμ–΄ λͺ¨λΈμ˜ 졜근 λ°œμ „μ€ λ§Žμ€ μžμ—°μ–΄ 처리(NLP) μž‘μ—…μ˜ μ„±λŠ₯을 크게 ν–₯μƒμ‹œμΌ°μŠ΅λ‹ˆλ‹€. λ³Έ λ…Όλ¬Έμ—μ„œλŠ” 두 κ°€μ§€ μƒˆλ‘œμš΄ κΈ°μˆ μ„ μ‚¬μš©ν•˜μ—¬ BERT와 RoBERTa λͺ¨λΈμ„ κ°œμ„ ν•œ μƒˆλ‘œμš΄ λͺ¨λΈ ꡬ쑰인 DeBERTaλ₯Ό μ œμ•ˆν•©λ‹ˆλ‹€. 첫 λ²ˆμ§ΈλŠ” λΆ„λ¦¬λœ μ–΄ν…μ…˜ λ©”μ»€λ‹ˆμ¦˜μœΌλ‘œ, 각 단어가 λ‚΄μš©κ³Ό μœ„μΉ˜λ₯Ό 각각 μΈμ½”λ”©ν•˜λŠ” 두 개의 λ²‘ν„°λ‘œ ν‘œν˜„λ˜λ©°, 단어듀 κ°„μ˜ μ–΄ν…μ…˜ κ°€μ€‘μΉ˜λŠ” λ‚΄μš©κ³Ό μƒλŒ€μ  μœ„μΉ˜μ— λŒ€ν•œ λΆ„λ¦¬λœ 행렬을 μ‚¬μš©ν•˜μ—¬ κ³„μ‚°λ©λ‹ˆλ‹€. 두 번째둜, λͺ¨λΈ 사전 ν•™μŠ΅μ„ μœ„ν•΄ λ§ˆμŠ€ν‚Ήλœ 토큰을 μ˜ˆμΈ‘ν•˜λŠ” 좜λ ₯ μ†Œν”„νŠΈλ§₯슀 측을 λŒ€μ²΄ν•˜λŠ” ν–₯μƒλœ 마슀크 디코더가 μ‚¬μš©λ©λ‹ˆλ‹€. μš°λ¦¬λŠ” 이 두 κ°€μ§€ 기술이 λͺ¨λΈ 사전 ν•™μŠ΅μ˜ νš¨μœ¨μ„±κ³Ό λ‹€μš΄μŠ€νŠΈλ¦Ό μž‘μ—…μ˜ μ„±λŠ₯을 크게 ν–₯μƒμ‹œν‚¨λ‹€λŠ” 것을 λ³΄μ—¬μ€λ‹ˆλ‹€. RoBERTa-Large와 λΉ„κ΅ν–ˆμ„ λ•Œ, 절반의 ν•™μŠ΅ λ°μ΄ν„°λ‘œ ν•™μŠ΅λœ DeBERTa λͺ¨λΈμ€ κ΄‘λ²”μœ„ν•œ NLP μž‘μ—…μ—μ„œ μΌκ΄€λ˜κ²Œ 더 λ‚˜μ€ μ„±λŠ₯을 보여주며, MNLIμ—μ„œ +0.9%(90.2% vs 91.1%), SQuAD v2.0μ—μ„œ +2.3%(88.4% vs 90.7%), RACEμ—μ„œ +3.6%(83.2% vs 86.8%)의 μ„±λŠ₯ ν–₯상을 λ‹¬μ„±ν–ˆμŠ΅λ‹ˆλ‹€. DeBERTa μ½”λ“œμ™€ 사전 ν•™μŠ΅λœ λͺ¨λΈμ€ https://github.com/microsoft/DeBERTa μ—μ„œ 곡개될 μ˜ˆμ •μž…λ‹ˆλ‹€.*


λ‹€μŒ 정보듀은 [원본 κ΅¬ν˜„ μ €μž₯μ†Œ](https://github.com/microsoft/DeBERTa)μ—μ„œ 보싀 수 μžˆμŠ΅λ‹ˆλ‹€. DeBERTa v2λŠ” DeBERTa의 λ‘λ²ˆμ§Έ λͺ¨λΈμž…λ‹ˆλ‹€. 
DeBERTa v2λŠ” SuperGLUE 단일 λͺ¨λΈ μ œμΆœμ— μ‚¬μš©λœ 1.5B λͺ¨λΈμ„ ν¬ν•¨ν•˜λ©°, 인간 기쀀점(베이슀라인) 89.8점 λŒ€λΉ„ 89.9점을 λ‹¬μ„±ν–ˆμŠ΅λ‹ˆλ‹€. μ €μžμ˜ 
[λΈ”λ‘œκ·Έ](https://www.microsoft.com/en-us/research/blog/microsoft-deberta-surpasses-human-performance-on-the-superglue-benchmark/)μ—μ„œ 더 μžμ„Έν•œ 정보λ₯Ό 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

v2의 μƒˆλ‘œμš΄ 점:

- **μ–΄νœ˜(Vocabulary)** v2μ—μ„œλŠ” ν•™μŠ΅ λ°μ΄ν„°λ‘œλΆ€ν„° κ΅¬μΆ•λœ 128K 크기의 μƒˆλ‘œμš΄ μ–΄νœ˜λ₯Ό μ‚¬μš©ν•˜λ„λ‘ ν† ν¬λ‚˜μ΄μ €κ°€ λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€. GPT2 기반 ν† ν¬λ‚˜μ΄μ € λŒ€μ‹ , μ΄μ œλŠ” [μ„Όν…μŠ€ν”ΌμŠ€ 기반](https://github.com/google/sentencepiece) ν† ν¬λ‚˜μ΄μ €λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.
- **nGiE[n그램 μœ λ„(Induced) μž…λ ₯ 인코딩]** DeBERTa-v2 λͺ¨λΈμ€ μž…λ ₯ ν† ν°λ“€μ˜ 지역적 μ˜μ‘΄μ„±μ„ 더 잘 ν•™μŠ΅ν•˜κΈ° μœ„ν•΄ 첫 번째 트랜슀포머 μΈ΅κ³Ό ν•¨κ»˜ 좔가적인 ν•©μ„±κ³± 측을 μ‚¬μš©ν•©λ‹ˆλ‹€.
- **μ–΄ν…μ…˜ μΈ΅μ—μ„œ μœ„μΉ˜ 투영 ν–‰λ ¬κ³Ό λ‚΄μš© 투영 ν–‰λ ¬ 곡유** 이전 μ‹€ν—˜λ“€μ„ 기반으둜, μ΄λŠ” μ„±λŠ₯에 영ν–₯을 μ£Όμ§€ μ•ŠμœΌλ©΄μ„œ λ§€κ°œλ³€μˆ˜λ₯Ό μ ˆμ•½ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
- **μƒλŒ€μ  μœ„μΉ˜λ₯Ό μΈμ½”λ”©ν•˜κΈ° μœ„ν•œ 버킷 적용** DeBERTa-v2 λͺ¨λΈμ€ T5와 μœ μ‚¬ν•˜κ²Œ μƒλŒ€μ  μœ„μΉ˜λ₯Ό μΈμ½”λ”©ν•˜κΈ° μœ„ν•΄ 둜그 버킷을 μ‚¬μš©ν•©λ‹ˆλ‹€.
- **900M λͺ¨λΈ & 1.5B λͺ¨λΈ** 900Mκ³Ό 1.5B, 두 κ°€μ§€ μΆ”κ°€ λͺ¨λΈ 크기가 제곡되며, μ΄λŠ” λ‹€μš΄μŠ€νŠΈλ¦Ό μž‘μ—…μ˜ μ„±λŠ₯을 크게 ν–₯μƒμ‹œν‚΅λ‹ˆλ‹€.

[DeBERTa](https://huggingface.co/DeBERTa) λͺ¨λΈμ˜ ν…μ„œν”Œλ‘œ 2.0 κ΅¬ν˜„μ€ [kamalkraj](https://huggingface.co/kamalkraj)κ°€ κΈ°μ—¬ν–ˆμŠ΅λ‹ˆλ‹€. 원본 μ½”λ“œλŠ” [이곳](https://github.com/microsoft/DeBERTa)μ—μ„œ ν™•μΈν•˜μ‹€ 수 μžˆμŠ΅λ‹ˆλ‹€.

## 자료

- [ν…μŠ€νŠΈ λΆ„λ₯˜ μž‘μ—… κ°€μ΄λ“œ](../tasks/sequence_classification)
- [토큰 λΆ„λ₯˜ μž‘μ—… κ°€μ΄λ“œ](../tasks/token_classification)
- [μ§ˆμ˜μ‘λ‹΅ μž‘μ—… κ°€μ΄λ“œ](../tasks/question_answering)
- [마슀크 μ–Έμ–΄ λͺ¨λΈλ§ μž‘μ—… κ°€μ΄λ“œ](../tasks/masked_language_modeling)
- [닀쀑 선택 μž‘μ—… κ°€μ΄λ“œ](../tasks/multiple_choice)

## DebertaV2Config

[[autodoc]] DebertaV2Config

## DebertaV2Tokenizer

[[autodoc]] DebertaV2Tokenizer
    - build_inputs_with_special_tokens
    - get_special_tokens_mask
    - create_token_type_ids_from_sequences
    - save_vocabulary

## DebertaV2TokenizerFast

[[autodoc]] DebertaV2TokenizerFast
    - build_inputs_with_special_tokens
    - create_token_type_ids_from_sequences

<frameworkcontent>
<pt>

## DebertaV2Model

[[autodoc]] DebertaV2Model
    - forward

## DebertaV2PreTrainedModel

[[autodoc]] DebertaV2PreTrainedModel
    - forward

## DebertaV2ForMaskedLM

[[autodoc]] DebertaV2ForMaskedLM
    - forward

## DebertaV2ForSequenceClassification

[[autodoc]] DebertaV2ForSequenceClassification
    - forward

## DebertaV2ForTokenClassification

[[autodoc]] DebertaV2ForTokenClassification
    - forward

## DebertaV2ForQuestionAnswering

[[autodoc]] DebertaV2ForQuestionAnswering
    - forward

## DebertaV2ForMultipleChoice

[[autodoc]] DebertaV2ForMultipleChoice
    - forward

</pt>
<tf>

## TFDebertaV2Model

[[autodoc]] TFDebertaV2Model
    - call

## TFDebertaV2PreTrainedModel

[[autodoc]] TFDebertaV2PreTrainedModel
    - call

## TFDebertaV2ForMaskedLM

[[autodoc]] TFDebertaV2ForMaskedLM
    - call

## TFDebertaV2ForSequenceClassification

[[autodoc]] TFDebertaV2ForSequenceClassification
    - call

## TFDebertaV2ForTokenClassification

[[autodoc]] TFDebertaV2ForTokenClassification
    - call

## TFDebertaV2ForQuestionAnswering

[[autodoc]] TFDebertaV2ForQuestionAnswering
    - call

## TFDebertaV2ForMultipleChoice

[[autodoc]] TFDebertaV2ForMultipleChoice
    - call

</tf>
</frameworkcontent>