DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. It outperforms BERT and RoBERTa on majority of NLU tasks with 80GB training data.
Please check the
official repository for more details and updates.
This is the DeBERTa V2 xxlarge model with 48 layers, 1536 hidden size. The total parameters are 1.5B and it is trained with 160GB raw data.
We present the dev results on SQuAD 1.1/2.0 and several GLUE benchmark tasks.
1pip install datasets
2pip install deepspeed
3# Download the deepspeed config file
4wget https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/ds_config.json -O ds_config.json
5export TASK_NAME=mnli
6output_dir="ds_results"
7num_gpus=8
8batch_size=8
9python -m torch.distributed.launch --nproc_per_node=${num_gpus} \\
10 run_glue.py \\
11 --model_name_or_path microsoft/deberta-v2-xxlarge \\
12 --task_name $TASK_NAME \\
13 --do_train \\
14 --do_eval \\
15 --max_seq_length 256 \\
16 --per_device_train_batch_size ${batch_size} \\
17 --learning_rate 3e-6 \\
18 --num_train_epochs 3 \\
19 --output_dir $output_dir \\
20 --overwrite_output_dir \\
21 --logging_steps 10 \\
22 --logging_dir $output_dir \\
23 --deepspeed ds_config.json
1cd transformers/examples/text-classification/
2export TASK_NAME=mnli
3python -m torch.distributed.launch --nproc_per_node=8 run_glue.py --model_name_or_path microsoft/deberta-v2-xxlarge \\
4--task_name $TASK_NAME --do_train --do_eval --max_seq_length 256 --per_device_train_batch_size 8 \\
5--learning_rate 3e-6 --num_train_epochs 3 --output_dir /tmp/$TASK_NAME/ --overwrite_output_dir --sharded_ddp --fp16
1@inproceedings{
2he2021deberta,
3title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
4author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
5booktitle={International Conference on Learning Representations},
6year={2021},
7url={https://openreview.net/forum?id=XPZIaotutsD}
8}