SlideShare a Scribd company logo
Prompt
Engineering
Damian Gordon
Contents
Introduction to Prompt
Engineering
Principles of Effective
Prompting
Prompting Methodologies
10 General Sample Prompts
Prompt
Engineering
• Prompt engineering is
designing and refining
prompts to effectively
communicate with GenAI
models, improving
quality, relevance, and
accuracy of their
responses.
Prompt Engineering
•Prompt Engineering can …
• increase the accuracy and relevance of answers.
• help control the tone, style, and format of
answers.
• enhance the efficiency of answers.
Prompt Engineering
•It is important to note that different GenAI
models interpret prompts differently (ChatGPT,
DALL·E, Copilot, etc.), so the most important
thing to do is try out different queries and
different approaches to generating queries,
and see which ones work best.
Prompt Engineering
3Ps of
Prompt
Engineering
Add more Clarity
Principles of
Effective Prompting
Prompt Engineering
•Principles of Effective Prompting:
•Clarity & Precision
•Context & Constraints
•Validation & Verification
•Repetition & Repetition
Clarity &
Precision
Clarity & Precision
•Using clear and specific language to guide
GenAI responses.
•Let’s say you want an GenAI to generate a
Python function to calculate the factorial of a
number >>>
Clarity & Precision
•Bad Prompt - Vague & Ambiguous
• Write about photosynthesis.
Clarity & Precision
•Good Prompt - Clear & Precise
• Explain the process of photosynthesis
in plants, including the role of
sunlight, chlorophyll, water, and
carbon dioxide.
Context &
Constraints
Context & Constraints
•Providing background information or setting
boundaries to get relevant answers.
•Let’s say you want to generate a function to
sort a list of numbers >>>
Context & Constraints
•Bad Prompt - Lacks Context & Constraints
• Generate a recipe for pasta.
Context & Constraints
•Good Prompt - Provides Context &
Constraints
• Generate a vegetarian pasta recipe that
serves 2 people, can be cooked in under
30 minutes, and does not use any dairy
products. Include a list of ingredients
and step-by-step instructions.
Validation
&
Verificatio
n
Validation & Verification
•Verifying the output of Generative AI (GenAI) is
crucial to ensure accuracy, reliability, and
ethical integrity.
•Here's a structured approach to critically
assess AI-generated content >>>
Validation & Verification: Check the
Facts !!!
• Verify Key Information: Scrutinize names, dates,
statistics, and claims by comparing them with credible
sources like academic journals, official reports, or
reputable news outlets.
• Validate Citations: If the GenAI provides references,
ensure they exist and accurately support the content.
GenAI models can sometimes fabricate citations or
misattribute information.
• Use Fact-Checking Tools: Leverage platforms such as
FactCheck.org, Snopes, or Google Fact Check Tools to
confirm the veracity of the information
Validation & Verification: Check the
Facts !!!
•Take the CRAAP Test!!!
•Currency
•Relevance
•Authority
•Accuracy
•Purpose
• https://damiantgordon.com/CheckSheets/CHECKSHEET-CRAAP-Test.pdf
Validation & Verification
•https://damiantgordon.com/CheckSheets/
Again, lots of Checklists
on my website, these can
be really helpful for some
learners to actively and
authentically engage
with content and models:
Repetition &
Repetition
Repetition & Repetition
•Repetition can help improve prompts —
but it depends on how and why you use it.
•Here’s how repetition can enhance
prompt effectiveness, especially with
GenAI >>>
Repetition & Repetition
•Clarifying Intent
•Repeating or rephrasing your request can
reinforce what’s important.
•Example:
•“Give me three bullet points. Just
three clear, short bullet points.”
Repetition & Repetition
•Guiding Structure
•GenAI responds well to consistent patterns.
•Example:
•“Write a short story. Make it
short, with a clear beginning,
middle, and end.”
Repetition & Repetition
•Stressing Constraints
•Repetition can highlight limits (like tone,
format, or length).
•Example:
•“Use plain language. No jargon.
Really, keep the language plain and
simple.”
Repetition & Repetition
•Prompt Tuning
• You can repeat an adjusted version of a prompt
to refine the GenAI's direction.
•First prompt:
• “Summarize this article.”
•Follow-up:
• “Summarize it again, but focus only on
the economic implications.”
Prompting
Methodologi
es
Prompt Engineering
•Prompting Methodologies:
•Iteration & Testing
•Role-based Prompts
•N-Shot Prompting
•Chain-of-Thought Prompting
Iteration &
Testing
Iteration & Testing
•Experimenting with different phrasings and
formats to achieve the best output.
•Let’s say we want to generate a function that
checks if a string is a palindrome (reads the
same forward and backward) >>>
Iteration & Testing
Attemp
t 3
Attemp
t 2
Attemp
t 1
Iteration & Testing
•Iteration 1 – A bit vague
• Summarize this article.
Iteration & Testing
•Iteration 2 – Adding Constraints
• Summarize the main argument of the
article in 3 bullet points, each no
longer than 20 words.
Iteration & Testing
•Iteration 3 – Final Refinement
• Summarize the main argument of the
article in 3 bullet points, each no
longer than 20 words, and avoid
repeating quotes from the text.
Iteration & Testing
•Methodology
• Start with a basic prompt and analyze the output.
• Iterate by adding constraints based on
shortcomings.
• Test edge cases to verify correctness.
• Refine until the GenAI’s output meets all
requirements.
Role-based
Prompts
Role-based Prompts
• Asking the GenAI to act as a specific expert or persona.
• This helps generate more accurate and more context-
aware responses. By assigning a role, you guide the
GenAI's thought process and ensure it presents
responses to the expected expertise level.
• For example, role-based prompt for Business Guru >>>
Role-based Prompts
•Prompt Without a Role - Generic Output
• What are some business tips?
Role-based Prompts
•Role-Based Prompt - More Focused & Useful
• You are a seasoned startup advisor with
15 years of experience in SaaS
businesses. What are the top 5 tips
you'd give a first-time founder
launching a B2B SaaS product?
N-Shot
Prompting
N-Shot Prompting
•This type of prompting is concerned with
whether or not the prompt includes an
example …
N-Shot Prompting
Prompt Type Explanation
Zero-shot
Prompting (0)
The GenAI is given no examples and must
infer the pattern or solution.
One-shot
Prompting (1)
The GenAI is given one example to learn
from before generating an answer.
Few-shot
Prompting (2-5)
The GenAI is given two to five examples to
learn from before generating an answer.
Multi-shot
Prompting (5+)
The GenAI is given over five examples to
learn from before generating an answer.
N-Shot Prompting
•Why is giving examples better?
• More structured & consistent.
• GenAI follows the given style.
• Consistent formatting and readability.
• Encourages GenAI to infer patterns from
examples.
N-Shot Prompting
•Zero-shot Prompt - No Examples Given:
•“Write a Python function that converts
Fahrenheit to Celsius.”
One-shot Prompt - One Example Given:
•“Here is a temperature conversion
functions … [SAMPLE CODE] … Now, write
a function to convert Fahrenheit to
Celsius following the same style.”
N-Shot Prompting
• Few-shot Prompt – 2 to 5 Examples Given:
• “Here are 2-5 temperature conversion
functions … [SAMPLE CODE] … Now, write a
function to convert Fahrenheit to Celsius
following the same style.”
Multi-shot Prompt – Over 5 Examples Given:
• “Here are over five temperature conversion
functions … [SAMPLE CODE] … Now, write a
function to convert Fahrenheit to Celsius
following the same style.”
N-Shot Prompting
• When to use each:
•Zero-shot: Useful for general tasks but may
produce inconsistent results.
•One-shot: Useful for specific task where the
answer needs to closely match the example.
N-Shot Prompting
• When to use each:
• Few-shot: Helps guide the GenAI by showing 2-5
examples, improving accuracy and structure. So, use few-
shot prompting when you need consistency, style
matching, or complex logic.
• Multi-shot: Helps guide the GenAI by showing over 5
examples, improving accuracy and structure. So, use
multi-shot prompting when you need a very high level of
consistency, style matching, or complex logic.
N-Shot Prompting
• NOTE:
• With Few-Shot and Multi-shot prompting, you
must always be aware of BIAS, there may be
something in the specific examples that the
GenAI might think have to always be contained in
their answers, so review its answers for this.
Chain-of-Thought
Prompting
Chain-of-Thought Prompting
• Also called:
• Step-by-Step Instructions
• Step-by-Step Prompting
• Multi-Turn Prompting
• Multi-Step Prompting
• Chain-of-Reasoning Prompting
Chain-of-Thought Prompting
•Encouraging step-by-step reasoning for
complex tasks.
•This helps improve accuracy and ensures
logical consistency, especially for
mathematical or algorithmic tasks.
•For example, we have a function that finds the
sum of all even numbers in a list, but it’s giving
incorrect results >>>
Chain-of-Thought Prompting
•Initial Prompt
•If there are 3 red balls and 5 blue
balls in a bag, and you take out 2
balls without looking, what is the
probability that both are red?
Chain-of-Thought Prompting
•Chain-of-Thought Prompt
•If there are 3 red balls and 5 blue
balls in a bag, and you take out 2
balls without looking, what is the
probability that both are red?
Please explain your reasoning step
by step.
Chain-of-Thought Prompting
•Chain-of-Thought Prompt
• There are a total of 3 red + 5 blue = 8 balls.
• The probability that the first ball drawn is
red is 3/8.
• If the first ball is red, there are now 2 red
and 7 total balls left.
• So the probability that the second ball is red
is 2/7.
• Therefore, the probability that both balls are
red is (3/8) × (2/7) = 6/56 = 3/28.
Chain-of-Thought Prompting
•Why better?
• Clear breakdown of the problem before answering it.
• Step-by-step reasoning helps with learning and
debugging.
• Reduces GenAI hallucinations by enforcing structured
logical thinking.
10 General Sample
Prompts
Summarization Prompt
• “Summarize the key findings of this research
paper in three bullet points, focusing on
the methodology, results, and conclusions.”
• Why it's good:
• It specifies the desired format (three bullet points).
• It defines the scope (methodology, results, and conclusions).
• It ensures clarity by requesting a summary rather than a full
analysis.
Analytical Prompt
• “Compare and contrast the strengths and
weaknesses of supervised and unsupervised
learning, providing examples of real-world
applications for each.”
• Why it's good:
• It requires critical thinking rather than just factual recall.
• It demands structured reasoning (compare and contrast).
• It provides a clear context (supervised vs. unsupervised
learning).
Creative Writing Prompt
• “Write a short science fiction story (500
words) set in a world where AI has become
the ruling class. Include a protagonist
who challenges the system.”
• Why it's good:
• It provides a clear theme (AI as rulers).
• It specifies word count (500 words).
• It introduces a conflict (protagonist challenges the system).
Code Generation Prompt
• “Write a Python function that takes a list of
numbers and returns the mean, median, and
mode. Ensure the function is efficient and
handles edge cases like empty lists.”
• Why it's good:
• It defines inputs and outputs (list of nums mean, median,
→
mode).
• It includes performance expectations (efficient).
• It asks for error handling (empty lists).
Educational Explanation Prompt
• “Explain the concept of entropy in
thermodynamics in simple terms, using an
everyday analogy a 12-year-old can
understand.”
• Why it's good:
• It specifies the complexity level (simple terms).
• It requires an analogy (everyday example).
• It identifies the target audience (12-year-old).
Debate and Argumentation Prompt
• “Argue for and against the use of AI in
education. Provide at least two strong
points for each side, then conclude with
your own reasoned opinion.”
• Why it's good:
• It requires balanced reasoning (both sides of the argument).
• It demands specific points (two per side).
• It includes a personal conclusion (opinion).
Data Analysis Prompt
• “Given a CSV file containing sales data with
columns for date, product, and revenue, write
a Python script to calculate the total
revenue per product and visualize it using a
bar chart”
• Why it's good:
• It defines the input format (CSV with specific columns).
• It describes expected outputs (total revenue per product).
• It requires a visualization (bar chart).
Ethical Discussion Prompt
• “What are the ethical concerns
surrounding deepfake technology? Discuss
both potential harms and possible
benefits, citing real-world examples.”
• Why it's good:
• It prompts critical thinking (ethical concerns).
• It requires both pros and cons (harms + benefits).
• It encourages real-world applications (examples).
Roleplaying/Simulation Prompt
• “Imagine you are a data scientist presenting
findings to a non-technical executive team.
Explain the key insights from your predictive
model in a way that emphasizes business
impact.”
• Why it's good:
• It provides a clear role (data scientist).
• It sets a target audience (non-technical executives).
• It emphasizes practical application (business impact).
Multimodal Prompt
• “Describe what a violin sounds like using
only visual and tactile metaphors.”
• Why it's good:
• It forces creative thinking (visual and tactile metaphors).
• It removes direct sensory descriptions, making it more
challenging.
• It encourages unique, engaging responses.
Introduction to Prompts and Prompt Engineering

More Related Content

Similar to Introduction to Prompts and Prompt Engineering (20)

PPTX
Building Your Own AI Instance (TBLC AI )
Brian Pichman
 
PPTX
End2EndTesting_With_GenerativeAI - ChatGPT
Mithilesh Singh
 
PDF
The Art and Science of Prompt Engineering
Larry888358
 
PDF
Leveraging Generative AI & Best practices
DianaGray10
 
PDF
purpose of prompt engineering in gen ai systems.pdf
mosesgenaimasters
 
PPTX
AI-Enhanced RAG System for Automated University Course Content Generation
PAVANKUMAR2943
 
PPTX
Chain of thoughts, 0-shot, few-shot, and their limitations
rhythmguptakrishna
 
PPTX
Generative AI for Technical Writer or Information Developers
Raghuram Pandurangan
 
PPTX
Gnerative AI presidency Module1_L3.pptx
Arunnaik63
 
PDF
Prompt Engineering guide for beginners .pdf
dhawal060709
 
PDF
Mastering Chatgpt The Ultimate Guide To Prompt Engineering For Beginners 2024...
Author Tushar Sheth
 
PPTX
Uses of GenAI in Education for pedagogical.pptx
MirzaAdnanBaig10
 
PDF
OpenAI GPT in Depth - Questions and Misconceptions
Ivo Andreev
 
PPTX
AI_Prompt_engineering_and_LLMs- Data Science digest.pptx
AlhassanMayei
 
PDF
Agile Kolkata 13-14 Sep 2024 | Prompting your way to Agility by Sanjit Bhatta...
AgileNetwork
 
PDF
Introduction-to-Non-Technical-Prompt-Engineering.pdf
SatishShivajiRaoS1
 
PPTX
Mastering_Prompt_Engineering_orompt.pptx
drgvkotireddy
 
PDF
intro_to_gen_ai_tools.pdf
Nohoax Kanont
 
PDF
Agile Gurugram 30-31Aug 2024 | The Art of Prompt Engineering for Agile Teams ...
AgileNetwork
 
PDF
How to Master AI Prompt Engineering Skills for Future Growth
SOFTTECHHUB
 
Building Your Own AI Instance (TBLC AI )
Brian Pichman
 
End2EndTesting_With_GenerativeAI - ChatGPT
Mithilesh Singh
 
The Art and Science of Prompt Engineering
Larry888358
 
Leveraging Generative AI & Best practices
DianaGray10
 
purpose of prompt engineering in gen ai systems.pdf
mosesgenaimasters
 
AI-Enhanced RAG System for Automated University Course Content Generation
PAVANKUMAR2943
 
Chain of thoughts, 0-shot, few-shot, and their limitations
rhythmguptakrishna
 
Generative AI for Technical Writer or Information Developers
Raghuram Pandurangan
 
Gnerative AI presidency Module1_L3.pptx
Arunnaik63
 
Prompt Engineering guide for beginners .pdf
dhawal060709
 
Mastering Chatgpt The Ultimate Guide To Prompt Engineering For Beginners 2024...
Author Tushar Sheth
 
Uses of GenAI in Education for pedagogical.pptx
MirzaAdnanBaig10
 
OpenAI GPT in Depth - Questions and Misconceptions
Ivo Andreev
 
AI_Prompt_engineering_and_LLMs- Data Science digest.pptx
AlhassanMayei
 
Agile Kolkata 13-14 Sep 2024 | Prompting your way to Agility by Sanjit Bhatta...
AgileNetwork
 
Introduction-to-Non-Technical-Prompt-Engineering.pdf
SatishShivajiRaoS1
 
Mastering_Prompt_Engineering_orompt.pptx
drgvkotireddy
 
intro_to_gen_ai_tools.pdf
Nohoax Kanont
 
Agile Gurugram 30-31Aug 2024 | The Art of Prompt Engineering for Agile Teams ...
AgileNetwork
 
How to Master AI Prompt Engineering Skills for Future Growth
SOFTTECHHUB
 

More from Damian T. Gordon (20)

PPTX
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
PPTX
TRIZ: Theory of Inventive Problem Solving
Damian T. Gordon
 
PPTX
Some Ethical Considerations of AI and GenAI
Damian T. Gordon
 
PPTX
Some Common Errors that Generative AI Produces
Damian T. Gordon
 
PPTX
The Use of Data and Datasets in Data Science
Damian T. Gordon
 
PPTX
A History of Different Versions of Microsoft Windows
Damian T. Gordon
 
PPTX
Writing an Abstract: A Question-based Approach
Damian T. Gordon
 
PPTX
Using GenAI for Universal Design for Learning
Damian T. Gordon
 
DOC
A CheckSheet for Inclusive Software Design
Damian T. Gordon
 
PPTX
A History of Versions of the Apple MacOS
Damian T. Gordon
 
PPTX
68 Ways that Data Science and AI can help address the UN Sustainability Goals
Damian T. Gordon
 
PPTX
Copyright and Creative Commons Considerations
Damian T. Gordon
 
PPTX
Exam Preparation: Some Ideas and Suggestions
Damian T. Gordon
 
PPTX
Studying and Notetaking: Some Suggestions
Damian T. Gordon
 
PPTX
The Growth Mindset: Explanations and Activities
Damian T. Gordon
 
PPTX
Hyperparameter Tuning in Neural Networks
Damian T. Gordon
 
PPTX
Early 20th Century Modern Art: Movements and Artists
Damian T. Gordon
 
PPTX
An Introduction to Generative Artificial Intelligence
Damian T. Gordon
 
PPTX
An Introduction to Green Computing with a fun quiz.
Damian T. Gordon
 
PPTX
Introduction to Sustainability and the UN Sustainable Development Goals
Damian T. Gordon
 
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
TRIZ: Theory of Inventive Problem Solving
Damian T. Gordon
 
Some Ethical Considerations of AI and GenAI
Damian T. Gordon
 
Some Common Errors that Generative AI Produces
Damian T. Gordon
 
The Use of Data and Datasets in Data Science
Damian T. Gordon
 
A History of Different Versions of Microsoft Windows
Damian T. Gordon
 
Writing an Abstract: A Question-based Approach
Damian T. Gordon
 
Using GenAI for Universal Design for Learning
Damian T. Gordon
 
A CheckSheet for Inclusive Software Design
Damian T. Gordon
 
A History of Versions of the Apple MacOS
Damian T. Gordon
 
68 Ways that Data Science and AI can help address the UN Sustainability Goals
Damian T. Gordon
 
Copyright and Creative Commons Considerations
Damian T. Gordon
 
Exam Preparation: Some Ideas and Suggestions
Damian T. Gordon
 
Studying and Notetaking: Some Suggestions
Damian T. Gordon
 
The Growth Mindset: Explanations and Activities
Damian T. Gordon
 
Hyperparameter Tuning in Neural Networks
Damian T. Gordon
 
Early 20th Century Modern Art: Movements and Artists
Damian T. Gordon
 
An Introduction to Generative Artificial Intelligence
Damian T. Gordon
 
An Introduction to Green Computing with a fun quiz.
Damian T. Gordon
 
Introduction to Sustainability and the UN Sustainable Development Goals
Damian T. Gordon
 
Ad

Recently uploaded (20)

PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Dimensions of Societal Planning in Commonism
StefanMz
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Ad

Introduction to Prompts and Prompt Engineering

  • 2. Contents Introduction to Prompt Engineering Principles of Effective Prompting Prompting Methodologies 10 General Sample Prompts
  • 3. Prompt Engineering • Prompt engineering is designing and refining prompts to effectively communicate with GenAI models, improving quality, relevance, and accuracy of their responses.
  • 4. Prompt Engineering •Prompt Engineering can … • increase the accuracy and relevance of answers. • help control the tone, style, and format of answers. • enhance the efficiency of answers.
  • 5. Prompt Engineering •It is important to note that different GenAI models interpret prompts differently (ChatGPT, DALL·E, Copilot, etc.), so the most important thing to do is try out different queries and different approaches to generating queries, and see which ones work best.
  • 8. Prompt Engineering •Principles of Effective Prompting: •Clarity & Precision •Context & Constraints •Validation & Verification •Repetition & Repetition
  • 10. Clarity & Precision •Using clear and specific language to guide GenAI responses. •Let’s say you want an GenAI to generate a Python function to calculate the factorial of a number >>>
  • 11. Clarity & Precision •Bad Prompt - Vague & Ambiguous • Write about photosynthesis.
  • 12. Clarity & Precision •Good Prompt - Clear & Precise • Explain the process of photosynthesis in plants, including the role of sunlight, chlorophyll, water, and carbon dioxide.
  • 14. Context & Constraints •Providing background information or setting boundaries to get relevant answers. •Let’s say you want to generate a function to sort a list of numbers >>>
  • 15. Context & Constraints •Bad Prompt - Lacks Context & Constraints • Generate a recipe for pasta.
  • 16. Context & Constraints •Good Prompt - Provides Context & Constraints • Generate a vegetarian pasta recipe that serves 2 people, can be cooked in under 30 minutes, and does not use any dairy products. Include a list of ingredients and step-by-step instructions.
  • 18. Validation & Verification •Verifying the output of Generative AI (GenAI) is crucial to ensure accuracy, reliability, and ethical integrity. •Here's a structured approach to critically assess AI-generated content >>>
  • 19. Validation & Verification: Check the Facts !!! • Verify Key Information: Scrutinize names, dates, statistics, and claims by comparing them with credible sources like academic journals, official reports, or reputable news outlets. • Validate Citations: If the GenAI provides references, ensure they exist and accurately support the content. GenAI models can sometimes fabricate citations or misattribute information. • Use Fact-Checking Tools: Leverage platforms such as FactCheck.org, Snopes, or Google Fact Check Tools to confirm the veracity of the information
  • 20. Validation & Verification: Check the Facts !!! •Take the CRAAP Test!!! •Currency •Relevance •Authority •Accuracy •Purpose • https://damiantgordon.com/CheckSheets/CHECKSHEET-CRAAP-Test.pdf
  • 21. Validation & Verification •https://damiantgordon.com/CheckSheets/ Again, lots of Checklists on my website, these can be really helpful for some learners to actively and authentically engage with content and models:
  • 23. Repetition & Repetition •Repetition can help improve prompts — but it depends on how and why you use it. •Here’s how repetition can enhance prompt effectiveness, especially with GenAI >>>
  • 24. Repetition & Repetition •Clarifying Intent •Repeating or rephrasing your request can reinforce what’s important. •Example: •“Give me three bullet points. Just three clear, short bullet points.”
  • 25. Repetition & Repetition •Guiding Structure •GenAI responds well to consistent patterns. •Example: •“Write a short story. Make it short, with a clear beginning, middle, and end.”
  • 26. Repetition & Repetition •Stressing Constraints •Repetition can highlight limits (like tone, format, or length). •Example: •“Use plain language. No jargon. Really, keep the language plain and simple.”
  • 27. Repetition & Repetition •Prompt Tuning • You can repeat an adjusted version of a prompt to refine the GenAI's direction. •First prompt: • “Summarize this article.” •Follow-up: • “Summarize it again, but focus only on the economic implications.”
  • 29. Prompt Engineering •Prompting Methodologies: •Iteration & Testing •Role-based Prompts •N-Shot Prompting •Chain-of-Thought Prompting
  • 31. Iteration & Testing •Experimenting with different phrasings and formats to achieve the best output. •Let’s say we want to generate a function that checks if a string is a palindrome (reads the same forward and backward) >>>
  • 32. Iteration & Testing Attemp t 3 Attemp t 2 Attemp t 1
  • 33. Iteration & Testing •Iteration 1 – A bit vague • Summarize this article.
  • 34. Iteration & Testing •Iteration 2 – Adding Constraints • Summarize the main argument of the article in 3 bullet points, each no longer than 20 words.
  • 35. Iteration & Testing •Iteration 3 – Final Refinement • Summarize the main argument of the article in 3 bullet points, each no longer than 20 words, and avoid repeating quotes from the text.
  • 36. Iteration & Testing •Methodology • Start with a basic prompt and analyze the output. • Iterate by adding constraints based on shortcomings. • Test edge cases to verify correctness. • Refine until the GenAI’s output meets all requirements.
  • 38. Role-based Prompts • Asking the GenAI to act as a specific expert or persona. • This helps generate more accurate and more context- aware responses. By assigning a role, you guide the GenAI's thought process and ensure it presents responses to the expected expertise level. • For example, role-based prompt for Business Guru >>>
  • 39. Role-based Prompts •Prompt Without a Role - Generic Output • What are some business tips?
  • 40. Role-based Prompts •Role-Based Prompt - More Focused & Useful • You are a seasoned startup advisor with 15 years of experience in SaaS businesses. What are the top 5 tips you'd give a first-time founder launching a B2B SaaS product?
  • 42. N-Shot Prompting •This type of prompting is concerned with whether or not the prompt includes an example …
  • 43. N-Shot Prompting Prompt Type Explanation Zero-shot Prompting (0) The GenAI is given no examples and must infer the pattern or solution. One-shot Prompting (1) The GenAI is given one example to learn from before generating an answer. Few-shot Prompting (2-5) The GenAI is given two to five examples to learn from before generating an answer. Multi-shot Prompting (5+) The GenAI is given over five examples to learn from before generating an answer.
  • 44. N-Shot Prompting •Why is giving examples better? • More structured & consistent. • GenAI follows the given style. • Consistent formatting and readability. • Encourages GenAI to infer patterns from examples.
  • 45. N-Shot Prompting •Zero-shot Prompt - No Examples Given: •“Write a Python function that converts Fahrenheit to Celsius.” One-shot Prompt - One Example Given: •“Here is a temperature conversion functions … [SAMPLE CODE] … Now, write a function to convert Fahrenheit to Celsius following the same style.”
  • 46. N-Shot Prompting • Few-shot Prompt – 2 to 5 Examples Given: • “Here are 2-5 temperature conversion functions … [SAMPLE CODE] … Now, write a function to convert Fahrenheit to Celsius following the same style.” Multi-shot Prompt – Over 5 Examples Given: • “Here are over five temperature conversion functions … [SAMPLE CODE] … Now, write a function to convert Fahrenheit to Celsius following the same style.”
  • 47. N-Shot Prompting • When to use each: •Zero-shot: Useful for general tasks but may produce inconsistent results. •One-shot: Useful for specific task where the answer needs to closely match the example.
  • 48. N-Shot Prompting • When to use each: • Few-shot: Helps guide the GenAI by showing 2-5 examples, improving accuracy and structure. So, use few- shot prompting when you need consistency, style matching, or complex logic. • Multi-shot: Helps guide the GenAI by showing over 5 examples, improving accuracy and structure. So, use multi-shot prompting when you need a very high level of consistency, style matching, or complex logic.
  • 49. N-Shot Prompting • NOTE: • With Few-Shot and Multi-shot prompting, you must always be aware of BIAS, there may be something in the specific examples that the GenAI might think have to always be contained in their answers, so review its answers for this.
  • 51. Chain-of-Thought Prompting • Also called: • Step-by-Step Instructions • Step-by-Step Prompting • Multi-Turn Prompting • Multi-Step Prompting • Chain-of-Reasoning Prompting
  • 52. Chain-of-Thought Prompting •Encouraging step-by-step reasoning for complex tasks. •This helps improve accuracy and ensures logical consistency, especially for mathematical or algorithmic tasks. •For example, we have a function that finds the sum of all even numbers in a list, but it’s giving incorrect results >>>
  • 53. Chain-of-Thought Prompting •Initial Prompt •If there are 3 red balls and 5 blue balls in a bag, and you take out 2 balls without looking, what is the probability that both are red?
  • 54. Chain-of-Thought Prompting •Chain-of-Thought Prompt •If there are 3 red balls and 5 blue balls in a bag, and you take out 2 balls without looking, what is the probability that both are red? Please explain your reasoning step by step.
  • 55. Chain-of-Thought Prompting •Chain-of-Thought Prompt • There are a total of 3 red + 5 blue = 8 balls. • The probability that the first ball drawn is red is 3/8. • If the first ball is red, there are now 2 red and 7 total balls left. • So the probability that the second ball is red is 2/7. • Therefore, the probability that both balls are red is (3/8) × (2/7) = 6/56 = 3/28.
  • 56. Chain-of-Thought Prompting •Why better? • Clear breakdown of the problem before answering it. • Step-by-step reasoning helps with learning and debugging. • Reduces GenAI hallucinations by enforcing structured logical thinking.
  • 58. Summarization Prompt • “Summarize the key findings of this research paper in three bullet points, focusing on the methodology, results, and conclusions.” • Why it's good: • It specifies the desired format (three bullet points). • It defines the scope (methodology, results, and conclusions). • It ensures clarity by requesting a summary rather than a full analysis.
  • 59. Analytical Prompt • “Compare and contrast the strengths and weaknesses of supervised and unsupervised learning, providing examples of real-world applications for each.” • Why it's good: • It requires critical thinking rather than just factual recall. • It demands structured reasoning (compare and contrast). • It provides a clear context (supervised vs. unsupervised learning).
  • 60. Creative Writing Prompt • “Write a short science fiction story (500 words) set in a world where AI has become the ruling class. Include a protagonist who challenges the system.” • Why it's good: • It provides a clear theme (AI as rulers). • It specifies word count (500 words). • It introduces a conflict (protagonist challenges the system).
  • 61. Code Generation Prompt • “Write a Python function that takes a list of numbers and returns the mean, median, and mode. Ensure the function is efficient and handles edge cases like empty lists.” • Why it's good: • It defines inputs and outputs (list of nums mean, median, → mode). • It includes performance expectations (efficient). • It asks for error handling (empty lists).
  • 62. Educational Explanation Prompt • “Explain the concept of entropy in thermodynamics in simple terms, using an everyday analogy a 12-year-old can understand.” • Why it's good: • It specifies the complexity level (simple terms). • It requires an analogy (everyday example). • It identifies the target audience (12-year-old).
  • 63. Debate and Argumentation Prompt • “Argue for and against the use of AI in education. Provide at least two strong points for each side, then conclude with your own reasoned opinion.” • Why it's good: • It requires balanced reasoning (both sides of the argument). • It demands specific points (two per side). • It includes a personal conclusion (opinion).
  • 64. Data Analysis Prompt • “Given a CSV file containing sales data with columns for date, product, and revenue, write a Python script to calculate the total revenue per product and visualize it using a bar chart” • Why it's good: • It defines the input format (CSV with specific columns). • It describes expected outputs (total revenue per product). • It requires a visualization (bar chart).
  • 65. Ethical Discussion Prompt • “What are the ethical concerns surrounding deepfake technology? Discuss both potential harms and possible benefits, citing real-world examples.” • Why it's good: • It prompts critical thinking (ethical concerns). • It requires both pros and cons (harms + benefits). • It encourages real-world applications (examples).
  • 66. Roleplaying/Simulation Prompt • “Imagine you are a data scientist presenting findings to a non-technical executive team. Explain the key insights from your predictive model in a way that emphasizes business impact.” • Why it's good: • It provides a clear role (data scientist). • It sets a target audience (non-technical executives). • It emphasizes practical application (business impact).
  • 67. Multimodal Prompt • “Describe what a violin sounds like using only visual and tactile metaphors.” • Why it's good: • It forces creative thinking (visual and tactile metaphors). • It removes direct sensory descriptions, making it more challenging. • It encourages unique, engaging responses.