Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
Search
Naoki
December 16, 2024
Technology
790
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
Naoki
December 16, 2024
More Decks by Naoki
See All by Naoki
AWS表彰プログラムとキャリアについて
naoki_0531
1
250
Qiita埋め込み用スライド
naoki_0531
0
28k
Amazon Bedrock、Amazon Auroraを組み合わせたRAGで回答精度の向上に取り組んでみた! 2月6日 Jr.Champions勉強会 -Top Engineers参観回
naoki_0531
1
15k
Amazon Bedrock、Amazon Auroraを組み合わせたRAGで回答精度の向上に取り組んでみた!
naoki_0531
4
550
Agents for Amazon BedrockとAmazon Kendraを活用してRAGを構築してみた!
naoki_0531
5
1.4k
Amazon BedrockとAmazon Kendraで専門知識から回答できる生成系AIサービスを構築!~業務効率化につなげている話~
naoki_0531
0
1k
ChatGPTを活用したAWSコスト削減
naoki_0531
0
270
Other Decks in Technology
See All in Technology
2026 秋 生成AI を活用した論文執筆ガイド/ワークショップ / Fall 2026: Guide and Workshop on Writing Papers Using Generative AI
ks91
PRO
0
100
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
ゲームのリアルタイム通信から見た QUIC と MoQ
segadevtech
0
120
DGX Spark でどこまでハッキングができるのか?
kash1064
2
1.2k
Snapshot Testing in Practice: Predictable and Reliable SwiftUI Views
fespinoza
0
210
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
230
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
350
転んだ話が背中を預ける理由になる / A_story_about_falling_down_gives_you_a_reason_to_watch_each_other_s_backs.pdf
pauli
3
360
AI時代に必要な脅威モデリング― 変化の速度に負けない理解とリスク判断
masakane55
5
1.3k
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
440
【Data Engineering Summit2026_登壇資料】医療ビッグデータ×AIエージェントを支えるデータ基盤とハーネスエンジニアリング
jmdc_presentation
0
140
FactoryBotアンチパターン / factory_bot anti-patterns
toshimaru
0
160
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.2k
Test your architecture with Archunit
thirion
2
2.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
530
The Limits of Empathy - UXLibs8
cassininazir
2
720
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Transcript
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成 株式会社セゾンテクノロジー 石原直樹 1 2024年12月16日color
is【クラウドLT大会vol.12】大型アップデート祭り
自己紹介 2 石原 直樹 (いしはら なおき) 株式会社セゾンテクノロジー : @Ishihara_Naok1 •経歴
2022年当社新卒入社 2023年金融グループ企業のCCoE 2024年生成AI活用プロジェクトリード •主な選出歴 2023 Japan AWS Jr. Champions AWS Community Builder (Machine Learning & Generative AI) 2024 Japan AWS Top Engineers (Machine Learning)
アジェンダ ⚫ RAGとは? ⚫ Amazon Kendra GenAI Indexとは? ⚫ Amazon
Bedrock Knowledge Bases 新旧機能比較 ⚫ 新旧ナレッジベース構築&データ同期手順 ⚫ 新旧ナレッジベース回答評価 ⚫ 追加検証 ⚫ まとめ
RAGとは? 4
• LLMが未学習の情報を外部から取得し、ハルシネーションを抑えて精度の高い回答 を生成する手法 RAGとは? RAGの構成要素 • データソース: 回答に必要な情報を含む文書 • チャンク分割:
テキストを小単位に分割 • 埋め込みモデル: テキストをベクトル化 • ベクターストア: ベクトル検索で関連チャンクを取得 (0.2,0.9…-0.1) ベクターストア ~~~~~ ~~~~~ (0.1,0.7…0.2) (0.5,0.6…0.3) ~~~~~~ ~~~~~~ チャンク分割 ベクトル化 ベクトル化 埋め込み モデル ~~~~~ ~~~~~ ~~~~~ ~~~~~ 検索 (0.2,0.8…-0.1) LLM チャンクを取得 データソース 回答生成 RAG構成図
(0.2,0.9…-0.1) ~~~~~ ~~~~~ (0.1,0.7…0.2) (0.5,0.6…0.3) ~~~~~~ ~~~~~~ チャンク分割 ベクトル化 埋め込み
モデル ~~~~~ ~~~~~ ~~~~~ ~~~~~ (0.2,0.8…-0.1) チャンクを取得 データソース Amazon Bedrock Amazon Bedrock 埋め込みモデル Amazon Bedrock LLM 6 • AWSでは「Amazon Bedrock Knowledge Bases」を利用することで、 RAGを簡単に構築・運用できる。 Amazon Bedrock Knowledge Bases ベクターストア (AWS or 3rd party) AWSでRAGを構築する方法
• AWS re:Invent 2024 で発表されたAmazon KendraのRAG特化機能 • Amazon Bedrock Knowledge
Basesと統合 ※ AWSが提供する全文検索サービス https://www.youtube.com/watch?v=qGzYTg5FIA4 Amazon Kendra GenAI Indexとは? ※
比較項目 Amazon Bedrock Knowledge Bases with vector store (従来の機能) Amazon
Bedrock Knowledge Base with Kendra GenAI Index (新機能) チャンク分割 固定サイズ, チャンキングなし, 階層的, セマンティック AWSマネージドで提供 埋め込みモデル Amazon Titan Embeddings G1 - Text, Amazon Titan Text Embeddings V2, Cohere Embed (英語/多言語) AWSマネージドで提供 ベクターストア Amazon OpenSearch Serverless, Amazon Neptune, Amazon Aurora, Pinecone, Redis Enterprise Cloud, MongoDB Atlas AWSマネージドで提供 検索 ハイブリッド検索, セマンティック検索 ハイブリッド検索 データストア Amazon S3 , Confluence, Microsoft SharePoint, Salesforce, Web Crawler, カスタムデータソース 43種類のソース(SharePoint, OneDrive, Google Drive, Salesforce等) 最低料金 $244.5 $ 230.4 新旧機能の回答を比較し、技術選定時の判断材料にする! Amazon Bedrock Knowledge Bases 新旧機能比較表
新旧ナレッジベース構築&データ同期手順 9
1. Amazon Bedrockサービスコンソールで「オーケストレーション」→「ナレッジベース」を選択 2. 「ナレッジベースを作成」をクリック 3. 「Knowledge Base with vector
store」または「Knowledge Base with Kendra GenAI Index」を選択 Amazon Bedrock Knowledge Bases 構築手順
1. データソースにS3(事前に作成したバケット)を指定 2. 埋め込みモデルにTitan Text Embeddings v2を選択 3. ベクトルストアにAmazon OpenSearch
Serverlessを指定 4. 上記3項目以外は全てデフォルトのまま「作成」を実行 Amazon Bedrock Knowledge Base with vector store 構築手順
作成したナレッジベースの「データソース」からデータソースを選択し「同期」を選択 Amazon Bedrock Knowledge Base with vector store データ同期手順
1. 「Create a new Kendra GenAI Index」を選択し、 2. 他はデフォルト設定でナレッジベースを作成。 Amazon
Bedrock Knowledge Base with Kendra GenAI Index 構築手順
1. ナレッジベース作成後の画面で「Add in Kendra」を選択 3. ナレッジベースの画面に戻り、「同期」を選択 2. Data sourcesで「Amazon S3
Connector」を選択 Data source bucketに作成したS3バケットを設定し、データソースを追加 Amazon Bedrock Knowledge Base with Kendra GenAI Index データ同期手順
新旧ナレッジベース回答評価 15
• LLMを用いてナレッジベースで生成された回答を自動評価することが可能 • 評価項目は正確性・完全性・有用性・論理的一貫性・忠実性などが含まれる • データセットの用意は必要 Amazon Bedrock Knowledge Bases
回答評価機能
• 読み込ませるドキュメント(英語) Amazon Bedrock Documentation User Guide https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html • 評価用データセット(日本語)
AWS公式サイト「Amazon Bedrockのよくある質問」(47問) https://aws.amazon.com/jp/bedrock/faqs/?refid=07e11748-d254-4d68-b9eb-c40a095bfc9d 評価に使用するデータ
ナレッジベース構成 Correctness (正確性) Completeness (完全性) Helpfulness (有用性) Logical coherence (論理的整合性)
Faithfulness (忠実性) vector store 0.59 0.49 0.79 1.00 0.83 Kendra GenAI Index 0.57 0.54 0.79 1.00 0.88 Kendra GenAI Index は忠実性と完全性においてやや優れるが、 RAGにおける重要な指標である正確性ではvector storeが上回っている 評価結果
追加検証 19
Advancedオプションを追加したナレッジベース • Advanced Parsing • 表・画像・グラフなど、様々な情報ソースから生成aiによりテキスト変換 • Advanced Chunking (Semantic
/ Hierarchical) • Semantic Chunking:意味的関連性を基にチャンク分割 • Hierarchical Chunking:階層構造により親チャンク・子チャンクを管理 よって以下設定を追加しナレッジベースをもう一つ作成 • テキスト抽出モデル:「Claude 3.5 Sonnet」 • チャンク戦略:「Hierarchical」 • 親チャンクサイズ:2000 • 子チャンクサイズ:200 ※ 回答精度向上のための高度な設定機能 ※
ナレッジベース構成 Correctness (正確性) Completeness (完全性) Helpfulness (有用性) Logical coherence (論理的整合性)
Faithfulness (忠実性) vector store (ほぼデフォルト) 0.59 0.49 0.79 1.00 0.83 Kendra GenAI Index 0.57 0.54 0.79 1.00 0.88 vector store (Advanced) 0.57 0.53 0.74 0.99 0.78 Advancedオプションを使用したとしても精度が上がるとは限らない 比較結果
• 読み込ませるドキュメントは同じ Amazon Bedrock Documentation User Guide • 評価用データセットは変更 AWS公式サイト「Amazon
Bedrock FAQs 78問」(英語) https://aws.amazon.com/jp/bedrock/faqs/?refid=07e11748-d254-4d68-b9eb-c40a095bfc9d 英語のデータセットを使用したケース
ナレッジベース構成 Correctness (正確性) Completeness (完全性) Helpfulness (有用性) Logical coherence (論理的整合性)
Faithfulness (忠実性) vector store (ほぼデフォルト) 0.53 0.49 0.79 1.00 0.91 Kendra GenAI Index 0.62 0.57 0.8 1.00 0.89 vector store (Advanced) 0.55 0.49 0.79 1.00 0.89 • 評価用データセットを変更したところ、Kendra GenAI Indexの評価が高くなった • RAGに読み込ませるドキュメントは同一でも、評価用データセットに応じて結果は変動する 比較結果(英語のデータセットを使用したケース)
まとめ 24
• Amazon Kendra GenAI Index を使えば、複雑な設定なしでRAGを構築可能 • Amazon Bedrock Knowledge
Bases上で、RAGの評価を手軽に実施できる • 最適なRAG構成は、読み込ませるデータやユースケースに合わせて変化する まとめ →ユースケースごとに適したデータセットを用いて、都度評価することが重要 https://qiita.com/Naoki_Ishihara/items/7de55bb8fe0878b23371