🚀 NeuralHermes 2.5 - Mistral 7B
NeuralHermesは、teknium/OpenHermes - 2.5 - Mistral - 7Bモデルをベースに、mlabonne/chatml_dpo_pairsデータセットを用いてDirect Preference Optimization (DPO) でさらにファインチューニングされたモデルです。多くのベンチマークで元のモデルを上回っています(結果を参照)。
このモデルは、Intel/neural - chat - 7b - v3 - 1の著者が説明したRLHFプロセスに直接インスピレーションを得て、性能を向上させています。同じデータセットを使用し、ChatMLテンプレートを適用するために再フォーマットしています。
このモデルを訓練するコードは、Google Colabと[GitHub](https://github.com/mlabonne/llm - course/tree/main)で利用可能です。約1時間のA100 GPUが必要です。
✨ 主な機能
- 元のモデルをベースにDPOでファインチューニングされ、多くのベンチマークで性能向上。
- RLHFプロセスを参考にして開発され、同じデータセットを用いてChatMLテンプレートを適用。
📦 インストール
本READMEに具体的なインストール手順は記載されていないため、このセクションをスキップします。
💻 使用例
基本的な使用法
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
結果
更新: NeuralHermes - 2.5は、Open LLMリーダーボードで最良のHermesベースのモデルとなり、7bモデルの中でもトップクラスのモデルの1つになりました。🎉

Teknium(OpenHermes - 2.5 - Mistral - 7Bの著者)がモデルのベンチマークを行いました(彼のツイートを参照)。
すべてのベンチマークで結果が向上しています: AGIEval(43.07%から43.62%)、GPT4All(73.12%から73.25%)、およびTruthfulQA。
AGIEval

GPT4All

TruthfulQA

Weights & Biasesプロジェクトはこちらで確認できます。
訓練ハイパーパラメータ
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
🔧 技術詳細
本READMEに具体的な技術詳細(50文字以上の説明)は記載されていないため、このセクションをスキップします。
📄 ライセンス
このモデルはApache 2.0ライセンスの下で提供されています。