VictorSanh commited on
Commit
881d3a0
1 Parent(s): c049898

First draft Model card

Browse files
Files changed (1) hide show
  1. README.md +132 -1
README.md CHANGED
@@ -1 +1,132 @@
1
- WIP
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: apache-2.0
4
+ ---
5
+
6
+ # Model Description
7
+
8
+ TO_* is a series of encoder-decoder models trained on a large set of different tasks specified in natural language prompts. We convert numerous English supervised datasets into prompts, each with multiple templates using varying formulations. These prompted datasets allow for benchmarking the ability of a model to perform completely unseen tasks specified in natural language. To obtain T0_*, we fine-tune a pretrained language model on this multitask mixture covering many different NLP tasks.
9
+
10
+ # Intended uses
11
+
12
+ You can use the models to perform inference on tasks by specifying your query in natural language, and the models will generate a prediction. For instance, you can ask *"Is this review positive or negative? Review: this is the best cast iron skillet you will ever buy"*, and the model will hopefully generate *"Positive"*.
13
+
14
+ # How to use
15
+
16
+ We make available the models presented in our [paper](TODO) along with the ablation models. We recommend using the [T0pp_11B](https://huggingface.co/bigscience/T0pp_11B) checkpoint as it leads (on average) to the best performances on a variety of NLP tasks.
17
+
18
+ |Model|Number of parameters|
19
+ |-|-|
20
+ |[T0_11B](https://huggingface.co/bigscience/T0_11B)|11 billion|
21
+ |[T0p_11B](https://huggingface.co/bigscience/T0p_11B)|11 billion|
22
+ |[T0pp_11B](https://huggingface.co/bigscience/T0pp_11B)|11 billion|
23
+ |[T0_11B_single_prompt](https://huggingface.co/bigscience/T0_11B_single_prompt)|11 billion|
24
+ |[T0_11B_original_task_only](https://huggingface.co/bigscience/T0_11B_original_task_only)|11 billion|
25
+ |[T0_3B](https://huggingface.co/bigscience/T0_3B)|3 billion|
26
+
27
+ Here is how to use the model in PyTorch:
28
+ ```python
29
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
30
+
31
+ tokenizer = AutoTokenizer.from_pretrained("bigscience/T0pp_11B")
32
+ model = AutoModelForSeq2SeqLM.from_pretrained("bigscience/T0pp_11B")
33
+
34
+ inputs = tokenizer.encode("Is this review positive or negative? Review: this is the best cast iron skillet you will ever buy", return_tensors="pt")
35
+ outputs = model.generate(inputs)
36
+ print(tokenizer.decode(outputs[0]))
37
+ ```
38
+
39
+ If you want to use another checkpoint, please replace the path in `AutoTokenizer` and `AutoModelForSeq2SeqLM`.
40
+
41
+ # Training procedure
42
+
43
+ T0_* models are based on [T5](https://huggingface.co/google/t5-v1_1-large), a Transformer-based encoder-decoder language model pre-trained with a masked language modeling-style objective on 34B tokens from [C4](https://huggingface.co/datasets/c4). We use the publicly available [language model-adapated T5 checkpoints](https://github.com/google-research/text-to-text-transfer-transformer/blob/main/released_checkpoints.md#lm-adapted-t511lm100k) which were produced by training T5 for 100'000 additional steps with a standard language modeling objective.
44
+
45
+ At a high level, the input text is fed to the encoder and the target text is produced by the decoder. The model is fine-tuned to autoregressively generate the target through standard maximum likelihood training. It is never trained to generate the input. We detail our training data in the next section.
46
+
47
+ Training details:
48
+ - Fine-tuning steps: 12'200
49
+ - Input sequence length: 1024
50
+ - Target sequence length: 256
51
+ - Bathc size: 1'024 sequences
52
+ - Optimizer: Adafactor
53
+ - Learning rate: 1e-3
54
+ - Dropout: 0.1
55
+ - Sampling strategy: proportional to the number of examples in each dataset (we treated any dataset with over 500'000 examples as having 500'000/`num_templates` examples)
56
+ - Example grouping: We use packing to combine multiple training examples into a single sequence to reach the maximum sequence length
57
+
58
+ # Training data
59
+
60
+ We trained different variants T0 with different mixtures of datasets.
61
+
62
+ |Model|Training datasets|
63
+ |--|--|
64
+ |T0_11B|- Multiple-Choice QA: CommonsenseQA, DREAM, QUAIL, QuaRTz, Social IQA, WiQA, Cosmos, QASC, Quarel, SciQ, Wiki Hop<br>- Extractive QA: Adversarial QA, Quoref, TyDiQA, DuoRC, ROPES<br>- Closed-Book QA: Hotpot QA, Wiki QA<br>- Structure-To-Text: Common Gen, Wiki Bio<br>- Sentiment: Amazon, App Reviews, IMDB, Rotten Tomatoes, Yelp<br>- Summarization: CNN Daily Mail, Gigaword, MultiNews, SamSum, XSum<br>- Topic Classification: AG News, DBPedia, TREC<br>- Paraphrase Identification: MRPC, PAWS, QQP|
65
+ |T0p_11B|Same as T0_11B with a few additional datasets:<br>- Multiple-Choice QA: ARC, Circa, MC-TACO, Open Book QA, PiQA, RACE<br>- Extractive QA: CoQA, DROP, QA SRL,QuAC, ReCoRD, SQuAD v2<br>- Closed-Book QA: NQ Open, Trivia QA, Web Questions|
66
+ |T0pp_11B|Same as T0p_11B with a few additional datasets from SuperGLUE:<br>- BoolQ<br>- COPA<br>- MultiRC<br>- ReCoRD<br>- WiC<br>- WSC|
67
+ |T0_11B_single_prompt|Same as T0_11B but only one prompt per training dataset|
68
+ |T0_11B_original_task_only|Same as T0_11B but only original tasks templates|
69
+ |T0_3B|Same as T0_11B but starting from a T5-LM XL (3B parameters) pre-trained model|
70
+
71
+ For reproducibility, we release the data we used for training (and evaluation) in the [P3 dataset](TODO).
72
+
73
+ # Evaluation data
74
+
75
+ We systematically evaluate our models on a suite of held-out tasks:
76
+
77
+ |Task category|Datasets|
78
+ |-|-|
79
+ |Natural language inference|ANLI, CB, HANS, RTE|
80
+ |Coreference resolution|WSC, Winogrande|
81
+ |Word sense disambiguation|WiC|
82
+ |Sentence completion|COPA, HellaSwag, Story Cloze|
83
+
84
+ We also evaluate T0_11B, T0p_11B and T0pp_11B on the a subset of the [BIG-bench benchmark](https://github.com/google/BIG-bench):
85
+ - code description task
86
+ - conceptual_combinations
87
+ - hindu_knowledge_json
88
+ - known_unknowns
89
+ - Language Identification
90
+ - logic_grid_puzzle_task
91
+ - logical_deduction
92
+ - common_misconceptions
93
+ - movie_dialog_same_or_different
94
+ - novel_concepts
95
+ - strategyqa
96
+ - formal_fallacies_syllogisms_negation
97
+ - VitaminC
98
+ - winowhy_multiple_choice
99
+
100
+ # Limitations
101
+
102
+ - The models of the T0_* series are quite large (3B or 11B parameters). Loading them and performing inference requires non-trivial computational ressources. When using multiple GPUs, it is possible to use [.parallelize()](https://huggingface.co/transformers/parallelism.html).
103
+ - We have observed that different prompts can lead to varying performances. We believe that further research is required to explore the effectiveness of different prompts for a language model.
104
+ - Due to design choices in the tokenization, the models are unable to perform inference for tasks involving code or non English text.
105
+
106
+ # Bias and fairness
107
+
108
+ Even if we took conservative decisions to exclude datasets with potentially harmful content, this model can have biased predictions. To evaluate our models on bias and fairness, we consider a series of datasets: [WinoGender Schemas](https://huggingface.co/datasets/super_glue) (also called AXG under SuperGLUE), [CrowS-Pairs](https://huggingface.co/datasets/crows_pairs), [WinoBias](https://huggingface.co/datasets/wino_bias), WIP.
109
+
110
+ WinoGender Schemas are minimal pairs of sentences that differ only by the gender of one pronoun in the sentence, designed to test for the presence of gender bias. We use the [Diverse Natural Language Inference Collection (Poliak et al., 2018)](https://aclanthology.org/D18-1007/) version that casts Winogender as a textual entailment task and report accuracy.
111
+ CrowS-Pairs is a challenge dataset for measuring the degree to which U.S. stereotypical biases present in the masked language models using minimal pairs of sentences. We re-formulate the task by predicting which of two sentences is stereotipycal (or anti-stereotipycal) and report accuracy. For each dataset, we evaluate between 5 and 10 prompts.
112
+
113
+ |Set|Model|Metric|Average|Median|
114
+ |-|-|-|-|-|
115
+ |CrowS-Pairs|T0_11B|Acc.|59.2|83.8|
116
+ |CrowS-Pairs|T0p_11B|Acc.|57.6|83.8|
117
+ |CrowS-Pairs|T0pp_11B|Acc.|62.7|64.4|
118
+ |CrowS-Pairs|T0_11B_single_prompt|Acc.|57.6|69.5|
119
+ |CrowS-Pairs|T0_11B_original_task_only|Acc.|47.1|37.8|
120
+ |CrowS-Pairs|T0_3B|Acc.|56.9|82.6|
121
+ |WinoGender|T0_11B|Acc.|84.2|84.3|
122
+ |WinoGender|T0p_11B|Acc.|80.1|80.6|
123
+ |WinoGender|T0pp_11B|Acc.|89.2|90.0|
124
+ |WinoGender|T0_11B_single_prompt|Acc.|81.6|84.6|
125
+ |WinoGender|T0_11B_original_task_only|Acc.|83.7|83.8|
126
+ |WinoGender|T0_3B|Acc.|69.7|69.4|
127
+
128
+
129
+ # BibTeX entry and citation info
130
+
131
+ ```bibtex
132
+ ```