RichardErkhov commited on
Commit
0876e3a
1 Parent(s): 9857091

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +291 -0
README.md ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ stablelm-zephyr-3b - bnb 8bits
11
+ - Model creator: https://huggingface.co/stabilityai/
12
+ - Original model: https://huggingface.co/stabilityai/stablelm-zephyr-3b/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ language:
20
+ - en
21
+ license: other
22
+ tags:
23
+ - causal-lm
24
+ datasets:
25
+ - HuggingFaceH4/ultrachat_200k
26
+ - HuggingFaceH4/ultrafeedback_binarized
27
+ - meta-math/MetaMathQA
28
+ - WizardLM/WizardLM_evol_instruct_V2_196k
29
+ - Intel/orca_dpo_pairs
30
+ extra_gated_fields:
31
+ Name: text
32
+ Email: text
33
+ Country: text
34
+ Organization or Affiliation: text
35
+ I ALLOW Stability AI to email me about new model releases: checkbox
36
+ model-index:
37
+ - name: stablelm-zephyr-3b
38
+ results:
39
+ - task:
40
+ type: text-generation
41
+ name: Text Generation
42
+ dataset:
43
+ name: AI2 Reasoning Challenge (25-Shot)
44
+ type: ai2_arc
45
+ config: ARC-Challenge
46
+ split: test
47
+ args:
48
+ num_few_shot: 25
49
+ metrics:
50
+ - type: acc_norm
51
+ value: 46.08
52
+ name: normalized accuracy
53
+ source:
54
+ url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=stabilityai/stablelm-zephyr-3b
55
+ name: Open LLM Leaderboard
56
+ - task:
57
+ type: text-generation
58
+ name: Text Generation
59
+ dataset:
60
+ name: HellaSwag (10-Shot)
61
+ type: hellaswag
62
+ split: validation
63
+ args:
64
+ num_few_shot: 10
65
+ metrics:
66
+ - type: acc_norm
67
+ value: 74.16
68
+ name: normalized accuracy
69
+ source:
70
+ url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=stabilityai/stablelm-zephyr-3b
71
+ name: Open LLM Leaderboard
72
+ - task:
73
+ type: text-generation
74
+ name: Text Generation
75
+ dataset:
76
+ name: MMLU (5-Shot)
77
+ type: cais/mmlu
78
+ config: all
79
+ split: test
80
+ args:
81
+ num_few_shot: 5
82
+ metrics:
83
+ - type: acc
84
+ value: 46.17
85
+ name: accuracy
86
+ source:
87
+ url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=stabilityai/stablelm-zephyr-3b
88
+ name: Open LLM Leaderboard
89
+ - task:
90
+ type: text-generation
91
+ name: Text Generation
92
+ dataset:
93
+ name: TruthfulQA (0-shot)
94
+ type: truthful_qa
95
+ config: multiple_choice
96
+ split: validation
97
+ args:
98
+ num_few_shot: 0
99
+ metrics:
100
+ - type: mc2
101
+ value: 46.49
102
+ source:
103
+ url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=stabilityai/stablelm-zephyr-3b
104
+ name: Open LLM Leaderboard
105
+ - task:
106
+ type: text-generation
107
+ name: Text Generation
108
+ dataset:
109
+ name: Winogrande (5-shot)
110
+ type: winogrande
111
+ config: winogrande_xl
112
+ split: validation
113
+ args:
114
+ num_few_shot: 5
115
+ metrics:
116
+ - type: acc
117
+ value: 65.51
118
+ name: accuracy
119
+ source:
120
+ url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=stabilityai/stablelm-zephyr-3b
121
+ name: Open LLM Leaderboard
122
+ - task:
123
+ type: text-generation
124
+ name: Text Generation
125
+ dataset:
126
+ name: GSM8k (5-shot)
127
+ type: gsm8k
128
+ config: main
129
+ split: test
130
+ args:
131
+ num_few_shot: 5
132
+ metrics:
133
+ - type: acc
134
+ value: 42.15
135
+ name: accuracy
136
+ source:
137
+ url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=stabilityai/stablelm-zephyr-3b
138
+ name: Open LLM Leaderboard
139
+ ---
140
+ # `StableLM Zephyr 3B`
141
+
142
+ Please note: For commercial use, please refer to https://stability.ai/membership.
143
+
144
+ ## Model Description
145
+
146
+ `StableLM Zephyr 3B` is a 3 billion parameter instruction tuned inspired by [HugginFaceH4's Zephyr 7B](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) training pipeline this model was trained on a mix of publicly available datasets, synthetic datasets using [Direct Preference Optimization (DPO)](https://arxiv.org/abs/2305.18290), evaluation for this model based on
147
+ [MT Bench](https://arxiv.org/abs/2306.05685) and [Alpaca Benchmark](https://tatsu-lab.github.io/alpaca_eval/)
148
+
149
+ ## Usage
150
+
151
+ `StableLM Zephyr 3B` uses the following instruction format:
152
+ ```
153
+ <|user|>
154
+ List 3 synonyms for the word "tiny"<|endoftext|>
155
+ <|assistant|>
156
+ 1. Dwarf
157
+ 2. Little
158
+ 3. Petite<|endoftext|>
159
+ ```
160
+
161
+ This format is also available through the tokenizer's `apply_chat_template` method:
162
+
163
+ ```python
164
+ from transformers import AutoModelForCausalLM, AutoTokenizer
165
+
166
+ tokenizer = AutoTokenizer.from_pretrained('stabilityai/stablelm-zephyr-3b')
167
+ model = AutoModelForCausalLM.from_pretrained(
168
+ 'stabilityai/stablelm-zephyr-3b',
169
+ device_map="auto"
170
+ )
171
+
172
+ prompt = [{'role': 'user', 'content': 'List 3 synonyms for the word "tiny"'}]
173
+ inputs = tokenizer.apply_chat_template(
174
+ prompt,
175
+ add_generation_prompt=True,
176
+ return_tensors='pt'
177
+ )
178
+
179
+ tokens = model.generate(
180
+ inputs.to(model.device),
181
+ max_new_tokens=1024,
182
+ temperature=0.8,
183
+ do_sample=True
184
+ )
185
+
186
+ print(tokenizer.decode(tokens[0], skip_special_tokens=False))
187
+ ```
188
+
189
+ You can also see how to run a performance optimized version of this model [here](https://github.com/openvinotoolkit/openvino_notebooks/blob/main/notebooks/273-stable-zephyr-3b-chatbot/273-stable-zephyr-3b-chatbot.ipynb) using [OpenVINO](https://docs.openvino.ai/2023.2/home.html) from Intel.
190
+
191
+ ## Model Details
192
+
193
+ * **Developed by**: [Stability AI](https://stability.ai/)
194
+ * **Model type**: `StableLM Zephyr 3B` model is an auto-regressive language model based on the transformer decoder architecture.
195
+ * **Language(s)**: English
196
+ * **Library**: [Alignment Handbook](https://github.com/huggingface/alignment-handbook.git)
197
+ * **Finetuned from model**: [stabilityai/stablelm-3b-4e1t](https://huggingface.co/stabilityai/stablelm-3b-4e1t)
198
+ * **License**: [StabilityAI Non-Commercial Research Community License](https://huggingface.co/stabilityai/stablelm-zephyr-3b/raw/main/LICENSE).
199
+ * **Commercial License**: to use this model commercially, please refer to https://stability.ai/membership
200
+ * **Contact**: For questions and comments about the model, please email `[email protected]`
201
+
202
+ ### Training Dataset
203
+
204
+ The dataset is comprised of a mixture of open datasets large-scale datasets available on the [HuggingFace Hub](https://huggingface.co/datasets):
205
+ 1. SFT Datasets
206
+ - HuggingFaceH4/ultrachat_200k
207
+ - meta-math/MetaMathQA
208
+ - WizardLM/WizardLM_evol_instruct_V2_196k
209
+ - Open-Orca/SlimOrca
210
+ 2. Preference Datasets:
211
+ - HuggingFaceH4/ultrafeedback_binarized
212
+ - Intel/orca_dpo_pairs
213
+
214
+ ## Performance
215
+
216
+ ### MT-Bench and Alpaca Bench
217
+
218
+
219
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/6310474ca119d49bc1eb0d80/8WIZS6dAlu5kSH-382pMl.png" alt="mt_bench_plot" width="600"/>
220
+
221
+ | Model | Size | Alignment | MT-Bench (score) | AlpacaEval (win rate %) |
222
+ |-------------|-----|----|---------------|--------------|
223
+ | **StableLM Zephyr 3B** 🪁 | 3B | DPO | 6.64 | 76.00 |
224
+ | StableLM Zephyr (SFT only) | 3B | SFT | 6.04 | 71.15 |
225
+ | Capybara v1.9 | 3B | dSFT | 5.94 | - |
226
+ | MPT-Chat | 7B |dSFT |5.42| -|
227
+ | Xwin-LM v0.1 | 7B| dPPO| 6.19| 87.83|
228
+ | Mistral-Instruct v0.1 | 7B| - | 6.84 |-|
229
+ | Zephyr-7b-α |7B| dDPO| 6.88| -|
230
+ | Zephyr-7b-β| 7B | dDPO | 7.34 | 90.60 |
231
+ | Falcon-Instruct | 40B |dSFT |5.17 |45.71|
232
+ | Guanaco | 65B | SFT |6.41| 71.80|
233
+ | Llama2-Chat | 70B |RLHF |6.86| 92.66|
234
+ | Vicuna v1.3 | 33B |dSFT |7.12 |88.99|
235
+ | WizardLM v1.0 | 70B |dSFT |7.71 |-|
236
+ | Xwin-LM v0.1 | 70B |dPPO |- |95.57|
237
+ | GPT-3.5-turbo | - |RLHF |7.94 |89.37|
238
+ | Claude 2 | - |RLHF |8.06| 91.36|
239
+ | GPT-4 | -| RLHF |8.99| 95.28|
240
+
241
+ ## Other benchmarks:
242
+ | Task | Value |
243
+ |-----------------------|---------------------------|
244
+ | ARC (25-shot) | 47.0 |
245
+ | HellaSwag (10-shot) | 74.2 |
246
+ | MMLU (5-shot) | 46.3 |
247
+ | TruthfulQA (0-shot) | 46.5 |
248
+ | Winogrande (5-shot) | 65.5 |
249
+ | GSM8K (5-shot) | 42.3 |
250
+ | BigBench (Avg) | 35.26 |
251
+ | AGI Benchmark (Avg) | 33.23 |
252
+
253
+ ### Training Infrastructure
254
+
255
+ * **Hardware**: `StableLM Zephyr 3B` was trained on the Stability AI cluster across 8 nodes with 8 A100 80GBs GPUs for each nodes.
256
+ * **Code Base**: We use our internal script for SFT steps and used [HuggingFace Alignment Handbook script](https://github.com/huggingface/alignment-handbook) for DPO training.
257
+
258
+ ## Commitment to Ethical AI
259
+ In line with our responsibility towards ethical AI development, `StableLM Zephyr 3B` is released with a focus on ensuring safety, reliability, and appropriateness in its applications. To this end, we have evaluated `StableLM Zephyr 3B` on 488 malicious prompts and used standard protocols to assess the harmfulness of its outputs. Compared to Zephyr-7b-β, `StableLM Zephyr 3B` reduces the number of harmful outputs as assessed by GPT-4 by 55. Additionally, we performed an internal red teaming event targeting the following abuse areas:
260
+ * **Self-Harm Methods**: (Suicide Methods, Encouragement of Self-Harm, Methods and encouragement of Eating Disorders)
261
+ * **Misinformation**: (Health, Conspiracy Theories, Social Unrest/Conflict, Political Misinformation, & Climate change)
262
+ * **Hate Speech**: (Race, Stereotypes, Immigrants, Gender, Personally Identifiable Information such as Social security numbers, Full names, ID numbers, Email addresses, and telephone numbers)
263
+
264
+ We have incorporated the findings of our malicious prompts evaluation and red teaming event into our release. Users are encouraged to fine-tune and evaluate the model to suit their specific needs, considering the potential biases and limitations found in `StableLM Zephyr 3B` and inherent in other LLM models.
265
+
266
+ ## Use and Limitations
267
+
268
+ ### Intended Use
269
+
270
+ The model is intended to be used as a foundational base model for application-specific fine-tuning. Developers must evaluate and fine-tune the model for safe performance in downstream applications. For commercial use, please refer to https://stability.ai/membership.
271
+
272
+ ### Limitations and Bias
273
+
274
+ This model is not trained against adversarial inputs. We strongly recommend pairing this model with an input and output classifier to prevent harmful responses.
275
+
276
+ Through our internal red teaming, we discovered that while the model will not output harmful information if not prompted to do so, it is willing to output potentially harmful outputs or misinformation when the user requests it. Using this model will require guardrails around your inputs and outputs to ensure that any outputs returned are not misinformation or harmful. Additionally, as each use case is unique, we recommend running your own suite of tests to ensure proper performance of this model. Finally, do not use the models if they are unsuitable for your application, or for any applications that may cause deliberate or unintentional harm to others.
277
+ # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
278
+ Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_stabilityai__stablelm-zephyr-3b)
279
+
280
+ | Metric |Value|
281
+ |---------------------------------|----:|
282
+ |Avg. |53.43|
283
+ |AI2 Reasoning Challenge (25-Shot)|46.08|
284
+ |HellaSwag (10-Shot) |74.16|
285
+ |MMLU (5-Shot) |46.17|
286
+ |TruthfulQA (0-shot) |46.49|
287
+ |Winogrande (5-shot) |65.51|
288
+ |GSM8k (5-shot) |42.15|
289
+
290
+
291
+