eladven commited on
Commit
1b4104b
1 Parent(s): 51a90a1

Upload model

Browse files
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ tags:
4
+ - exbert
5
+ license: mit
6
+ ---
7
+
8
+ # ColD Fusion BERT uncased model
9
+
10
+ Finetuned model that aims to be a great base model. It improves over BERT base model (uncased), trained on 35 datasets.
11
+ Full details at [this paper](https://arxiv.org/abs/2212.01378).
12
+
13
+ ## Paper Abstract:
14
+
15
+ Pretraining has been shown to scale well with compute, data size and data diversity. Multitask learning trains on a
16
+ mixture of supervised datasets and produces improved performance compared to self-supervised pretraining. Until now,
17
+ massively multitask learning required simultaneous access to all datasets in the mixture and heavy compute resources
18
+ that are only available to well-resourced teams.
19
+
20
+ In this paper, we propose ColD Fusion, a method that provides the benefits of multitask learning but leverages distributed
21
+ computation and requires limited communication and no sharing of data. Consequentially, ColD Fusion can create a synergistic
22
+ loop, where finetuned models can be recycled to continually improve the pretrained model they are based on. We show that
23
+ ColD Fusion yields comparable benefits to multitask pretraining by producing a model that (a) attains strong performance on
24
+ all of the datasets it was multitask trained on and (b) is a better starting point for finetuning on unseen datasets. We find
25
+ ColD Fusion outperforms RoBERTa and even previous multitask models. Specifically, when training and testing on 35 diverse datasets,
26
+ ColD Fusion-based model outperforms RoBERTa by 2.45 points in average without any changes to the architecture.
27
+
28
+
29
+ ### How to use
30
+ Best way to use is to finetune on your own task, but you can also extract features directly.
31
+ To get the features of a given text in PyTorch:
32
+
33
+ ```python
34
+ from transformers import RobertaTokenizer, RobertaModel
35
+ tokenizer = RobertaTokenizer.from_pretrained('ibm/ColD-Fusion')
36
+ model = RobertaModel.from_pretrained('ibm/ColD-Fusion')
37
+ text = "Replace me by any text you'd like."
38
+ encoded_input = tokenizer(text, return_tensors='pt')
39
+ output = model(**encoded_input)
40
+ ```
41
+
42
+ and in TensorFlow:
43
+
44
+ ```python
45
+ from transformers import RobertaTokenizer, TFRobertaModel
46
+ tokenizer = RobertaTokenizer.from_pretrained('ibm/ColD-Fusion')
47
+ model = TFRobertaModel.from_pretrained('ibm/ColD-Fusion')
48
+ text = "Replace me by any text you'd like."
49
+ encoded_input = tokenizer(text, return_tensors='tf')
50
+ output = model(encoded_input)
51
+ ```
52
+
53
+ ## Evaluation results
54
+ See full evaluation results of this model and many more [here](https://ibm.github.io/model-recycling/roberta-base_table.html)
55
+ When fine-tuned on downstream tasks, this model achieves the following results:
56
+
57
+
58
+
59
+ ### BibTeX entry and citation info
60
+
61
+ ```bibtex
62
+ @article{ColDFusion,
63
+ author = {Shachar Don-Yehiya, Elad Venezian, Colin Raffel, Noam Slonim, Yoav Katz, Leshem ChoshenYinhan Liu and},
64
+ title = {ColD Fusion: Collaborative Descent for Distributed Multitask Finetuning},
65
+ journal = {CoRR},
66
+ volume = {abs/2212.01378},
67
+ year = {2022},
68
+ url = {https://arxiv.org/abs/2212.01378},
69
+ archivePrefix = {arXiv},
70
+ eprint = {2212.01378},
71
+ }
72
+ ```
73
+
74
+ <a href="https://huggingface.co/exbert/?model=ibm/ColD-Fusion">
75
+ <img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
76
+ </a>
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "bert-base-uncased",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "LABEL_0",
14
+ "1": "LABEL_1",
15
+ "2": "LABEL_2"
16
+ },
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 3072,
19
+ "label2id": {
20
+ "LABEL_0": 0,
21
+ "LABEL_1": 1,
22
+ "LABEL_2": 2
23
+ },
24
+ "layer_norm_eps": 1e-12,
25
+ "max_position_embeddings": 512,
26
+ "model_type": "bert",
27
+ "num_attention_heads": 12,
28
+ "num_hidden_layers": 12,
29
+ "pad_token_id": 0,
30
+ "position_embedding_type": "absolute",
31
+ "problem_type": "single_label_classification",
32
+ "torch_dtype": "float32",
33
+ "transformers_version": "4.21.0",
34
+ "type_vocab_size": 2,
35
+ "use_cache": true,
36
+ "vocab_size": 30522
37
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:332c320998068ba0bd5b793885af76bae47191e7d73ae9e4346b389b35ffb6dc
3
+ size 438006381
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "do_lower_case": true,
4
+ "mask_token": "[MASK]",
5
+ "model_max_length": 512,
6
+ "name_or_path": "bert-base-uncased",
7
+ "pad_token": "[PAD]",
8
+ "sep_token": "[SEP]",
9
+ "special_tokens_map_file": null,
10
+ "strip_accents": null,
11
+ "tokenize_chinese_chars": true,
12
+ "tokenizer_class": "BertTokenizer",
13
+ "unk_token": "[UNK]"
14
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff