6 Strategies For Prompt Engineering

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

JUSTIN CHIA

6 STRATEGIES FOR
PROMPT
ENGINEERING
(ACCORDING TO OPENAI!)

Swipe to learn
JUSTIN CHIA

SICK OF GETTING BAD


RESULTS WITH
CHATGPT?

HERE ARE 6 STRATEGIES


OPEN AI RECOMMENDS:
JUSTIN CHIA

WRITE CLEAR
INSTRUCTIONS
Clear, detailed instructions lead to
more accurate model outputs.

Specify your needs, like format,


length, or expertise level, to reduce
ambiguity.

Example: Instead of saying "Tell me


about climate change,"

specify with: "Write a 200-word


summary on the impacts of climate
change on Arctic wildlife."
JUSTIN CHIA

INCLUDE DETAILS
AND EXAMPLES
Provide detailed queries, examples,
and specify desired output lengths
to get relevant answers.

Adopting a persona or using


delimiters can also clarify distinct
input parts.

Example: For a detailed response,


ask, "Explain the theory of relativity
as if you were a physics professor,
using examples from everyday life."
Include delimiters like "Theory:",
"Examples:", and "Conclusion:" to
organize your request.
JUSTIN CHIA

PROVIDE
REFERENCE TEXT
Providing reference text helps them
generate more accurate responses

Language models can fabricate


answers, especially on esoteric
topics.

Example: When asking about a


complex topic like quantum
mechanics, you might say, "Using
'Quantum Physics for Dummies' as
a reference, explain quantum
entanglement in simple terms."
JUSTIN CHIA

SPLIT COMPLEX
TASKS
Break down complex tasks into
simpler subtasks for better
accuracy. This modular approach
reduces error rates.

Example: For a complex task like


planning a trip, break it down:

"1. Suggest three destinations for a


family holiday.
2. Outline a 5-day itinerary for the
top destination.
3. Provide a budget breakdown for
the trip."
JUSTIN CHIA

GIVE THE MODEL


TIME TO THINK
Allowing time for reasoning and
asking for a 'chain of thought' leads
to more accurate answers.

This process mirrors human


problem-solving.

Example: For a math problem, ask,

"Can you walk me through the steps


of how you calculate the area of a
circle with a radius of 5cm?" This
encourages a chain-of-thought
response.
JUSTIN CHIA

USE EXTERNAL TOOLS


AND TEST CHANGES
SYSTEMATICALLY
Utilizing tools like text retrieval
systems and code execution
engines can augment the model's
capabilities. GPT-4 has Code
Interpreter built in.

Example: For a coding task, specify,


"Please use the Python environment
to write and test a script that sorts a
list of numbers."

To test changes, you could provide a


set of lists to ensure the script works
correctly in different scenarios.
JUSTIN CHIA

TO GET THIS
FULL PDF:
1. LIKE THIS POST
2. COMMENT “GUIDE”
3. FOLLOW ME

You might also like