CollectionStudio julien-c HF Staff commited on
Commit
1ad7795
·
0 Parent(s):

Duplicate from microsoft/deberta-v3-base

Browse files

Co-authored-by: Julien Chaumond <julien-c@users.noreply.huggingface.co>

Files changed (8) hide show
  1. .gitattributes +27 -0
  2. README.md +96 -0
  3. config.json +22 -0
  4. pytorch_model.bin +3 -0
  5. rust_model.ot +3 -0
  6. spm.model +3 -0
  7. tf_model.h5 +3 -0
  8. tokenizer_config.json +4 -0
.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ tags:
4
+ - deberta
5
+ - deberta-v3
6
+ - fill-mask
7
+ thumbnail: https://huggingface.co/front/thumbnails/microsoft.png
8
+ license: mit
9
+ ---
10
+
11
+ ## DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
12
+
13
+ [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.
14
+
15
+ 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).
16
+
17
+ Please check the [official repository](https://github.com/microsoft/DeBERTa) for more implementation details and updates.
18
+
19
+ 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.
20
+
21
+
22
+ #### Fine-tuning on NLU tasks
23
+
24
+ We present the dev results on SQuAD 2.0 and MNLI tasks.
25
+
26
+ | Model |Vocabulary(K)|Backbone #Params(M)| SQuAD 2.0(F1/EM) | MNLI-m/mm(ACC)|
27
+ |-------------------|----------|-------------------|-----------|----------|
28
+ | RoBERTa-base |50 |86 | 83.7/80.5 | 87.6/- |
29
+ | XLNet-base |32 |92 | -/80.2 | 86.8/- |
30
+ | ELECTRA-base |30 |86 | -/80.5 | 88.8/ |
31
+ | DeBERTa-base |50 |100 | 86.2/83.1| 88.8/88.5|
32
+ | DeBERTa-v3-base |128|86 | **88.4/85.4** | **90.6/90.7**|
33
+ | DeBERTa-v3-base + SiFT |128|86 | -/- | 91.0/-|
34
+
35
+ We present the dev results on SQuAD 1.1/2.0 and MNLI tasks.
36
+
37
+ #### Fine-tuning with HF transformers
38
+
39
+ ```bash
40
+ #!/bin/bash
41
+
42
+ cd transformers/examples/pytorch/text-classification/
43
+
44
+ pip install datasets
45
+ export TASK_NAME=mnli
46
+
47
+ output_dir="ds_results"
48
+
49
+ num_gpus=8
50
+
51
+ batch_size=8
52
+
53
+ python -m torch.distributed.launch --nproc_per_node=${num_gpus} \
54
+ run_glue.py \
55
+ --model_name_or_path microsoft/deberta-v3-base \
56
+ --task_name $TASK_NAME \
57
+ --do_train \
58
+ --do_eval \
59
+ --evaluation_strategy steps \
60
+ --max_seq_length 256 \
61
+ --warmup_steps 500 \
62
+ --per_device_train_batch_size ${batch_size} \
63
+ --learning_rate 2e-5 \
64
+ --num_train_epochs 3 \
65
+ --output_dir $output_dir \
66
+ --overwrite_output_dir \
67
+ --logging_steps 1000 \
68
+ --logging_dir $output_dir
69
+
70
+ ```
71
+
72
+ ### Citation
73
+
74
+ If you find DeBERTa useful for your work, please cite the following papers:
75
+
76
+ ``` latex
77
+ @misc{he2021debertav3,
78
+ title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing},
79
+ author={Pengcheng He and Jianfeng Gao and Weizhu Chen},
80
+ year={2021},
81
+ eprint={2111.09543},
82
+ archivePrefix={arXiv},
83
+ primaryClass={cs.CL}
84
+ }
85
+ ```
86
+
87
+ ``` latex
88
+ @inproceedings{
89
+ he2021deberta,
90
+ title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
91
+ author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
92
+ booktitle={International Conference on Learning Representations},
93
+ year={2021},
94
+ url={https://openreview.net/forum?id=XPZIaotutsD}
95
+ }
96
+ ```
config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "deberta-v2",
3
+ "attention_probs_dropout_prob": 0.1,
4
+ "hidden_act": "gelu",
5
+ "hidden_dropout_prob": 0.1,
6
+ "hidden_size": 768,
7
+ "initializer_range": 0.02,
8
+ "intermediate_size": 3072,
9
+ "max_position_embeddings": 512,
10
+ "relative_attention": true,
11
+ "position_buckets": 256,
12
+ "norm_rel_ebd": "layer_norm",
13
+ "share_att_key": true,
14
+ "pos_att_type": "p2c|c2p",
15
+ "layer_norm_eps": 1e-7,
16
+ "max_relative_positions": -1,
17
+ "position_biased_input": false,
18
+ "num_attention_heads": 12,
19
+ "num_hidden_layers": 12,
20
+ "type_vocab_size": 0,
21
+ "vocab_size": 128100
22
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:691d48a2800b926a19e3051def466fc2cca4f59a15e42ce4a0cf7f1b380b5e33
3
+ size 371146213
rust_model.ot ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:276aadc323988709f076fb489790103d28e64b80c72e9a3e19043d28f4c7c31a
3
+ size 742218621
spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
3
+ size 2464616
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01ad1b35cac509fb00b9873c670d824363ef884d1aa2758471c47b26cc2948f0
3
+ size 735589384
tokenizer_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "do_lower_case": false,
3
+ "vocab_type": "spm"
4
+ }