留出用にトレーニングデータセットを準備する - Amazon Bedrock

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

留出用にトレーニングデータセットを準備する

モデルカスタムジョブを開始する前に、最低限のトレーニングデータセットを必要があります。カスタムモデルの入力データセットを準備するには、.jsonlファイルを作成します。各行はレコードに対応する JSON オブジェクトです。作成するファイルは、選択したモデル抽出とモデルの形式に従う必要があります。その中のレコードは、サイズ要件にも準拠している必要があります。

入力データをプロンプトとして指定します。Amazon Bedrock は、入力データを使用して教師モデルからレスポンスを生成し、生成されたレスポンスを使用して学生モデルを微調整します。Amazon Bedrock が使用する入力の詳細と、ユースケースに最適なオプションの選択については、「」を参照してくださいAmazon Bedrock Model Distillation の仕組み。入力データセットを準備するには、いくつかのオプションがあります。

注記

Amazon Nova モデルには、抽出に関するさまざまな要件があります。詳細については、Amazon Nova「モデルの抽出」を参照してください。

留出でサポートされているモダリティ

にリストされているモデルは、text-to-textモダリティのみAmazon Bedrock Model Distillation でサポートされているモデルとリージョンをサポートします。

合成データ生成の入力プロンプトを最適化する

モデルの抽出中、Amazon Bedrock は特定のユースケースに合わせて学生モデルを微調整するために使用する合成データセットを生成します。詳細については、「Amazon Bedrock Model Distillation の仕組み」を参照してください。

必要なユースケースの入力プロンプトをフォーマットすることで、合成データ生成プロセスを最適化できます。例えば、抽出されたモデルのユースケースが検索拡張生成 (RAG) の場合、モデルがエージェントのユースケースに焦点を当てるようにする場合とは異なる方法でプロンプトをフォーマットします。

以下は、RAG またはエージェントのユースケースの入力プロンプトをフォーマットする方法の例です。

RAG prompt example
{ "schemaVersion": "bedrock-conversation-2024", "system": [ { "text": "You are a financial analyst charged with answering questions about 10K and 10Q SEC filings. Given the context below, answer the following question." } ], "messages": [ { "role": "user", "content": [ { "text": "<context>\nDocument 1: Multiple legal actions have been filed against us as a result of the October 29, 2018 accident of Lion Air Flight 610 and the March 10, 2019 accident of Ethiopian Airlines Flight 302.\n</context>\n\n<question>Has Boeing reported any materially important ongoing legal battles from FY2022?</question>" } ] } ] }
Agent prompt example
{ "schemaVersion": "bedrock-conversation-2024", "system": [ { "text": 'You are an expert in composing functions. You are given a question and a set of possible functions. Based on the question, you will need to make one or more function/tool calls to achieve the purpose. Here is a list of functions in JSON format that you can invoke. [ { "name": "lookup_weather", "description: "Lookup weather to a specific location", "parameters": { "type": "dict", "required": [ "city" ], "properties": { "location": { "type": "string", }, "date": { "type": "string", } } } } ]' } ], "messages": [ { "role": "user", "content": [ { "text": "What's the weather tomorrow?" } ] }, { "role": "assistant", "content": [ { "text": "[lookup_weather(location=\"san francisco\", date=\"tomorrow\")]" } ] } ] }