Amazon BedrockでAmazon Novaモデルをカスタマイズ可能に
AWSはAmazon Bedrockを通じてAmazon Novaモデルのカスタマイズ(教師ありファインチューニング、強化学習ファインチューニング、モデル蒸留)を容易にし、企業固有の知識をモデルに直接埋め込み、推論速度向上・トークンコスト削減・精度向上を実現する方法を公開した。
キーポイント
3つのカスタマイズ手法
Amazon BedrockはAmazon Novaモデルに対して、教師ありファインチューニング(SFT)、強化学習ファインチューニング(RFT)、モデル蒸留の3つのカスタマイズ手法を提供し、新しい知識をモデルの重みに直接埋め込む。
実用的な利点
これらの手法により、プロンプトエンジニアリングやRAGよりも高速な推論、低いトークンコスト、ビジネスに重要なタスクでの高い精度が実現される。
運用の簡便性
Amazon Bedrockはトレーニングプロセスを自動管理し、ユーザーはデータをAmazon S3にアップロードし、AWS Management Console、CLI、またはAPIを通じてジョブを開始するだけでよく、深い機械学習の専門知識は不要である。
従量課金モデル
カスタマイズされたNovaモデルはAmazon Bedrockでオンデマンド呼び出しが可能で、より高価な確保済みスループット(Provisioned Throughput)を購入する必要なく、標準レートで呼び出しごとに支払うことができる。
影響分析・編集コメントを表示
影響分析
この発表は、大規模言語モデル(LLM)の企業実装における重要な障壁であった「汎用モデルを特定業務に最適化する難しさ」と「専門知識の必要性」を大幅に低減する。AWSのマネージドサービスとして提供されることで、より多くの企業が自社データでモデルをカスタマイズし、競争優位性を築く道を開く可能性がある。
編集コメント
プロンプトエンジニアリングやRAGの限界を超え、モデル自体をカスタマイズする実用的な道筋を示した点が核心。AWSのエコシステム優位性を活かした、企業AI導入のハードル下げ策として注目。
本日、Amazon Bedrock を活用して、Amazon Nova モデル を特定のビジネスニーズに合わせてカスタマイズする方法についてご紹介します。顧客が AI デプロイメントを拡大するにつれ、独自知識やワークフローを反映したモデルが必要となります。具体的には、顧客対応における一貫したブランドボイスの維持、複雑な業界固有のワークフローへの対応、あるいは高ボリュームの航空券予約システムにおける意図の正確な分類などが該当します。
プロンプトエンジニアリングや検索拡張生成(RAG: Retrieval-Augmented Generation)といった手法は、タスクパフォーマンスを向上させるためにモデルに追加の文脈を提供しますが、これらの手法だけではモデルにネイティブな理解力を付与することはできません。
Amazon Bedrock は、Nova モデルに対して 3 つの調整アプローチをサポートしています。1 つ目は教師あり微調整(SFT)で、ラベル付きの入力 - 出力例を用いてモデルを訓練します。2 つ目は強化学習微調整(RFT)で、報酬関数を用いて学習を目標行動へと誘導します。3 つ目はモデル蒸留で、より大規模な教師モデルから知識を転移し、より小さく高速な学生モデルに継承する手法です。各技術は、プロンプトや取得されたコンテキストを通じて推論時に情報を供給するのではなく、新しい知識を直接モデルの重みに埋め込みます。これらのアプローチにより、推論速度が向上し、トークンコストが削減され、ビジネスにとって最も重要なタスクにおける精度が高まります。Amazon Bedrock は訓練プロセスを自動的に管理するため、データは Amazon Simple Storage Service (Amazon S3) へアップロードするだけでよく、AWS Management Console、CLI、または API を介してジョブを開始すれば済みます。深い機械学習の専門知識は必要ありません。Nova モデルでは、Amazon Bedrock 上でカスタマイズ済みモデルをオンデマンドで呼び出すことが可能です。つまり、高価な割当容量(Provisioned Throughput)を購入する必要はなく、標準レートで呼び出しごとに課金されるだけで済みます。
本稿では、Amazon Nova モデルを用いた Amazon Bedrock におけるモデルファインチューニングの完全な実装手順を解説します。ドメイン固有タスクにおいて優れた性能を発揮する意図分類器の例を通じて、各ステップを実践的に示していきます。本ガイド全体を通じて、意味のあるモデル改善をもたらす高品質なトレーニングデータの準備方法や、過学習を防ぎつつ学習を最適化するためのハイパーパラメータ設定方法、そして精度向上とレイテンシ削減を実現するファインチューニング済みモデルのデプロイ方法を学びます。また、トレーニング指標およびロス曲線を用いた結果評価の方法についても紹介します。
ファインチューニングの理解と使用タイミング
プロンプトエンジニアリングや検索拡張生成(RAG:Retrieval-Augmented Generation)などのコンテキストエンジニアリング手法は、情報をモデルのプロンプト内に配置します。これらのアプローチには大きな利点があります:トレーニングを必要とせず即座に効果を発揮し、動的な情報更新が可能であり、修正を加えることなく複数の基盤モデルで動作します。しかし、これらの手法は各呼び出しごとにコンテキストウィンドウのトークンを消費するため、時間とともに累積コストやレイテンシが増加する可能性があります。さらに重要なのは、これらが一般化しにくい点です。モデルは毎回指示を読み取っているだけで知識を内部化していないため、明示的にプロンプトに提供された範囲を超える推論が必要なタスクや、新しい表現、エッジケースに対して苦労することがあります。
一方、カスタマイズ手法では、追加の重みを持つアダプター行列を追加してその部分をカスタマイズすることで(「パラメータ効率型ファインチューニング」、略称「PEFT」)、新たな知識をモデルに直接組み込みます。その結果、カスタマイズされたモデルは特定のドメイン固有のスキルを獲得します。カスタマイズにより、特定のトレーニング領域において、より小さく効率的なモデルが大型モデルと同等のパフォーマンスを発揮できるようになります。
ファインチューニングを行うべきタイミング: 高ボリュームかつ明確に定義されたタスクにおいて、品質の高いラベル付きデータや報酬関数を構築できる場合にファインチューニングを検討してください。ユースケースには、自社のロゴを正しく描画するようモデルを訓練すること、ブランドのトーンや企業方針をモデルに埋め込むこと、従来の機械学習(ML)分類器を小型大規模言語モデル(LLM: Large Language Model)で置き換えることが含まれます。例えば、Amazon Customer Service は Nova Micro をカスタマイズ して専門的な顧客サポートに活用し、精度とレイテンシの改善を図っています。これにより、ドメイン固有の問題では 5.4%、一般的な問題では 7.3% の精度向上を実現しました。
Nova Micro などのファインチューニング済み小型 LLM は、意図検出(intent detection)などのタスクにおいて従来の ML 分類器を徐々に置き換えています。これらは、軽量モデル特有の速度とコストで、LLM が持つ柔軟性と世界知識を提供します。分類器とは異なり、LLM は再学習なしに自然な表現のバリエーション、スラング、文脈を処理でき、ファインチューニングを行うことで特定のタスクに対する精度がさらに向上します。このブログの後半では、意図分類器の例を用いてこれを実証します。
ファインチューニングを行わないべきタイミング: ファインチューニングには、品質の高いラベル付きデータや報酬関数の構築、およびトレーニングジョブの実行が必要であり、これらには初期の時間とコストがかかります。ただし、この初期投資は、高ボリュームアプリケーションにおけるリクエストあたりの推論コストとレイテンシを削減する効果があります。
カスタマイズのアプローチ
Amazon Bedrock は、Nova モデルに対して 3 つのカスタマイズアプローチを提供しています。
- 教師あり微調整(SFT)は、あなたが提供するラベル付きデータからパターンを学習させるようにモデルをカスタマイズします。本記事ではこの手法の実践例を示します。
- 強化学習微調整(RFT)は異なるアプローチを採用し、トレーニングデータに報酬関数を組み合わせて学習プロセスを誘導します。報酬関数は、独自に作成したコードまたは判別者として機能する大規模言語モデル(LLM)のいずれかです。
- モデル蒸留は、知識転送が必要なシナリオ向けに、大規模な教師モデルからの知見を圧縮し、リソース制約のあるデバイスに適したより小さく効率的な学生モデルを作成することを可能にします。
Amazon Bedrock は、Nova モデルのカスタマイズにおいて、モデルに応じた適切なパラメータ効率微調整(PEFT)技術を自動的に使用します。これにより、フル微調整と比較してメモリ要件が削減されトレーニングが加速される一方、モデルの品質は維持されます。いつなぜ微調整を使用すべきかが明確になったところで、Amazon Bedrock が実装プロセスをどのように簡素化するか、およびどの Nova モデルがこのカスタマイズアプローチをサポートしているかを探っていきましょう。
Amazon Bedrock 上の Amazon Nova モデルの理解
Amazon Bedrock は、インフラストラクチャのプロビジョニング、コンピューティング管理、トレーニングのオーケストレーションを完全に自動化します。データを S3 にアップロードし、単一の API コールでトレーニングを開始するだけで、クラスターや GPU の管理、分散トレーニングパイプラインの設定は不要です。データ準備(フォーマット仕様とスキーマ要件を含む)に関する明確なドキュメント、感度の高いハイパーパラメータのデフォルト設定(例:epochCount, learningRateMultiplier)、およびリアルタイムでの収束監視を支援する損失曲線によるトレーニング可視性を提供します。
Nova モデル: 一部の Nova モデルではファインチューニングが可能です(ドキュメント を参照)。トレーニング完了後、カスタマイズされた Nova モデルを Amazon Bedrock でホストするオプションがあり、非カスタムモデルと同じ低価格のオンデマンド推論(On Demand inference)を利用できます。
例えば、Nova 2 Lite は高速でコスト効率の高い推論モデルです。マルチモーダル基盤モデルとして、100 万トークンのコンテキストウィンドウ内でテキスト、画像、ビデオを処理します。このコンテキストウィンドウは、単一のプロンプトで 400 ページを超える文書や 90 分間のビデオの分析をサポートしています。ドキュメント処理、ビデオ理解、コード生成、エージェントワークフローにおいて卓越した性能を発揮します。Nova 2 Lite は SFT(Supervised Fine-Tuning)と RFT(Reinforcement Fine-Tuning)の両方をサポートしています。
最も小型の Nova モデルである Nova Micro は、LLM の知能を備えつつ高速かつ低コストな推論を提供できるため、特に有用です。Nova Micro は、より大きなシステムの一部として行われるパイプライン処理タスク、例えば住所の修正やテキストからのデータフィールド抽出などに最適です。本稿では、カスタムデータサイエンスモデルを構築する代わりに、セグメンテーションタスクのために Nova Micro をカスタマイズする例を示します。
この表には、Nova 1 および Nova 2 の推論モデルと、公開時点での現在の利用状況、ならびに現在 RFT(Reinforcement Fine-Tuning)または SFT(Supervised Fine-Tuning)が可能なモデルを記載しています。これらの機能は変更される可能性があります。最新のモデル利用状況については オンラインドキュメント を、カスタマイズ機能については同様の カスタマイズドキュメント を参照してください。また、モデルの詳細については Nova ユーザーガイド をご覧ください。
| Model | Capabilities | Input | Output | Status | Bedrock fine-tuning |
|---|
| Nova Premier | 複雑なタスクに最も適したモデル、およびモデル蒸留用の教師モデル | テキスト、画像、動画(音声を除く) | テキスト | 一般利用可能 | モデル蒸留の教師として使用可能
Nova Pro
精度、速度、コストの最適な組み合わせを備えた多機能モデル。幅広いタスクに対応
テキスト、画像、動画
テキスト
一般提供開始
SFT(Supervised Fine-Tuning)
Nova 2 Lite
高速処理を実現する低コストの多機能モデル
テキスト、画像、動画
テキスト
一般提供開始
RFT(Reinforcement Fine-Tuning)、SFT(Supervised Fine-Tuning)
Nova Lite
高速処理を実現する低コストの多機能モデル
テキスト、画像、動画
テキスト
一般提供開始
SFT(Supervised Fine-Tuning)
Nova Micro
低コストで最も応答遅延が短いモデル
テキスト
テキスト
一般提供開始
SFT(Supervised Fine-Tuning)
Now that you understand how Nova models support fine-tuning through the Amazon Bedrock managed infrastructure, let's examine a real-world scenario that demonstrates these capabilities in action.
Use case example – intent detection (replacing traditional ML models)
Intent detection determines the category of the user's intended interaction from the input case. For example, in the case of an airline travel assistance system, the user might be attempting to get information about a previously booked flight or asking a question about airline services, such as how to transport a pet. Often systems will want to route the inquiry to specific agents based on intent. Intent detection systems must operate quickly and economically at high volume.
このようなシステムの従来の解決策は、機械学習モデルを訓練することでした。これは効果的ですが、開発者は現在、これらのタスクに対してより頻繁に小型のLLM(大規模言語モデル)を利用しています。LLM はより柔軟性があり、プロンプトの変更を通じて迅速に修正可能で、広範な世界知識が組み込まれています。略語、テキストメッセージのスラング、同義語、文脈の理解において優れたユーザー体験を提供でき、AI エンジニアにとって LLM の開発経験は馴染み深いものです。
私たちの例では、意図ベースシステムの業界標準ベンチマークであるオープンソースの Airline Travel Information System (ATIS) データセット上で Nova Micro モデルをカスタマイズします。カスタマイズを行わない場合、Nova Micro の ATIS での精度は 41.4% ですが、特定のタスク向けにカスタマイズすることで、単純なトレーニングジョブで精度を 97% に向上させることができます。
技術的実装:ファインチューニングプロセス
モデルのファインチューニング成功を駆動する 2 つの重要な要素は、データ品質とハイパーパラメータの選択です。これらを適切に設定することが、モデルが効率的に収束するか、あるいは高コストな再学習が必要になるかを決定します。まずトレーニングデータの準備方法から始め、実装プロセスの各コンポーネントを順を追って解説していきます。
データの準備
Amazon Bedrock では、トレーニング中に大規模データセットを効率的にストリーミング処理し、メモリ制約なしでデータを逐次処理できるようにするため、JSONL(JavaScript Object Notation Lines)形式が必要です。この形式は検証も簡素化します。各行はエラーについて独立してチェックできます。JSONL ファイル内の各行が有効な JSON 形式であることを確認してください。ファイル形式が無効な場合、Amazon Bedrock のモデル作成ジョブはエラーで失敗します。詳細については、Nova モデルのファインチューニングに関するドキュメントをご覧ください。私たちはスクリプトを使用して ATIS データセットを JSONL 形式に変換しました。Nova Micro は検証用セットを個別に受け付けるため、データの 10% を検証用セットとして分割しました(Nova 2 モデルではカスタマイズ時に自動的にこの処理が行われます)。また、モデルがトレーニングしていないレコードのテストセットも確保し、クリーンなテスト結果を得られるようにしました。
意図分類器の例では入力データはテキストのみですが、マルチメディアモデルをファインチューニングする際は、サポートされている画像形式(PNG、JPEG、GIF)のみを使用していることを確認してください。トレーニング例が重要なケースを網羅しているか確認し、チームと連携してデータを検証した上で、曖昧または矛盾する回答をファインチューニング前に削除してください。
「schemaVersion」フィールドの値は"bedrock-conversation-2024"です。システムプロンプトには、航空関連の問い合わせ意図を分類する指示が含まれています。以下のリストから1つの意図を選択してください:略語(abbreviation)、航空機(aircraft)、航空機+便名+フライト番号(aircraft+flight+flight_no)、運賃(airfare)、運賃+飛行時間(airfare+flight_time)、航空会社(airline)、航空会社+便名(airline+flight_no)、空港(airport)、座席数(capacity)、最安値(cheapest)、都市(city)、距離(distance)、フライト(flight)、フライト+運賃(flight+airfare)、便名(flight_no)、飛行時間(flight_time)、地上運賃(ground_fare)、地上サービス(ground_service)、地上サービス+地上運賃(ground_service+ground_fare)、食事(meal)、数量(quantity)、制限事項(restriction)。
応答は意図名のみとし、それ以外の情報は含めないでください。
ユーザーのメッセージ:"show me the morning flights from boston to philadelphia"
アシスタントの応答:"flight"
これはトレーニングデータサンプル内の1行として準備された例です(JSONL形式では、見た目には折り返されていても、実際には各事例が1行で構成されています)。
重要:システムプロンプトはトレーニングデータに含まれている点に注意してください。モデルはシステムプロンプトを、微調整された動作を引き起こす文脈として学習するため、トレーニング時に使用するシステムプロンプトと推論(inference)時に使用するシステムプロンプトが一致していることが極めて重要です。
データプライバシーに関する考慮事項:
機密データを対象に微調整を行う場合:
- Amazon S3 へのアップロード前に、個人識別情報(PII)(氏名、電子メールアドレス、電話番号、支払い詳細など)を匿名化またはマスクしてください。
- 規制コンプライアンスのためのデータレジデンシー要件も考慮してください。
- Amazon Bedrock は、お客様のトレーニングデータをベースモデルの改善に使用しません。
- セキュリティを強化するには、Amazon S3 と Amazon Bedrock の間のプライベート接続に Amazon Virtual Private Cloud (VPC) エンドポイントを使用することを検討してください。これにより、パブリックインターネットへの露出が排除されます。
主要なハイパーパラメータ
ハイパーパラメータはトレーニングジョブを制御します。Amazon Bedrock は適切なデフォルト値を設定しており、多くの場合調整なしで使用できますが、目標とする精度を達成するために、ファインチューニングジョブでこれらの値を調整する必要がある場合があります。以下に Nova 理解モデルのハイパーパラメータを示しますが、他のモデルについては ドキュメント を参照してください。
3 つのハイパーパラメータがトレーニングジョブの動作を制御します。Amazon Bedrock は適切なデフォルト値を設定していますが、これらの値を理解することで結果を最適化できます。これらの設定を正しく行うことで、トレーニング時間を数時間節約し、計算コストを最小限に抑えることができます。
最初のハイパーパラメータである epochCount は、モデルがデータセットを何回完全に通過するかを指定します。これは、理解度を高めるために本を複数回読むようなものです。初回の読了後には材料の 60% が記憶に残るかもしれませんが、2 回目の通読で理解度が 80% に向上します。しかし、材料の 100% を理解した後にさらに読み進めても、学習時間を浪費するだけで成果は得られません。Amazon Nova モデルでは 1 から 5 の epochCount をサポートしており、デフォルト値は 2 です。大規模なデータセットでは通常、より少ないエポック数で収束しますが、小規模なデータセットではより多くの反復処理が有益となります。約 5000 件のサンプルを合わせた ATIS 意図分類器の例では、epochCount を 3 に設定しています。
learningRateMultiplier は、モデルがエラーからどの程度積極的に学習するかを制御します。これは本質的に修正のためのステップサイズです。学習率が高すぎると詳細を見落とし、誤った結論に飛びついてしまう可能性があります。逆に、学習率が低すぎると結論に至るまでに時間がかかります。ATIS の例では 1e-5(0.00001)を使用し、安定した漸進的な学習を実現しています。learningRateWarmupSteps パラメータは段階的に t
原文を表示
Today, we’re sharing how Amazon Bedrock makes it straightforward to customize Amazon Nova models for your specific business needs. As customers scale their AI deployments, they need models that reflect proprietary knowledge and workflows — whether that means maintaining a consistent brand voice in customer communications, handling complex industry-specific workflows or accurately classifying intents in a high-volume airline reservation system. Techniques like prompt engineering and Retrieval-Augmented Generation (RAG) provide the model with additional context to improve task performance, but these techniques do not instill native understanding into the model.
Amazon Bedrock supports three customization approaches for Nova models: supervised fine-tuning (SFT), which trains the model on labeled input-output examples; reinforcement fine-tuning (RFT), which uses a reward function to guide learning toward target behaviors; and model distillation, which transfers knowledge from a larger teacher model into a smaller, faster student model. Each technique embeds new knowledge directly into the model weights, rather than supplying it at inference time through prompts or retrieved context. With these approaches, you get faster inference, lower token costs, and higher accuracy on the tasks that matter most to your business. Amazon Bedrock manages the training process automatically, requiring only that you upload your data to Amazon Simple Storage Service (Amazon S3) and initiate the job through the AWS Management Console, CLI, or API. Deep machine learning expertise is not required. Nova models support on-demand invocation of customized models in Amazon Bedrock. This means you pay only per-call at the standard rate for the model, instead of needing to purchase more expensive allocated capacity (Provisioned Throughput).
In this post, we’ll walk you through a complete implementation of model fine-tuning in Amazon Bedrock using Amazon Nova models, demonstrating each step through an intent classifier example that achieves superior performance on a domain specific task. Throughout this guide, you’ll learn to prepare high-quality training data that drives meaningful model improvements, configure hyperparameters to optimize learning without overfitting, and deploy your fine-tuned model for improved accuracy and reduced latency. We’ll show you how to evaluate your results using training metrics and loss curves.
Understanding fine-tuning and when to use it
Context-engineering techniques such as prompt engineering or Retrieval-Augmented Generation (RAG) place information into the model’s prompt. These approaches offer significant advantages: they take effect immediately with no training required, allow for dynamic information updates, and work with multiple foundation models without modification. However, these techniques consume context window tokens on every invocation, which can increase cumulative costs and latency over time. More importantly, they do not generalize well. The model is simply reading instructions each time rather than having internalized the knowledge, so it can struggle with novel phrasings, edge cases, or tasks that require reasoning beyond what was explicitly provided in the prompt. Customization techniques, by comparison, incorporate the new knowledge directly into the model by adding an adapter matrix of additional weights and customizing those (“parameter-efficient fine-tuning”, aka “PEFT”). The resulting customized model has acquired new domain-specific skills. Customization allows faster and more efficient small models to reach performance comparable to larger models in the specific training domain.
When to fine-tune: Consider fine-tuning when you have a high-volume, well-defined task where you can assemble quality labeled examples or a reward function. Use cases include training a model to correctly render your company’s logo, embedding brand tone and company policies into the model, or replacing a traditional ML classifier with a small LLM. For example, Amazon Customer Service customized Nova Micro for specialized customer support to improve accuracy and reduce latency, improving accuracy by 5.4% on domain-specific issues and 7.3% on general issues.
Fine-tuned small LLMs like Nova Micro are increasingly replacing traditional ML classifiers for tasks such as intent detection. They deliver the flexibility and world knowledge of an LLM at the speed and cost of a lightweight model. Unlike classifiers, LLMs handle natural variation in phrasing, slang, and context without retraining, and fine-tuning sharpens their accuracy further for the specific task. We demonstrate this with an intent classifier example later in this blog.
When NOT to fine-tune: Fine-tuning requires assembling quality labeled data or a reward function and executing a training job, which involves upfront time and cost. However, this initial investment can reduce per-request inference costs and latency for high-volume applications.
Customization approaches
Amazon Bedrock offers three customization approaches for Nova models:
- Supervised fine-tuning (SFT) customizes the model to learn patterns from labeled data that you supply. This post demonstrates this technique in action.
- Reinforcement fine-tuning (RFT) takes a different approach, using training data combined with a reward function, either custom code or an LLM acting as a judge, to guide the learning process.
- Model distillation, for scenarios requiring knowledge transfer, lets you compress insights from large teacher models into smaller, more efficient student models suitable for resource-constrained devices.
Amazon Bedrock automatically uses parameter efficient fine-tuning (PEFT) techniques appropriate to the model for customizing Nova models. This reduces memory requirements and accelerates training compared to full fine-tuning, while maintaining model quality. Having established when and why to use fine-tuning, let’s explore how Amazon Bedrock simplifies the implementation process, and which Nova models support this customization approach.
Understanding Amazon Nova models on Amazon Bedrock
Amazon Bedrock fully automates infrastructure provisioning, compute management, and training orchestration. You upload data to S3 and start training with a single API call, without managing clusters and GPUs or configuring distributed training pipelines. It provides clear documentation for data preparation (including format specifications and schema requirements), sensible hyperparameter defaults (such as epochCount, learningRateMultiplier), and training visibility through loss curves that help you monitor convergence in real-time.
Nova Models: Several of the Nova models allow fine-tuning (see documentation). After training is completed, you have the option to host the customized Nova models on Amazon Bedrock using cost-effective On Demand inference, at the same low inference price as the non-customized model.
Nova 2 Lite, for example, is a fast, cost-effective reasoning model. As a multimodal foundation model, it processes text, images, and video within a 1-million token context window. This context window supports analysis of documents longer than 400 pages or 90-minute videos in a single prompt. It excels at document processing, video understanding, code generation, and agentic workflows. Nova 2 Lite supports both SFT and RFT.
The smallest Nova model, Nova Micro, is also particularly useful because it offers fast, low-cost inference with LLM intelligence. Nova Micro is ideal for pipeline processing tasks done as part of a larger system, such as fixing addresses or extracting data fields from text. In this post, we show an example of customizing Nova Micro for a segmentation task instead of building a custom data science model.This table shows both Nova 1 and Nova 2 reasoning models and their current availability as of publication time, with which models currently allow RFT or SFT. These capabilities are subject to change; see the online documentation for the most current model availability and customization, and the Nova Users Guide for more detail on the models.
Model
Capabilities
Input
Output
Status
Bedrock fine-tuning
Nova Premier
Most capable model for complex tasks and teacher for model distillation
Text, images, video (excluding audio)
Text
Generally available
Can be used as a teacher for model distillation
Nova Pro
Multimodal model with best combination of accuracy, speed, and cost for a wide range of tasks
Text, images, video
Text
Generally available
SFT
Nova 2 Lite
Low cost multimodal model with fast processing
Text, images, video
Text
Generally available
RFT, SFT
Nova Lite
Low cost multimodal model with fast processing
Text, images, video
Text
Generally available
SFT
Nova Micro
Lowest latency responses at low cost.
Text
Text
Generally available
SFT
Now that you understand how Nova models support fine-tuning through the Amazon Bedrock managed infrastructure, let’s examine a real-world scenario that demonstrates these capabilities in action.
Use case example – intent detection (replacing traditional ML models)
Intent detection determines the category of the user’s intended interaction from the input case. For example, in the case of an airline travel assistance system, the user might be attempting to get information about a previously booked flight or asking a question about airline services, such as how to transport a pet. Often systems will want to route the inquiry to specific agents based on intent. Intent detection systems must operate quickly and economically at high volume.
The traditional solution for such a system has been to train a machine-learning model. While this is effective, developers are more often turning to small LLMs for these tasks. LLMs offer more flexibility, can quickly be modified through prompt changes, and come with extensive world knowledge built in. Their understanding of shorthand, texting slang, equivalent words, and context can provide a better user experience, and the LLM development experience is familiar for AI engineers.
For our example, we will customize Nova Micro model on the open-source Airline Travel Information System (ATIS) data set, an industry standard benchmark for intent-based systems. Nova Micro achieves 41.4% on ATIS with no customization, but we can customize it for the specific task, improving its accuracy to 97% with a simple training job.
Technical implementation: Fine-tuning process
The two critical factors that drive model fine-tuning success are data quality and hyperparameter selection. Getting these right determines whether your model converges efficiently or requires costly retraining. Let’s walk through each component of the implementation process, starting with how to prepare your training data.
Data preparation
Amazon Bedrock requires JSONL (JavaScript Object Notation Lines) format because it supports efficient streaming of large datasets during training, so that you can process your data incrementally without memory constraints. This format also simplifies validation. Each line can be checked independently for errors. Verify that each row in the JSONL file is valid JSON. If the file format is invalid, the Amazon Bedrock model creation job will fail with an error. For more detail, see the documentation on Nova model fine-tuning. We used a script to format the ATIS dataset as JSONL. Nova Micro accepts a separate validation set so we then off split 10% of the data into a validation set (Nova 2 models do this automatically in customization). We also reserved a test set of records, which the model was not trained on, to facilitate clean testing results.
For our intent classifier example, our input data is text only. However, when fine-tuning multimedia models, also make sure you are using only supported image formats (PNG, JPEG, and GIF). Make sure your training examples span the important cases. Validate your dataset with your team and remove ambiguous or contradictory answers before fine-tuning.
{"schemaVersion": "bedrock-conversation-2024", "system": [{"text": "Classify the intent of airline queries. Choose one intent from this list: abbreviation, aircraft, aircraft+flight+flight_no, airfare, airfare+flight_time, airline, airline+flight_no, airport, capacity, cheapest, city, distance, flight, flight+airfare, flight_no, flight_time, ground_fare, ground_service, ground_service+ground_fare, meal, quantity, restriction\n\nRespond with only the intent name, nothing else."}], "messages": [{"role": "user", "content": [{"text": "show me the morning flights from boston to philadelphia"}]}, {"role": "assistant", "content": [{"text": "flight"}]}]}
*Prepared row in a training data sample (note that although it appears wrapped, JSONL format is really a single row per example)*
Important: Note that the system prompt appears in the training data. It is important that the system prompt used for training match the system prompt used for inference, because the model learns the system prompt as context that triggers its fine-tuned behavior.
Data privacy considerations:
When fine-tuning with sensitive data:
- Anonymize or mask PII (names, email addresses, phone numbers, payment details) before uploading to Amazon S3.
- Consider data residency requirements for regulatory compliance.
- Amazon Bedrock does not use your training data to improve base models.
- For enhanced security, consider using Amazon Virtual Private Cloud (VPC) endpoints for private connectivity between S3 and Amazon Bedrock, eliminating exposure to the public internet.
Key hyperparameters
Hyperparameters control the training job. Amazon Bedrock sets reasonable defaults, and you can often use them with no adjustment, but you might need to adjust them for your fine-tuning job to achieve your target accuracy. Here are the hyperparameters for the Nova understanding models – consult the documentation for other models:
Three hyperparameters control your training job’s behavior, and while Amazon Bedrock sets reasonable defaults, understanding them helps you optimize results. Getting these settings right can save you hours of training time and minimize compute costs.
The first hyperparameter, epochCount, specifies how many complete passes the model makes through your dataset. Think of it like reading a book multiple times to improve comprehension. After the first read you might retain 60% of the material; a second pass raises comprehension to 80%. However, after you understand 100% of the material, additional readings waste training time without producing gains. Amazon Nova models support 1 to 5 epochs with a default of 2. Larger datasets typically converge with fewer epochs, while smaller datasets benefit from more iterations. For our ATIS intent classifier example with ~5000 combined samples, we set epochCount to 3.
The learningRateMultiplier controls how aggressively the model learns from errors. It is essentially the step size for corrections. If the learning rate is too high, you might miss details and jump to wrong conclusions. If the rate is too low, you form conclusions slowly. We use 1e-5 (0.00001) for the ATIS example, which provides stable, gradual learning. The learningRateWarmupSteps parameter gradually increases t
関連記事
Pococha開発環境をEKS上で再設計:ブランチ単位の開発とPull Request単位の検証 [DeNAインフラSRE]
DeNAのインフラSREチームが、Pocochaの開発環境をAmazon EC2からAmazon EKSへ移行し、ブランチ単位の開発とPull Request単位の検証を可能にするコンテナベースの環境を構築した。
Amazon Bedrock AgentCoreでReactアプリにライブAIブラウザエージェントを組み込む
Amazonは、Bedrock AgentCoreのブラウザツールを提供し、開発者がReactアプリにAIエージェントを組み込めるようにした。これにより、ユーザーはAIエージェントのウェブ操作を可視化でき、信頼性と制御性を向上させる。
大規模エージェント管理の未来:AWS Agent Registryがプレビュー公開
AWSがAWS Agent Registryを発表し、組織内でエージェント・ツール・スキルを発見・共有・再利用できる機能をAmazon Bedrock AgentCoreで提供開始した。