Module 2
Module 2
es
Un
t.
atterns to cr
e p ea
ag t
es
gu
LLM
ent
Uses lan
the entire ne
ences
s
te
w
ra
stor
Gene GenAI
y.
Module 2: Introduction to Prompt Engineering
1. Overview of Prompt Engineering
A prompt is simply the input instruction you give to an AI model. It can be a question, command, or example that guides the model to
produce the desired response.
Key idea: The better and clearer the prompt, the better the output.
Examples:
Customer Service:
Instruction: "Responses should be professional and provide accurate information."
Result: The AI will generate responses that are formal and factually correct.
Example Prompt: User Query: "How can I reset my password?"
Legal Document:
Instruction: "The document should comply with relevant laws and regulations."
Result: Ensures the document follows legal standards.
Example Prompt: User Query: "Please create a non-disclosure agreement."
Product Review:
Instruction: "The review should be unbiased and informative."
Combined with role prompting (tech expert) and seed-word prompting (smartphone features), it generates a detailed and balanced review.
Example Prompt: User Query: "Write a product review for the new smartphone."
Combining Techniques:
Instructions can be paired with other techniques (like role prompting or seed-word prompting) to increase the precision and control of the model's
output.
Module 2: Introduction to Prompt Engineering
2 The Evolution of Prompt Engineering
These prompts are written in natural System prompts are pre-written Conditional prompts involve setting specific
human language, making them more instructions or templates that guide conditions or limitations that direct the
intuitive for developers to interact with the AI model on how to respond. model's behavior based on certain criteria.
the model. The goal is to provide These prompts can direct the format, These conditions can be framed as logical
instructions that mimic human speech, style, or tone of the output, providing statements, like "If X, then Y", guiding the
making the communication more a clear framework for the model to model on what to produce in different
natural. follow. scenarios.
Prompt: "Can you explain how photosynthesis Prompt: "Write a formal email explaining the Prompt: "If the user asks about weather, provide a
works?" delay in project delivery." weather update. If the user asks about sports, provide
the latest sports news."
Output: "Photosynthesis is the process by which Output:
plants convert light energy into chemical energy "Subject: Project Delivery Delay Input: "What's the weather like today?"
stored in glucose." Dear [Recipient], Output: "The weather today is sunny with a high of
I regret to inform you that due to 25°C."
Module 2: Introduction to Prompt Engineering
4. How Does Prompt Engineering Work?
Prompt engineering is a systematic process that involves crafting effective instructions for Large
Language Models (LLMs) to get the best output. The process is iterative, meaning you might need to
refine your prompts multiple times to achieve the desired results.
Example:
Vague Prompt: "Create a response to the user’s inquiry."
Precise Prompt: "Write a formal email apologizing for a delayed response."
The second prompt gives clear, understandable directions, leaving no room for confusion.
Module 2: Introduction to Prompt Engineering
4. How Does Prompt Engineering Work?
Step 3: Add Specific Details
Goal: The more detailed the prompt, the better the response.
Tip: Provide enough context or constraints to guide the model effectively. Specificity helps the
model understand your exact requirements.
Example:
General Prompt: "Write a poem."
Specific Prompt: "Write a poem about the joy of summer, with imagery of the beach and
sunshine."
The second prompt gives the LLM more to work with, increasing the chance of generating a relevant
poem.
Module 2: Introduction to Prompt Engineering
4. How Does Prompt Engineering Work?
Step 4: Provide Examples
Goal: Help the LLM understand the type of output you're expecting.
Tip: If possible, provide a sample output that demonstrates the desired style or format. This helps
the model align its output with your expectations.
Example:
Prompt: "Write a summary of the following article in bullet points."
Example Output:
"Article Summary:
• Discusses the impact of climate change.
• Explores renewable energy solutions."
Providing an example shows the model exactly how you want the summary to look.
Module 2: Introduction to Prompt Engineering
4. How Does Prompt Engineering Work?
Step 5: Experiment and Refine
Goal: Prompt engineering isn’t perfect from the first try.
Tip: Test different prompts to find the one that works best. Experimentation and iteration are
key to discovering the most effective approach.
Example:
If you’re not getting the right answer, try rephrasing the prompt or adding more context to see if
the response improves.
Module 2: Introduction to Prompt Engineering
4. How Does Prompt Engineering Work?
3. Add Specific Include enough context or constraints for "Write a poem about summer with imagery of
Details better results. the beach and sunshine."
4. Provide Show the LLM the type of output you’re "Write a summary of this article in bullet points
Examples expecting. like this: ..."
5. Experiment Keep refining your prompts by Adjusting wording or adding extra context to
and Refine experimenting with different versions. improve model output.
Module 2: Introduction to Prompt Engineering
5. The Role of Prompt Engineering in Communication
Improving Specificity & Clear, precise prompts ensure "Write an email apologizing for the delay in
Clarity unambiguous communication. the meeting and offer a rescheduled time."
Increasing Creativity & Prompts spark creativity, generating "Write a short story about a young artist who
Engagement engaging and thought-provoking outputs. discovers a magical paintbrush."
Overcoming Linguistic Prompts help LLMs translate languages "Translate into Spanish: 'Could you please
Barriers with accuracy and cultural sensitivity. provide me with the details by tomorrow?'"
Question
Answering
Increases accuracy in providing factual
responses.
→ "Paris"
"What is the capital of France?"
Creative Enhances creativity and produces "Write a poem about a sunset" → Creative
Writing engaging, imaginative content. poem generation.
Machine
Translation
Improves precision and ensures context-
aware translations.
"Translate 'Hello' to French" → "Bonjour"
Helps in generating accurate and "Write a Python function for factorial" →
Coding
effective code. Generates correct Python code.
Module 2: Introduction to Prompt Engineering
7. The Future of Large Language Model (LLM) Communication
ed
1. Introduction to Prompt Engineering
t
4. Prompts for Creative Thinking
e
[Link] of Prompt Engineering [Link]
l
[Link] Evolution of Prompt Engineering [Link] Imagination and Innovation
p
[Link] of Prompts
m
[Link] Does Prompt Engineering Work? 5. Prompts for Effective Writing
o
[Link]
C
[Link] Role of Prompt Engineering in Communication
[Link] Advantages of Prompt Engineering [Link] the Writing Process with Prompts
[Link] Future of Large Language Model (LLM)
Communication
Prompt engineering involves crafting specific instructions (prompts) to guide how an AI model
generates responses.
By providing clear and structured prompts, developers can direct the AI's output to be relevant,
accurate, and high-quality for a wide range of tasks.
Goal:
The main goal of prompt engineering is to shape the model's behavior, ensuring that the
responses meet the desired standards and objectives for a given task
Key Techniques in Prompt Engineering
Standard Prompts: Simple prompts that directly ask the AI to perform a specific task.
Role Prompting: The model is given a specific role to play, influencing the tone, style, or behavior of
the response.
Seed-Word Prompting: The prompt provides a seed word or phrase that the model should build
upon, guiding its response based on that initial cue.
Conditional Prompting: Conditions or limitations are set for the model, such as "If this, then that".
Module 2: Prompt Engineering Techniques for ChatGPT
1. Introduction to Prompt Engineering Techniques
Why is Prompt Engineering Important?
Relevance: Well-crafted prompts ensure the model produces relevant responses, making
them more aligned with the task's objectives.
Accuracy: Prompt engineering helps the model generate responses that are factually correct
and appropriate for the given context.
Versatility: Different types of prompts can be used to adapt the model’s output to fit a wide
variety of tasks, from casual conversations to formal reports.
One Shot The model uses one example to understand "Summarize this sentence: 'The sun rises
Prompting the task and generate a response. in the east.'"
Few Shot The model uses a few examples to generate "Write a product review based on these
Prompting a more accurate and relevant response. features..."
Module 2: Prompt Engineering Techniques for ChatGPT
4 Self-Consistency Prompt
The Self-Consistency Prompt is a sophisticated technique used in prompt engineering to ensure
that the generated text remains coherent and logically consistent with the information provided.
This technique is particularly useful when you want the AI model, such as ChatGPT, to adhere to
specific facts, opinions, or constraints throughout a conversation or task.
How It Works:
The main aim of the Self-Consistency Prompt is to maintain coherence and logical
consistency in the model's responses.
Process:
You provide the model with a prompt that contains key information or facts that the model
must remain consistent with during the interaction. This could include background
knowledge, established facts, or constraints that the model should adhere to while generating
text.
Module 2: Prompt Engineering Techniques for ChatGPT
4 Self-Consistency Prompt
Example:
[Link]: Climate Change
Prompt:
"Climate change is driven by human activity, particularly the burning of
fossil fuels. Scientists agree that the Earth's average temperature has risen
by 1.1°C since the late 19th century. Based on this scientific consensus,
explain the impact of rising global temperatures on ecosystems."
Generated Response:
The model, guided by the self-consistency prompt, would provide an
answer that aligns with the scientific consensus and remains consistent
with the data about climate change.
Module 2: Prompt Engineering Techniques for ChatGPT
4 Self-Consistency Prompt
ed
1. Introduction to Prompt Engineering
t
4. Prompts for Creative Thinking
e
[Link] of Prompt Engineering [Link]
l
[Link] Evolution of Prompt Engineering [Link] Imagination and Innovation
p
[Link] of Prompts
m
[Link] Does Prompt Engineering Work?
o
5. Prompts for Effective Writing
C
[Link] Role of Prompt Engineering in Communication
[Link]
[Link] Advantages of Prompt Engineering
[Link] the Writing Process with Prompts
[Link] Future of Large Language Model (LLM)
Communication
ed
3. Prompt Engineering Techniques for ChatGPT
t
le
[Link] to Prompt Engineering Techniques
p
[Link] Prompt Technique
m
o
[Link], One, and Few Shot Prompting
C
[Link]-Consistency Prompt
Outline
Module 2: Prompts for Creative Thinking
Ajantha Devi Vairamani and Anand Nayyar, Prompt Engineering: Empowering Communication, 1st Edition, CRC Press, Taylor & Francis Group
[Link]
[Link] Imagination and Innovation
Module 2: Prompts for Creative Thinking
1. Introduction
In today’s world, creativity is essential for innovation and problem-solving across various
fields.
Prompts act as tools to ignite imagination, spark new ideas, and help overcome mental blocks.
Types of Prompts:
Open-ended questions challenge conventional thinking.
Playful prompts encourage unconventional associations.
Benefits of Prompts:
Help expand imagination and discover new possibilities.
Guide you to connect unrelated ideas and embrace curiosity.
Practical Strategies: The chapter offers practical exercises that encourage exploration and
creative thinking.
Module 2: Prompts for Creative Thinking
2. Unlocking Imagination and Innovation
t e d
Ajantha Devi Vairamani and Anand Nayyar, Prompt Engineering: Empowering Communication, 1st Edition, CRC Press, Taylor & Francis Group
e
ed
1. Introduction to Prompt Engineering
t
p l
4. Prompts for Creative
m
Thinking
e
[Link] of Prompt Engineering [Link]
o
l C
[Link] Evolution of Prompt Engineering [Link] Imagination and Innovation
p
[Link] of Prompts
m
[Link] Does Prompt Engineering Work?
o
5. Prompts for Effective Writing
C
[Link] Role of Prompt Engineering in Communication
[Link]
[Link] Advantages of Prompt Engineering
[Link] the Writing Process with Prompts
[Link] Future of Large Language Model (LLM)
Communication
ed
3. Prompt Engineering Techniques for ChatGPT
t
le
[Link] to Prompt Engineering Techniques
p
[Link] Prompt Technique
m
o
[Link], One, and Few Shot Prompting
C
[Link]-Consistency Prompt
Module 2: Prompts for Effective Writing
Introduction
A prompt for effective writing is a specific instruction, question, or idea that helps guide the writer in
generating creative, focused, and coherent content.
Prompts can serve as a starting point when you’re unsure how to begin writing or need inspiration.
They encourage you to explore different writing styles, overcome writer's block, and tackle a wide range of
topics.
Types of Writing Prompts:
Creative Writing Prompts: These prompts encourage imagination and creativity. They’re perfect for
writers working on fiction, poetry, or storytelling.
Descriptive Writing Prompts: These focus on developing skills to describe people, places, or objects in
detail.
Problem-Solving Writing Prompts: These help you tackle challenges or work through critical thinking
in your writing.
Reflective Writing Prompts: These encourage you to explore your thoughts, experiences, and feelings.
Persuasive Writing Prompts: These help you practice convincing readers of your viewpoint on a
particular issue.
Module 2: Prompts for Effective Writing
Igniting the Writing Process with Prompts
"Igniting the Writing Process with Prompts" is a helpful guide designed to kickstart your
writing journey. It provides creative prompts and practical strategies to help writers of all
levels overcome obstacles like writer's block and improve their writing skills.
1. Encourages Creativity
Prompts inspire new ideas and spark imagination for writing. They give you a
starting point when you don't know where to begin.
Example:
Prompt: "Write about a character who discovers a hidden door in their house."
This prompt gets you thinking about mystery and adventure, helping you start a
story even when you’re stuck.
Module 2: Prompts for Effective Writing
Igniting the Writing Process with Prompts
2. Overcomes Writer's Block
If you're struggling to write, prompts help you break through writer's block by giving
you a clear direction for your writing.
Example:
Prompt: "Describe a place where you feel most at peace."
This prompt helps you focus on writing a peaceful scene, even if you feel stuck
with ideas.
Module 2: Prompts for Effective Writing
Igniting the Writing Process with Prompts
3. Refines Storytelling Skills
Prompts help you develop storytelling skills by encouraging you to think about
different characters, settings, and conflicts.
Example:
Prompt: "Write a dialogue between two people who have just met for the first
time."
This prompt helps you focus on creating characters and conversation, improving
your dialogue-writing skills.
Module 2: Prompts for Effective Writing
Igniting the Writing Process with Prompts
4. Enhances Expression
Prompts encourage you to express yourself in new ways, whether you're writing
fiction, essays, or poetry.
Example:
Prompt: "Write a poem about a rainy day."
This prompt helps you explore descriptive language and develop your creative
expression.
Module 2: Prompts for Effective Writing
Igniting the Writing Process with Prompts
5. Provides Clear Pathways for Writing
Prompts act as guides that lead you through the writing process, making it easier to
organize thoughts and ideas.
Example:
Prompt: "Write an essay arguing why online education is the future."
This helps you structure your thoughts, guiding you to create a clear argument
for the essay.
Module 2: Prompts for Effective Writing
Igniting the Writing Process with Prompts
6. Builds Confidence
By using prompts, writers gain confidence because they know exactly where to start
and can practice regularly.
Example:
Prompt: "Write a letter to your future self."
Writing something personal like this can make you feel more comfortable with
expressing your thoughts and ideas.
Why These Prompts Are Helpful:
Stimulate Creativity: Help you think of new ideas and ways to approach writing.
Improve Writing: Develop better storytelling, descriptive writing, and expression.
Build Confidence: Encourage regular practice and creativity, making writing feel
easier.
Outline
Module 2: Prompt Engineering Techniques for ChatGPT
t e d
Ajantha Devi Vairamani and Anand Nayyar, Prompt Engineering: Empowering Communication, 1st Edition, CRC Press, Taylor & Francis Group
e
ed
1. Introduction to Prompt Engineering
t
p l
4. Prompts for Creative
m
Thinking
e
[Link] of Prompt Engineering [Link]
o
l C
[Link] Evolution of Prompt Engineering [Link] Imagination and Innovation
p d
[Link] of Prompts
e
m t
[Link] Does Prompt Engineering Work?
e
o l
5. Prompts for Effective Writing
p
C
[Link] Role of Prompt Engineering in Communication
[Link]
m
[Link] Advantages of Prompt Engineering
o
[Link] the Writing Process with Prompts
C
[Link] Future of Large Language Model (LLM)
Communication
ed
3. Prompt Engineering Techniques for ChatGPT
t
le
[Link] to Prompt Engineering Techniques
p
[Link] Prompt Technique
m
o
[Link], One, and Few Shot Prompting
C
[Link]-Consistency Prompt
Thank You
Module 2 - Completed