Skip to Content
生成AIデザインパターン
book

生成AIデザインパターン

by Valliappa Lakshmanan, Hannes Hapke
October 2025
Beginner to intermediate
508 pages
8h 1m
Japanese
O'Reilly Media, Inc.
Content preview from 生成AIデザインパターン

第3章. 知識を加える:ベース

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

基盤モデルは、トレーニングデータによって制限されるクローズドシステム 。多くの場合、基盤モデルに追加情報を与える必要がある。例えば、その情報は、基盤モデルのトレーニング時には発生していなかった最近の出来事をベースモデルにしていたり、その情報が機密情報であったり、基盤モデルのトレーナーにとって利用できないものであったりする。

LLMに知識を追加して再トレーニングを行ったり、基礎モデルに知識を追加するために継続的な事前トレーニング(CPT)を行ったりすることは非現実的である。1回のトレーニングにかかるコストでさえ大きい。また、情報の変化は非常に速いため、CPTは頻繁に行わなければならない。これらのコストは、数千万ドルに上ることもある、1そのため、通常は基盤モデルをそのまま使用し、実行時に知識を追加することを望むだろう。

実行時に基盤モデルに追加情報を提供するために使われる重要なパターンは、 、フェイスブックAIリサーチ(現在はMetaの一部)で働く研究者たちによって2020年に発表された画期的な論文「Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks」で紹介された。RAG(検索拡張生成)は、基盤モデルを、トレーニングデータによって制限されるクローズドなシステムから、オンデマンドで外部の知識を活用できるオープンなシステムへとトランスフォーマー化する。

Diagram showing the progression and interconnection of RAG system patterns including Basic RAG, Semantic Indexing, Indexing at Scale, Index-aware Retrieval, Node Postprocessing, Trustworthy Generation, and Deep Search, with considerations for demos, internal tools, and external products.
図3-1. 第3章と 第4章のパターンは互いに構築されている

RAGは、3つのステップ(索引付け、検索、生成)からなる構成要素として考えるのが最適であり、デプロイする必要があるが、その構成要素はかなりカスタマイズ可能である。そのため、本書の他の章とは異なり、自分の問題に最も適したパターンを選ぶのではなく、本章のすべてのパターンを順番に読むことを推奨する(図3-1参照)。

本章のパターンは、高度化する要件を処理するために使用できる機能を追加しながら、互いに構築し合っている。ボックスはパターンであり、矢印は、洗練度を上げて次のパターンに進む理由を示している。たとえば、無関係なコンテンツや曖昧さなどを処理する必要がある場合は、パターン9からパターン10に進むことができる。

とはいえ、システムを構築するために、ここで紹介するすべてのアイデアが必要になるわけではない。どれが必要かは、あなたのシステムが何のためにあるのかによって変わってくる。(専門家向けの社内ツールなのか、それとも何百万人もの顧客が使う製品なのか)。また、本章のアイデアで扱われる問題が、RAGシステムが遭遇する質問やドキュメントのタイプに関連しているかどうかにもよる。

パターン 6: 基本的な RAG

Basic RAGパターンでは、システム 、インデックス作成、検索、生成の3つのコアステップで構成される。この章で取り上げるBasic RAGパターンをそのまま採用することはあまり期待しないが、かなり単純化された実装の限界が、この章の他のパターンの正当性を示している。実装を複雑にしすぎないように、より高度なテクニックの理由とトレードオフを理解することが重要である。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

はじめての知識グラフ構築ガイド

はじめての知識グラフ構築ガイド

Jesus Barrasa, Jim Webber
AIネイティブのソフトウェアデリバリー

AIネイティブのソフトウェアデリバリー

Nick Durkin, Eric Minick, Chinmay Gaikwad

Publisher Resources

ISBN: 9798341671447