🚀 NeuralHermes 2.5 - Mistral 7B
NeuralHermes基于teknium/OpenHermes - 2.5 - Mistral - 7B模型,使用mlabonne/chatml_dpo_pairs数据集通过直接偏好优化(DPO)进一步微调。在大多数基准测试中,它的表现超越了原始模型(见测试结果)。
该模型直接受到Intel/neural - chat - 7b - v3 - 1作者所描述的基于人类反馈的强化学习(RLHF)过程的启发,以提升性能。使用了相同的数据集,并将其重新格式化为ChatML模板。
训练此模型的代码可在Google Colab和GitHub上获取。训练大约需要A100 GPU运行一小时。
✨ 主要特性
- 基于强大的
teknium/OpenHermes - 2.5 - Mistral - 7B
模型进行微调。
- 使用直接偏好优化(DPO)和特定数据集提升性能。
- 在多个基准测试中超越原始模型。
📦 安装指南
文档未提供具体安装步骤,可参考相关代码库和工具的使用说明进行安装。
💻 使用示例
基础用法
import transformers
from transformers import AutoTokenizer
message = [
{"role": "system", "content": "You are a helpful assistant chatbot."},
{"role": "user", "content": "What is a Large Language Model?"}
]
tokenizer = AutoTokenizer.from_pretrained(new_model)
prompt = tokenizer.apply_chat_template(message, add_generation_prompt=True, tokenize=False)
pipeline = transformers.pipeline(
"text-generation",
model=new_model,
tokenizer=tokenizer
)
sequences = pipeline(
prompt,
do_sample=True,
temperature=0.7,
top_p=0.9,
num_return_sequences=1,
max_length=200,
)
print(sequences[0]['generated_text'])
📚 详细文档
量化模型
- GGUF:https://huggingface.co/TheBloke/NeuralHermes-2.5-Mistral-7B-GGUF
- AWQ:https://huggingface.co/TheBloke/NeuralHermes-2.5-Mistral-7B-AWQ
- GPTQ:https://huggingface.co/TheBloke/NeuralHermes-2.5-Mistral-7B-GPTQ
- EXL2:
- 3.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-3.0bpw-h6-exl2
- 4.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-4.0bpw-h6-exl2
- 5.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-5.0bpw-h6-exl2
- 6.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-6.0bpw-h6-exl2
- 8.0bpw:https://huggingface.co/LoneStriker/NeuralHermes-2.5-Mistral-7B-8.0bpw-h8-exl2
训练超参数
LoRA
属性 |
详情 |
r |
16 |
lora_alpha |
16 |
lora_dropout |
0.05 |
bias |
"none" |
task_type |
"CAUSAL_LM" |
target_modules |
['k_proj', 'gate_proj', 'v_proj', 'up_proj', 'q_proj', 'o_proj', 'down_proj'] |
训练参数
属性 |
详情 |
per_device_train_batch_size |
4 |
gradient_accumulation_steps |
4 |
gradient_checkpointing |
True |
learning_rate |
5e - 5 |
lr_scheduler_type |
"cosine" |
max_steps |
200 |
optim |
"paged_adamw_32bit" |
warmup_steps |
100 |
DPOTrainer
属性 |
详情 |
beta |
0.1 |
max_prompt_length |
1024 |
max_length |
1536 |
结果
更新:NeuralHermes - 2.5成为Open LLM排行榜上基于Hermes的最佳模型,也是最好的7B模型之一。🎉

Teknium(OpenHermes - 2.5 - Mistral - 7B的作者)对该模型进行了基准测试(查看他的推文)。
在每个基准测试中结果都有所提升:AGIEval(从43.07%提升到43.62%)、GPT4All(从73.12%提升到73.25%)和TruthfulQA。
AGIEval

GPT4All

TruthfulQA

你可以在此查看Weights & Biases项目。
模型指标
📄 许可证
本项目采用Apache - 2.0许可证。