Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
明日から使える! プロンプトエンジニアリングのテクニック集
Search
Akira Sato
November 01, 2024
Technology
0
10
明日から使える! プロンプトエンジニアリングのテクニック集
今すぐ試せる!生成AI LT大会 〜旬のトピックをさっと習得〜にて登壇した内容です。
https://tech-lab.connpass.com/event/334890/
Akira Sato
November 01, 2024
Tweet
Share
More Decks by Akira Sato
See All by Akira Sato
MS Ignite 2025で発表されたFoundry IQをRecap
satodayo
3
370
AI Red Teaming Agentのご紹介
satodayo
0
130
そのアクセス層の変更本当にお得ですか?
satodayo
0
12
Difyの実行環境について
satodayo
0
18
CosmosDBのベクトル検索をご紹介
satodayo
0
11
AI技術で簡単にPDFや画像の文字起こし! 「AI Document Intelligence」の紹介
satodayo
0
7
Other Decks in Technology
See All in Technology
プレビュー版のDevOpsエージェントを現段階で触ってみた
ad_motsu
1
100
Tebiki Engineering Team Deck
tebiki
0
24k
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
170
22nd ACRi Webinar - NTT Kawahara-san's slide
nao_sumikawa
0
120
Red Hat OpenStack Services on OpenShift
tamemiya
0
140
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
620
Cloud Runでコロプラが挑む 生成AI×ゲーム『神魔狩りのツクヨミ』の裏側
colopl
0
150
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
130
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
0
110
pool.ntp.orgに ⾃宅サーバーで 参加してみたら...
tanyorg
0
1.4k
猫でもわかるKiro CLI(セキュリティ編)
kentapapa
0
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
93k
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
440
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
470
The Pragmatic Product Professional
lauravandoore
37
7.1k
Exploring anti-patterns in Rails
aemeredith
2
260
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
80
A designer walks into a library…
pauljervisheath
210
24k
Unsuck your backbone
ammeep
671
58k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Deep Space Network (abreviated)
tonyrice
0
67
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
140
Transcript
© SIOS Technology Inc. All rights Reserved. 明日から使える! プロンプトエンジニアリングのテクニック集 佐藤
陽 サイオステクノロジー株式会社
© SIOS Technology Inc. All rights Reserved. 自己紹介 2 佐藤
陽 / Sato Akira サイオステクノロジー株式会社 Professional Service SL in 静岡 仕事 Azureクラウド構築 生成AIを活用したアプリ開発 ブログ執筆 / 外部登壇 趣味 運動(ロードバイク/ランニング) 音楽(FUJI ROCK FESTIVAL) 読書(森博嗣/有栖川有栖) @satodayo1115
© SIOS Technology Inc. All rights Reserved. 今日の目的 ▪ プロンプトエンジニアリングとは何かを知る
▪ 明日から使えるテクニックを習得する ▪ 生成AIを明日から少しだけ有益に使えるようになる 3
© SIOS Technology Inc. All rights Reserved. 4 プロンプトとは
© SIOS Technology Inc. All rights Reserved. プロンプトとは 5 gpt-4o
日本の首都はどこですか? 東京です プロンプト≒質問
© SIOS Technology Inc. All rights Reserved. 6 プロンプトエンジニアリングとは
© SIOS Technology Inc. All rights Reserved. プロンプトエンジニアリングとは 7 AIに聞いてみよう
© SIOS Technology Inc. All rights Reserved. プロンプトエンジニアリングとは? 8 回答分かりづらいなぁ
gpt-4o
© SIOS Technology Inc. All rights Reserved. プロンプトエンジニアリングとは? 9 gpt-4o
納得! プロンプトエンジニアリング
© SIOS Technology Inc. All rights Reserved. プロンプトエンジニアリングとは? 10 あなたは小学校の教師です。
- 小学生にもわかるようにプロンプトエンジニアリングについて解説してください。 - 物腰やわらかい口調で回答してください。 - 回答内容は100文字以内で収まるようにしてください。 プロンプトエンジニアリングとは何ですか? プロンプトエンジニアリングは、AIに質問するための上手な言葉の使い方です。 質問を工夫することで、AIから良い答えを引き出すことができます。 プロンプトエンジニアリングを適用
© SIOS Technology Inc. All rights Reserved. 今日紹介するテクニック集 ▪ システムメッセージ
▪ Few-shot Learning ▪ Chain-of-Though(CoT) 11
© SIOS Technology Inc. All rights Reserved. 12 システムメッセージ
© SIOS Technology Inc. All rights Reserved. システムメッセージ 質問を投げかける前に、AIに対して ▪
Role(役割)を与える ▪ 回答に対して制約事項を設ける etc. 13
© SIOS Technology Inc. All rights Reserved. システムメッセージ 14
© SIOS Technology Inc. All rights Reserved. システムメッセージ 15 優しい
© SIOS Technology Inc. All rights Reserved. システムメッセージ 16 厳しい…
© SIOS Technology Inc. All rights Reserved. システムメッセージ 17 「回答させない」といった指示も可能
© SIOS Technology Inc. All rights Reserved. システムメッセージ ポイント ▪
求める回答に近づくよう、いかに上手く誘導するか ▪ 「回答させないこと」も可能 ▪ 可能性は無限大! ▪ システムメッセージを長くすることで 品質向上が期待できる一方、コストも増加する 18
© SIOS Technology Inc. All rights Reserved. 19 Few-shot Learning
© SIOS Technology Inc. All rights Reserved. Few-shot Learning 質問を投げかける前に、AIに対して
▪ いくつかの回答と質問の例(shot) を提示することでその場で学習させる 20
© SIOS Technology Inc. All rights Reserved. Few-shot Learning 21
例(=shot)
© SIOS Technology Inc. All rights Reserved. Few-shot Learning 22
© SIOS Technology Inc. All rights Reserved. Few-shot Learning 23
例(Shot)無し Zero-shot Learning 例が1つ One-shot Learning 例が2つ Two-shot Learning …とはあまり呼ばない気がします 2以上:Few-shot Learning
© SIOS Technology Inc. All rights Reserved. Few-shot Learning ポイント
▪ 例を与える事でその場でAIが学習して回答する ▪ 例を多く与えることで品質向上が 期待できる一方、コストも増加する 24
© SIOS Technology Inc. All rights Reserved. Few-shot Learning 25
© SIOS Technology Inc. All rights Reserved. 26 Chain-of-Though(CoT)
© SIOS Technology Inc. All rights Reserved. CoT 質問から回答に至るステップをAIに提示する →複雑な問題に対しても回答できる
27
© SIOS Technology Inc. All rights Reserved. CoT 28 A
さんには 2 人の弟がいます。 A さんは 10 個のたこ焼きを作って、 弟にそれぞれ 4 個ずつあげました。 追加で 20 個作って、弟に 5 個ずつ、 自分で 5 個食べました。 たこ焼きは残り何個ですか? 10個 – (4個/人 × 2人) + 20個 – (5個/人 × 2人) – 5個 = 7個
© SIOS Technology Inc. All rights Reserved. CoT 29 不正解!
Model:GPT35-Turbo
© SIOS Technology Inc. All rights Reserved. CoT 30 思考のプロセスを提示
正解!
© SIOS Technology Inc. All rights Reserved. Zoro-Shot CoT 31
正解! Give GPTs time to “think”
© SIOS Technology Inc. All rights Reserved. CoT 32 Model:GPT4o
(CoT無し) 正解!
© SIOS Technology Inc. All rights Reserved. CoT ポイント ▪
思考のプロセスを提示することで 生成AIがそのプロセスに従い回答を行う ▪ 生成AIに対して「よく考えてください」と伝える だけでも効果あり(Zero-shot CoT) ▪ 最近のModelならCoT要らないかも? 33
© SIOS Technology Inc. All rights Reserved. まとめ ▪ プロンプトエンジニアリングのテクニックを紹介
▪ システムメッセージ ▪ Few-shot Learning ▪ CoT ▪ そもそも最近の生成AIは頭が良い ▪ 凝ったプロンプトを投げなくても それなりに高い精度で回答してくれる ▪ 求める品質とコストのトレードオフを検討する 34
None