Upgrade to Pro — share decks privately, control downloads, hide ads and more …

いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」

Soh Ohara
March 25, 2025

いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」

今さら聞けない生成AI入門 〜基礎から最新トレンドまで2時間で完全キャッチアップ〜
https://aws.amazon.com/startups/events/generative-ai-basics

にて、発表した資料となります。

参考リンクなど
サンプリングのパラメータ: https://www.promptingguide.ai/jp/introduction/settings
Anthropic - Introduction to Prompt Design
https://docs.anthropic.com/ja/docs/build-with-claude/prompt-engineering/

Advanced RAG 入門: https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/

https://www.anthropic.com/research/building-effective-agents

Soh Ohara

March 25, 2025
Tweet

More Decks by Soh Ohara

Other Decks in Programming

Transcript

  1. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ⽣成 AI を⾼速キャッチアップ Soh Ohara Solutions Architect
  2. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 2 ⾃⼰紹介 尾原 颯 アマゾン ウェブ サービス ジャパン合同会社 ソリューションアーキテクト スタートアップ(⽣成 AI ・ヘルスケア)の お客様中⼼に技術⽀援をしています。 東京⼤学⼯学部機械⼯学科卒業. 学⽣時代は ヘルスケアスタートアップなどにて 機械学習エンジニアインターン ⽝が好きです 著書 @soh_ohara 𝕏
  3. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. この資料は? ⽣成 AI に関する基礎的な概念をキャッチアップするための資料になります。 AWS のサービス紹介などは含まず、⼀般論に寄せています。 3
  4. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. アジェンダ LLMと周辺知識 RAG AI エージェント モデルのカスタマイズ 責任ある AI 4
  5. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. LLMと周辺知識 5
  6. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⼈⼯知能 (Artificial Intelligence, AI) ⼈間の知的判断をコンピュータ上で実現するための技術全般 機械学習 (Machine Learning, ML) 知的モデルを構築するためにデータの中の傾向を学習する技術 深層学習 (Deep Learning, DL) ⾳声・画像認識などのタスクを深い複数レイヤー構造の ニューラルネットワークで実現 ⽣成AI (Generative AI) テラバイト規模のデータで数千億規模のパラメーターのモデルを学習することで、 追加学習なしに⼈間と同等のコンテンツ⽣成能⼒を実現 6 AI、機械学習、深層学習、⽣成 AI 6
  7. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI とは︖ ⽂章・画像・動画・⾳声などを⼊⼒として、 ⽂章・画像・動画・⾳声などを出⼒(⽣成)する AI ⽂章を⼊⼒・出⼒するものが特に主流 7 ⽣成AI モデル ⼊⼒ 出⼒ ⽂章、画像 などのデータ ⽂章、画像 などのデータ
  8. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. LLM・基盤モデル LLM = large language model 基盤モデル = LLM を含む⽣成 AI の実体とされるもの 8
  9. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 教師あり学習の例 9 x = -2, -1, 0, 1, 2, 3, 4 y = -3, -1, 1, 3, 5, 7, 9 y = f(x) = αx + β 興味のある⼈向け
  10. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 教師あり学習の例 10 x = -2, -1, 0, 1, 2, 3, 4 y = -3, -1, 1, 3, 5, 7, 9 y = f(x) = αx + β α と β にはそれぞれどんな数字が⼊るでしょう︖ 興味のある⼈向け
  11. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 学習データ・教師データ 11 x = -2, -1, 0, 1, 2, 3, 4 y = -3, -1, 1, 3, 5, 7, 9 y = f(x) = 2x + 1 学習データ 教師データ 興味のある⼈向け
  12. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 教師あり学習の課題 ラベル付という作業が必要 ラベル付は⼈⼒でやる必要があることが多く、 機械学習モデルを作るために⼗分な量のデータを集めるための ⼯数が莫⼤になることも (例えば、画像分類をやるとしたら数万以上のデータが欲しいケースなどもある) 12 興味のある⼈向け
  13. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⾃⼰教師あり学習 ラベル付けされていないデータから教師データを⾃動的に⽣成し モデルを学習させる⼿法 13 興味のある⼈向け
  14. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⾃⼰教師あり学習 ラベル付けされていないデータから教師データを⾃動的に⽣成し モデルを学習させる⼿法 14 ⼤量のデータを⽤意するのが⽐較的容易になり⼤規 模な学習が可能に 興味のある⼈向け
  15. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⾃⼰教師あり学習 15 花粉症は、主にくしゃみ、⿐⽔、⿐づまり、⽬のかゆみ、 充⾎などが⽣じます。 興味のある⼈向け
  16. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⾃⼰教師あり学習(例) 16 花粉症は、 機械学習モデル 花粉症は、主にくしゃみ、⿐⽔、⿐づまり、⽬のかゆみ、充⾎ などが⽣じます。 ⽂章の続きを ⽣成するよう学習 https://allergyportal.jp/knowledge/hay-fever/ より抜粋 興味のある⼈向け
  17. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 深層学習は脳の情報処理を模倣したもの 17 𝐲 = σ(& 𝒌 𝒘𝟎𝒌 𝒙𝒌 + ⋯ & 𝒌 𝒘𝒊𝒌 𝒙𝒌 … ) … 内包するパラメータが多く、⼤量のデータからパターンを認知することが得意 興味のある⼈向け
  18. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 18 ⾃⼰教師あり学習 深層学習 X ⼤量のデータ (⽂書) 深層学習 モデル ⼤規模⾔語モデル (Large Language Model; LLM) 興味のある⼈向け
  19. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 19 ⾃⼰教師あり学習 深層学習 X ⼤量のデータ (⽂書) 深層学習 モデル ⼤規模⾔語モデル (Large Language Model; LLM) 与えられた⽂章の続きを⽣成するのみ。 指⽰に従った何かに使うことはできない。 興味のある⼈向け
  20. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 20 ⾃⼰教師あり学習 深層学習 X ⼤量のデータ (⽂書) 深層学習 モデル (実⽤に耐える)⼤規模⾔語モデル (Large Language Model; LLM) 指⽰に従った⽂章を⽣成するよう 学習(教師あり学習) Instruction Tuning と呼ばれます 興味のある⼈向け
  21. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 指⽰に従うとは 21 花粉症について説明してください。 ⼤規模⾔語モデル わかりました。花粉症は、主にくしゃみ、⿐⽔、⿐づまり、⽬の かゆみ、充⾎などが⽣じます。 指⽰に従って ⽂章を⽣成
  22. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 指⽰ = プロンプト 22 花粉症について説明してください。 症状のみを箇条書きで列挙してください。 ⼤規模⾔語モデル - くしゃみ - ⿐⽔ - ⿐づまり - ⽬のかゆみ - 充⾎
  23. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. LLM でのサンプリング LLM では、次のトークンを選択する時にすべての語彙に対して どの語彙を⽣成するか︖のスコアを割り振る(候補は 3 万以上) 例︓「こんにちは(0.1)、。(1.1)、朝(1.5)」 このスコアをベースに次に⽣成する単語を選択(=サンプリング)する。 スコアをベースに確率的に選択するアプローチが主流 単語をサンプリングしたら、次に⽣成したい単語のスコアを再度計算して。。の 繰り返し 23
  24. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. サンプリング時のパラメータ 温度(temperature)︓ この値が低いほど、最も確率が⾼い回答が常に選ばれるため、 回答の再現性が⾼い。上げると、ランダム性が増し、より多様で創造的なアウト プットが可能になる。 Top-p、Top-k︓ モデルが応答を⽣成する際に考慮する単語の範囲を限定するためのパラメータ。 ⼩さい→少ない候補(スコアが⾼い候補)から選択 ⼤きい→多くの候補から選択 Top-p(累積確率が p になるまで) Top-k(上位 k 個) 24 https://www.promptingguide.ai/jp/introduction/settings
  25. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. プロンプト&プロンプトエンジニアリング 25 プロンプト ⽣成 AI モデルに⼊⼒するテキスト。Q&A のユースケースであれば質問⽂を含む。 出⼒の品質を左右する重要な要素のひとつ。 プロンプトエンジニアリング ⽣成 AI モデルが所望の結果を返すようなプロンプトを試⾏錯誤すること。 使⽤する⽣成 AI モデルやユースケースによって適切なプロンプトの形式は⼤きく異なる。 https://docs.anthropic.com/ja/docs/build-with-claude/prompt-engineering/ Anthropic - Introduction to Prompt Design
  26. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. トークン 26 トークン、token テキストを⽣成 AI に⼊⼒するために変換 (tokenization) したあとの基本的な単位。 ⼊⼒したテキストがどのようにトークンとして分割されるかは⽣成 AI によって異なる。 ⽣成 AI が扱えるテキストの⻑さは、⽣成 AI が対応するトークン数によって決まる。 This is a pen. This, is, a, pen, . 5 トークン 単語単位でトークン化する例 英語テキストをベースに作成された⽣成 AI の場合、同じ内容のプロンプトでも、 英語と⽐べて⽇本語の⽅がトークン数が多くなる傾向がある。 これはペンです。 これ, は, ペン, で, す, 。 6 トークン
  27. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽇本語と英語でのトークン⻑の違い ⽇本語︓3378 トークン 27 英語︓2213 トークン Amazon Bedrock FAQ の「General」カテゴリーページに記載されている⽂章を題材に計測
  28. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. コンテキスト⻑(context length) LLM が次のトークンを⽣成する時に考慮できる最⼤⻑ (先程のサンプリングで計算したスコアを出すために考慮できる⽂章⻑) 28
  29. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. マルチモーダル テキスト ⾳声 動画 画像 etc. これらの形式の違う⼊⼒を2つ以上受け付けることをマルチモーダルという 29
  30. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ハルシネーション 30 ⽣成AI モデル 「2 x 3 は︖」 「4 です。」 「愛知県の⼈⼝は何⼈︖」 「500万⼈です。」 (実際は 2024年12⽉時点で746万⼈) 愛知県HPより ⽣成 AI が「もっともらしい嘘」をついてしまう現象。 嘘の例 • 論理的に間違った答えを導いてしまう • 事実とは異なることを答える
  31. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. プロンプトテクニック例 In-context learning (few-shot prompting) プロンプトの中でいくつか例を⽰すことで LLM に任せたいタスクの概要を⽰す Chain-of-Thought(後述) 31
  32. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ここまでで触れた単語(LLMと周辺知識) ⽣成 AI LLM・基盤モデル 教師あり学習・⾃⼰教師あり学習 Instruction Tuning Temperature・Top-p・Top-k プロンプト・プロンプトエンジニアリング トークン コンテキスト⻑さ(context window) マルチモーダル ハルシネーション In-context learning 32
  33. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. RAG 33
  34. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. RAG; Retrieval Augumented Generation (検索拡張⽣成) 34 ⽣成 AI モデル ユーザー アプリ ① クエリ(問い合わせ⽂) ⑤ 回答 ⑥ 回答 ④ クエリ+ドキュメント データベース ③ 関連ドキュメント ② クエリ ユーザーからの問い合わせに対して ⽂書検索エンジンなどから関連情報を検索し、 取得された関連情報も含めてモデルに⼊⼒し回答を得ること “今年新しく”発表された ⽣成AIの教育現場活⽤についての 論⽂の動向を教えてください 「今年発表された論⽂は、 OOのものが多いです。」 2022 2024 2025 2025
  35. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ベクトル検索 35 椅⼦ .951 ソファー .930 ベッド .802 テレビ .311 スマホ .013 タブレット .014 ゴリラ .021 イルカ .001 シャチ .002 連邦国家 .010 共和国 .009 たき⽕のそばに座るのにち ょうどいい場所は︖ ソファー 椅⼦ ベッド 共和国 連邦国家 シャチ イルカ ゴリラ テレビ スマホ タブレット • ⼊⼒語句に対して類似度の⾼い⽂章・語句を検索する 質問⽂をベクトル化・類似度算出して 各語句との類似度を0〜1の数値で表現 https://pages.awscloud.com/rs/112-TZM-766/images/AWS-Black-Belt_2024_Amazon-Bedrock-Knowledge-Bases_0920_v1.pdf
  36. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ベクトル検索の原理 36 ⾮構造化データ (⽂書、画像、⾳声、動画) を ベクトルとして扱う 類似したベクトル = 類似したアイテム ベクトル間の距離や⾓度に 基づいて関連度を判断する 検索⼿法 お気に⼊りの楽曲 気に⼊る 可能性が⾼い曲 Amazon Music: レコメンデーション https://pages.awscloud.com/rs/112-TZM-766/images/AWS-Black-Belt_2024_Amazon-Bedrock-Knowledge-Bases_0920_v1.pdf
  37. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. RAG の基本的な流れ (ベクトル DB を利⽤する場合) 37 チャンク チャンク チャンク チャンク チャンク チャンク チャンク チャンク ドキュメント ベクトル データベース 埋め込みモデル テキスト ⽣成モデル データ取り込み 検索 + テキスト⽣成 ユーザー クエリ クエリ 類似チャンク 分割 ベクトル化 保管 検索 プロンプト https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  38. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. チャンキング ⽂章などを検索の単位まで分割すること。 分割の単位は 128 トークンとか 1024 トークンなど、トークン数でカウント (注意︓ここでのトークン数は埋め込みモデルにとってのトークン数であり、 LLM にとってのトークン数とは別物で) 38
  39. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Embedding (埋め込み) ある特定のテキストや画像などのデータをベクトルに変換すること 39 埋め込みモデル 「鯖」 [0, 0.1, …, -1.0] 「美味しい⻘⿂は︖」 [0.3, -0.2, …, 5.0]
  40. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. RAG の改善アプローチ : 検索の⾼度化 40 チャンク チャンク チャンク チャンク チャンク チャンク チャンク チャンク ドキュメント 埋め込みモデル テキスト ⽣成モデル データ取り込み 検索 + テキスト⽣成 ユーザー クエリ クエリ 類似チャンク 分割 ベクトル化 保管 検索 プロンプト ベクトル データベース モデルの 性能は⼗分︖ 必要なドキュメ ントは収集でき ている︖ タスクに合った 埋め込みモデルを選 定している︖ • 検索結果にクエリと関係ないチャンクが含まれている ▷ 誤った情報によるハルシネーション • 回答に必要なチャンクが検索し切れていない ▷ 不⼗分なコンテキストによるハルシネーション ❶ 検索システムにどうデータを⼊れるか ❷ 検索前処理 : 検索クエリのカスタマイズ ❸ 検索エンジンのアルゴリズム変更 ❹ 検索後処理 : 検索結果のフィルタリング https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  41. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Advanced RAG ⼿法による精度改善の事例 41 Source: A Survey of Techniques for Maximizing LLM Performance – OpenAI Dev Day 2023 45% 65% 85% 98% 回答の正確さ (%) Naïve RAG チャンク/埋め込み の試⾏錯誤 • リランキング • カテゴリ分類 • プロンプトエンジニアリング • Function calling (tool use) • クエリ拡張 https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  42. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Advanced RAG の⼿法 42 ⼩ ⼤ 追加レイテンシー・コスト 開発コスト・難易度 まずはここから チャンクサイズ調整 ドキュメントパースの改善 メタデータによるフィルタ ハイブリッド検索 ⾼度な Retrieval リランキング クエリ書き換え Small-to-big Retrieval ファインチューニング 埋め込みモデルの微調整 テキスト⽣成モデルの微調整 エージェント クエリ計画 クエリルーティング マルチドキュメントエージェント Graph RAG (参考) Building Production-Ready RAG Applications: Jerry Liu https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  43. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. リランキング ベクトル検索やキーワード検索等の1次検索後に、別の機械学習モデルを利⽤してそれらの候補 をリランキングする。より関連度の⾼い候補を選定できる。 • Cohere のリランカーは多⾔語対応で API や SageMaker JumpStart から利⽤可能 • その他リランキングモデルを⾃分でホストすることも可能 • LLM でのリランキングも可能 43 https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  44. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. クエリ書き換え ⾃然⾔語で⼊⼒されたクエリを LLM で検索に適したクエリに変換する • 簡潔で明快な表現への書き換え • 複雑なクエリを単純な複数のクエリ (サブクエリ) に分割 • タイポ修正・類義語追加 44 RRR (Rewrite-retrieve-read): Ma et al., “Query rewriting for retrieval-augmented large language models” など Cohere Command-R+ Knowledge Bases for Amazon Bedrock https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  45. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Small-to-Big Retrieval (階層チャンク) 45 中間の層は、既存のFMを活⽤し、独⾃のデータによりFMのカスタマ イズを⾏い、⼤⼿クラウドプロバイダーのセキュリティと機能を利⽤して ⽣成AIアプリケーションを構築したい、そしてこれらすべてを1つのマ ネージドサービスとして提供してほしいと考えるお客様のためのもので す。Amazon Bedrockは同層を発明し、ファーストパーティおよび サードパーティーのFMからなる幅広い選択肢と、⽣成AIビルダーがよ り⾼品質のモデルをすばやく構築するための使いやすい機能により、 ⽣成AIアプリケーションをきわめて容易に構築・拡張する⽅法をお客 様に提供します。Amazon Bedrockは好調なスタートを切り、わず か数か⽉で数万⼈のアクティブ顧客を獲得しました。チームは Amazon Bedrockにおいて迅速な反復を続けており、最近では ガードレール(アプリケーションが回答する質問を保護)、ナレッジ ベース(検索拡張⽣成(RAG)とリアルタイムクエリによりモデルの ナレッジベースを拡張)、エージェント(マルチステップのタスクを完 了)、微調整(継続的なモデルの教育と改良)を提供しており、こ れらすべてがお客様のアプリケーションの品質を向上させています。 「Amazon Bedrockの主な特徴と、そ れがどのように企業の⽣成 AIアプリケー ション開発を⽀援しているのか説明して ください。」 類似度検索 LLM への ⼊⼒ Source: アンディ・ジャシーCEOによる2023 Letter to Shareholders • ⽂レベルでチャンクを検索し、LLM への⼊⼒ は前後のウィンドウを含める • Amazon Bedrock Knowledge Baseで ネイティブにサポート https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  46. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. データの結びつき (connectedness) 複数の異なるドキュメントに散らばった データを検索するのは困難 内容の詳細さ (Specificity) 埋め込まれた (embedded) 表現は 重要な詳細に⽋けることがある 説明性 (Explainability) ベクトル検索では検索結果の根拠を説明 することが難しい https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  47. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ナレッジグラフ (Property Graph) とは • ノード間をリレーションシップ (エッジ) で結ぶ形でデータを持つ • ノードやリレーションシップは プロパティで特徴づけられる • ドキュメントからグラフを構築する⼿法は 様々あるが、LLM にグラフを作らせること も可能 • 2024年2⽉のマイクロソフトの論⽂でグ ラフの階層的なコミュニティ (トピック) 構造ごとに要約を⽣成する⼿ 法が提案され、話題に https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  48. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Graph RAG [arXiv: 2404.16130] on AWS 48 ドキュメント LlamaIndex Amazon Neptune コミュニティ A (トピック A) コミュニティ B (トピック B) 階層的なコミュニティ構造の例 (ニュース記事のデータセットの場合) C0: 世界政治、テクノロジー、スポーツ C1: ⽶中関係、欧州連合、中東情勢 C2: 貿易交渉、技術競争、外交会談 C3: 関税引き上げの影響、交渉の結果 ユーザー 各コミュニティの要約 に基づいた 中間の回答 (map) 関連度の⾼い中間 回答に基づいた 最終回答 (reduce) 質問 LLM LLM グラフ構築 *グローバルサーチの場合。 ローカルサーチでは質問と関連するノードの周辺情報を⽤いる。 https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  49. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Graph RAG の利点と注意点 • Graph RAG ではグラフ構造でデータを保持するのに加えて、コミュニティ (トピック) の階層ごとに要約を保持することで幅広い質問に対応可能 • ドメインをまたがった質問、関連する事象の探索 • 異なるトピックの共通のパターンを認識 • 関連するトピックの列挙 • 注意点 • グラフ構築時に多数の LLM 呼び出しが発⽣しコストがかかる • 直接的な質問「XX について教えて」は従来の RAG が優れているという報告も 49 https://aws.amazon.com/jp/blogs/news/a-practical-guide-to-improve-rag-systems-with-advanced-rag-on-aws/
  50. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ここまでで触れた単語(RAG) RAG ベクトル検索 チャンキング Embedding (埋め込み) Advanced RAG リランキング クエリ置き換え Small-to-Big Retrieval (階層チャンク) ナレッジグラフ Graph RAG 50
  51. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AI エージェント周り 51
  52. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. AI エージェント ユーザーからの問い合わせに対して、 ⾃律的に計画を⽴ててタスクを完遂する 52
  53. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 53 ⽣成 AI モデル ユーザー 来週以降で天気の良い⽇に 1泊2⽇の旅館を予約して。 ツール群(環境) 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 01
  54. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 54 ⽣成 AI モデル ユーザー 来週以降で天気の良い⽇に 1泊2⽇の旅館を予約して。 ツール群(環境) 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール ユーザーからのリクエストからまずは天気 の良い⽇を調べよう。 今⽇が2025/01/14なので、 2025/01/21以降で調べよう。 02 01
  55. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 55 ⽣成 AI モデル ユーザー 来週以降で天気の良い⽇に 1泊2⽇の旅館を予約して。 ツール群(環境) 旅館空き状況取得ツール 旅館予約ツール ユーザーからのリクエストからまずは天気 の良い⽇を調べよう。 今⽇が2025/01/14なので、 2025/01/21以降で調べよう。 2025年01⽉21⽇以降の 1週間天気予報を取得。 03 02 01 天気予報取得ツール
  56. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 56 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 2025年01⽉21⽇以降の 1週間天気予報を取得。 04 ツール群(環境)
  57. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 57 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 2025年01⽉21⽇以降の 1週間天気予報を取得。 2025/01/22: 曇り 2025/01/23: 晴れ 2025/01/24: 晴れ … 04 05 ツール群(環境)
  58. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 58 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 01⽉23⽇-24⽇が⽇程的に良さそう この⽇程で、空き状況を取得しよう。 06 ツール群(環境)
  59. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 59 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 01⽉23⽇-24⽇が⽇程的に良さそう この⽇程で、空き状況を取得しよう。 2025年01⽉23-24⽇で 空きのある旅館を取得 06 07 ツール群(環境)
  60. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 60 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 空きのある旅館 - 旅館 A - 旅館 B 08 ツール群(環境)
  61. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 61 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 空きのある旅館⼀覧を取得できた。 どの旅館が良いかユーザーに確かめよう 空きのある旅館 - 旅館 A - 旅館 B 09 08 ツール群(環境)
  62. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 62 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 空きのある旅館⼀覧を取得できた。 どの旅館が良いかユーザーに確かめよう 空きのある旅館 - 旅館 A - 旅館 B 旅館 A と旅館 B に空きがあり ました。 どちらの旅館にしますか︖ 09 10 08 ツール群(環境)
  63. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 63 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 空きのある旅館⼀覧を取得できた。 どの旅館が良いかユーザーに確かめよう 空きのある旅館 - 旅館 A - 旅館 B 旅館 A と旅館 B に空きがあり ました。 どちらの旅館にしますか︖ 旅館 A でお願いします 09 11 10 08 ツール群(環境)
  64. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 64 ⽣成 AI モデル ユーザー ツール群 天気予報取得ツール 旅館空き状況取得ツール 旅館 A でリクエストが来たので、旅館 A で予約しよう。 旅館 A でお願いします 11 12 ツール群(環境) 旅館予約ツール
  65. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 65 ⽣成 AI モデル ユーザー ツール群 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 旅館 A でリクエストが来たので、旅館 A で予約しよう。 予約リクエスト 旅館 A 2025年01⽉23-24⽇ 旅館 A でお願いします 13 11 12 ツール群(環境)
  66. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 66 ⽣成 AI モデル ユーザー ツール群 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 旅館 A でリクエストが来たので、旅館 A で予約しよう。 予約リクエスト 旅館 A 2025年01⽉23-24⽇ 旅館 A でお願いします 13 11 12 予約が完了しました。 14 ツール群(環境)
  67. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽣成 AI エージェント ユーザーからの問い合わせに対して、⾃律的に計画を⽴ててタスクを完遂する 67 ⽣成 AI モデル ユーザー 天気予報取得ツール 旅館空き状況取得ツール 旅館予約ツール 旅館 A で、 2025年01⽉23-24⽇の ⽇程で予約が完了しました。 15 ツール群(環境) 複数ステップにわたって、⽣成 AI が⾃律的に考えながら ユーザーから問い合わせを受けた旅館予約タスクを完了
  68. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. もう少し抽象化すると 68 環境 ⽣成 AI モデル (エージェント) ユーザー アクション フィードバック ストップ https://www.anthropic.com/research/building-effective-agents をベースに作成 ⽣成 AI モデル(LLM)と環境とのインタラクションを通じて、 複雑なタスクを(⾃律的に)完遂する。
  69. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Tool Use (Function Calling) OpenAPI 形式などで定義したツール⼀覧情報を与えると、 スキーマに即した形でのリクエストを整形して戻す機能 69 { "name": "get_ticket_status", "description": """既存のチケットのステータスを取得する""", "parameters": { "customer_id": { "description": "⼀意の顧客識別⼦", "required": True, "type": "string" }, "ticket_id": { "description": "⼀意のチケット識別⼦", "required": False, "type": "string" } } }, { “name”: “create_ticket”… ID345のチケットの 現状を教えてください。 ⽣成 AI モデル わかりました。 ID345 のチケットの ステータスを確認します。 { "name": "get_ticket_status", "parameters": { "customer_id": 1 "ticket_id": 345 } } もらったリクエスト内容から 外部ツールを呼び出す 外部ツール 呼び出し
  70. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. reasoning いくつかの研究から、LLMにいきなり結論を出させるよりも うまいこと「考えさせる」テクニックを使うことで、より深い思考をさせることができる ことがわかってきている。 LLM が持つ論理推論能⼒を引き出すためのプロンプトテクニック 70 https://arxiv.org/abs/2210.03629 ReAct: 次のアクションを考える時に理由も同時に考えさせる Self-Consistency: LLMに複数回考えさせて、それらの結果をマージする https://arxiv.org/abs/2203.11171 Chain-of-Thought (CoT) : ステップバイステップで考えさせる。(ステップバイステップで考えましょう) https://arxiv.org/abs/2201.11903
  71. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. reasoning reasoning に特化した形でカスタマイズされたモデル (特段指定をしなくても思考過程を詳細に記載してくれる) 例︓OpenAI o1、DeepSeek-R1 71
  72. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. なぜ reasoning が⼤事なのか︖ LLMがエージェントとして、タスクの計画・理解をするためには ⾼度な推論能⼒(reasoning)が必要とになる 72 https://www.anthropic.com/research/building-effective-agents
  73. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. LLM に中間的な推論ステップを⽣成させることで、論理的推論能⼒が向上 モデル⼊⼒ Q: ロジャーは🎾を5個持っている。2⽸の🎾を買い⾜した。 1⽸には3個の🎾が⼊ってる。今、彼は合計で何個の🎾を持ってる︖ A: ロジャーは🎾を最初5個持っていた。3個⼊り x 2⽸分 (6個) 🎾を買い⾜した。 5 + 6 = 11で、答えは11個。 Q: カフェテリアに🍏が23個あった。そのうち20個をランチの準備に使い、 新たに6個買い⾜した。今、カフェテリアに🍏は何個︖ モデル出⼒ A: カフェテリアには最初🍏が23個。ランチの準備に20個使った。 よって23 - 20 = 3個に。6個買い⾜し、3 + 6 = 9個。答えは9個。 Chain-of-Thought (CoT) [arXiv:2201.11903]
  74. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. “Let‘s think step by step” (「ステップバイステップで考えよう」) と⾔うだけ モデル⼊⼒︓ Q: ジョンは16個のフルーツを買いたい。 フルーツの半分はリンゴで、その半分は🍏にする。🍏は何個︖ A: ステップバイステップで考えよう。 モデル出⼒︓ フルーツは全部で16個。 フルーツの半分がリンゴ、つまりリンゴは8個。 リンゴの半分が🍏、つまり🍏は4個。 Zero-shot CoT [arXiv:2205.11916]
  75. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 複数経路の推論を⾏いそれらの回答から最終的な結果を導く ジャネットの🪿は1⽇に16個の🥚を産む。彼⼥は毎朝3個を朝⾷に⾷べ、 毎⽇4個を使って友⼈のためにマフィンを焼く。残りの🥚は1個2ドルで売る。 彼⼥は毎⽇いくら稼げる︖ • 彼⼥は16 - 3 - 4 = 9個の🥚が残る。∴ 1⽇に2ドル × 9 = 18ドル稼ぐ。 • 彼⼥は残りの卵を2ドル × (16 - 4 - 3) = 26ドルで売ることになる。 • 彼⼥は朝⾷に3個⾷べ、16 - 3 = 13個が残る。次にマフィンを焼き、13 - 4 = 9個の卵が 残る。∴ 9個の卵 × 2ドル = 18ドル ⇒ 答えは18ドル Multi-path CoT with Self-consistency [arXiv:2203.11171]
  76. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ⽊構造のような思考プロセスにより解を探索 Tree of thought (ToT) [arXiv:2305.08291, arXiv:2305.10601] ToT 論⽂ [arXiv:2305.10601] より
  77. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. マルチエージェント The greatest improvements in the productive powers of labor, and most of the skill, dexterity, and judgment with which it is directed or applied, seem to be results of the division of labor. 意訳︓労働の⽣産性を⼤きく向上させ、また労働を効果的に導き 活⽤するための技能や熟練、判断⼒の多くは、 分業(労働の分業化)によってもたらされているように思われる。 シングルエージェント vs マルチエージェント 77 アダム・スミス「国富論」より AI エージェントでも、1つのエージェントに全てをやらせるよりも 分業体制をしくことで全体としての⽣産性や成果物の品質を ⼤きく向上できる期待がある (スイッチングコストの削減、専⾨性の特化など) https://arxiv.org/abs/2309.07864
  78. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. マルチエージェントの種類 • 異なる専⾨性を持ったエージェントでの分業体制(左) • 複数のペルソナを持たせて敵対的に協調をさせるスタイル(右) 78 https://arxiv.org/abs/2309.07864
  79. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Hierarchical collaboration アプローチ 79 Supervisor Agent Sub Agent -1 Sub Agent -2 Sub Agent -4 Sub Agent -3 Hierarchical • Agents は⽊構造のエージェントネットワークで上下の 関係を形成 • Supervisor Agent (⽊構造の Root Agent) は エンドユーザーと対話してメモリを形成 • Sub Agents を持つ Agent は、割り当てられた Task を Sub Task へ分解して委任し、結果を集約する責 任を持つ • 単⼀ Agent 同様、Sub Agents を持つ Agent もツ ールや KB へのアクセスが可能 KB = Knowledge Base(ナレッジベース)
  80. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Agentic Workflow エージェントに⾃ら考えてもらうが、 タスクのステップなどはある程度ガイドを⾏う 例︓ 1. 「Xというトピックについてのエッセイのアウトラインを書いて」 2. 「web 検索が必要︖」 3. 「最初のドラフトを書いて。」 4. 「どの部分で書き直しや追加の調査が必要か考えて」 エージェントとワークフローとの組み合わせ 80 https://www.youtube.com/watch?v=sal78ACtGTc
  81. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ここまでで触れた単語(AI エージェント) ⽣成 AI エージェント 環境 Tool Use (Function Calling) reasoning Chain-of-Thought (CoT) Zero-shot CoT Multi-path CoT with Self-consistency Tree of thought (ToT) マルチエージェント Hierarchical collaboration アプローチ Agentic Workflow 81
  82. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. モデルのカスタマイズ 82
  83. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. いつファインチューニングするべきか 13B の Swallow 、 7B の ELYZA は 128 件以上のデータで要約タスクにお いて Claud 2.1 より⾼いスコアに到達 久保 隆宏, 呉 和仁, 前川 泰毅 (2024). 質問回答データセットを⽤いた Prompt Tuning から Fine Tuning への移⾏時期推定. ⾔語処理学会第30回年次⼤会 併設ワークショップ (JLR2024) ü ⼩さなモデルでもタスク特化でフ ァインチューニングすれば⼤きな モデル以上の性能を発揮する可能 性がある ü ⻑いプロンプトが不要になるため 推論レイテンシーが削減されリク エストあたりのコストも低下 ü ホスティングの場合、⼀定のリク エスト数があれば API モデルより も低コスト 要約データセットでファインチューニングした際の精度⽐較
  84. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 多数の プロンプト 教師モデルからの 応答 蒸留モデル ⾼性能な 教師モデルで 推論 軽量な ⽣徒モデルで 学習 蒸留(distillation) ⾼性能な教師モデルの振る舞いを真似するよう、軽量な⽣徒モデルを学習させる。 特定のユースケースでは軽量モデルで⾼性能なモデル相当の性能を発揮するように Fine-tuning するアプローチ
  85. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ここまでで触れた単語(ファインチューニング) 蒸留 85
  86. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 責任ある AI 86
  87. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 87 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T1-03.pdf
  88. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. AI セキュリティで活⽤できるフレームワークの例 # 出典 フレームワーク 概要 URL ⼤まかな分類 1 AWS The Generative AI Security Scoping Matrix ⽣成 AI 利⽤のスコーピング毎に必要な考慮 点が整理されたもの こちら (Tech) Non-Tech 2 AWS AWS Cloud Adoption Framework for Artificial Intelligence, Machine Learning, and Generative AI AI、ML、⽣成 AI ユースケースにおいて、 ⼊⼒ / モデル / 出⼒に対し 7 つのセキュリ ティの基礎的な能⼒について整理されたもの こちら Tech Non-Tech 3 NIST Artificial Intelligence Risk Management Framework (AI RMF 1.0) AI に特化したリスク管理フレームワークで あり、各管理策に対する Playbook なども整 理されている こちら Non-Tech 4 ISO ISO/IEC 42001:2023 AI に関するリスクを回避するための要件や リスクが⽣じた場合の対応を含む信頼性の⾼ いマネジメントシステムを構築するために活 ⽤が想定される こちら Non-Tech 5 OWASP OWASP Top10 for LLM Applications LLM アプリケーションに特化した10の脆弱 性に対して具体的な脅威と緩和戦略が記載さ れている 原⽂ 和訳 Tech 6 MITRE MITRE ATLAS MITRE ATT&CK の観点をベースに⽣成 AI アプリケーションへの攻撃の戦術や技術また は⼿法の観点で脅威を分類するフレームワー ク こちら Tech 88 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  89. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. OWASP Top 10 for LLM Applications Version 1.1 LLM09 過度の信頼 LLMに過度に依存したシス テムや⼈々は、誤った情報、 誤ったコミュニケーション、 法的問題、セキュリティの 脆弱性に直⾯する可能性が あります LLM10 モデルの盗難 独⾃のLLMモデルへの不正 アクセス、コピー、または 流出により経済的損失、競 争上の優位性の低下、機密 情報へのアクセスの可能性 があります LLM06 機微情報の 漏えい LLMは、その応答の中で不 注意に機密データを暴露す る可能性があり、不正な データアクセス、プライバ シー侵害、セキュリティ侵 害につながります LLM07 安全が確認され ていないプラグ イン設計 LLMプラグインが悪⽤され、 リモート・コード実⾏のよ うな結果をもたらす可能性 があります LLM08 過剰な代理⾏為 LLMベースのシステムは、 意図しない結果を招く動作 をすることがあります LLM03 訓練データの 汚染 LLM の訓練データが改ざん され、セキュリティ、有効 性、倫理的⾏動を損なうよ うな脆弱性やバイアスなど が LLM に含まれた状態とな ります LLM01 プロンプト インジェクション 巧妙な⼊⼒によって⼤規模 ⾔語モデル(LLM)を操作 し、LLMが意図しない動作 を引き起こします LLM02 安全が確認され ていない出⼒ ハンドリング LLM の出⼒が精査されずに 受け⼊れられ、バックエン ドシステムに影響を与えま す LLM04 モデルの DoS LLM上でリソースを⼤量に 消費する操作を引き起こす ことで、サービスの低下や ⾼コストをもたらします LLM05 サプライチェーン の脆弱性 LLMアプリケーションのラ イフサイクルは、脆弱なコ ンポーネントやサービスに よって侵害される可能性が あり、セキュリティ攻撃に つながります 89 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf 注 最新版は v.2025 で更新されている
  90. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Version 1.1 と Version 2025 との対応関係(独⾃に整理) https://aws.amazon.com/jp/blogs/news/secure-gen-ai-applications-on-aws-refer-to-owasp-top-10-for-llm-applications/
  91. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. OWASP Top 10 for LLM Applications の歩き⽅ Description 脆弱性の概要が説明されています Common Example of Vulnerability 脆弱性の⼀般的な例が説明されています Prevention and Mitigation Strategies 脆弱性に対する予防・緩和戦略が整理されています Example Attack Senarios 具体的な攻撃シナリオの例が⽰されています Version 1.1 91 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  92. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. LLM01 : プロンプトインジェクション a.直接的なプロンプトインジェクション (Jailbreak) b.間接的なプロンプトインジェクション 悪意あるプロンプト 悪意あるプロンプトを 含んだデータ 巧妙な⼊⼒によって⼤規模な⾔語モデル(LLM)を操作し、LLM が意図しない動作を引き起こします。 直接的な注⼊はシステムのプロンプトを上書きし、間接的な注⼊は外部ソースからの⼊⼒を操作するものです。 攻撃者 LLM アプリケーション LLM ユーザー LLM アプリケーション LLM 攻撃者 RAG ⽤データ 悪意あるプロンプトが動作 92 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  93. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. LLM01 : プロンプトインジェクション - 予防・緩和戦略 ü LLM のバックエンドシステムへのアクセスに特権コントロールを導⼊ ü アクションが実⾏される前に、⼈による判断をいれる(Human in the loop) ü 外部コンテンツをユーザープロンプトから分離する ü LLM を信頼されないユーザーとして扱い、外部ソース、拡張可能な機能との間 の信頼境界を確⽴する 確実な防⽌策はないが、以下の対策によりプロンプトインジェク ションの影響を軽減することができる 93 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  94. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 参考︓プロンプトインジェクションを試してみる https://gandalf.lakera.ai/intro 攻撃者に扮して、プロンプトインジェクションを⾏い秘密のパスコードを⼿にいれる 94 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  95. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. LLM09 : 過度の信頼 著作権の問題 組織の信頼の低下 不正確な情報を応答 誤解を招くような コンテンツの作成 脆弱なコードの利⽤ 安全でない、あるいは⽋ 陥のあるコードを提案 ⼗分監督されていないLLMに過度に依存したシステムや⼈々は、LLMが⽣成したコンテンツが不正確または 不適切なものである場合、誤った情報、誤ったコミュニケーション、法的問題、セキュリティの脆弱性に直⾯ する可能性があります。 LLM アプリケーション LLM ユーザー 95 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  96. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. LLM09 : 過度の信頼 - 予防・緩和戦略 ü 出⼒を定期的にモニターしテストする ü 検証レイヤーを追加する(例︓LLM の出⼒を信頼できる外部の情報源と照合する) ü ファインチューニングやエンベディングでモデルを強化する ü LLM の使⽤に伴うリスクと限界を伝える ü コンテンツのフィルタリングや不正確な可能性に関するユーザーへの警告 LLM アプリケーション LLM ユーザー 96 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  97. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ü ⽣成 AI アプリケーションの初回利⽤時に利⽤規定や注意事項を表⽰させる ü 利⽤者が注意事項に同意した後にアプリケーションを利⽤できるようにし、 利⽤者が同意したことをログに記録する ü 利⽤者に⽣成 AI 利⽤に関する e-learning を受講させる ü ⽣成 AI の利⽤ガイドラインを作成する (例︓https://www.jdla.org/document/) ⽣成 AI アプリ利⽤者の安全利⽤に関する Tips 97 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  98. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 以下を⼀部加筆修正 https://owasp.org/www-project-top-10-for-large-language-model-applications/llm-top-10-governance-doc/LLM_AI_Security_and_Governance_Checklist-v1_1_JP.pdf#page=24 LLM アプリ全体像 学習データ LLM サービス アプリ プラグイン 外部サービス ユーザ 98 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  99. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. 以下を⼀部加筆修正 https://owasp.org/www-project-top-10-for-large-language-model-applications/llm-top-10-governance-doc/LLM_AI_Security_and_Governance_Checklist-v1_1_JP.pdf#page=24 LLM アプリ全体像 学習データ LLM サービス アプリ プラグイン 外部サービス ユーザ 脅威は LLM アプリケーション全体 に潜んでるため、 リスクベースで対応策を検討していくことが重要 99 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T2-03.pdf
  100. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 100 https://pages.awscloud.com/rs/112-TZM-766/images/aws-ai-day-1031-AI-T1-03.pdf https://aws.amazon.com/jp/ai/responsible-ai/
  101. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 責任ある AI を行うためのパーツ例 • ガードレール • モデル評価 • バイアスと説明可能性 • Human in the loop • ガバナンス 101 https://aws.amazon.com/jp/ai/responsible-ai/
  102. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ガードレール ユーザーからの⼊⼒や、⽣成 AI からの出⼒が 事前に定めたポリシーに沿っているかを検閲する。 102 ⽣成 AI モデル ユーザー ガードレール ガードレール この⽣成 AI モデルからの出⼒は、ユーザーの 気分を害する恐れがあるので、 ユーザーへの表⽰はやめよう。
  103. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. モデル・⽣成 AI アプリケーションの評価 サービスの品質や出⼒の公平性・透明性などを確保するためには モデルや⽣成 AI アプリケーション全体における end-to-endでの評価を⾏うことが必要不可⽋ 評価を⾏うための⼊⼒(と出⼒のセット)を⽤意することが⼤切 データの例︓通常の⼊⼒・プロンプトインジェクション・ポリシーに反した⼊⼒ (LLM に合成してもらうというアプローチもある) 103
  104. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. 参考︓プロンプトエンジニアリングの流れ 104 初期プロンプト を作る ケースに対してプ ロンプトをテスト する プロンプトを 改善する プロンプトの 完成! エッジケースも忘れずに 評価する 評価セットに 対するテスト テストケース を作る 実験と反復 この流れが⾮常に⼤切です︕
  105. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. モデル評価の指標例 Accuracy: LLMの基本的な性能評価指標 Ethicality: プライバシー保護、誤情報削減、公平性、透明性に関する評価 Fairness: 個⼈や集団の属性によらない公平な出⼒の評価 Generalization: 未知のデータへの適応能⼒の評価 Robustness: エラーや操作、敵対的攻撃への耐性評価 Reasoning: 論理的推論や演繹能⼒の評価 105 https://arxiv.org/abs/2404.09135
  106. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. LLM-as-a-Judge モデルの出⼒内容を LLM に⾏わせる 主観的プログラムでの定量評価が難しいケースなどで使われる 106 プロンプト例 与えられた要約⽂と原⽂を⾒⽐べて、下記観点で該当箇所ごとに評価を⾏ってください。 <points> - 原⽂に書かれていないことが書かれている: -20点 - 要約の内容に⼀貫性がある: +10点 - 「⽣成 AI のことをよく知らない⾮技術者」向けに専⾨⽤語を噛み砕いて使っている: +10点 </points>
  107. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. RAGでの評価指標例 107 Answer Semantic Similarity (回答の意味的な 類似性) ⽣成された答えと正解の意味的な類似性の評価です。この評価は正解と答えに 基づいており、0から1の範囲の値をとります。より⾼いスコアは、⽣成され た答えと正解の間の⼀致度が⾼いことを⽰します。 (≒どれだけ正解に近いことを回答したか) Answer Relevance (回答の関連性) ⽣成された回答が与えられたプロンプトに関連性があるかどうかを評価します。 回答が不完全、もしくは冗⻑な情報を含む場合はスコアが低くなり、関連性が ⾼いほど⾼いスコアがつけられます。質問、コンテキスト、回答を使って計算 されます。 (≒質問に対しての答えになっているか) Context Recall (コンテキストの 適合) 取得されたコンテキストが正解と⼀致する程度を測定します。これは真の答え と取得されたコンテキストに基づいて計算され、値の範囲は0から1の間で、 値が⾼いほど性能が良いことを⽰します。 (≒検索結果の精度) Faithfulness (忠実さ) ⽣成された回答が与えられたコンテキストと⼀致する程度を測定します。回答 と取得したコンテキストから計算されます。回答は(0,1)の範囲にスケーリン グされ、値が⾼いほど良いです。 (≒検索結果を使って忠実に回答したか)
  108. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Human in the Loop ⽣成 AI アプリケーションのフローの中に⼈間による評価を⼊れ込むアプローチ どこで挟むか︖ • エンドユーザーに出⼒を表⽰する前の検閲 • LLM からの出⼒を評価して、改善のためのデータとする • ⽣成 AI アプリで⾃動対応できなかった事例に対するマニュアルを追加する 108
  109. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Human in the loop の例 109 https://aws.amazon.com/jp/blogs/news/aws-summit-japan-2024-generative-ai-demo-for-process-manufacturing/
  110. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. ここまでで触れた単語(責任ある AI) OWASP Top 10 for LLM Applications プロンプトインジェクション 過度の信頼 ガードレール モデル評価 LLM-as-a-Judge Human in the Loop 110
  111. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Confidential and Trademark. Thank you! © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.