Prompt Engineering
Prompt Engineering
esteve almirall
@ealmirall
[email protected]
prompt: ACT III. Scene
BabyGPT is ant-sized
LLM. We trained it for
about an hour on a laptop
on just a few megabytes of
text. It makes its guesses
one letter at a time, which
makes it a bit easier for us
to see what it’s learning.
We trained with the
complete works of
Shakespeare, nearly 900K
words and nothing else.
prompt: PICARD: Mister La Forge
BabyGPT is ant-sized
LLM. We trained it for
about an hour on a laptop
on just a few megabytes of
text. It makes its guesses
one letter at a time, which
makes it a bit easier for us
to see what it’s learning.
We trained with the
complete works of “Star
Trek: The Next
Generation”, nearly 1M
words and nothing else.
”The animal didn't cross the street because it was too tired”
Transformer
Attention is all
you need
Transformer
Attention is all
you need
RLHF
Reinforcement
Learning
with
Human
Feedback
- prompt engineering -
chat.openai.com
What can we expect of LLMs?
What can we expect of LLMs?
What can we expect of LLMs?
We found that the utility of AI can fluctuate over the course of a professional’s workflow, with some tasks falling inside
while others fall outside of the frontier. For tasks inside the frontier, these findings carry large performance
implications. Across 18 realistic business tasks, AI significantly increased performance and quality for every
model specification, increasing speed by more than 25%, performance as rated by humans by more than
40%, and task completion by more than 12%. Further, it operated in a way that benefitted bottom-half
performers the most, though all users benefitted from AI. Thus, AI seems to both level performance differences
across levels of ability and raise the quality of work for inside-the-frontier tasks. These findings suggest a need to
understand how work can be organized to better integrate AI. Tasks outside the AI frontier also present
opportunities for individuals to operate as either cyborgs or centaurs. Cyborgs integrate AI and human
capabilities at a granular, sub-task level, while centaurs strategically delegate between human and AI sub-
tasks. In our sample, we observed these two behaviors (see Appendix E). It is clear that the best approaches to using AI
are not fully understood and need to be deeply examined by scholars and practitioners. It was only when we identified
tasks outside the frontier that we saw performance decreases as a result of AI. On those tasks, this study
highlights the importance of validating and interrogating AI (Lebovitz et al., 2022) and of continuing to exert
cognitive effort and experts’ judgment when working with AI (Dell’Acqua, 2022). Professionals who had a negative
performance when using AI tended to blindly adopt its output and interrogate it less (“unengaged interaction with AI”
Lebovitz et al. (2022)).
ChatGPT
answers
Business Model
ChatGPT
answers
ChatGPT
1) write clear &
specific instructions
use delimiters
```, """, < >, <tag> </tag>, {}, …
ChatGPT
1) write clear &
specific instructions
ask for structured
output
JSON, HTML, CSV, …
ChatGPT
1) write clear &
specific instructions
ask for structured
output
JSON, HTML, CSV, …
ChatGPT
1) write clear &
specific instructions
transform into a list
instructions, bullet points, …
ChatGPT
1) write clear &
specific instructions
transform into a list
instructions, bullet points, …
ChatGPT
1) write clear &
specific instructions
few shot prompting
ChatGPT
1) write clear &
specific instructions
also with images
ChatGPT
1) write clear &
specific instructions
also with images
ChatGPT
1) write clear &
specific instructions
also with images
write clear & specific instructions
Imagine a task and ask ChatGPT
to perform it providing clear
instructions
3m
ChatGPT
2) give the model time
to “think”
specify the steps
ChatGPT
2) give the model time
to “think”
ask for output in a
specified format
ChatGPT
2) give the model time
to “think”
instruct the model
to work out the
solutions before
rushing a
conclusion
ChatGPT
2) give the model time
to “think”
fix it by instructing
the model to work
out its own solution
first
Give the model time to “think”
3m
ChatGPT
3) improve your writing
specify a task and a
tone
ChatGPT
3) improve your writing
specify a task and a
tone
ChatGPT
3) improve your writing
specify a task and a
tone
ChatGPT
3) improve your writing
specify a task and a
tone
ChatGPT
3) improve your writing
specify a task and a
tone
Improve your English or any other language …
3m
ChatGPT
4) Iterative prompt
development
first solution
ChatGPT
4) Iterative prompt
development
issue 1 the text is
too long
ChatGPT
4) Iterative prompt
development
issue 2 text
focuses on the
wrong details
ChatGPT
4) Iterative prompt
development
also images
ChatGPT
4) Iterative prompt
development
also images
ChatGPT
4) Iterative prompt
development
also images
ChatGPT
4) Iterative prompt
development
also images
ChatGPT
4) Iterative prompt
development
also images
ChatGPT
4) Iterative prompt
development
also images
ChatGPT
4) Iterative prompt
development
also images
Iterative prompt development
3m
ChatGPT
5) summarizing
with a
word/sentence/
character limit
ChatGPT
5) summarizing
with a focus on
shipping and
delivery
ChatGPT
5) summarizing
with a focus on
price and value
ChatGPT
5) summarizing
you can also use
extract
ChatGPT
5) summarizing
multiple
Summarizing
3m
ChatGPT
6) inferring
sentiment
(postive/negative)
ChatGPT
6) inferring
identify types of
emotions
ChatGPT
6) inferring
identify anger
ChatGPT
6) inferring
extract product
and company
name from
reviews
ChatGPT
6) inferring
multiple tasks
ChatGPT
6) inferring
inferring topics
ChatGPT
6) inferring
identifying topics
from a list
Inferring
- Identify emotions
- Identify topics
3m
basic example
1 ... 2 … 3
basic example
1 ... 2 … 3
esteve almirall
@ealmirall