規制産業におけるLLMの幻覚問題を克服:Artificial Geniusの決定論的モデルがAmazon Novaで提供
規制業界におけるLLMのハルシネーション問題に対し、Artificial GeniusはAmazon NovaとSageMaker AIを活用し、入力は確率的な理解を出力は決定論的な検証層で処理するハイブリッドアーキテクチャを提供し、安全なエンタープライズ採用を可能にする。
キーポイント
規制業界におけるLLM採用の障壁
金融・医療などの厳格な規制下では、ハルシネーションによる不確実性が監査可能性と再現性を損ない、ミッションクリティカルシステムへの採用を阻害している。
第3世代ハイブリッドアーキテクチャ
確率的なコンテキスト理解(入力処理)と決定論的な出力検証を分離する設計により、生成モデルの流暢さと事実正確性の両立を目指す。
標準生成モデルの数学的限界への対応
外挿によるハルシネーションを防ぐため、モデルを生成用途ではなく補間(interpolative)用途に限定して活用し、入力情報の解釈みに特化する。
AWS環境との統合実装
Amazon SageMaker AIとAmazon Novaを活用し、エンタープライズレベルの監査可能かつ再現可能な実装をISVパートナー経由で提供している。
影響分析・編集コメントを表示
影響分析
本記事は、金融・医療などの厳格な規制下にある業界において、LLMの確率的性質がもたらすハルシネーションをどう実務レベルで解決するかという現実的な課題に答えている。決定論的検証層を付加するハイブリッドアーキテクチャは、生成AIの信頼性を担保しつつ実装コストを抑える現実的な解決策として、多くのエンタープライズに採用基準を見直すきっかけを与えるだろう。
編集コメント
AWSパートナー社による技術ブログではあるが、生成AIの「確率性」と「決定論」をアーキテクチャレベルで分離する設計思想は、実務導入における信頼性確保の標準パターンとして今後広く参照されるだろう。ハルシネーション対策をプロンプトエンジニアリングの範疇を超え、システム設計段階で解決する方向性は業界の次のステップを示している。
*この投稿は、Artificial Genius の Paul Burchard と Igor Halperin によって共同執筆されました。*
大規模言語モデル(LLM)の普及は、金融サービスや医療といった厳格な規制業界において、大きなパラドックスを提示しています。これらのモデルが複雑で構造化されていない情報を処理する能力は、分析、コンプライアンス、リスク管理において変革的な可能性をもたらします。しかし、その本質的に確率的な性質は、「ハルシネーション(幻覚)」と呼ばれる、説得力はあるが事実に反する情報の生成につながります。
監査可能性と正確性に対する厳格な要件に支配される業界では、標準的な生成 AI の非決定的な振る舞いは、ミッションクリティカルなシステムへの導入における障壁となっています。銀行や病院にとって、決定論的であることは単なる目標ではなく、結果は正確で、関連性があり、再現可能でなければなりません。
本稿では、AWS ISV パートナーの Artificial Genius が、Amazon SageMaker AI と Amazon Nova を活用してこの課題をどのように解決しているかをご紹介できることを嬉しく思います。彼らは第 3 世代の言語モデルを導入することで、入力に対しては確率的でありながら出力に対しては決定論的となるソリューションを提供し、安全でエンタープライズグレードな採用を可能にしています。
このソリューションを理解するために、AI がどのように進化してきたかを見てみましょう:
- 第1世代(1950年代):研究者は記号論理を用いて、決定論的かつルールベースのモデルを構築しました。安全性は高いものの、流暢さに欠け、スケーラビリティも不足していました。
- 第2世代(1980年代~現在):確率モデルへの転換(トランスフォーマーアーキテクチャに至る過程)により、驚異的な流暢性が実現されました。しかし、これらのモデルは確率に基づいて次のトークンを予測するため、設計によって排除が困難な無制限の失敗モード(ハルシネーション)に悩まされています。
- 第3世代(Artificial Geniusのアプローチ):古いものを置き換える新たな世代ではなく、記号論理の硬直性と確率モデルの不確実性の中間にあるハイブリッドアーキテクチャへと移行しています。このアプローチでは、Amazon Nova の生成力を用いて文脈を理解しつつ、決定論的なレイヤーを適用して出力を検証・生成します。これは流暢さと事実性の収束点です。
解決策:生成に対する逆説的なアプローチ
標準的な生成モデルから幻覚(ハルシネーション)を防止することは数学的に困難です。なぜなら、外挿的・生成的プロセスそのものが誤りを引き起こすためです。アーティフィシャル・ジニアスはこの課題に対し、モデルを厳密に非生成的に使用することで対応します。このパラダイムでは、モデルが学習した膨大な確率情報は、入力に対して補間的(interpolative)にのみ利用されます。これにより、モデルは情報を回答する際に確率に依存することなく、ある情報や質問が表現される無数の方法を理解できるようになります。この第3世代の能力を実現するために、アーティフィシャル・ジニアスは SageMaker AI を用いて、Amazon Nova ベースモデルに対して特定の形式のインストラクションチューニング(instruction tuning)を施します。
この特許取得済みの手法は、出力確率を効果的に排除します。標準的な解決策では、*温度*(temperature)パラメータをゼロに下げることで決定論的(deterministic)な動作を保とうとしますが、これはしばしば核心的な幻覚問題の解決に至りません。一方、アーティフィシャル・ジニアスはモデルに対してポストトレーニング(post-training)を行い、次トークン予測の対数確率(log-probabilities)を絶対値 1 または 0 に傾けるように調整します。この微調整(fine-tuning)により、モデルに「存在しない答えをでっち上げるな」という単一のシステム指示に従わせることが強制されます。
これにより、数学的な抜け道が生まれます。モデルはデータに対する天才レベルの理解力を保持したまま、金融や医療分野に必要な安全性プロファイルで動作することが可能になります。
RAG を超えて
検索拡張生成(RAG)は精度に対する解決策として頻繁に引用されますが、依然として生成プロセスであり、後続のクエリに関連しない可能性のある固定されたベクトル埋め込みを作成します。第 3 世代のアプローチは、入力テキストとユーザークエリの両方を統合された埋め込みに効果的に埋め込むことで RAG を改善します。これにより、データ処理が特定の質問に本質的に関連していることが保証され、標準的なベクトル検索手法よりも高い忠実度と関連性を提供します。
エージェント型ワークフローによる価値の提供
企業が非構造化データの価値を最大化できるよう支援するため、Artificial Genius はこのモデルを業界標準のエージェント型クライアントサーバープラットフォームにパッケージ化し、AWS Marketplace を通じて利用可能です。
第 2 世代のエージェントはワークフローで連鎖させることでエラーが複合化するリスクがありますが、この第 3 世代モデルの固有の信頼性により、複雑で高忠実度の自動化が可能になります。これらのワークフローを作成するために使用されるプロンプトは、製品要件定義書(PRD)の構造に従っています。この構造を通じて、AI エンジニアではないドメイン専門家であっても、自然言語でクエリを策定しながら出力に対して厳格な制御を維持することができます。
本製品はさらに、ワークフロー仕様に対する自由形式のプロンプト入力も提供しています。この目的のために、特に自由形式のプロンプトを PRD 形式に変換する能力に特化した Amazon Nova Premier モデルが使用されます。Nova Premier は生成モデルであり、その出力を検証するために人間がループに参加する必要がありますが、これはエージェント型ワークフローにおける唯一の人間のチェックポイントです。
非生成クエリの定義
ここで採用されている核心的な数学的な抜け道は、生成モデルを厳密に非生成として使用することです。つまり、このモデルは確率を用いて回答の次のトークンを推測するのではなく、入力コンテキストに基づいて情報を抽出または検証します。日付や名前などの短い回答は明らかに非生成的ですが、長いシーケンスも決定論的に出力することが可能です。例えば、以前の回答を正当化するために文書からの直接引用を求めることは、非生成タスクとなります。以下に、Artificial Genius がこれらの対話をどのように構造化するかを示す例を挙げます(ハルシネーション防止指示を含むシステムプロンプトは、以下の JSON 転送には表示されていません):
回答可能で非生成的な短回答:
[ { "role": "user", "content": [{"text": "文書:財務業績は第 3 四半期を通じて堅調でした。当社の収益は前年比 15% 成長しました...質問:年間収益成長率は何ですか?回答:"}], }, { "role": "assistant", "content": [{"text": "15%"}] } ]
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
回答可能、非生成型、長文回答、追跡質問
[
{
"role": "user",
"content": [{"text": "ドキュメント:財務成績は第 3 四半期を通じて堅調でした。当社の収益は、エンタープライズセグメントでの堅調な販売を背景に、前年比で 15% 成長しました。質問:年間収益成長率が 15% であることを示すドキュメントからの引用を提供してください。回答:"}],
},
{
"role": "assistant",
"content: [{"text": '"Our revenue grew by 15% year-over-year, driven by robust sales in the enterprise segment.'"}],
}
]
JSON
// 回答不可能な短文回答の例
[
{
"role": "user",
"content": [{"text": "ドキュメント:財務成績は第 3 四半期を通じて堅調でした。当社の収益は、エンタープライズセグメントでの堅調な販売を背景に、前年比で 15% 成長しました。質問:今年の CEO のボーナスはいくらですか?回答:"}],
},
{
"role": "assistant",
"content: [{"text": "不明"}],
}
]
これらは単なる例示です。第 3 世代の言語モデル製品は、実用的な自然言語処理(NLP)ニーズを満たす非生成型クエリを構築する方法を理解するためのレシピと共に提供されます。この理解に基づき、SageMaker AI 上で Amazon Nova を用いた非生成型ファインチューニングパイプラインの技術的実装について探っていきましょう。
AWS リファレンスアーキテクチャ

前節の図に示されたアーキテクチャは、ファウンデーションモデルのカスタマイズに向けた簡素化されたアプローチを採用しています。モデル学習には SageMaker Training jobs を、デプロイには Amazon Bedrock を利用します。
- データストレージ:トレーニングデータ(合成 Q&A)は Amazon Simple Storage Service (Amazon S3) に保存されます。
- トレーニング:SageMaker Training jobs が計算リソースをプロビジョニングし、教師あり微調整(SFT: supervised fine-tuning)手法を用いた指示微調整によって Nova ベースモデルのファインチューニングを行います。
- デプロイ:ファインチューニングされたモデルは、カスタムモデル作成機能を使用して Amazon Bedrock にインポートされます。
- 推論:アプリケーションは、Amazon Bedrock エンドポイントを通じてモデルと対話します。オンデマンド推論機能(on-demand inference)を活用してカスタムモデルを作成することで、安全かつスケーラブルなループを確保します。
この設計により、開発上の懸念事項と本番環境での推論が分離されつつ、明確なデータ系譜が維持されます。これは金融サービスにおける監査証跡にとって不可欠な要素です。
技術的実装:非生成型ファインチューニングのためのステップバイステップガイド
前述の通り、第 3 世代言語モデルの構築には以下の手順が必要です:
- これは第2世代のファウンデーションモデルから始まります。最初のタスクは、適切なベースモデルを選択することです。後ほどご覧になる通り、Amazon Nova ファミリーには、このベースとして理想的な候補が含まれています。
- ベースモデルは、「答えをでっち上げるな」という単一のシステム指示に従うようにポストトレーニングする必要があります。もちろん、これまでに多くの人が試みてきましたが、数学的な観点から理解されているのは、これは非生成型の質問に対してのみ可能だということです。したがって、実用的なレベルで、どのような種類の質問が生成型であり、どの種類が非生成型であるかを理解することが重要です。
- ポストトレーニングによって言語モデルに汎用能力が付与されるため、その成功は、この汎用能力を十分に活用する高品質かつ多様なデータセットの構築に大きく依存します。Artificial Genius は、回答可能な質問と不可能な質問の両方を含む、独自の合成非生成型 Q&A 生成器を開発しました。この合成データ生成器は、エンタープライズ顧客によって作成されるカスタマイズされた第3世代言語モデル構築の基盤となります。
- 最後に、SageMaker AI は、最終モデルを効率的に生産するためのコスト効果が高く能力のあるポストトレーニングプラットフォームを提供しており、これについては後ほど詳細に解説します。
では、これらのステップをより詳しく見ていきましょう。
適切な基盤モデルの選択
第3世代の言語モデルを構築するにあたり、私たちは信頼性と安全性に焦点を当てる必要があります。異なるユースケースのために構築された一部の基盤モデルには、他の機能があり、それが邪魔をして非生成用途には適さなくなることがあります。
重要な例として、チャットアシスタントとしての利用に最適化されている基盤モデルがあります。これらは、冗長で論じすぎた回答ではなく、簡潔な回答を提供するように説得することが難しくなる要因となります。このような傾向を修正するには、ハルシネーション(幻覚)防止の指示に従うこと以上の追加的なポストトレーニングが必要になる場合があります。Amazon Nova モデルファミリーは、パフォーマンス、コスト効率、速度の強力なバランスのために設計されており、エンタープライズアプリケーションに理想的な候補です。Nova ファミリー内では、Nova Lite モデルは本質的にきめ細やかで簡潔な回答を提供する傾向があります。したがって、この目的には Nova Lite が理想的なベースモデルとなります。
もう一つの関連する最近の進展は、第 2 世代言語モデルへの推論後機能の追加であり、これらはしばしば思考連鎖(Chain of Thought)または強化学習手法に基づいています。これらの機能には有用性がありますが、非生成型の第 3 世代モデルの作成を妨げる要因となります。例えば、思考連鎖を含む DeepSeek/Llama3 モデルにこの手法を適用する際、これらの追加機能をオフにするために、トレーニングデータにモデル内部のトークンを直接含めるプロンプトインジェクションを行う必要がありました。幸いにも、Amazon Nova Lite には推論後機能は含まれていません。
事後学習における指示追従タスクの設計
事後学習(SFT など)を適用してベースモデルを訓練し、システムプロンプトに含まれる反ハルシネーション指示に従うようにすることができます。この指示の例としては、「質問がドキュメントから回答できない場合は、『不明』と答える」といったものが挙げられます。
これが自明に思えるなら——過去にも何度も試されてきたことですが——覚えておいてください。この一見して自明なアイデアは、生成モデルを厳密に非生成型として使用するという、自明ではない逆説的な数学的原理と組み合わさって初めて機能するのです。
高品質で幻覚を抑制するポストトレーニングデータの構築
Artificial Genius は、モデルが非生成型の多様な質問に対して正しく回答するか、あるいは回答を拒否する能力を訓練するために設計された独自合成型・非生成型 Q&A ジェネレータを開発しました。この Artificial Genius の合成 Q&A ジェネレータは、金融分野における Q&A の合成生成に関する先行研究に基づいて構築されていますが、純粋に非生成型の Q&A を最大限多様に生成することに焦点を当てており、入力テキスト・質問・回答の多様性の次元を数倍に拡大しています。このタスクに適した合成 Q&A ジェネレータを構築することは、大きなエンジニアリング課題です。しかし、Artificial Genius の合成 Q&A ジェネレータを基盤とすることで、顧客固有のポストトレーニングタスクと組み合わせることで、カスタマイズされた第 3 世代言語モデルを作成することが可能になります。
推論後の思考連鎖(CoT)の克服
思考連鎖(Chain-of-thought、以下 CoT)は、最終的な回答に至る前にモデルに中間的な段階ごとの推論を生成させることで、複雑な推論タスクにおける大規模言語モデル(LLM)のパフォーマンスを向上させるプロンプト手法です。しばしば有益である一方で、初期の deepseek-ai/DeepSeek-R1-Distill-Llama-8B モデルに内在する CoT に似た振る舞いが逆効果となることを発見しました。このモデルは、必要な簡潔で事実に基づく出力ではなく、冗長で非決定的な推論ステップを生成し、回答可能な質問だけでなく、回答不可能な質問に対しても延々と推論を試みるという問題を引き起こしました。
これを解決するため、チームは新しいプロンプトメタインジェクション手法を開発しました。このアプローチでは、トレーニングデータを再構成してモデルの CoT プロセスを事前に終了させるものです。前述の例と同じ JSON 形式を用い、データは以下のように構造化されました:
// CoT を回避するためのプロンプト注入の例
[
{
"role": "user",
"content": [{"text": "ドキュメント:財務成績は第 3 四半期を通じて堅調でした。当社の収益は、エンタープライズセグメントでの堅調な販売を背景に、前年比で 15% 成長しました。質問:年間収益成長率はいくらか?回答:"}],
},
{
"role": "assistant",
"content": [{"text": "15%"}]
}
]
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms など) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
各トレーニング例において、モデルの内部利用のみを意図した token を正解の直前に挿入することで、モデルは自身の内部プロセスの完了を最終的な正しい出力の開始に直接関連付けることを学習しました。これにより、推論時に不要な冗長な推論が短絡され、モデルが望ましい決定論的答えのみを生成するように強制されました。
この手法は、データ形式をツールとして用いてモデルの生来的な行動を制御し形成する強力な例です。
最高パフォーマンスのための Amazon Nova のファインチューニング
ハルシネーション防止タスクに選択された SFT(Supervised Fine-Tuning)技術は Low-Rank Adaptation (LoRA) です。これは、基盤モデルの言語理解能力を最も忠実に保持しつつ、単にパラメータ化されたアダプターをその上に配置する手法だからです。ベースモデルのパラメータを直接変更する他のファインチューニング手法では、この能力が低下するリスクがあります。SFT に関する研究文献でよく知られているように、克服すべき最大の障壁は過学習の回避です。LoRA ベースの SFT で過学習を防ぐための多くの技術が存在し、これらは SageMaker AI に含まれるファインチューニングレシピによってサポートされています。
- 正則化:これは過学習を防ぐ最も一般的な手法です。LoRA SFT の SageMaker レシピでは、1 つの正則化手法である LoRA dropout がサポートされています。研究文献によると最適な値は約 50% のドロップアウトであり、実験によってこの値の最適性が確認されています。
- パラメータ削減:これは過学習を回避するための brute force(力任せ)な方法ですが、代わりにアンダーフィッティング(未学習)のリスクがあるという欠点があります。LoRA SFT の SageMaker レシピでは、LoRA alpha パラメータを減らすことで LoRA rank を削減する 1 つのパラメータ削減手法がサポートされています。この場合、このパラメータを減らしてもアンダーフィッティングが悪化するだけで過学習の抑制には役立たないため、効果はありません。私たちの目標は汎用能力の構築であるため、パラメータ数を可能な限り高く保つことが最善であり、削減すべきではありません。
- 早期停止:多くの場合、トレーニング初期には検証エラーが改善しますが、あるステップを過ぎると過学習が始まり、トレーニングエラーは低下する一方で検証エラーが再び上昇します。SageMaker AI は自動的な早期停止をサポートしていませんが、より長いトレーニング実行における検証エラーの推移を確認し、検証エラーが最小化される時点までエポック数を手動で制限することで、手動で実施することができます。これは SageMaker AI が各エポックごとに返す検証エラーの時系列データを用いて実現できます。
- 訓練データの量と多様性の増加:目標は汎用能力の構築、つまりハルシネーション(幻覚)の回避であるため、訓練データの量と多様性が大きければ大きいほど、モデルが特定の訓練データに過学習する可能性は低くなります。訓練データは合成生成されるため、必要に応じて組み合わせ的(すなわち指数関数的)な量の異なる訓練例を生成することが可能です。この最後の手法はこの汎用タスクにおいて最も効果的ですが、十分な量と多様性の訓練データへのスケーリング能力を確保するために、合成データ生成器の慎重な構築が必要です。
これらすべての技術を組み合わせる——50% の LoRA dropout 正則化、意図しないアンダーフィッティングを避けるために LoRA パラメータ数を最小化するのではなく最大化する、より長い実行からの検証指標を追跡して行う手動による早期停止、そして訓練データの規模を増やすこと——
原文を表示
*This post is cowritten by Paul Burchard and Igor Halperin from Artificial Genius.*
The proliferation of large language models (LLMs) presents a significant paradox for highly regulated industries like financial services and healthcare. The ability of these models to process complex, unstructured information offers transformative potential for analytics, compliance, and risk management. However, their inherent probabilistic nature leads to *hallucinations*, plausible but factually incorrect information.
In sectors governed by stringent requirements for auditability and accuracy, the non-deterministic behavior of standard generative AI is a barrier to adoption in mission-critical systems. For a bank or a hospital, determinism isn’t only a goal; the outcomes must be accurate, relevant, and reproducible.
In this post, we’re excited to showcase how AWS ISV Partner Artificial Genius is using Amazon SageMaker AI and Amazon Nova to solve this challenge. By introducing a third generation of language models, they’re delivering a solution that is probabilistic on input but deterministic on output, helping to enable safe, enterprise-grade adoption.
To understand the solution, let’s look at how AI has evolved:
- First generation (1950s): Researchers used symbolic logic to build deterministic, rule-based models. While safe, these models lacked fluency and could not scale.
- Second generation (1980s–present): The shift to probabilistic models (culminating in the Transformer architecture) unlocked incredible fluency. However, because these models predict the next token based on probability, they suffer from unbounded failure modes (hallucinations) that are difficult to engineer away.
- Third generation (the Artificial Genius approach): Rather than a new generation that replaces the old, we’re moving from the rigidity of symbolic logic and the unpredictability of probabilistic models toward a hybrid architecture. This approach uses the generative power of Amazon Nova to understand context but applies a deterministic layer to verify and produce output. It’s the convergence of fluency and factuality.
The solution: A paradoxical approach to generation
It’s mathematically difficult to prevent standard generative models from hallucinating because the extrapolative, generative process itself causes errors. Artificial Genius addresses this by using the model strictly non-generatively. In this paradigm, the vast probability information learned by the model is used only interpolatively on the input. This allows the model to comprehend the innumerable ways a piece of information or a question can be expressed without relying on probability to generate the answer. To create this third-generation capability, Artificial Genius uses SageMaker AI to perform a specific form of instruction tuning on Amazon Nova base models.
This patented method effectively removes the output probabilities. While standard solutions attempt to ensure determinism by lowering the *temperature* to zero (which often fails to address the core hallucination issue), Artificial Genius post-trains the model to tilt log-probabilities of next-token predictions toward absolute ones or zeros. This fine-tuning forces the model to follow a single system instruction: don’t make up answers that don’t exist.
This creates a mathematical loophole where the model retains its genius-level understanding of data but operates with the safety profile required for finance and healthcare.
Going beyond RAG
Retrieval Augmented Generation (RAG) is frequently cited as the solution to accuracy, but it remains a generative process and creates fixed vector embeddings that might not be relevant to subsequent queries. The third-generation approach improves upon RAG by effectively embedding the input text and the user query into a unified embedding. This helps ensure that the data processing is inherently relevant to the specific question asked, delivering higher fidelity and relevance than standard vector retrieval methods.
Delivering value using agentic workflows
To help enterprises maximize the value of their unstructured data, Artificial Genius packages this model into an industry-standard agentic client-server platform, available through AWS Marketplace.
Unlike second-generation agents, which risk compounding errors when strung together in workflows, the inherent reliability of this third-generation model allows for complex, high-fidelity automation. The prompts used to create these workflows follow the structure of a product requirements document (PRD). Through this structure, domain experts—who might not be AI engineers—can formulate queries in natural language while maintaining strict control over the output.
The product additionally offers free-form prompting of the workflow specification. For this purpose, the Amazon Nova Premier model, which is especially capable of translating free-form prompts into PRD format, is used. Although Nova Premier is a generative model, which requires a human-in-the-loop to check its output, this is the only human checkpoint in the agentic workflow.
Defining the non-generative query
The core mathematical loophole employed here is using a generative model strictly non-generatively. This means the model doesn’t use probabilities to guess the next token of an answer, but rather extracts or verifies information based solely on the input context. While short answers (such as dates or names) are obviously non-generative, it’s also possible to output long sequences deterministically. For example, asking for a direct quote from a document to justify a previous answer is a non-generative task. The following are examples of how Artificial Genius structures these interactions (the system prompt containing anti-hallucination instructions isn’t shown in these JSON turns):
Answerable, non-generative short answer:
[
{
"role": "user",
"content": [{"text": "Document: Financial performance remained strong through the third quarter. Our revenue grew by 15% year-over-year... Question: What was the annual revenue growth? Answer:"}],
},
{
"role": "assistant",
"content": [{"text": "15%"}]
}
]Answerable, non-generative, long-answer, follow-up question
[
{
“role”: “user”,
“content”: [{“text”: “Document: Financial performance remained strong through the third quarter. Our revenue grew by 15% year-over-year, driven by robust sales in the enterprise segment. Question: Provide a quote from the document showing that the annual revenue growth was 15%. Answer:”}],
},
{
“role”: “assistant”,
“content: [{“text”: ‘”Our revenue grew by 15% year-over-year, driven by robust sales in the enterprise segment.’’}],
}
]
JSON
// Example of an unanswerable, short-answer question
[
{
“role”: “user”,
“content”: [{“text”: “Document: Financial performance remained strong through the third quarter. Our revenue grew by 15% year-over-year, driven by robust sales in the enterprise segment. Question: What was the CEO’s bonus this year? Answer:”}],
},
{
“role”: “assistant”,
“content: [{“text”: “Unknown”}],
}
]These are only illustrative examples. The third-generation language model products will be delivered with recipes to assist with understanding how to construct non-generative queries to meet all practical natural language processing needs. With this understanding, let’s explore the technical implementation of building a non-generative fine-tuning pipeline using Amazon Nova on SageMaker AI.
AWS Reference Architecture

The architecture shown in the preceding diagram uses a streamlined approach to customizing foundation models. It uses SageMaker Training jobs for model training and Amazon Bedrock for deployment.
- Data storage: Training data (synthetic Q&A) is stored in Amazon Simple Storage Service (Amazon S3).
- Training: SageMaker Training jobs provision compute resources to fine tune the Nova base model using the instruction tuning with supervised fine-tuning (SFT) method.
- Deployment: The fine-tuned model is imported into Amazon Bedrock using the create custom model feature.
- Inference: Applications interact with the model through Amazon Bedrock endpoints using the on-demand inference feature of Amazon Bedrock to create a custom model, helping to ensure a secure, scalable loop.
This design separates development concerns from production inference while maintaining clear data lineage—essential for audit trails in financial services.
Technical implementation: A step-by-step guide for non-generative fine-tuning
As indicated previously, the construction of a third-generation language model involves the following steps:
- It starts with a second-generation foundation model. The first task is to select a good base model. As you will see, the Amazon Nova family includes ideal candidates to serve as this base.
- The base model must be post-trained to follow a single system instruction: Do not make up answers. Of course, many people have tried this before, but now we understand from mathematics that this is only possible for non-generative questions. So, it’s important to understand, on a practical level, what types of questions are generative and which are non-generative.
- Because the post-training gives the language model a general-purpose capability, its success is critically dependent on the construction of a high-quality, highly diverse data set that fully exercises this general capability. Artificial Genius has produced a proprietary synthetic, non-generative Q&A generator, that includes both answerable and unanswerable questions. This synthetic data generator will be the foundation of any customized third-generation language model builds produced by enterprise customers.
- Finally, SageMaker AI offers a cost-effective and capable post-training platform that enables the efficient production of final models, which will be explored in detail.
Let’s go through these steps in more detail.
Choosing the right foundation model
In building a third-generation language model, we want to focus on reliability and safety. Some foundation models, built for different use cases, have other capabilities that distract and make them less suitable for non-generative use.
An important example is that some foundation models are optimized for use as chat assistants, which can make it difficult to persuade them to provide concise instead of verbose and discursive answers. Correcting such a tendency can require additional post-training beyond following the non-hallucination instruction. The Amazon Nova family of models is designed for a strong balance of performance, cost-efficiency, and speed, making them ideal candidates for enterprise applications, and within the Nova family, the Nova Lite model is naturally inclined to provide crisp and concise answers. Nova Lite therefore makes an ideal base model for this purpose.
Another relevant recent development is the addition of post-inference features to second-generation language models, often based on chain of thought (CoT) or on reinforcement learning methods. These features, while they have utility, interfere with the creation of a non-generative third-generation model. For example, when applying this methodology to the DeepSeek/Llama3 model, which includes chain of thought, it was necessary to perform prompt injection by including the model’s internal `` tokens directly in the training data to shut off these extra features. Fortunately, Amazon Nova Lite doesn’t have any post-inference features.
Designing a post-training instruction-following task
Post-training, such as SFT, can then be applied to the base model, to train it to follow an anti-hallucination instruction included in the system prompt. This instruction could be, for example: If the Question cannot be answered from the Document, then answer “Unknown” instead.
If this sounds obvious—it has been tried many times before—remember that this seemingly obvious idea only works in combination with the non-obvious, counterintuitive mathematical principle of using the generative model in a strictly non-generative way.
Building high quality, anti-hallucinatory post-training data
Artificial Genius has created a proprietary synthetic, non-generative Q&A generator that’s designed to exercise the model’s ability to correctly answer or refuse to answer a great variety of non-generative questions. Artificial Genius’s synthetic Q&A generator builds on previous research into synthetic generation of Q&A for the financial domain, but focuses on producing the greatest variety of purely non-generative Q&A and expanding by multiples the dimensions of diversity of the input text, questions, and answers. Constructing a suitable synthetic Q&A generator for this task is a significant engineering endeavor. But with Artificial Genius’s synthetic Q&A generator as a base, customer-specific post-training tasks can be combined with it to create customized, third-generation language models.
Overcoming the post inference CoT
Chain-of-thought (CoT) is a prompting technique that improves LLM performance on complex reasoning tasks by encouraging the model to generate intermediate, step-by-step reasoning before arriving at a final answer. While often beneficial, we discovered that an innate CoT-like behavior in the initial deepseek-ai/DeepSeek-R1-Distill-Llama-8B model was counterproductive. It generated verbose, non-deterministic reasoning steps instead of the required concise, factual outputs, and it caused the model to attempt lengthy excursions of reasoning to answer every question, even those that were unanswerable. To solve this, the team developed a novel prompt meta-injection technique. This approach involves reformatting the training data to preemptively terminate the model’s CoT process. Using the same JSON format as the previous examples, the data was structured as follows:
// Example of prompt injection to circumvent CoT
[
{
“role”: “user”,
“content”: [{“text”: “Document: Financial performance remained strong through the third quarter. Our revenue grew by 15% year-over-year, driven by robust sales in the enterprise segment. Question: What was the annual revenue growth? Answer: ”}],
},
{
“role”: “assistant”,
“content: [{“text”: “15%”}],
}
]By injecting the `` token—intended only for internal use by the model—immediately before the ground-truth answer in every training example, the model learned to associate the completion of its internal process directly with the start of the final, correct output. This effectively short-circuited the unwanted verbose reasoning at inference time, forcing the model to produce only the desired deterministic answer.
This technique is a powerful example of using data format as a tool to control and shape a model’s innate behavior.
Fine tuning Amazon Nova for peak performance
The SFT technique chosen for the non-hallucination task is Low-Rank Adaptation (LoRA) because it most faithfully preserves the language comprehension of a foundation model, merely placing a parameterized adapter on top. Other fine-tuning methods, which directly change parameters of the base model, risk degrading this capability. As is well known in the research literature on SFT, the biggest hurdle to overcome is avoiding overfitting. There are many techniques to avoid overfitting with LoRA-based SFT, which are supported by the fine-tuning recipes provided within SageMaker AI:
- Regularization: This is the most general method to prevent overfitting. The SageMaker recipes for LoRA SFT have support for one regularization method: LoRA dropout. The research literature suggests that the optimal value is about 50% dropout, and experiments confirm the optimality of that value.
- Parameter reduction: This is a brute force way of avoiding overfitting, but with the downside of risking underfitting instead. The SageMaker recipes for LoRA SFT support one parameter reduction method, reducing the LoRA rank by reducing the LoRA alpha parameter. In this case, it doesn’t help to reduce this parameter because doing so underfits more than it reduces overfitting. Because our goal is to create a general-purpose capability, it’s best to keep the raw parameter count as high as possible, not reduce it.
- Early stopping: Often the training will initially improve the validation error, but after some steps, it will start overfitting, with the training error going down but the validation error going back up. Although SageMaker AI doesn’t support automatic early stopping, you can perform it manually by checking the course of the validation error on a longer, overfitting training run, and then manually limiting the number of epochs to the point where the validation error is minimized. This can be accomplished using the time series of validation errors for each epoch returned by SageMaker AI.
- Increased quantity and diversity of training data: Because the objective is to train a general-purpose capability, that is, avoid hallucination, the greater the quantity and diversity of the training data, the less the model has a chance to overfit on the specific data it’s trained on. Because the training data is synthetically generated, combinatorial (that is, exponential) amounts of distinct training examples can be produced as needed. This last method is the most effective for this general-purpose task but requires careful construction of the synthetic data generator to help ensure the ability to scale to sufficient quantity and diversity of training data.
Putting together all of these techniques—50% LoRA dropout regularization, maximizing instead of minimizing the number of LoRA parameter, to avoid unintentional underfitting, manual early stopping based on tracking the validation metrics from a longer run, and increasing the size of th
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み