Prompt Engineering Cheatsheet
1.
Basic Principles
Be Specific: Clearly define the
task &
expectations.
Use Constraints: Limit
responses by
length,
format, or
style.
Provide Context: Give
background
for
better results.
Use Examples: Guide
with a
few-shot approach.
Iterate &
Refine: Modify
prompts based on
output quality.
2.
Prompting Techniques
Zero-Shot Prompting
Without examples, the
relies only on
pre-trained knowledge.
Example:
“
Explain Newton’s Third Law in
simple words.”
One-Shot Prompting
Provides example to
guide the
.
Example:
“
Translate ‘Hello’ to
French.
Answer: Bonjour. Now translate ‘Goodbye’ to
French.”
Few-Shot Prompting
Uses examples for
accuracy.
Example:
“
Translate:
- ‘Hello’ → ‘Bonjour’
- ‘Goodbye’ → ‘Au revoir’
- ‘Thank you’ → ?”
Response: “Merci.”
Chain-of-Thought (CoT) Prompting
Encourages step-by-step
reasoning.
Example:
“
A train moves at
60 km/h for
2.5 hours. How far does it travel?
Explain step by step.”
Response:
Step
: Speed = 60 km/h
Step: Time = 2.5
Step: Distance =
Speed ×
Time = 60 × 2.5 = 150 km.
Instruction-Based Prompting
Directly instructs with
clear guidelines.
Example:
“
Summarize this
article in
bullet points.”
Role-Based Prompting
Assigns a
persona for
understanding.
Example:
“
You are a
historian. Explain the
impact of the
Chola dynasty in
South India.”
Delimiter Prompting
Keeps focused by using
delimiters.
Example:
“
Summarize the following text between triple quotes:
”’The mitochondria is the powerhouse of the cell…”'”
3.
Advanced Prompting Techniques
Prompt Chaining
Breaks down complex tasks into
sequential prompts.
Example: Generate an
outline for an
essay.
Expand each
section into
paragraphs.
Refine
grammar &
style.
Self-Consistency
Runs multiple variations of a
prompt & picks
best output.
Example:
“
Solve 27 × 43.
Explain your reasoning.”
(AIruns multiple
approaches &
picks the most
consistent result.)
Retrieval-Augmented Generation (RAG)
Fetches relevant external
data before generating a
response.
Example:
“
Summarize the
latest
research on
quantum computing using external sources.”
4.
Common Issues &
Fixes
Use | |
Specify | |
Provide | |
Use | |
Use |
5.
Applications of Prompt Engineering
Chatbots & Assistants – Personalized AI
interactions.
Content Creation – Blogs,
articles, &
creative writing.
Education – AI
tutors, explanations, & summaries.
Coding – Generating &
debugging
code.
Data Analysis – Summarizing
reports & extracting insights.
By mastering these techniques, you can create highly effective prompts for AI-driven tasks &
maximize the
accuracy of AI-generated outputs.