🚀 DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
DeBERTaV3 enhances the efficiency of DeBERTa through ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing, significantly improving model performance on downstream tasks.
🚀 Quick Start
DeBERTa enhances the BERT and RoBERTa models by leveraging disentangled attention and an enhanced mask decoder. With these two improvements, DeBERTa outperforms RoBERTa on a majority of NLU tasks using 80GB of training data.
In DeBERTa V3, we further boost the efficiency of DeBERTa by applying ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version notably improves the model's performance on downstream tasks. You can find more technical details about the new model in our paper.
Please refer to the official repository for more implementation details and updates.
The DeBERTa V3 base model consists of 12 layers and has 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 160GB of data, the same as DeBERTa V2.
✨ Features
Fine-tuning on NLU tasks
We present the dev results on SQuAD 2.0 and MNLI tasks.
Property |
Details |
Model Type |
DeBERTaV3 base model |
Training Data |
160GB |
Model |
Vocabulary(K) |
Backbone #Params(M) |
SQuAD 2.0(F1/EM) |
MNLI-m/mm(ACC) |
RoBERTa-base |
50 |
86 |
83.7/80.5 |
87.6/- |
XLNet-base |
32 |
92 |
-/80.2 |
86.8/- |
ELECTRA-base |
30 |
86 |
-/80.5 |
88.8/ |
DeBERTa-base |
50 |
100 |
86.2/83.1 |
88.8/88.5 |
DeBERTa-v3-base |
128 |
86 |
88.4/85.4 |
90.6/90.7 |
DeBERTa-v3-base + SiFT |
128 |
86 |
-/- |
91.0/- |
We also present the dev results on SQuAD 1.1/2.0 and MNLI tasks.
💻 Usage Examples
Basic Usage
#!/bin/bash
cd transformers/examples/pytorch/text-classification/
pip install datasets
export TASK_NAME=mnli
output_dir="ds_results"
num_gpus=8
batch_size=8
python -m torch.distributed.launch --nproc_per_node=${num_gpus} \
run_glue.py \
--model_name_or_path microsoft/deberta-v3-base \
--task_name $TASK_NAME \
--do_train \
--do_eval \
--evaluation_strategy steps \
--max_seq_length 256 \
--warmup_steps 500 \
--per_device_train_batch_size ${batch_size} \
--learning_rate 2e-5 \
--num_train_epochs 3 \
--output_dir $output_dir \
--overwrite_output_dir \
--logging_steps 1000 \
--logging_dir $output_dir
📄 License
This project is licensed under the MIT license.
Citation
If you find DeBERTa useful for your work, please cite the following papers:
@misc{he2021debertav3,
title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing},
author={Pengcheng He and Jianfeng Gao and Weizhu Chen},
year={2021},
eprint={2111.09543},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@inproceedings{
he2021deberta,
title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
booktitle={International Conference on Learning Representations},
year={2021},
url={https://openreview.net/forum?id=XPZIaotutsD}
}