Model reference · open weights
stablelm-zephyr is an open-weight language model from stabilityai. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Maker | stabilityai |
|---|---|
| Type | Language models |
| Task | Text gen |
| Parameters (lead) | 2.8B |
| Runs with | transformers |
| Released | 2023-11-21 |
| Popularity | 15k downloads / month |
| Licence | Commercial licence needed |
About
Please note: For commercial use, please refer to https://stability.ai/license.
StableLM Zephyr 3B is a 3 billion parameter instruction tuned inspired by HugginFaceH4's Zephyr 7B training pipeline this model was trained on a mix of publicly available datasets, synthetic datasets using Direct Preference Optimization (DPO), evaluation for this model based on
MT Bench and Alpaca Benchmark
StableLM Zephyr 3B uses the following instruction format:
List 3 synonyms for the word "tiny"
1. Dwarf
2. Little
3. Petite
This format is also available through the tokenizer's apply_chat_template method:
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('stabilityai/stablelm-zephyr-3b')
model = AutoModelForCausalLM.from_pretrained(
'stabilityai/stablelm-zephyr-3b',
device_map="auto"
)
prompt = [{'role': 'user', 'content': 'List 3 synonyms for the word "tiny"'}]
inputs = tokenizer.apply_chat_template(
prompt,
add_generation_prompt=True,
return_tensors='pt'
)
tokens = model.generate(
inputs.to(model.device),
max_new_tokens=1024,
temperature=0.8,
do_sample=True
)
print(tokenizer.decode(tokens[0], skip_special_tokens=False))
You can also see how to run a performance optimized version of this model here using OpenVINO from Intel.
StableLM Zephyr 3B model is an auto-regressive language model based on the transformer decoder architecture.lm@stability.aiThe dataset is comprised of a mixture of open datasets large-scale datasets available on the HuggingFace Hub:
| Model | Size | Alignment | MT-Bench (score) | AlpacaEval (win rate %) |
|---|---|---|---|---|
| StableLM Zephyr 3B 🪁 | 3B | DPO | 6.64 | 76.00 |
| StableLM Zephyr (SFT only) | 3B | SFT | 6.04 | 71.15 |
| Capybara v1.9 | 3B | dSFT | 5.94 | - |
| MPT-Chat | 7B | dSFT | 5.42 | - |
| Xwin-LM v0.1 | 7B | dPPO | 6.19 | 87.83 |
| Mistral-Instruct v0.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 |
| Task | Value |
|---|---|
| ARC (25-shot) | 47.0 |
| HellaSwag (10-shot) | 74.2 |
| MMLU (5-shot) | 46.3 |
| TruthfulQA (0-shot) | 46.5 |
| Winogrande (5-shot) | 65.5 |
| GSM8K (5-shot) | 42.3 |
| BigBench (Avg) | 35.26 |
| AGI Benchmark (Avg) | 33.23 |
StableLM Zephyr 3B was trained on the Stability AI cluster across 8 nodes with 8 A100 80GBs GPUs for each nodes.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:
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.
The model is intended to be used as a foundational base model for application-specific fine-tuning. Developers must evaluate and fine-tune th
From the published model card. Full card on the HuggingFace links in the sidebar.
Benchmarks
As published on the model card — the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| Text Generation | AI2 Reasoning Challenge (25-Shot) | normalized accuracy | 46.080 |
| Text Generation | HellaSwag (10-Shot) | normalized accuracy | 74.160 |
| Text Generation | MMLU (5-Shot) | accuracy | 46.170 |
| Text Generation | TruthfulQA (0-shot) | mc2 | 46.490 |
| Text Generation | Winogrande (5-shot) | accuracy | 65.510 |
| Text Generation | GSM8k (5-shot) | accuracy | 42.150 |
Using it via the API
Once AxForge deploys stablelm-zephyr for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (stablelm-zephyr below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/chat/completions \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"stablelm-zephyr","messages":[{"role":"user","content":"Hello"}]}'
Create an account — your API key is available in the console. 5M tokens/month currently included with every new account at launch.