|
--- |
|
license: cc-by-sa-4.0 |
|
datasets: |
|
- HuggingFaceH4/ultrachat_200k |
|
- HuggingFaceH4/ultrafeedback_binarized |
|
- meta-math/MetaMathQA |
|
- WizardLM/WizardLM_evol_instruct_V2_196k |
|
|
|
language: |
|
- en |
|
tags: |
|
- causal-lm |
|
extra_gated_fields: |
|
Name: text |
|
Email: text |
|
Country: text |
|
Organization or Affiliation: text |
|
I ALLOW Stability AI to email me about new model releases: checkbox |
|
--- |
|
# `Stable Zephyr 3B` |
|
|
|
## Model Description |
|
|
|
`Stable 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 |
|
[MT Bench](https://tatsu-lab.github.io/alpaca_eval/) and [Alpaca Benchmark](https://tatsu-lab.github.io/alpaca_eval/) |
|
|
|
## Usage |
|
|
|
Get started generating text with `Stable Zephyr 3B` by using the following code snippet: |
|
|
|
```python |
|
from transformers import AutoModelForCausalLM, AutoTokenizer |
|
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stable_zephyr_3b_dpo") |
|
model = AutoModelForCausalLM.from_pretrained( |
|
"stabilityai/stable_zephyr_3b_dpo", |
|
trust_remote_code=True, |
|
torch_dtype="auto", |
|
) |
|
model.cuda() |
|
prompt = "<|user|>\nIn the field of quantum physics, what is superposition, and how does it relate to the phenomenon of quantum entanglement?<|endoftext|>\n<|assistant|>\n" |
|
inputs = tokenizer(prompt, return_tensors="pt").to("cuda") |
|
tokens = model.generate( |
|
**inputs, |
|
max_new_tokens=1024, |
|
temperature=0.7, |
|
top_p=0.95, |
|
do_sample=True, |
|
) |
|
print(tokenizer.decode(tokens[0], skip_special_tokens=True)) |
|
``` |
|
|
|
## Model Details |
|
|
|
* **Developed by**: [Stability AI](https://stability.ai/) |
|
* **Model type**: `Stable Zephyr 3B` models are auto-regressive language models based on the transformer decoder architecture. |
|
* **Language(s)**: English |
|
* **Library**: [Alignment Handbook](https://github.com/huggingface/alignment-handbook.git) |
|
* **Finetuned from model**: [stabilityai/stablelm-3b-4e1t](https://huggingface.co/stabilityai/stablelm-3b-4e1t) |
|
* **License**: Model checkpoints are licensed under the Creative Commons license ([CC BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/)). Under this license, you must give [credit](https://creativecommons.org/licenses/by/4.0/#) to Stability AI, provide a link to the license, and [indicate if changes were made](https://creativecommons.org/licenses/by/4.0/#). You may do so in any reasonable manner, but not in any way that suggests the Stability AI endorses you or your use. |
|
* **Contact**: For questions and comments about the model, please email `lm@stability.ai` |
|
|
|
### Training Dataset |
|
|
|
The dataset is comprised of a mixture of open datasets large-scale datasets available on the [HuggingFace Hub](https://huggingface.co/datasets): |
|
- HuggingFaceH4/ultrachat_200k |
|
- HuggingFaceH4/ultrafeedback_binarized |
|
- meta-math/MetaMathQA |
|
- Capybara |
|
- Instruct Code Dataset (Internal) |
|
- Wizard Dataset |
|
|
|
### Training Procedure |
|
|
|
## Performance |
|
|
|
![image/png](https://cdn-uploads.huggingface.co/production/uploads/63466107f7bd6326925fc770/V8VmVuCajYcM9KVu8XcyV.png) |
|
|
|
At the time of release, Zephyr-7B-β is the highest ranked 7B chat model on the [MT-Bench](https://huggingface.co/spaces/lmsys/mt-bench) and [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/) benchmarks: |
|
|
|
| Model | Size | Alignment | MT-Bench (score) | AlpacaEval (win rate %) | |
|
|-------------|-----|----|---------------|--------------| |
|
| **Stable Zephyr 3B** 🪁 | 3B | DPO | 6.86 | 75.19 | |
|
| Stable Zephyr (SFT only) | 3B | SFT | 7.12 | 71.15 | |
|
| MPT-Chat | 7B |dSFT |5.42| -| |
|
| Xwin-LMv0.1 | 7B| dPPO| 6.19| 87.83| |
|
| Mistral-Instructv0.1 | 7B| - | 6.84 |-| |
|
| Zephyr-7b-α |7B| dDPO| 6.88| -| |
|
| Zephyr-7b-β| 7B | dDPO | 7.34 | 90.60 | |
|
| Falcon-Instruct | 40B |dSFT |5.17 |45.71| |
|
| Guanaco | 65B | SFT |6.41| 71.80| |
|
| Llama2-Chat | 70B |RLHF |6.86| 92.66| |
|
| Vicuna v1.3 | 33B |dSFT |7.12 |88.99| |
|
| WizardLM v1.0 | 70B |dSFT |7.71 |-| |
|
| Xwin-LM v0.1 | 70B |dPPO |- |95.57| |
|
| GPT-3.5-turbo | - |RLHF |7.94 |89.37| |
|
| Claude 2 | - |RLHF |8.06| 91.36| |
|
| GPT-4 | -| RLHF |8.99| 95.28| |
|
|
|
### Training Infrastructure |
|
|
|
* **Hardware**: `Stable Zephyr 3B` was trained on the Stability AI cluster across 8 nodes with 8 A100 80GBs GPUs for each nodes. |
|
* **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. |
|
## Use and Limitations |
|
|
|
### Intended Use |
|
|
|
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. |
|
|
|
### Limitations and Bias |
|
|
|
As a base model, this model may exhibit unreliable, unsafe, or other undesirable behaviors that must be corrected through evaluation and fine-tuning prior to deployment. The pre-training dataset may have contained offensive or inappropriate content, even after applying data cleansing filters, which can be reflected in the model-generated text. We recommend that users exercise caution when using these models in production systems. 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. |