🚀 Llama-3.1-Nemotron-70B-Instruct
Llama-3.1-Nemotron-70B-Instructは、NVIDIAがカスタマイズした大規模言語モデルです。このモデルは、ユーザーのクエリに対するLLMの応答の有用性を向上させることを目的としています。
🚀 クイックスタート
このモデルを使用するには、HuggingFace Transformersライブラリを利用します。2つ以上の80GB GPU(NVIDIA Ampere以降)と少なくとも150GBの空きディスク容量が必要です。
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "How many r in strawberry?"
messages = [{"role": "user", "content": prompt}]
tokenized_message = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt", return_dict=True)
response_token_ids = model.generate(tokenized_message['input_ids'].cuda(),attention_mask=tokenized_message['attention_mask'].cuda(), max_new_tokens=4096, pad_token_id = tokenizer.eos_token_id)
generated_tokens =response_token_ids[:, len(tokenized_message['input_ids'][0]):]
generated_text = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0]
print(generated_text)
✨ 主な機能
📦 インストール
このモデルを使用するには、HuggingFace Transformersライブラリを利用します。2つ以上の80GB GPU(NVIDIA Ampere以降)と少なくとも150GBの空きディスク容量が必要です。コードはTransformers v4.44.0、torch v2.4.0、2つのA100 80GB GPUでテストされていますが、meta-llama/Llama-3.1-70B-Instruct
をサポートする設定であれば、このモデルもサポートされます。問題が発生した場合は、pip install -U transformers
を実行することを検討してください。
💻 使用例
基本的な使用法
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "nvidia/Llama-3.1-Nemotron-70B-Instruct-HF"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "How many r in strawberry?"
messages = [{"role": "user", "content": prompt}]
tokenized_message = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt", return_dict=True)
response_token_ids = model.generate(tokenized_message['input_ids'].cuda(),attention_mask=tokenized_message['attention_mask'].cuda(), max_new_tokens=4096, pad_token_id = tokenizer.eos_token_id)
generated_tokens =response_token_ids[:, len(tokenized_message['input_ids'][0]):]
generated_text = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0]
print(generated_text)
📚 ドキュメント
モデル概要
Llama-3.1-Nemotron-70B-Instructは、NVIDIAがカスタマイズした大規模言語モデルで、ユーザークエリに対するLLMの応答の有用性を向上させることを目的としています。このモデルは、いくつかの自動アライメントベンチマークで優れた成績を収めており、2024年10月1日時点で3つのベンチマークすべてで1位となっています。
評価指標
モデル |
Arena Hard |
AlpacaEval |
MT-Bench |
平均応答長 |
Llama-3.1-Nemotron-70B-Instruct |
85.0 (-1.5, 1.5) |
57.6 (1.65) |
8.98 |
2199.8 |
Llama-3.1-70B-Instruct |
55.7 (-2.9, 2.7) |
38.1 (0.90) |
8.22 |
1728.6 |
Llama-3.1-405B-Instruct |
69.3 (-2.4, 2.2) |
39.3 (1.43) |
8.49 |
1664.7 |
Claude-3-5-Sonnet-20240620 |
79.2 (-1.9, 1.7) |
52.4 (1.47) |
8.81 |
1619.9 |
GPT-4o-2024-05-13 |
79.3 (-2.1, 2.0) |
57.5 (1.47) |
8.74 |
1752.2 |
ライセンス
このモデルの使用は、NVIDIA Open Model Licenseによって管理されています。追加情報は、Llama 3.1 Community License Agreementを参照してください。
参考文献
モデルアーキテクチャ
属性 |
詳情 |
モデルタイプ |
Transformer |
ネットワークアーキテクチャ |
Llama 3.1 |
入力
属性 |
詳情 |
入力タイプ |
テキスト |
入力形式 |
文字列 |
入力パラメータ |
一次元 (1D) |
その他の入力関連プロパティ |
最大128kトークン |
出力
属性 |
詳情 |
出力タイプ |
テキスト |
出力形式 |
文字列 |
出力パラメータ |
一次元 (1D) |
その他の出力関連プロパティ |
最大4kトークン |
ソフトウェア統合
属性 |
詳情 |
サポートされるハードウェアマイクロアーキテクチャ互換性 |
NVIDIA Ampere、NVIDIA Hopper、NVIDIA Turing |
サポートされるオペレーティングシステム |
Linux |
推論
属性 |
詳情 |
エンジン |
Triton |
テストハードウェア |
H100、A100 80GB、A100 40GB |
倫理的考慮事項
NVIDIAは、信頼できるAIは共同の責任であると考えており、幅広いAIアプリケーションの開発を可能にするためのポリシーと実践を確立しています。サービス利用規約に従ってダウンロードまたは使用する場合、開発者はサポートモデルチームと協力して、このモデルが関連する業界やユースケースの要件を満たし、予期しない製品の誤用に対応することを確認する必要があります。このモデルの倫理的考慮事項の詳細については、Model Card++ Explainability、Bias、Safety & Security、およびPrivacy Subcardsを参照してください。セキュリティバグまたはNVIDIA AIに関する懸念事項は、こちらから報告してください。
引用
@misc{wang2024helpsteer2preferencecomplementingratingspreferences,
title={HelpSteer2-Preference: Complementing Ratings with Preferences},
author={Zhilin Wang and Alexander Bukharin and Olivier Delalleau and Daniel Egert and Gerald Shen and Jiaqi Zeng and Oleksii Kuchaiev and Yi Dong},
year={2024},
eprint={2410.01257},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2410.01257},
}
🔧 技術詳細
Llama-3.1-Nemotron-70B-Instructは、RLHF(具体的にはREINFORCE)を使用して訓練されており、Llama-3.1-Nemotron-70B-RewardとHelpSteer2-Preference promptsを利用しています。このモデルは、Llama-3.1-70B-Instructモデルを初期ポリシーとして使用しています。
📄 ライセンス
このモデルの使用は、NVIDIA Open Model Licenseによって管理されています。追加情報は、Llama 3.1 Community License Agreementを参照してください。