rohitsroch
commited on
Commit
•
9052bac
1
Parent(s):
3c9d81d
Push SEAD-L-6_H-384_A-12-mnli model weights
Browse files- README.md +80 -0
- config.json +37 -0
- eval_m-results.json +8 -0
- eval_mm-results.json +8 -0
- flax_model.msgpack +3 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- test_m-results.json +7 -0
- test_mm-results.json +7 -0
- tf_model.h5 +3 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
license: apache-2.0
|
5 |
+
tags:
|
6 |
+
- SEAD
|
7 |
+
datasets:
|
8 |
+
- glue
|
9 |
+
- mnli
|
10 |
+
---
|
11 |
+
|
12 |
+
## Paper
|
13 |
+
|
14 |
+
## [SEAD: SIMPLE ENSEMBLE AND KNOWLEDGE DISTILLATION FRAMEWORK FOR NATURAL LANGUAGE UNDERSTANDING](https://www.adasci.org/journals/lattice-35309407/?volumes=true&open=621a3b18edc4364e8a96cb63)
|
15 |
+
Aurthors: *Moyan Mei*, *Rohit Sroch*
|
16 |
+
|
17 |
+
## Abstract
|
18 |
+
|
19 |
+
With the widespread use of pre-trained language models (PLM), there has been increased research on how to make them applicable, especially in limited-resource or low latency high throughput scenarios. One of the dominant approaches is knowledge distillation (KD), where a smaller model is trained by receiving guidance from a large PLM. While there are many successful designs for learning knowledge from teachers, it remains unclear how students can learn better. Inspired by real university teaching processes, in this work we further explore knowledge distillation and propose a very simple yet effective framework, SEAD, to further improve task-specific generalization by utilizing multiple teachers. Our experiments show that SEAD leads to better performance compared to other popular KD methods [[1](https://arxiv.org/abs/1910.01108)] [[2](https://arxiv.org/abs/1909.10351)] [[3](https://arxiv.org/abs/2002.10957)] and achieves comparable or superior performance to its teacher model such as BERT [[4](https://arxiv.org/abs/1810.04805)] on total 13 tasks for the GLUE [[5](https://arxiv.org/abs/1804.07461)] and SuperGLUE [[6](https://arxiv.org/abs/1905.00537)] benchmarks.
|
20 |
+
|
21 |
+
*Moyan Mei and Rohit Sroch. 2022. [SEAD: Simple ensemble and knowledge distillation framework for natural language understanding](https://www.adasci.org/journals/lattice-35309407/?volumes=true&open=621a3b18edc4364e8a96cb63).
|
22 |
+
Lattice, THE MACHINE LEARNING JOURNAL by Association of Data Scientists, 3(1).*
|
23 |
+
|
24 |
+
## SEAD-L-6_H-384_A-12-mnli
|
25 |
+
|
26 |
+
This is a student model distilled from [**BERT base**](https://huggingface.co/bert-base-uncased) as teacher by using SEAD framework on **mnli** task. For weights initialization, we used [microsoft/xtremedistil-l6-h384-uncased](https://huggingface.co/microsoft/xtremedistil-l6-h384-uncased)
|
27 |
+
|
28 |
+
|
29 |
+
## All SEAD Checkpoints
|
30 |
+
|
31 |
+
Other Community Checkpoints: [here](https://huggingface.co/models?search=SEAD)
|
32 |
+
|
33 |
+
## Intended uses & limitations
|
34 |
+
|
35 |
+
More information needed
|
36 |
+
|
37 |
+
### Training hyperparameters
|
38 |
+
|
39 |
+
Please take a look at the `training_args.bin` file
|
40 |
+
|
41 |
+
```python
|
42 |
+
$ import torch
|
43 |
+
$ hyperparameters = torch.load(os.path.join('training_args.bin'))
|
44 |
+
|
45 |
+
```
|
46 |
+
|
47 |
+
|
48 |
+
### Evaluation results
|
49 |
+
|
50 |
+
| eval_m-accuracy | eval_m-runtime | eval_m-samples_per_second | eval_m-steps_per_second | eval_m-loss | eval_m-samples | eval_mm-accuracy | eval_mm-runtime | eval_mm-samples_per_second | eval_mm-steps_per_second | eval_mm-loss | eval_mm-samples |
|
51 |
+
|:---------------:|:--------------:|:-------------------------:|:-----------------------:|:-----------:|:--------------:|:----------------:|:---------------:|:--------------------------:|:------------------------:|:------------:|:---------------:|
|
52 |
+
| 0.8495 | 6.5443 | 1499.776 | 46.911 | 0.4366 | 9815 | 0.8508 | 5.6975 | 1725.678 | 54.059 | 0.4252 | 9832 |
|
53 |
+
|
54 |
+
|
55 |
+
### Framework versions
|
56 |
+
|
57 |
+
- Transformers >=4.8.0
|
58 |
+
- Pytorch >=1.6.0
|
59 |
+
- TensorFlow >=2.5.0
|
60 |
+
- Flax >=0.3.5
|
61 |
+
- Datasets >=1.10.2
|
62 |
+
- Tokenizers >=0.11.6
|
63 |
+
|
64 |
+
If you use these models, please cite the following paper:
|
65 |
+
|
66 |
+
|
67 |
+
```
|
68 |
+
@article{article,
|
69 |
+
author={Mei, Moyan and Sroch, Rohit},
|
70 |
+
title={SEAD: Simple Ensemble and Knowledge Distillation Framework for Natural Language Understanding},
|
71 |
+
volume={3},
|
72 |
+
number={1},
|
73 |
+
journal={Lattice, The Machine Learning Journal by Association of Data Scientists},
|
74 |
+
day={26},
|
75 |
+
year={2022},
|
76 |
+
month={Feb},
|
77 |
+
url = {www.adasci.org/journals/lattice-35309407/?volumes=true&open=621a3b18edc4364e8a96cb63}
|
78 |
+
}
|
79 |
+
```
|
80 |
+
|
config.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "../artifacts/best_models/mnli/L-6_H-384_A-12/student-ckpt",
|
3 |
+
"architectures": [
|
4 |
+
"BertForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"finetuning_task": "mnli",
|
9 |
+
"gradient_checkpointing": false,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 384,
|
13 |
+
"id2label": {
|
14 |
+
"0": 0,
|
15 |
+
"1": 1,
|
16 |
+
"2": 2
|
17 |
+
},
|
18 |
+
"initializer_range": 0.02,
|
19 |
+
"intermediate_size": 1536,
|
20 |
+
"label2id": {
|
21 |
+
"0": 0,
|
22 |
+
"1": 1,
|
23 |
+
"2": 2
|
24 |
+
},
|
25 |
+
"layer_norm_eps": 1e-12,
|
26 |
+
"max_position_embeddings": 512,
|
27 |
+
"model_type": "bert",
|
28 |
+
"num_attention_heads": 12,
|
29 |
+
"num_hidden_layers": 6,
|
30 |
+
"pad_token_id": 0,
|
31 |
+
"position_embedding_type": "absolute",
|
32 |
+
"problem_type": "single_label_classification",
|
33 |
+
"transformers_version": "4.18.0",
|
34 |
+
"type_vocab_size": 2,
|
35 |
+
"use_cache": true,
|
36 |
+
"vocab_size": 30522
|
37 |
+
}
|
eval_m-results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"eval_m-accuracy": 0.8495160468670403,
|
3 |
+
"eval_m-loss": 0.43661612505244896,
|
4 |
+
"eval_m-runtime": 6.5443,
|
5 |
+
"eval_m-samples": 9815,
|
6 |
+
"eval_m-samples_per_second": 1499.776,
|
7 |
+
"eval_m-steps_per_second": 46.911
|
8 |
+
}
|
eval_mm-results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"eval_mm-accuracy": 0.850793327908869,
|
3 |
+
"eval_mm-loss": 0.42524906876799345,
|
4 |
+
"eval_mm-runtime": 5.6975,
|
5 |
+
"eval_mm-samples": 9832,
|
6 |
+
"eval_mm-samples_per_second": 1725.678,
|
7 |
+
"eval_mm-steps_per_second": 54.059
|
8 |
+
}
|
flax_model.msgpack
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4974722ec0301193bfc70f64c52e42fb5f887eb3c2ad4925be489494e5a02dd2
|
3 |
+
size 90861290
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:374f85b13124c247cb4a82c48dd33b5fab49ebc5f32e5cfc8dad1441a4b880a2
|
3 |
+
size 90887737
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
|
test_m-results.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"ckpt_name": "student-checkpoint-49088",
|
3 |
+
"test_m-runtime": 5.3114,
|
4 |
+
"test_m-samples": 9796,
|
5 |
+
"test_m-samples_per_second": 1844.351,
|
6 |
+
"test_m-steps_per_second": 57.801
|
7 |
+
}
|
test_mm-results.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"ckpt_name": "student-checkpoint-49088",
|
3 |
+
"test_mm-runtime": 5.2791,
|
4 |
+
"test_mm-samples": 9847,
|
5 |
+
"test_mm-samples_per_second": 1865.291,
|
6 |
+
"test_mm-steps_per_second": 58.344
|
7 |
+
}
|
tf_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f1961beccdd43f29ae85782812404a19dfbcac4e7359ffe692811f85cbce800f
|
3 |
+
size 91014288
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"do_lower_case": true, "do_basic_tokenize": true, "never_split": null, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "special_tokens_map_file": null, "tokenizer_file": null, "name_or_path": "microsoft/xtremedistil-l6-h384-uncased", "tokenizer_class": "BertTokenizer"}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:128539e9b57579bd90c202db1996a643dce02ac1f6f4c73ddaee46d4f5844c64
|
3 |
+
size 2720
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|