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
プロンプトのプロに! / Become a Prompt Professional
Search
Henry Cui
March 25, 2023
Technology
1
260
プロンプトのプロに! / Become a Prompt Professional
Henry Cui
March 25, 2023
Tweet
Share
More Decks by Henry Cui
See All by Henry Cui
プロダクション言語モデルの情報を盗む攻撃 / Stealing Part of a Production Language Model
zchenry
1
190
Direct Preference Optimization
zchenry
0
370
Diffusion Model with Perceptual Loss
zchenry
0
390
レンズの下のLLM / LLM under the Lens
zchenry
0
180
Go with the Prompt Flow
zchenry
0
160
Mojo Dojo
zchenry
0
210
ことのはの力で画像の異常検知 / Anomaly Detection by Language
zchenry
0
560
驚愕の事実!LangChainが抱える問題 / Problems of LangChain
zchenry
0
240
MLOps初心者がMLflowを触る / MLflow Brief Introduction
zchenry
0
120
Other Decks in Technology
See All in Technology
いつの間にか入れ替わってる!?新しいAWS Security Hubとは?
cmusudakeisuke
0
140
さくらのIaaS基盤のモニタリングとOpenTelemetry/OSC Hokkaido 2025
fujiwara3
3
460
Operating Operator
shhnjk
1
600
Contributing to Rails? Start with the Gems You Already Use
yahonda
2
100
Lakebaseを使ったAIエージェントを実装してみる
kameitomohiro
0
140
React開発にStorybookとCopilotを導入して、爆速でUIを編集・確認する方法
yu_kod
1
290
[ JAWS-UG千葉支部 x 彩の国埼玉支部 ]ムダ遣い卒業!FinOpsで始めるAWSコスト最適化の第一歩
sh_fk2
2
110
開発生産性を組織全体の「生産性」へ! 部門間連携の壁を越える実践的ステップ
sudo5in5k
3
7.4k
Tokyo_reInforce_2025_recap_iam_access_analyzer
hiashisan
0
190
shake-upを科学する
rsakata
6
560
How Do I Contact HP Printer Support? [Full 2025 Guide for U.S. Businesses]
harrry1211
0
120
United airlines®️ USA Contact Numbers: Complete 2025 Support Guide
unitedflyhelp
0
330
Featured
See All Featured
Scaling GitHub
holman
460
140k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
54k
Speed Design
sergeychernyshev
32
1k
4 Signs Your Business is Dying
shpigford
184
22k
GraphQLとの向き合い方2022年版
quramy
49
14k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Docker and Python
trallard
44
3.5k
Code Review Best Practice
trishagee
69
19k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Adopting Sorbet at Scale
ufuk
77
9.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Transcript
プロンプトのプロに! 機械学習の社会実装勉強会第21回 Henry 2023/3/25
プロンプトに興味 ▪ 研究上 • 大規模言語モデル(Large Language Model, LLM)の研究が広がりつ つある •
テキスト生成・画像生成の基盤になる • モデルにテキスト入力(プロンプト!)が要だが、入力テキストにどのよ うに反応している詳しい仕組みが不明 ▪ 応用上 • みんなChatGPTについて話している • LLMベースのいろんな新興サービスが出ている • プロンプトを書くだけの仕事がとんだ高給 ▪ 目標:プロンプトについて詳しくなる 2
紹介する内容 ▪ Learn Prompting • https://github.com/trigaten/Learn_Prompting にて公開されている入 門コース • 今日はこれのBasic部分を紹介
▪ Large Language Models are Zero-Shot Reasoners, Kojima et al., NeurIPS 2022 • プロンプトを工夫することで、より良い解答を得る手法を提案 3
まずシンプルに英語で命令すれば良い ▪ 例えば Write an essay about the benefits of
AI 4
プロンプトは短くても長くても良い 5 数値計算はLLMの弱い分野とされて、正 しく答えてもらうためにプロンプトの改良 (プロンプトエンジニアリング)を行うのが 定番でした。 ChatGPTはプロンプトの改良を意識しなく ても正確に答えてくれるようになった。 プロンプトが長くても大丈夫です。
もっと複雑な命令も与えられる 6
例をより具体的に与えることで性能向上 7
ルールをより具体的に説明することで性能向上 8
プロンプトの形式は多種多様 ▪ 標準形式 • What is the capital of France?
▪ Q&A形式 • Q: What is the capital of France? A: 9
プロンプトの形式は多種多様 ▪ Few Shot形式 • What is the capital of
Spain? Madrid What is the capital of Italy? Rome What is the capital of France? ▪ Few Shot Q&A形式 • Q: What is the capital of Spain? A: Madrid Q: What is the capital of Italy? A: Rome Q: What is the capital of France? A: 10
背景説明、Q&Aなどを色々含めても大丈夫 11
生成文のスタイル変換 ▪ 何もスタイルを指定しない場合 12
生成文のスタイル変換 ▪ 生成スタイルを指定する場合 13
生成文のスタイル変換 ▪ 生成スタイルと生成言語を指定する場合 14
形容詞で細かく指定 ▪ "Funny", "Curt", "Unfriendly", "Academic Syntax"などの形 容詞で指定できる 15
より詳しく指定するために ▪ https://twitter.com/gijigae/status/1629834619184111618 16
チャットボットの特性を活用 ▪ 会話履歴にある文も後の生成文を影響する ▪ 何も前置きなくて、いきなり聞く場合 17
チャットボットの特性を活用 ▪ 会話冒頭で設定を入れた場合 18
Kojima et al., NeurIPS 2022 ▪ Chain of Thoughts (CoT)
• LLMが弱いとされている論理的推論を改善する手法 ▪ 二段階の推論を行う 19
ChatGPTはこの点において改善された ▪ プロンプト:Roger has 5 tennis balls. He buys 2
more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now? 20
まとめ ▪ プロンプトの基本 ▪ Chain of Thoughts 21