license: apache-2.0
base_model: mistral-community/Mixtral-8x22B-v0.1
tags:
- trl
- orpo
- generated_from_trainer
datasets:
- argilla/distilabel-capybara-dpo-7k-binarized
model-index:
- name: zephyr-orpo-141b-A35b-v0.1
results: []
inference:
parameters:
temperature: 0.7
Zephyr 141B-A39B 模型卡
Zephyr 是一个旨在成为有用助手的语言模型系列。Zephyr 141B-A39B 是该系列的最新模型,是基于 mistral-community/Mixtral-8x22B-v0.1 微调的版本,采用了一种名为 Odds Ratio Preference Optimization (ORPO) 的新型对齐算法进行训练,使用了 7k 个实例,在 4 个节点(每个节点 8 个 H100 GPU)上训练了 1.3 小时。ORPO 不需要 SFT 步骤即可实现高性能,因此比 DPO 和 PPO 等方法计算效率更高。为了训练 Zephyr-141B-A39B,我们使用了 argilla/distilabel-capybara-dpo-7k-binarized
偏好数据集,该数据集由通过 LLM 评分的高质量、多轮合成偏好组成。
[!NOTE]
该模型由 Argilla、KAIST 和 Hugging Face 合作训练。
模型详情
模型描述
模型来源
- 代码库: https://github.com/huggingface/alignment-handbook
- 数据集: https://huggingface.co/datasets/argilla/distilabel-capybara-dpo-7k-binarized
性能
Zephyr 141B-A39B 旨在测试 ORPO 在大规模应用中的有效性,其基础数据集包含通用聊天能力的混合。它在 MT Bench 和 IFEval 等聊天基准测试中表现出色。以下分数是通过 LightEval 评估套件获得的,每个提示都使用模型对应的聊天模板格式化,以模拟实际使用场景。因此,某些分数可能与技术报告或 Open LLM 排行榜中报告的分数有所不同。
预期用途与限制
该模型在聊天、代码、数学和推理数据的混合上进行了微调。以下是使用 🤗 Transformers 的 pipeline()
函数运行模型的方法:
import torch
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1",
device_map="auto",
torch_dtype=torch.bfloat16,
)
messages = [
{
"role": "system",
"content": "You are Zephyr, a helpful assistant.",
},
{"role": "user", "content": "Explain how Mixture of Experts work in language a child would understand."},
]
outputs = pipe(
messages,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_k=50,
top_p=0.95,
)
print(outputs[0]["generated_text"][-1]["content"])
偏见、风险与限制
Zephyr 141B-A39B 未在 RLHF 阶段与人类偏好对齐,也未像 ChatGPT 那样部署响应过滤机制,因此模型可能会产生有问题的输出(尤其是在被提示这样做时)。此外,基础模型(mistral-community/Mixtral-8x22B-v0.1
)的训练数据集的规模和组成尚不清楚,但可能包括网络数据和技术来源(如书籍和代码)的混合。有关示例,请参阅 Falcon 180B 模型卡。
训练过程
训练超参数
训练过程中使用了以下超参数:
- learning_rate: 5e-06
- train_batch_size: 1
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 32
- total_train_batch_size: 32
- total_eval_batch_size: 256
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: inverse_sqrt
- lr_scheduler_warmup_steps: 100
- num_epochs: 3
框架版本
- Transformers 4.39.3
- Pytorch 2.1.2+cu121
- Datasets 2.18.0
- Tokenizers 0.15.1
引用
如果您发现 Zephyr 141B-A39B 对您的工作有用,请引用 ORPO 论文:
@misc{hong2024orpo,
title={ORPO: Monolithic Preference Optimization without Reference Model},
author={Jiwoo Hong and Noah Lee and James Thorne},
year={2024},
eprint={2403.07691},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
您也可以引用该模型的创建者:
@misc{zephyr_141b,
author = {Alvaro Bartolome and Jiwoo Hong and Noah Lee and Kashif Rasul and Lewis Tunstall},
title = {Zephyr 141B A39B},
year = {2024},
publisher = {Hugging Face},
journal = {Hugging Face repository},
howpublished = {\url{https://huggingface.co/HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1}}
}