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
210
プロンプトのプロに! / Become a Prompt Professional
Henry Cui
March 25, 2023
Tweet
Share
More Decks by Henry Cui
See All by Henry Cui
Direct Preference Optimization
zchenry
0
160
Diffusion Model with Perceptual Loss
zchenry
0
79
レンズの下のLLM / LLM under the Lens
zchenry
0
99
Go with the Prompt Flow
zchenry
0
100
Mojo Dojo
zchenry
1
140
ことのはの力で画像の異常検知 / Anomaly Detection by Language
zchenry
0
210
驚愕の事実!LangChainが抱える問題 / Problems of LangChain
zchenry
0
120
MLOps初心者がMLflowを触る / MLflow Brief Introduction
zchenry
0
63
{{guidance}}のガイダンス / Guidance of guidance
zchenry
0
110
Other Decks in Technology
See All in Technology
IaCからAWSに入門した初心者が CloudFormationを通して考えた「AWS操作」の使い分け
maimyyym
3
650
生成AIと産業向けソフトウェアの自動生成 〜 ハノーバーメッセ2024より〜
kioto
2
340
個人のAWSアカウントをマルチ運用してみた
miura55
2
270
【基本】データベース設計
oracle4engineer
PRO
2
290
パスワードを保存しますか?
hanacchi
0
240
2024春 注目のWeb系 OSS & SaaS 3選
makies
0
210
TanStack Routerで型安全かつ効率的なルーティングを実現
ytaisei
4
630
cgroup v2 で何が変わったのか / TechFeed Experts Night #28
tenforward
2
130
NewSQL Landscape
oracle4engineer
PRO
5
3k
パフォーマンス最適化のベストプラクティス
databricksjapan
0
120
Prisma ORMを2年運用して培ったノウハウを共有する
tockn
17
3.9k
データ分析力を高めるSQL研修サービス『SQL Everyone』
hikarut
1
200
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
325
20k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
8
3.5k
The Invisible Side of Design
smashingmag
294
49k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
660
120k
Six Lessons from altMBA
skipperchong
22
3k
The Cult of Friendly URLs
andyhume
74
5.7k
Faster Mobile Websites
deanohume
300
30k
How to train your dragon (web standard)
notwaldorf
75
5.2k
The Pragmatic Product Professional
lauravandoore
26
5.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
9
1.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
47k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
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