100% found this document useful (4 votes)
761 views

Prompt Engineering

Uploaded by

saied farhamnia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
761 views

Prompt Engineering

Uploaded by

saied farhamnia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 100

- 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

- Generate output in different


formats (list, JSON, table, steps,

- Impersonate ChatGPT (you are a
…) obtaining a more nuanced
result
- Use few shot prompting for a
different view

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”

Image a task with several


subtasks and ask ChatGPT to do
it step by step

Imagine a task that involves


math calculation and ask
ChatGPT to do it step by step

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 …

Create a fast draft, poorly written

- Ask ChatGPT to re-rewrite or


re-phrase it in various styles

- Asks ChatGPT to impersonate


several characters (academic,
journalist, consultant, student
… ) and rephrase it

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

Create a marketing brochure


based on Amazon’s description
of a product

- Ask ChatGPT to customize


targeting different audiences

- Asks ChatGPT to shorten or


lengthen the text

- Asks ChatGPT to produce


alternative versions of text
with different styles (more
punch, … )

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

Find a text on the internet (e.g.


Wikipedia, a paper, … )

- Ask ChatGPT to summarize it

- Limit the # of words

- Tailor to a specific audience

- Combine several texts &


summarize them

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

Find a critic of a movie and infer


the sentiment behind it

- Identify emotions

- Identify topics

- Produce a table with


sentiment, emotions and
topics

3m
basic example
1 ... 2 … 3
basic example
1 ... 2 … 3

1.- Import your data: Upload your CSV or Excel file.


basic example
1 ... 2 … 3

2.- Ask your question or give an instruction.


“Conduct and visualize a detailed graphical analysis on sales
profitability in key cities.”

“What is the probability that a customer will repeat a purchase


in the next three months?”
basic example
1 ... 2 … 3
3.- Make a report in Word

“Make a report in word with all the analysis”


one more thing …
well, maybe two …
Thank you !

esteve almirall
@ealmirall

You might also like