Commit ·
d054d2d
1
Parent(s): 0002941
Update README.md
Browse files
README.md
CHANGED
|
@@ -48,3 +48,91 @@ Which of the following best characterizes binne bams?\n
|
|
| 48 |
- Sentence 3: Binne bams are luxurious apartments.\n
|
| 49 |
- Sentence 4: Binne bams are places where people live."
|
| 50 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
- Sentence 3: Binne bams are luxurious apartments.\n
|
| 49 |
- Sentence 4: Binne bams are places where people live."
|
| 50 |
---
|
| 51 |
+
|
| 52 |
+
**Official repository**: [seonghyeonye/Flipped-Learning](https://github.com/seonghyeonye/Flipped-Learning)
|
| 53 |
+
# Model Description
|
| 54 |
+
DIRECT is a strong baseline of FLIPPED, based on the training objective on [T0-3B](https://huggingface.co/bigscience/T0_3B).
|
| 55 |
+
With only 5% token updates and half of training datasets compared to T0-3B, DIRECT outperforms T0-3B. (+6.38% mean accuracy on 14 NLP tasks, +1.19% mean accuracy on 14 BIG-bench tasks)
|
| 56 |
+
|
| 57 |
+
# How to use
|
| 58 |
+
Our overall explanation models along with ablations can be found in our [paper](https://arxiv.org/abs/2210.02969). We recommend using the [FLIPPED-11B](seonghyeonye/flipped_11B) checkpoint as it leads (on average) to the best performances on a variety of NLP tasks.
|
| 59 |
+
|Model|Number of parameters|
|
| 60 |
+
|-|-|
|
| 61 |
+
|[Flipped_11B](https://huggingface.co/seonghyeonye/flipped_11B)|11 billion|
|
| 62 |
+
|[Flipped_3B](https://huggingface.co/seonghyeonye/flipped_3B)|3 billion|
|
| 63 |
+
Here is how to download the model in PyTorch:
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
import torch
|
| 67 |
+
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 68 |
+
|
| 69 |
+
model = T5ForConditionalGeneration.from_pretrained("seonghyeonye/direct_3B")
|
| 70 |
+
tokenizer = T5Tokenizer.from_pretrained("seonghyeonye/direct_3B")
|
| 71 |
+
```
|
| 72 |
+
If you want to use another checkpoint, please replace the path in `T5Tokenizer` and `T5ForConditionalGeneration`.
|
| 73 |
+
We also provide a quick [Jupyter Notebook](https://github.com/seonghyeonye/Flipped-Learning/blob/master/flipped_inference.ipynb) where you can inference with our method.
|
| 74 |
+
**Note: the model was trained with fp32 activations. As such, we highly discourage running inference with fp16.**
|
| 75 |
+
|
| 76 |
+
# Training procedure
|
| 77 |
+
DIRECT model is based on [T5+LM](https://huggingface.co/google/t5-xl-lm-adapt), a Transformer-based encoder-decoder language model pre-trained with a masked language modeling-style objective additionally pretrained on language modeling objective on [C4](https://huggingface.co/datasets/c4).
|
| 78 |
+
Training details:
|
| 79 |
+
- Fine-tuning steps: 5'000
|
| 80 |
+
- Input sequence length: 512
|
| 81 |
+
- Target sequence length: 128
|
| 82 |
+
- Batch size: 240
|
| 83 |
+
- Optimizer: Adafactor
|
| 84 |
+
- Learning rate: 1e-4
|
| 85 |
+
- Dropout: 0.1
|
| 86 |
+
- Sampling strategy: proportional to the number of examples in each dataset (we randomly sampled any dataset if it has over 500'000 examples so that it has at most 500'000 examples. Also, we randomly choose which instruction to generate for each training steps, so ideally each instruction appears *num_examples/num_templates* while training.)
|
| 87 |
+
|
| 88 |
+
# Training data
|
| 89 |
+
We trained different variants T0 with different mixtures of datasets.
|
| 90 |
+
|Model|Training datasets|
|
| 91 |
+
|--|--|
|
| 92 |
+
|FLIPPED_11B|- Multiple-Choice QA: CommonsenseQA, DREAM, QUAIL, QuaRTz, Social IQA, WiQA, Cosmos, QASC, Quarel, SciQ<br>- Sentiment: Amazon, App Reviews, IMDB, Rotten Tomatoes, Yelp<br>- Topic Classification: AG News, DBPedia<br>- Paraphrase Identification: MRPC, PAWS, QQP|
|
| 93 |
+
|FLIPPED_3B|Same as FLIPPED-11B|
|
| 94 |
+
|DIRECT_3B|Same as FLIPPED-11B|
|
| 95 |
+
We only choose prompts examples that has output lables, which can be found on the dataset page.
|
| 96 |
+
|
| 97 |
+
# Evaluation data
|
| 98 |
+
|
| 99 |
+
We evaluate our models on following datasets:
|
| 100 |
+
|Task category|Datasets|
|
| 101 |
+
|-|-|
|
| 102 |
+
|Natural language inference|ANLI(R1, R2, R3), CB, RTE|
|
| 103 |
+
|Coreference resolution|WSC, Winogrande|
|
| 104 |
+
|Word sense disambiguation|WiC|
|
| 105 |
+
|Sentence completion|COPA, HellaSwag, Story Cloze|
|
| 106 |
+
|QA|PIQA, ARC-Challenge, OpenbookQA|
|
| 107 |
+
We also evaluate FLIPPED on a subset of [BIG-bench benchmark](https://github.com/google/BIG-bench):
|
| 108 |
+
- Code description task
|
| 109 |
+
- Conceptual combinations
|
| 110 |
+
- Hindu knowledge json
|
| 111 |
+
- Known unknowns
|
| 112 |
+
- Language identification
|
| 113 |
+
- Logic grid puzzle task
|
| 114 |
+
- Logical deduction
|
| 115 |
+
- Common misconceptions
|
| 116 |
+
- Movie dialog same or different
|
| 117 |
+
- Novel concepts
|
| 118 |
+
- Strategyqa
|
| 119 |
+
- Formal fallacies syllogisms negation
|
| 120 |
+
- VitaminC
|
| 121 |
+
- Winowhy multiple choice
|
| 122 |
+
|
| 123 |
+
# Label generalization
|
| 124 |
+
We evaluate the robustness of models on following datasets with changing the output label of the datasets. The substitute words can be found in our [paper](https://arxiv.org/abs/2210.02969).
|
| 125 |
+
|Task category|(Datasets, Template name)|
|
| 126 |
+
|-|-|
|
| 127 |
+
|Unseen tasks|(WSC, does the pronoun refer to), (CB, can we infer), (RTE, MNLI crowdsource)|
|
| 128 |
+
|Seen tasks|(IMDB, Reviewer Enjoyment Yes No), (PAWS, Meaning) |
|
| 129 |
+
The template name we used can be found in the [promptsource template library](https://github.com/bigscience-workshop/promptsource/tree/main/promptsource/templates).
|
| 130 |
+
# BibTeX entry and citation info
|
| 131 |
+
```bibtex
|
| 132 |
+
@article{ye2022guess,
|
| 133 |
+
title={Guess the Instruction! Flipped Learning Makes Language Models Stronger Zero-Shot Learners},
|
| 134 |
+
author={Ye, Seonghyeon and Kim, Doyoung and Jang, Joel and Shin, Joongbo and Seo, Minjoon},
|
| 135 |
+
journal={arXiv preprint arXiv:2210.02969},
|
| 136 |
+
year={2022}
|
| 137 |
+
}
|
| 138 |
+
```
|