Amazon Bedrock Model Distillation が一般提供開始となりました
こんにちは、森田です。
以下のアップデートで Bedrock Model Distillation が一般提供開始となりました。
Amazon Bedrock Model Distillation とは
Amazon Bedrock 上で 教師モデル (teacher) の知識を 生徒モデル (student) に転移し、レイテンシと推論コストを削減できる機能です。
エージェント機能を含むワークフローでも、蒸留済みモデルを利用することで精度向上が期待できます。
本機能は re:Invent 2024 でプレビュー版が発表されていました。
プレビューとの違い
対応モデルの追加
新たに以下のモデルでも蒸留モデルを作成できるようになりました。
教師モデル | 生徒モデル |
---|---|
Nova Premier | Nova Pro / Nova Lite / Nova Micro |
Claude Sonnet 3.5 v2 | Claude 3 Haiku |
Llama 3.3 70B | Llama 3.2 1B / Llama 3.2 3B |
Nova Premierは、先日GAしたばかりのモデルですが、教師モデルとして早速対応しているようです。
ジョブステータスの表示
従来はジョブ実行中の進捗が分かりませんでしたが、Job status details が追加され、
リアルタイムでステータス確認 ができるようになりました。
蒸留ジョブ実行は、時間がかかり、エラーも起こりやすいため、嬉しいアップデートですね。
やってみた
データの準備
以下記事と同じデータを用意します。
また、以前まで少なかったデータセット周りの情報も追加されているようでした。
ジョブの作成
今回は、新規に追加されたNova Premier
を教師モデルとしてジョブを実行します。
ジョブのステータス確認
正常に実行されますと、以下のようにJob status details
に現在のステータスが表示されます。
1~2時間ほど待つとTrainingまで完了となり、モデルの利用が可能となります。
S3バケットの確認
S3バケットを確認することでトレーニングの詳細を確認することができます。
プレビューとの違いとしては、学習時に使用したデータも格納されています。
このファイルから、意図しない学習をしていないかを確認することができます。
{"schemaVersion": "bedrock-conversation-2024", "system": [{"text": "A chat between a curious User and an artificial intelligence Bot. The Bot gives helpful, detailed, and polite answers to the User's questions."}], "messages": [{"role": "user", "content": [{"text": "How does augmented reality work?"}]}, {"role": "assistant", "content": [{"text": "Augmented reality overlays digital information onto the real world through devices like smartphones or AR glasses."}]}]}
{"schemaVersion": "bedrock-conversation-2024", "system": [{"text": "A chat between a curious User and an artificial intelligence Bot. The Bot gives helpful, detailed, and polite answers to the User's questions."}], "messages": [{"role": "user", "content": [{"text": "How can I learn a new language quickly?"}]}, {"role": "assistant", "content": [{"text": "Focus on immersive techniques, daily practice, and language apps for rapid progress."}]}]}
{"schemaVersion": "bedrock-conversation-2024", "system": [{"text": "A chat between a curious User and an artificial intelligence Bot. The Bot gives helpful, detailed, and polite answers to the User's questions."}], "messages": [{"role": "user", "content": [{"text": "What are the principles of project management?"}]}, {"role": "assistant", "content": [{"text": "The main principles include scope, time, cost, quality, communication, risk, and procurement management."}]}]}
{"schemaVersion": "bedrock-conversation-2024", "system": [{"text": "A chat between a curious User and an artificial intelligence Bot. The Bot gives helpful, detailed, and polite answers to the User's questions."}], "messages": [{"role": "user", "content": [{"text": "What are the principles of content marketing?"}]}, {"role": "assistant", "content": [{"text": "Creating valuable and relevant content to attract a defined audience and drive profitable actions."}]}]}
さいごに
ジョブステータスや学習データを確認することができるようになったため、以前よりもトラブルシューティングが捗りそうです。
本記事では紹介していませんが、Bedrock Model Distillation では、モデル呼び出しログを使った学習もできるため、よりお手軽に蒸留モデルを作成できます。
ぜひ、試してみてはいかがでしょうか。