StableLM 2 Zephyr 1.6BStable LM 2 Zephyr 1.6B 是一个拥有 16 亿参数的指令微调语言模型,其灵感来源于 HugginFaceH4 的 Zephyr 7B 训练流程。该模型在公开可用数据集与合成数据集的混合数据上进行训练,并采用了 直接偏好优化(DPO) 技术。
StableLM 2 Zephyr 1.6B 采用以下指令格式:
<|user|>
Which famous math number begins with 1.6 ...?<|endoftext|>
<|assistant|>
The number you are referring to is 1.618033988749895. This is the famous value known as the golden ratio<|endoftext|>此格式也可通过分词器的 apply_chat_template 方法获取:
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('stabilityai/stablelm-2-zephyr-1_6b')
model = AutoModelForCausalLM.from_pretrained(
'stabilityai/stablelm-2-zephyr-1_6b',
device_map="auto"
)
prompt = [{'role': 'user', 'content': 'Which famous math number begins with 1.6 ...?'}]
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.5,
do_sample=True
)
print(tokenizer.decode(tokens[0], skip_special_tokens=False))StableLM 2 Zephyr 1.6B 模型是一种基于 Transformer 解码器架构的自回归语言模型。lm@stability.ai该数据集由 HuggingFace Hub 上可用的多种开放大型数据集混合而成:
| 模型 | 规模 | MT-Bench |
|---|---|---|
| Mistral-7B-Instruct-v0.2 | 7B | 7.61 |
| Llama2-Chat | 70B | 6.86 |
| stablelm-zephyr-3b | 3B | 6.64 |
| MPT-30B-Chat | 30B | 6.39 |
| stablelm-2-zephyr-1.6b | 1.6B | 5.42 |
| Falcon-40B-Instruct | 40B | 5.17 |
| Qwen-1.8B-Chat | 1.8B | 4.95 |
| dolphin-2.6-phi-2 | 2.7B | 4.93 |
| phi-2 | 2.7B | 4.29 |
| TinyLlama-1.1B-Chat-v1.0 | 1.1B | 3.46 |
| 模型 | 规模 | 平均值 | ARC Challenge(acc_norm) | HellaSwag(acc_norm) | MMLU(acc_norm) | TruthfulQA(mc2) | Winogrande(acc) | Gsm8k(acc) |
|---|---|---|---|---|---|---|---|---|
| microsoft/phi-2 | 2.7B | 61.32% | 61.09% | 75.11% | 58.11% | 44.47% | 74.35% | 54.81% |
| stabilityai/stablelm-2-zephyr-1_6b | 1.6B | 49.89% | 43.69% | 69.34% | 41.85% | 45.21% | 64.09% | 35.18% |
| microsoft/phi-1_5 | 1.3B | 47.69% | 52.90% | 63.79% | 43.89% | 40.89% | 72.22% | 12.43% |
| stabilityai/stablelm-2-1_6b | 1.6B | 45.54% | 43.43% | 70.49% | 38.93% | 36.65% | 65.90% | 17.82% |
| mosaicml/mpt-7b | 7B | 44.28% | 47.70% | 77.57% | 30.80% | 33.40% | 72.14% | 4.02% |
| KnutJaegersberg/Qwen-1_8B-Llamaified* | 1.8B | 44.75% | 37.71% | 58.87% | 46.37% | 39.41% | 61.72% | 24.41% |
| openlm-research/open_llama_3b_v2 | 3B | 40.28% | 40.27% | 71.60% | 27.12% | 34.78% | 67.01% | 0.91% |
| iiuae/falcon-rw-1b | 1B | 37.07% | 35.07% | 63.56% | 25.28% | 35.96% | 62.04% | 0.53% |
| TinyLlama/TinyLlama-1.1B-3T | 1.1B | 36.40% | 33.79% | 60.31% | 26.04% | 37.32% | 59.51% | 1.44% |
StableLM 2 Zephyr 1.6B 在 Stability AI 集群上进行训练,该集群包含 8 个节点,每个节点配备 8 块 A100 80GB GPU。该模型旨在用于类聊天应用。开发人员必须在其特定用例中评估模型的安全性能。请阅读下文的安全与限制部分了解更多信息。
此模型未针对对抗性输入进行训练。我们强烈建议将此模型与输入和输出分类器配合使用,以防止产生有害响应。
通过我们内部的红队测试,我们发现,虽然在未被提示的情况下模型不会输出有害信息,但它会编造许多事实。当用户明确要求时,它也可能输出潜在有害的内容或错误信息。
使用此模型时,需要对输入和输出设置防护措施,以确保返回的任何输出都不是错误信息或有害内容。
此外,由于每个用例都是独特的,我们建议运行您自己的测试套件,以确保此模型的性能符合要求。
最后,如果模型不适合您的应用,或者可能对他人造成故意或非故意伤害的任何应用,请勿使用这些模型。
@misc{StableLM-2-1.6B,
url={[https://huggingface.co/stabilityai/stablelm-2-1.6b](https://huggingface.co/stabilityai/stablelm-2-1.6b)},
title={Stable LM 2 1.6B},
author={Stability AI Language Team}
}