🚀 10.7B Solarの紹介: Upstage Depth UP Scalingによるパフォーマンス向上!
SOLAR-10.7Bは、107億のパラメータを持つ高度な大規模言語モデル(LLM)です。様々な自然言語処理(NLP)タスクで卓越したパフォーマンスを発揮し、300億以下のパラメータを持つモデルの中でも群を抜いています。
🚀 クイックスタート
このモデルは、シングルターンの会話用にファインチューニングされています。以下の手順で使用を開始できます。
バージョンの確認
transformersライブラリの正しいバージョンがインストールされていることを確認します。
pip install transformers==4.35.2
モデルの読み込み
以下のPythonコードを使用してモデルを読み込みます。
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("Upstage/SOLAR-10.7B-Instruct-v1.0")
model = AutoModelForCausalLM.from_pretrained(
"Upstage/SOLAR-10.7B-Instruct-v1.0",
device_map="auto",
torch_dtype=torch.float16,
)
シングルターン会話の実行
conversation = [ {'role': 'user', 'content': 'Hello?'} ]
prompt = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, use_cache=True, max_length=4096)
output_text = tokenizer.decode(outputs[0])
print(output_text)
以下は出力の例です。
<s> ### User:
Hello?
### Assistant:
Hello, how can I assist you today? Please feel free to ask any questions or request help with a specific task.</s>
✨ 主な機能
- 高性能:300億以下のパラメータを持つモデルの中で、最高水準のパフォーマンスを発揮します。
- ファインチューニングに適している:SOLAR-10.7Bは、ファインチューニングに最適なロバスト性と適応性を備えています。
- データ汚染の排除:データ汚染テストの結果、このモデルは汚染がないことが確認されています。
📦 インストール
必要なライブラリをインストールすることで、モデルを使用できます。
pip install transformers==4.35.2
💻 使用例
基本的な使用法
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("Upstage/SOLAR-10.7B-Instruct-v1.0")
model = AutoModelForCausalLM.from_pretrained(
"Upstage/SOLAR-10.7B-Instruct-v1.0",
device_map="auto",
torch_dtype=torch.float16,
)
conversation = [ {'role': 'user', 'content': 'Hello?'} ]
prompt = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, use_cache=True, max_length=4096)
output_text = tokenizer.decode(outputs[0])
print(output_text)
📚 ドキュメント
モデルの概要
SOLAR-10.7Bは、深度アップスケーリング(DUS)というLLMのスケーリング手法を用いて開発されました。これにはアーキテクチャの変更と継続的な事前学習が含まれます。具体的には、Mistral 7Bの重みをアップスケーリングされたレイヤーに統合し、最後にモデル全体を継続的に事前学習しました。
ファインチューニング戦略
最新の命令ファインチューニング手法である教師付きファインチューニング(SFT)と直接嗜好最適化(DPO)を利用しています。以下のデータセットを混合して使用しています。
- c-s-ale/alpaca-gpt4-data (SFT)
- Open-Orca/OpenOrca (SFT)
- Metamathを利用した社内生成データ (SFT, DPO)
- Intel/orca_dpo_pairs (DPO)
- allenai/ultrafeedback_binarized_cleaned (DPO)
データ生成時にGSM8Kサンプルを使用せず、適用可能な場合は以下のリストを介してタスクをフィルタリングすることで、データ汚染を回避しています。
filtering_task_list = [
'task228_arc_answer_generation_easy',
'ai2_arc/ARC-Challenge:1.0.0',
'ai2_arc/ARC-Easy:1.0.0',
'task229_arc_answer_generation_hard',
'hellaswag:1.1.0',
'task1389_hellaswag_completion',
'cot_gsm8k',
'cot_gsm8k_ii',
'drop:2.0.0',
'winogrande:1.1.0'
]
上記のデータセットを使用して、SFTと反復的なDPOトレーニングを適用し、独自のアライメント戦略を用いて、結果として得られるモデルのパフォーマンスを最大化しています。
データ汚染テスト結果
最近、LLMリーダーボード上の一部のモデルに汚染問題がありました。私たちは、トレーニングからすべてのベンチマーク関連データセットを除外するよう努めました。また、HuggingFaceチームも使用しているデータ汚染テスト [3] を実施することで、モデルの整合性を確保しました。
result < 0.1, %:
が0.9を大きく下回る結果は、私たちのモデルが汚染されていないことを示しています。
HellaSwagとWinogradeのデータ汚染テスト結果は、[3] が対応したら追加されます。
モデル |
ARC |
MMLU |
TruthfulQA |
GSM8K |
SOLAR-10.7B-Instruct-v1.0 |
result < 0.1, %: 0.06 |
result < 0.1, %: 0.15 |
result < 0.1, %: 0.28 |
result < 0.1, %: 0.70 |
評価結果
モデル |
H6 |
モデルサイズ |
SOLAR-10.7B-Instruct-v1.0 |
74.20 |
~ 11B |
mistralai/Mixtral-8x7B-Instruct-v0.1 |
72.62 |
~ 46.7B |
01-ai/Yi-34B-200K |
70.81 |
~ 34B |
01-ai/Yi-34B |
69.42 |
~ 34B |
mistralai/Mixtral-8x7B-v0.1 |
68.42 |
~ 46.7B |
meta-llama/Llama-2-70b-hf |
67.87 |
~ 70B |
tiiuae/falcon-180B |
67.85 |
~ 180B |
SOLAR-10.7B-v1.0 |
66.04 |
~11B |
mistralai/Mistral-7B-Instruct-v0.2 |
65.71 |
~ 7B |
Qwen/Qwen-14B |
65.86 |
~ 14B |
01-ai/Yi-34B-Chat |
65.32 |
~34B |
meta-llama/Llama-2-70b-chat-hf |
62.4 |
~ 70B |
mistralai/Mistral-7B-v0.1 |
60.97 |
~ 7B |
mistralai/Mistral-7B-Instruct-v0.1 |
54.96 |
~ 7B |
🔧 技術詳細
SOLAR-10.7Bは、深度アップスケーリング(DUS)という手法を用いて開発されました。これにはアーキテクチャの変更と継続的な事前学習が含まれます。具体的には、Mistral 7Bの重みをアップスケーリングされたレイヤーに統合し、最後にモデル全体を継続的に事前学習しました。
📄 ライセンス
引用方法
このモデルを使用する場合は、以下の論文を次の形式で引用してください。
@misc{kim2023solar,
title={SOLAR 10.7B: Scaling Large Language Models with Simple yet Effective Depth Up-Scaling},
author={Dahyun Kim and Chanjun Park and Sanghoon Kim and Wonsung Lee and Wonho Song and Yunsu Kim and Hyeonwoo Kim and Yungi Kim and Hyeonju Lee and Jihoo Kim and Changbae Ahn and Seonghoon Yang and Sukyung Lee and Hyunbyung Park and Gyoungjin Gim and Mikyoung Cha and Hwalsuk Lee and Sunghun Kim},
year={2023},
eprint={2312.15166},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@misc{kim2024sdpo,
title={sDPO: Don't Use Your Data All at Once},
author={Dahyun Kim and Yungi Kim and Wonho Song and Hyeonwoo Kim and Yunsu Kim and Sanghoon Kim and Chanjun Park},
year={2024},
eprint={2403.19270},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Upstage AIチーム
Upstageは、最高のLLMとDocAIを創造しています。詳細はhttps://upstage.ai をご覧ください。
お問い合わせ
質問や提案がある場合は、ディスカッションタブを使用してください。直接お問い合わせしたい場合は、contact@upstage.ai までメールを送信してください。