長いコンテキストウィンドウの使用
Amazon Nova Premier では、100 万トークンのコンテキスト長がサポートされています。これは、100 万トークンのテキスト、500 個のイメージ、または 90 分の動画に変換します。Amazon Nova Premier は、長いドキュメントに対するコードの理解と質問への回答に優れています。コンテキストサイズが大きくなるとパフォーマンスがわずかに低下する可能性があるため、最良の結果を得るには、次のガイドラインに従ってください。
-
長い形式のデータを先頭に配置する: 長いドキュメントと入力をプロンプトの最初の方に配置します。これらは、クエリ、手順、および例の前に配置する必要があります。
-
最後に指示を配置する: プロンプトの最後に指示を配置します。モデルは、コンテキストが最初に示され、最後に手順が指定されたときに最適に動作します。
-
ドキュメントコンテンツの構造の開始マーカーと終了マーカー:
[Document Start]
や[Document End]
などの開始マーカーと終了マーカーを使用して、長いドキュメントの開始と終了を示します。サンプルのテンプレートを次に示します。
// Provide your long inputs at the top of your prompt [Document Start] {{ Your document}} [Document End] // Then specify your query and instructions {{ User query}} {{ Instructions}}
-
引用マーカーを使用してレスポンスをグラウンディングする: 長いドキュメントタスクの場合、タスクを進める前に、ドキュメントの関連セクションからの引用を使用してレスポンスをグラウンディングするように Amazon Nova モデルに指示することをお勧めします。このアプローチは、モデルが最も関連性の高い情報に注目するようにし、無関係なコンテンツによって精度を落とさないようにするのに役立ちます。モデルがレスポンスに基づいて答えを出すようにリクエストする場合、引用できるセクションは数値である必要があります。例えば、Passage %[1]%、Passage %[2]% など、または単に <C1>、<C2> などです。プロンプトに引用を含める方法の詳細については、「独自の RAG を構築する」を参照してください。
プロンプトの例を次に示します。
""" You are an AI financial assistant. Your task is to find patterns and insights from multi-year financial documents Passage %[1]% {{ Your document}} Passage %[2]% {{ Your document}} Passage %[3]% {{ Your document}} Passage %[4]% {{ Your document}} ## Task: Analyze Amazon's financial reports across multiple years to identify significant performance trends, segment growth patterns, and strategic shifts. ## Context information: - You have access to Amazon's annual financial reports (10-K) for multiple fiscal years in PDF format - These reports contain comprehensive financial data including income statements, balance sheets, cash flow statements, and management discussions - The analysis should focus on year-over-year comparisons to identify meaningful trends - Amazon operates multiple business segments including North America retail, International retail, Amazon Web Services (AWS), advertising, and subscription services Based on the provided Context, extract key financial metrics from each year's reports phrases from the documents, citing them using %[1]%, %[2]%, %[3]%, and for the corresponding passage that supports the response. ## Response Schema: %[1]% (Extracted Financial Metrics) %[2]% (Extracted Financial Metrics) %[3]% (Extracted Financial Metrics) ... """
ユーザーのタスクに基づいて重要な情報を抽出したら、抽出された財務メトリクスを使用して、次に示すように関連する質問に回答できます。
""" ## Task Analyze Amazon's financial reports across multiple years to identify significant performance trends, segment growth patterns, and strategic shifts. {{ extracted financial metrics }} ## Model Instructions: - Organize data chronologically to identify meaningful trends - DO compare segment performance across the five-year period - DO identify significant strategic shifts or investments mentioned in management discussions - DO NOT make speculative predictions beyond what is supported by the data - ALWAYS note any changes in accounting practices or reporting methodologies that might affect year-over-year comparisons ## Response style and format requirements: - Respond in markdown - Structure the analysis with clear headings and subheadings - Present key financial metrics in tabular format showing all five years side-by-side - Include percentage changes year-over-year for all major metrics - Create a section dedicated to visualizing the most significant trends (with descriptions of what would be shown in charts) - Limit the executive summary to 250 words maximum - Format segment analysis as separate sections with consistent metrics across all segments - MUST include a Key Insights bullet-pointed list at the end of each major section