Skip to Content
AWSではじめる生成AI ―RAGアプリケーション開発から、基盤モデルの微調整、マルチモーダルAI活用までを試して学ぶ
book

AWSではじめる生成AI ―RAGアプリケーション開発から、基盤モデルの微調整、マルチモーダルAI活用までを試して学ぶ

by Chris Fregly, Antje Barth, Shelbee Eigenbrode, 久富木 隆一, 本橋 和貴, 久保 隆宏
July 2024
Intermediate to advanced
352 pages
5h 19m
Japanese
O'Reilly Japan, Inc.
Content preview from AWSではじめる生成AI ―RAGアプリケーション開発から、基盤モデルの微調整、マルチモーダルAI活用までを試して学ぶ

2章プロンプトエンジニアリングとコンテキスト内学習

この章では、コードをほとんど書かずに生成AIモデルと対話する方法について学びます。具体的には、プロンプトエンジニアリングとコンテキスト内学習が、その方法です。プロンプトエンジニアリングは、「モデルが生成する応答の品質と適切さの向上を促す技法(art)であり、同時に科学(science)でもある」ことを本章で理解できるでしょう。また、基盤モデルを最大限に活用するために、プロンプトならびにプロンプトのテンプレートを定義する際のベストプラクティスも紹介します。

また、プロンプトへの入力と一緒に、別のプロンプトと応答のペア(例えば、質問と回答のペア)を複数「コンテキスト(context:文脈)」内に入れて渡すコンテキスト内学習の利用法も学びます。コンテキスト内学習では、別のプロンプトと応答のペアを、コンテキスト内で例として与え、似たような応答をするようにモデルを促します。1回の問いかけの間だけモデルの動作を一時的に変化させる点において、コンテキスト内学習は、基盤モデルが備える能力の中でも特徴的なものと言えます。

最後に、コンテンツ作成時に基盤モデルのランダム性等を制御するためによく使われる生成パラメーター(temperatureやtop k等)について学びます。

大規模言語モデルは、入力としてプロンプトを受け取り、応答を生成します。そうしたプロンプトと応答は、次に説明するように、テキストベースのトークン群から構成されています。

2.1 プロンプトと応答

生成AIタスクは、複数のモダリティ(modality:データ型)にまたがることがありますが、テキストベースの入力を伴う場合が大半です。こうした入力を、プロンプト(prompt:発言等を促すこと)と呼びます。プロンプトは、あるタスクを達成するために用いられる、指示、コンテキスト、制約全般で構成されます。 ...

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

ベタープログラマ ―優れたプログラマになるための38の考え方とテクニック

ベタープログラマ ―優れたプログラマになるための38の考え方とテクニック

Pete Goodliffe, 柴田 芳樹
スクラム実践者が知るべき97のこと

スクラム実践者が知るべき97のこと

Gunther Verheyen, 吉羽 龍太郎, 原田 騎郎, 永瀬 美穂

Publisher Resources

ISBN: 9784814400720Publisher Website