README.md
3.6 KB · 110 lines · markdown Raw
1 ---
2 language:
3 - multilingual
4 - en
5 - ar
6 - bg
7 - de
8 - el
9 - es
10 - fr
11 - hi
12 - ru
13 - sw
14 - th
15 - tr
16 - ur
17 - vi
18 - zh
19 tags:
20 - deberta
21 - deberta-v3
22 - mdeberta
23 - fill-mask
24 thumbnail: https://huggingface.co/front/thumbnails/microsoft.png
25 license: mit
26 ---
27
28 ## DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
29
30 [DeBERTa](https://arxiv.org/abs/2006.03654) improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data.
31
32 In [DeBERTa V3](https://arxiv.org/abs/2111.09543), we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our [paper](https://arxiv.org/abs/2111.09543).
33
34 Please check the [official repository](https://github.com/microsoft/DeBERTa) for more implementation details and updates.
35
36 mDeBERTa is multilingual version of DeBERTa which use the same structure as DeBERTa and was trained with CC100 multilingual data.
37 The mDeBERTa V3 base model comes with 12 layers and a hidden size of 768. It has 86M backbone parameters with a vocabulary containing 250K tokens which introduces 190M parameters in the Embedding layer. This model was trained using the 2.5T CC100 data as XLM-R.
38
39
40 #### Fine-tuning on NLU tasks
41
42 We present the dev results on XNLI with zero-shot cross-lingual transfer setting, i.e. training with English data only, test on other languages.
43
44 | Model |avg | en | fr| es | de | el | bg | ru |tr |ar |vi | th | zh | hi | sw | ur |
45 |--------------| ----|----|----|---- |-- |-- |-- | -- |-- |-- |-- | -- | -- | -- | -- | -- |
46 | XLM-R-base |76.2 |85.8|79.7|80.7 |78.7 |77.5 |79.6 |78.1 |74.2 |73.8 |76.5 |74.6 |76.7| 72.4| 66.5| 68.3|
47 | mDeBERTa-base|**79.8**+/-0.2|**88.2**|**82.6**|**84.4** |**82.7** |**82.3** |**82.4** |**80.8** |**79.5** |**78.5** |**78.1** |**76.4** |**79.5**| **75.9**| **73.9**| **72.4**|
48
49 #### Fine-tuning with HF transformers
50
51 ```bash
52 #!/bin/bash
53
54 cd transformers/examples/pytorch/text-classification/
55
56 pip install datasets
57
58 output_dir="ds_results"
59
60 num_gpus=8
61
62 batch_size=4
63
64 python -m torch.distributed.launch --nproc_per_node=${num_gpus} \
65 run_xnli.py \
66 --model_name_or_path microsoft/mdeberta-v3-base \
67 --task_name $TASK_NAME \
68 --do_train \
69 --do_eval \
70 --train_language en \
71 --language en \
72 --evaluation_strategy steps \
73 --max_seq_length 256 \
74 --warmup_steps 3000 \
75 --per_device_train_batch_size ${batch_size} \
76 --learning_rate 2e-5 \
77 --num_train_epochs 6 \
78 --output_dir $output_dir \
79 --overwrite_output_dir \
80 --logging_steps 1000 \
81 --logging_dir $output_dir
82
83 ```
84
85 ### Citation
86
87 If you find DeBERTa useful for your work, please cite the following papers:
88
89 ``` latex
90 @misc{he2021debertav3,
91 title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing},
92 author={Pengcheng He and Jianfeng Gao and Weizhu Chen},
93 year={2021},
94 eprint={2111.09543},
95 archivePrefix={arXiv},
96 primaryClass={cs.CL}
97 }
98 ```
99
100 ``` latex
101 @inproceedings{
102 he2021deberta,
103 title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
104 author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
105 booktitle={International Conference on Learning Representations},
106 year={2021},
107 url={https://openreview.net/forum?id=XPZIaotutsD}
108 }
109 ```
110