Skip to Content
仕組みからわかる大規模言語モデル 生成AI時代のソフトウェア開発入門
book

仕組みからわかる大規模言語モデル 生成AI時代のソフトウェア開発入門

by 奥田 勝己
February 2025
Intermediate
376 pages
9h 25m
Japanese
Shōeisha
Content preview from 仕組みからわかる大規模言語モデル 生成AI時代のソフトウェア開発入門
3.8.1
ReActのプロンプトと処理手順
ReActでは、次の構成のプロンプトを使用します。
タスクの説明
利用可能なツールの説明
推論・行動・観測(Thought-Action-Observation)のフォーマット
利用可能なツールの説明では、関数のシグネチャやその仕様を与えます。推論・行動・観測
のフォーマットでは、LLMの出力(推論・行動)とLLM への入力(観測)の形式を指定します。
フォーマットの指定は、Few-Shotプロンプトで例示することで行われます。ただし、ツール
利用に対応しているLLM の場合は、例示を省略することもできます。
ReActの手順は次のとおりです。
1. プロンプトの作成:LLMに対して、タスクの説明や目標を含むプロンプトを与えます。
2. 目標を達成するまで、次のステップを繰り返します。
①推論(Thought):LLMはプロンプトに基づいて推論を行い、次の行動を決定します。
推論の内容は、タスクの分析、必要な情報の特定、行動の計画などが含まれます。
②行動(Action):エージェントは推論の結果に基づいて行動を実行します。行動には、
ツールの使用(例:Web検索、計算の実行など)や最終回答の生成などがあります。
③観測(Observation):エージェントは行動の結果を観測し、LLM にフィードバックし
ます。ツールを使用した場合はツールからの出力が観測となります。最終回答が生成
された場合は、タスクの実行が終了します。
④次の推論のためのプロンプトの更新:現在までの推論 ...
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

What Successful Brick-and-Mortar Retailers Get Right

What Successful Brick-and-Mortar Retailers Get Right

Rob Angell
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9784798185613