nihalnayak commited on
Commit
ab5ba32
·
verified ·
1 Parent(s): 69b5844

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +150 -1
README.md CHANGED
@@ -8,4 +8,153 @@ pipeline_tag: text-generation
8
  tags:
9
  - task generation
10
  - synthetic datasets
11
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  tags:
9
  - task generation
10
  - synthetic datasets
11
+ ---
12
+ # Model Card for Llama-3.1-8B-bonito-v1
13
+
14
+ <!-- Provide a quick summary of what the model is/does. -->
15
+
16
+ Bonito is an open-source model for conditional task generation: the task of converting unannotated text into task-specific training datasets for instruction tuning.
17
+
18
+ ![Bonito](https://raw.githubusercontent.com/BatsResearch/bonito/main/assets/workflow.png)
19
+
20
+ ## Model Details
21
+
22
+ ### Model Description
23
+
24
+ <!-- Provide a longer summary of what this model is. -->
25
+
26
+ Bonito can be used to create synthetic instruction tuning datasets to adapt large language models on users' specialized, private data.
27
+ In our [paper](https://arxiv.org/abs/2402.18334), we show that Bonito can be used to adapt both pretrained and instruction tuned models to tasks without any annotations.
28
+
29
+ - **Developed by:** Nihal V. Nayak, Yiyang Nan, Avi Trost, and Stephen H. Bach
30
+ - **Model type:** LlamaForCausalLM
31
+ - **Language(s) (NLP):** English
32
+ - **License:** Apache 2.0
33
+ - **Finetuned from model:** `meta-llama/Meta-Llama-3.1-8B`
34
+
35
+ ### Model Sources
36
+
37
+ <!-- Provide the basic links for the model. -->
38
+
39
+ - **Repository:** [https://github.com/BatsResearch/bonito](https://github.com/BatsResearch/bonito)
40
+ - **Paper:** [Learning to Generate Instruction Tuning Datasets for
41
+ Zero-Shot Task Adaptation](https://arxiv.org/abs/2402.18334)
42
+
43
+ ### Model Performance
44
+
45
+ Downstream performance of Mistral-7B-v0.1 after training with Llama-3.1-8B-bonito-v1 generated instructions.
46
+
47
+ | Model | PubMedQA | PrivacyQA | NYT | Amazon | Reddit | ContractNLI | Vitamin C | Average |
48
+ |------------------------------------------|----------|-----------|------|--------|--------|-------------|-----------|---------|
49
+ | Mistral-7B-v0.1 | 25.6 | 44.1 | 24.2 | 17.5 | 12.0 | 31.2 | 38.9 | 27.6 |
50
+ | Mistral-7B-v0.1 + Llama-3.1-8B-bonito-v1 | 44.5 | 53.7 | 80.7 | 72.9 | 70.1 | 69.7 | 73.3 | 66.4 |
51
+
52
+ ## Uses
53
+
54
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
55
+
56
+ ### Direct Use
57
+
58
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
59
+ To easily generate synthetic instruction tuning datasets, we recommend using the [bonito](https://github.com/BatsResearch/bonito) package built using the `transformers` and the `vllm` libraries.
60
+
61
+ ```python
62
+ from bonito import Bonito
63
+ from vllm import SamplingParams
64
+ from datasets import load_dataset
65
+
66
+ # Initialize the Bonito model
67
+ bonito = Bonito("BatsResearch/bonito-v1")
68
+
69
+ # load dataaset with unannotated text
70
+ unannotated_text = load_dataset(
71
+ "BatsResearch/bonito-experiment",
72
+ "unannotated_contract_nli"
73
+ )["train"].select(range(10))
74
+
75
+ # Generate synthetic instruction tuning dataset
76
+ sampling_params = SamplingParams(max_tokens=256, top_p=0.95, temperature=0.5, n=1)
77
+ synthetic_dataset = bonito.generate_tasks(
78
+ unannotated_text,
79
+ context_col="input",
80
+ task_type="nli",
81
+ sampling_params=sampling_params
82
+ )
83
+ ```
84
+
85
+
86
+ ### Out-of-Scope Use
87
+
88
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
89
+
90
+ Our model is trained to generate the following task types: summarization, sentiment analysis, multiple-choice question answering, extractive question answering, topic classification, natural language inference, question generation, text generation, question answering without choices, paraphrase identification, sentence completion, yes-no question answering, word sense disambiguation, paraphrase generation, textual entailment, and
91
+ coreference resolution.
92
+ The model might not produce accurate synthetic tasks beyond these task types.
93
+
94
+ ## Bias, Risks, and Limitations
95
+
96
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
97
+ **Limitations**
98
+
99
+ Our work relies on the availability of large amounts of unannotated text.
100
+ If only a small quantity of unannotated text is present, the target language model, after adaptation, may experience a drop in performance.
101
+ While we demonstrate positive improvements on pretrained and instruction-tuned models, our observations are limited to the three task types (yes-no question answering, extractive question answering, and natural language inference) considered in our paper.
102
+
103
+ **Risks**
104
+
105
+ Bonito poses risks similar to those of any large language model.
106
+ For example, our model could be used to generate factually incorrect datasets in specialized domains.
107
+ Our model can exhibit the biases and stereotypes of the base model, Mistral-7B, even after extensive supervised fine-tuning.
108
+ Finally, our model does not include safety training and can potentially generate harmful content.
109
+
110
+ ### Recommendations
111
+
112
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
113
+
114
+ We recommend users thoroughly inspect the generated tasks and benchmark performance on critical datasets before deploying the models trained with the synthetic tasks into the real world.
115
+
116
+ ## Training Details
117
+
118
+ ### Training Data
119
+
120
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
121
+ To train Bonito, we create a new dataset called conditional task generation with attributes by remixing existing instruction tuning datasets.
122
+ See [ctga-v1](https://huggingface.co/datasets/BatsResearch/ctga-v1) for more details.
123
+
124
+ ### Training Procedure
125
+
126
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
127
+
128
+ #### Training Hyperparameters
129
+
130
+ - **Training regime:** <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
131
+ We train the model using [Q-LoRA](https://github.com/artidoro/qlora) by optimizing the cross entropy loss over the output tokens.
132
+ The model is trained for 100,000 steps.
133
+ The training takes about 1 day on eight A100 GPUs to complete.
134
+
135
+ We use the following hyperparameters:
136
+ - Q-LoRA rank (r): 64
137
+ - Q-LoRA scaling factor (alpha): 4
138
+ - Q-LoRA dropout: 0
139
+ - Optimizer: Paged AdamW
140
+ - Learning rate scheduler: linear
141
+ - Max. learning rate: 1e-04
142
+ - Min. learning rate: 0
143
+ - Weight decay: 0
144
+ - Dropout: 0
145
+ - Max. gradient norm: 0.3
146
+ - Effective batch size: 16
147
+ - Max. input length: 2,048
148
+ - Max. output length: 2,048
149
+ - Num. steps: 100,000
150
+
151
+ ## Citation
152
+
153
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
154
+ ```
155
+ @inproceedings{bonito:aclfindings24,
156
+ title = {Learning to Generate Instruction Tuning Datasets for Zero-Shot Task Adaptation},
157
+ author = {Nayak, Nihal V. and Nan, Yiyang and Trost, Avi and Bach, Stephen H.},
158
+ booktitle = {Findings of the Association for Computational Linguistics: ACL 2024},
159
+ year = {2024}}
160
+ ```