abhishek HF staff commited on
Commit
fb5ba45
1 Parent(s): c43d9db

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +95 -0
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ tags:
4
+ - deberta
5
+ - deberta-v3
6
+ thumbnail: https://huggingface.co/front/thumbnails/microsoft.png
7
+ license: mit
8
+ ---
9
+
10
+ ## DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
11
+
12
+ [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.
13
+
14
+ 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).
15
+
16
+ Please check the [official repository](https://github.com/microsoft/DeBERTa) for more implementation details and updates.
17
+
18
+ The DeBERTa V3 base model comes with 12 layers and a hidden size of 768. It has only 86M backbone parameters with a vocabulary containing 128K tokens which introduces 98M parameters in the Embedding layer. This model was trained using the 160GB data as DeBERTa V2.
19
+
20
+
21
+ #### Fine-tuning on NLU tasks
22
+
23
+ We present the dev results on SQuAD 2.0 and MNLI tasks.
24
+
25
+ | Model |Vocabulary(K)|Backbone #Params(M)| SQuAD 2.0(F1/EM) | MNLI-m/mm(ACC)|
26
+ |-------------------|----------|-------------------|-----------|----------|
27
+ | RoBERTa-base |50 |86 | 83.7/80.5 | 87.6/- |
28
+ | XLNet-base |32 |92 | -/80.2 | 86.8/- |
29
+ | ELECTRA-base |30 |86 | -/80.5 | 88.8/ |
30
+ | DeBERTa-base |50 |100 | 86.2/83.1| 88.8/88.5|
31
+ | DeBERTa-v3-base |128|86 | **88.4/85.4** | **90.6/90.7**|
32
+ | DeBERTa-v3-base + SiFT |128|86 | -/- | 91.0/-|
33
+
34
+ We present the dev results on SQuAD 1.1/2.0 and MNLI tasks.
35
+
36
+ #### Fine-tuning with HF transformers
37
+
38
+ ```bash
39
+ #!/bin/bash
40
+
41
+ cd transformers/examples/pytorch/text-classification/
42
+
43
+ pip install datasets
44
+ export TASK_NAME=mnli
45
+
46
+ output_dir="ds_results"
47
+
48
+ num_gpus=8
49
+
50
+ batch_size=8
51
+
52
+ python -m torch.distributed.launch --nproc_per_node=${num_gpus} \
53
+ run_glue.py \
54
+ --model_name_or_path microsoft/deberta-v3-base \
55
+ --task_name $TASK_NAME \
56
+ --do_train \
57
+ --do_eval \
58
+ --evaluation_strategy steps \
59
+ --max_seq_length 256 \
60
+ --warmup_steps 500 \
61
+ --per_device_train_batch_size ${batch_size} \
62
+ --learning_rate 2e-5 \
63
+ --num_train_epochs 3 \
64
+ --output_dir $output_dir \
65
+ --overwrite_output_dir \
66
+ --logging_steps 1000 \
67
+ --logging_dir $output_dir
68
+
69
+ ```
70
+
71
+ ### Citation
72
+
73
+ If you find DeBERTa useful for your work, please cite the following papers:
74
+
75
+ ``` latex
76
+ @misc{he2021debertav3,
77
+ title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing},
78
+ author={Pengcheng He and Jianfeng Gao and Weizhu Chen},
79
+ year={2021},
80
+ eprint={2111.09543},
81
+ archivePrefix={arXiv},
82
+ primaryClass={cs.CL}
83
+ }
84
+ ```
85
+
86
+ ``` latex
87
+ @inproceedings{
88
+ he2021deberta,
89
+ title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
90
+ author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
91
+ booktitle={International Conference on Learning Representations},
92
+ year={2021},
93
+ url={https://openreview.net/forum?id=XPZIaotutsD}
94
+ }
95
+ ```