Prompt Engineering Guide
Elevate Your Communication: Mastering the Art of Prompt Engineering
PART 1 - FOUNDATIONS
Author : Lampros Mousselimis
Email : [Link]@[Link]
LinkedIn : [Link]
Version : 0.0.1
TABLE OF CONTENTS
FUNDAMENTALS OF PROMPT ENGINEERING.......................................... 5
HYPER-PARAMETERS OF LLMs.................................................... 5
Priming.................................................................. 5
Temperature.............................................................. 6
Top-p (Nucleus Sampling)................................................. 6
Top-k Sampling........................................................... 6
Max Tokens............................................................... 6
Frequency Penalty........................................................ 6
Presence Penalty......................................................... 6
Prompt Length............................................................ 6
Model Choice............................................................. 7
Response Length.......................................................... 7
USAGE EXAMPLES OF HYPER-PARAMETERS TUNING................................... 7
PRIMING.................................................................. 7
Understanding "Priming" in Prompting.................................. 7
- Example without "Priming"........................................ 7
- Example with "Priming" (Providing Context)....................... 8
Tips for Using "Priming" Parameter.................................... 8
- Set the Context:................................................. 8
- Specify Details:................................................. 8
Considerations........................................................ 8
- Example Prompt for Experimentation............................... 8
TEMPERATURE CONTROL...................................................... 9
Temperature Control Basics............................................ 9
- Low Temperature (e.g., 0.2 - 0.5):............................... 9
- Medium Temperature (e.g., 0.7 - 1.0):............................ 9
- High Temperature (e.g., 1.2 - 1.5):.............................. 9
Temperature in Context............................................... 10
- Example without Temperature Control:............................ 10
- Example with Low Temperature:................................... 10
- Example with Medium Temperature:................................ 10
- Example with High Temperature:.................................. 10
Temperature Experimentation ( Same prompt | different temperatures ). 11
- No Temperature Control:......................................... 11
- Low Temperature (e.g., 0.3):.................................... 11
- Medium Temperature (e.g., 0.8):................................. 11
- High Temperature (e.g., 1.5):................................... 11
TOP-P (NUCLEUS) SAMPLING................................................ 12
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 1
Understanding Top-p (Nucleus) Sampling:.............................. 12
- Example without Top-p (Nucleus) Sampling:....................... 12
- Example with Top-p (Nucleus) Sampling:.......................... 12
Tips for Using Top-p (Nucleus) Sampling.............................. 13
- Adjusting Thresholds:........................................... 13
- Contextual Application:......................................... 13
- Experimentation:................................................ 13
Considerations....................................................... 13
Example Prompt for Experimentation................................... 13
TOP-K SAMPLING IN PROMPTING............................................. 14
Understanding Top-k Sampling in Prompting:........................... 14
- Example without Top-k Sampling:................................. 14
- Example with Top-k Sampling (k=5):.............................. 14
Tips for Using Top-k Sampling........................................ 15
- Select an Appropriate k-Value:.................................. 15
Considerations....................................................... 15
- Example Prompt for Experimentation.............................. 15
MAX TOKENS.............................................................. 16
Understanding "max tokens" in Prompting.............................. 16
- Example without "max tokens" Limitation......................... 16
- Example with "max tokens" Limitation (max tokens=50)............ 16
Tips for Using "max tokens" Parameter................................ 16
- Determine an Appropriate Limit:................................. 16
- Balance Conciseness with Context:............................... 16
Considerations....................................................... 17
- Example Prompt for Experimentation.............................. 17
FREQUENCY PENALTY....................................................... 17
Understanding Frequency Penalty...................................... 17
- Example without Frequency Penalty............................... 17
- Example with Frequency Penalty.................................. 18
Tips for Using Frequency Penalty..................................... 18
- Balancing Repetition:........................................... 18
- Customization:.................................................. 18
Considerations....................................................... 18
- Example Prompt for Experimentation.............................. 18
PRESENCE PENALTY........................................................ 19
Understanding Presence Penalty....................................... 19
- Example without Presence Penalty................................ 19
- Example with Presence Penalty................................... 19
Tips for Using Presence Penalty...................................... 20
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 2
- Contextual Alignment:........................................... 20
- Fine-Tuning Relevance:.......................................... 20
Considerations....................................................... 20
- Example Prompt for Experimentation.............................. 20
PROMPT LENGTH........................................................... 20
Understanding "Prompt Length" in Prompting........................... 21
- Example without Consideration for Prompt Length................. 21
- Example with Consideration for Prompt Length (Concise Prompt)... 21
Tips for Managing Prompt Length...................................... 21
- Focus on Essentials:............................................ 21
- Avoid Overly Complex Prompts:................................... 21
Considerations....................................................... 21
- Example Prompt for Experimentation:............................. 22
MODEL CHOICE............................................................ 22
Understanding "Model Choice" in Prompting............................ 22
- Example without "Model Choice" Specification.................... 22
- Example with "Model Choice" Specification (Selecting Scientific
Expertise Model).................................................. 23
Tips for Using "Model Choice" Parameter.............................. 23
- Identify Task Requirements:..................................... 23
- Select the Appropriate Model:................................... 23
Considerations....................................................... 23
RESPONSE LENGTH......................................................... 23
Understanding "Response Length" in Prompting......................... 23
- Example without "Response Length" Specification................. 24
- Example with "Response Length" Instruction (Limit to 50 words).. 24
Tips for Using "Response Length" Parameter........................... 24
- Define the Limit:............................................... 24
- Balance Detail and Conciseness:................................. 24
Considerations....................................................... 24
- Example Prompt for Experimentation.............................. 25
OTHER PROMPTING METHODS................................................. 25
DESIRED FORMAT.......................................................... 25
Understanding "Desired Format" in Prompting.......................... 25
- Example without "Desired Format" Specification.................. 25
- Example with "Desired Format" (Requesting a List Format)........ 26
Tips for Using "Desired Format" Parameter............................ 26
- Specify the Format:............................................. 26
- Alignment with Purpose:......................................... 26
Considerations....................................................... 26
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 3
- Example Prompt for Experimentation.............................. 26
<PLACEHOLDERS> AS PARAMETERS............................................ 27
Understanding "<Placeholders> as Parameters" in Prompting............ 27
- Example without "<Placeholders> as Parameters" Consideration.... 27
- Example with "<Placeholders> as Parameters" (Dynamic Insertion): 28
Tips for Using "<Placeholders> as Parameters" Parameter.............. 28
- Designate Placeholder Tags:..................................... 28
- Provide Context:................................................ 28
Considerations....................................................... 28
- Example Prompt for Experimentation.............................. 28
<PLACEHOLDERS> AS INSTRUCTIONS.......................................... 29
Understanding "<Placeholders> as Instructions" in Prompting.......... 29
- Example without "<Placeholders> as Instructions" Consideration.. 29
- Example with "<Placeholders> as Instructions" (Guiding the
Explanation):..................................................... 29
Tips for Using "<Placeholders> as Instructions" Parameter............ 30
- Clearly Define Placeholder Instructions:........................ 30
- Use Descriptive Labels:......................................... 30
Considerations....................................................... 30
- Example Prompt for Experimentation.............................. 30
SPECIFY TONE/STYLE...................................................... 31
Understanding "Specify Style/Tone" in Prompting...................... 32
- Example without "Specify Style/Tone" Consideration.............. 32
- Example with "Specify Style/Tone" (Requesting a Playful Tone):.. 32
Tips for Using "Specify Style/Tone" Parameter........................ 32
- Be Explicit:.................................................... 32
- Alignment with Content:......................................... 32
Considerations....................................................... 33
- Example Prompt for Experimentation.............................. 33
SPECIFYING TARGET AUDIENCE PROMPTING.................................... 33
Understanding "Specifying Target Audience Prompting"................. 33
- Example without "Specifying Target Audience Prompting".......... 34
- Example with "Specifying Target Audience Prompting" (Tailored for
Seniors).......................................................... 34
Tips for Using "Specifying Target Audience Prompting"................ 34
- Define the Audience:............................................ 34
- Consider Audience Interests:.................................... 34
Considerations....................................................... 34
- Example Prompt for Experimentation.............................. 35
OUTRO................................................................... 35
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 4
FUNDAMENTALS OF PROMPT ENGINEERING
Dive into the world of AI and Large Language Models (LLMs) with our
first installment, where we unravel the fundamentals of Prompt
Engineering. Discover how tweaking simple settings can significantly
impact the quality and relevance of AI-generated text. Perfect for
beginners and those looking to refresh their knowledge, the first part
of “Prompt Engineering Guide” lays the groundwork for mastering AI
interactions.
Welcome to the first step on our journey through the fascinating world
of Prompt Engineering with Large Language Models (LLMs). Whether
you're new to artificial intelligence or seeking a refresher, this
series promises to equip you with the essential knowledge and tools
needed to navigate and harness the power of AI. From understanding the
basic hyperparameters that influence AI behavior to learning how to
craft prompts that yield meaningful and relevant responses, this
installment lays the foundation for transforming your AI interactions
from mere commands to a fine art. Join us as we embark on this
enlightening adventure, unlocking the secrets to effectively
communicating with one of the most advanced technologies of our age.
HYPER-PARAMETERS OF LLMs
When working with large language models (LLMs) like GPT-3 or GPT-4,
there are several hyperparameters that you can tune to influence the
behavior and output of the model. Here's an extensive list of some
common hyperparameters along with a brief explanation of each:
Priming
(Although Priming is a Prompting Method and not a Hyperparameter, we choose to
start with it due to its importance.)
"Priming" in AI prompting is like giving the AI a map before it
starts a journey. It sets the context and provides key details,
ensuring the AI's response is focused and relevant. Just as you'd
guide a painter with a vision, priming directs the AI to create
content that aligns with your specific requirements, resulting in
more accurate and tailored responses. It's your tool to enhance
the precision and relevance of AI-generated content.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 5
Temperature
Controls the randomness in the model's responses. A higher
temperature increases diversity but can reduce coherence, while a
lower temperature makes responses more deterministic and
potentially more repetitive.
Top-p (Nucleus Sampling)
This parameter sets a threshold to sample from the top p% of the
probability distribution. It helps in generating diverse
responses by focusing on the most likely tokens but avoids the
long tail of very unlikely ones.
Top-k Sampling
Limits the model's choices to the k most likely next words. The
model will only consider these k words for the next token, which
can help control the quality of the output.
Max Tokens
Determines the maximum length of the model's output. It's useful
for controlling the verbosity of responses.
Frequency Penalty
Reduces the likelihood of the model repeating the same line or
information. A higher penalty discourages repetition.
Presence Penalty
Similar to frequency penalty, but focuses on reducing the
repetition of entire topics or themes, encouraging the model to
introduce new concepts.
Prompt Length
While technically part of the input rather than a hyperparameter,
the length and quality of the prompt can significantly influence
the model's output.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 6
Model Choice
Different versions of models (e.g., GPT-3.5 vs. GPT-4) may have
different characteristics and capabilities.
Response Length
Controls how long the generated response should be.
It's important to note that the availability and exact behavior of
these hyperparameters can vary depending on the specific model and
platform you are using. Additionally, the optimal settings for these
hyperparameters can depend greatly on the specific task or type of
response you are aiming to generate. Experimentation and tweaking are
often necessary to achieve the desired output.
USAGE EXAMPLES OF HYPER-PARAMETERS TUNING
PRIMING
(Although Priming is a Prompting Method and not a Hyperparameter, we choose to start
with it due to its importance.)
"Priming" is an essential concept in prompting that involves setting
the context, introducing specific details, or providing background
information to guide the AI's response. This guide explores the
principles and examples of using "priming" to effectively influence
and shape AI-generated content.
Understanding "Priming" in Prompting
"Priming" refers to the act of preparing the AI for a particular task
or direction by providing context, background information, or relevant
details in the prompt. It helps set the stage for the desired response
- Example without "Priming"
Describe a painting.
Response (No "Priming" Consideration):
A painting is a visual representation created by an artist using
various techniques and colors.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 7
- Example with "Priming" (Providing Context)
Prompt:
Describe a famous painting by Vincent van Gogh, "Starry Night."
Response ("Priming" with Context):
"Starry Night" is a masterpiece by Vincent van Gogh, known for
its swirling, dreamlike depiction of a starry night sky over a
tranquil village. The use of vibrant blues and yellows creates a
sense of cosmic wonder and serene beauty.
Tips for Using "Priming" Parameter
- Set the Context:
Clearly establish the context or background information required
for the AI to generate a relevant response.
- Specify Details:
Provide specific details, themes, or attributes that you want the
AI to incorporate into the response.
Considerations
- "Priming" helps ensure that the AI understands the context and
requirements of the task, resulting in more accurate and relevant
responses.
- It is effective when you need to guide the AI's response by
providing essential context or specific details.
- Example Prompt for Experimentation
Prompt:
Write a poem inspired by the beauty of a serene mountain lake,
providing "priming" with vivid imagery and emotions.
Response ("Priming" with Imagery and Emotions):
By the tranquil mountain lake, where crystal waters gently kiss the shore,
Reflecting emerald peaks that touch the azure heavens, I find solace.
Amidst whispers of wind and symphonies of nature, my soul finds home.
Experimenting with "priming" in your prompts allows you to set the
context, introduce details, and guide the AI's response effectively.
By providing the necessary background information, you can ensure that
the AI generates more accurate, relevant, and context-aware content.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 8
TEMPERATURE CONTROL
Temperature control is a crucial aspect of fine-tuning AI responses.
It influences the creativity and randomness of generated content.
Let's explore how to effectively use temperature control in your
prompts.
Temperature Control Basics
Adjusting the temperature parameter helps balance between creativity
and consistency in AI-generated responses.
- Low Temperature (e.g., 0.2 - 0.5):
Produces more focused and deterministic responses.
Suitable for precision-oriented tasks and generating factual
information.
Low Temperature Example Prompt Input:
Write a 4 line poem about “SUN”. (Temperature parameter = 0.35)
Low Temperature Example Prompt Output:
Beneath blue skies, it softly gleams,
A golden orb, the stuff of dreams.
Its gentle warmth, a soothing ray,
The sun brings joy to each new day.
- Medium Temperature (e.g., 0.7 - 1.0):
Strikes a balance between creativity and coherence.
Ideal for creative writing, brainstorming, or generating diverse
ideas.
Medium Temperature Example Prompt Input:
Write a 4 line poem about “SUN”. (Temperature parameter = 0.85)
Medium Temperature Example Prompt Output:
The sun blazes high, a fiery sphere,
Its brilliance strong, we hold it dear,
A blazing heart in the vast expanse,
With its warmth, life's intricate dance
- High Temperature (e.g., 1.2 - 1.5):
Encourages more randomness and creativity.
Suitable for exploratory tasks and generating novel concepts.
High Temperature Example Prompt Input:
Write a 4 line poem about “SUN”. (Temperature parameter = 1.35)
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 9
High Temperature Example Prompt Output:
In the scorching sky, it fiercely glows,
A blazing star that fiercely shows,
Its searing touch, a burning embrace,
In its radiance, we find our place.
Temperature in Context
Consider the context of your prompt and the desired outcome when
selecting the temperature. Experiment with different values to find
the right balance for your specific task.
- Example without Temperature Control:
Prompt:
Describe the process of photosynthesis.
Response (No Temperature Control):
Photosynthesis is the process by which plants, algae, and some
bacteria convert light energy into chemical energy.
- Example with Low Temperature:
Prompt:
Explain the concept of quantum entanglement.
Response (Low Temperature: 0.3):
Quantum entanglement is a quantum physics phenomenon where
particles become correlated and behave as one system, even when
separated by large distances.
- Example with Medium Temperature:
Prompt:
Discuss the impact of artificial intelligence on society.
Response (Medium Temperature: 0.8):
The integration of AI in society raises profound ethical
questions, impacting job markets, privacy, and our understanding
of intelligence.
- Example with High Temperature:
Prompt:
Envision a utopian future for humanity.
Response (High Temperature: 1.5):
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
10
In a world filled with floating cities and sentient clouds,
humanity thrives on a harmonious blend of nature and advanced
technology, transcending conventional boundaries.
Experiment with temperature settings to tailor AI responses to your
specific needs, whether you're seeking precision or fostering creative
exploration. Adjust the temperature based on the nature of your prompt
and the desired output.
Temperature Experimentation ( Same prompt | different temperatures )
Let's explore the same prompt with different temperature levels to
observe the variations in AI-generated responses:
Prompt: Envision a utopian future for humanity.
- No Temperature Control:
Response:
In a world where advanced technology and nature coexist in
perfect harmony, humanity has achieved unparalleled prosperity.
Floating cities and self-sustaining ecosystems thrive, fostering
a utopia of endless possibilities.
- Low Temperature (e.g., 0.3):
Response:
A utopian future for humanity is characterized by a harmonious
blend of advanced technology and nature. Floating cities and
sustainable ecosystems contribute to unprecedented prosperity.
- Medium Temperature (e.g., 0.8):
Response:
Picture a utopian future where humanity thrives amidst floating
cities and sentient clouds. The harmony between advanced
technology and nature creates a world of boundless possibilities,
transcending conventional boundaries.
- High Temperature (e.g., 1.5):
Response:
In a kaleidoscopic vision of the future, humanity soars above on
ethereal clouds, connected by a web of consciousness. The very
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
11
fabric of reality warps, giving birth to a utopia where minds
meld with machines, and possibilities unfold in unpredictable
splendor.
Adjusting the temperature introduces variability in the creativity and
randomness of responses. Lower temperatures yield more focused and
deterministic content, while higher temperatures foster more
imaginative and diverse outputs. It's essential to choose the
temperature level that aligns with your specific goals and desired
tone for the generated content.
TOP-P (NUCLEUS) SAMPLING
Top-p, also known as nucleus sampling, is a parameter that influences
the diversity of responses generated by the AI. It controls the
nucleus of likely next words, limiting choices to a cumulative
probability threshold. This section explores the principles and
examples of using top-p to shape AI responses.
Understanding Top-p (Nucleus) Sampling:
Top-p sampling introduces a dynamic approach to token sampling,
adjusting the probability threshold for word selection. It provides a
balance between creativity and coherence in AI-generated content.
- Example without Top-p (Nucleus) Sampling:
Prompt:
Write a poem about the moon.
Response (No Top-p):
In the quiet night sky, the moon, a celestial ball of silver,
Illuminates the world with its ethereal glow, a cosmic river.
Stars dance around, enchanted by its captivating spell,
A silent symphony in the universe where stories dwell.
- Example with Top-p (Nucleus) Sampling:
Prompt:
Write a poem about the moon using top-p sampling,
emphasizing unexpected word choices.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
12
Response (Top-p):
In the hushed cosmos, the moon, a lunar pearl aglow,
Bathes the Earth in its mystic radiance, casting a celestial
Show.
Night's tapestry, adorned with stars in a cosmic ballet,
A clandestine sonnet, where celestial secrets find their way.
Tips for Using Top-p (Nucleus) Sampling
- Adjusting Thresholds:
Higher thresholds (e.g., 0.8) limit choices to a smaller nucleus,
resulting in more focused responses.
Lower thresholds (e.g., 0.2) broaden the nucleus, allowing for
more diverse and unexpected word choices.
- Contextual Application:
Apply top-p sampling when you want to balance coherence with
creativity, especially in creative writing or content generation.
- Experimentation:
Experiment with different top-p values to find the right balance
for your specific prompt and desired outcomes.
Considerations
- Top-p sampling is effective for scenarios where a balance between
coherence and creativity is desired.
- It influences the richness of vocabulary and the level of
unpredictability in the generated content.
Example Prompt for Experimentation
Prompt:
Describe a futuristic city using top-p sampling with a threshold
of 0.5, aiming for a balance between creative and coherent
descriptions.
Response (Top-p Experimentation):
In the metropolis of tomorrow, skyscrapers soar like crystalline Giants,
Hovering gardens suspended between the towers, a vision defiant.
Technological whispers weave through streets paved with luminescent glass,
A symphony of innovation and nature in a city that lets dreams amass.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
13
Experimenting with top-p sampling allows you to fine-tune the balance
between coherence and creativity in AI-generated content. Adjust the
threshold to observe how it influences the richness of language and
the unpredictability of responses.
TOP-K SAMPLING IN PROMPTING
Top-k sampling is a technique used in prompting to influence the AI's
response by selecting from the top-k most likely next tokens at each
step of text generation. This section explores the principles and
examples of using top-k sampling for more controlled and context-aware
AI-generated content.
Understanding Top-k Sampling in Prompting:
Top-k sampling restricts the AI's choice of the next word by
considering only the top-k most likely candidates based on their
predicted probabilities. This technique enables you to control the
randomness of the output and maintain context coherence.
- Example without Top-k Sampling:
Prompt:
Write a paragraph about the benefits of exercise.
Response (No Top-k Sampling):
Exercise has numerous advantages, including improved
cardiovascular health, enhanced mood, and weight management. It
also boosts energy levels and strengthens muscles.
- Example with Top-k Sampling (k=5):
Prompt:
Explain the benefits of exercise in a concise manner.
Response (Top-k Sampling with k=5):
Exercise offers a wide range of benefits, such as cardiovascular
health improvement, mood enhancement, weight management,
increased energy levels, and muscle strength.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
14
Tips for Using Top-k Sampling
- Select an Appropriate k-Value:
Choose an appropriate value for k based on the desired level of
control and creativity in the response. Higher k-values introduce
more randomness, while lower values yield more deterministic
Outputs.
- Balance Between Creativity and Control:
Experiment with different k-values to strike a balance between
maintaining context and introducing variability.
Considerations
- Top-k sampling is effective when you want to control the
generation process and ensure context coherence in the output.
- It helps prevent overly repetitive or divergent responses by
constraining the AI's choices.
- Example Prompt for Experimentation
Prompt:
Write a short story about a detective solving a mysterious case
using top-k sampling with k=3.
Response (Top-k Sampling Experimentation with k=3):
Detective Alex was known for his sharp intellect and unwavering
determination. When a mysterious case landed on his desk, he
couldn't ignore the eerie details. As he delved deeper into the
enigma, the pieces of the puzzle gradually fell into place,
leading him to an unexpected revelation that would change
everything.
Experimenting with top-k sampling allows you to influence the AI's
responses by controlling the selection of the most likely tokens at
each step. Choose an appropriate k-value to strike the right balance
between control and creativity in the generated content.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
15
MAX TOKENS
The "max tokens" parameter in prompting allows you to limit the length
of the AI-generated response. We can explore the principles and
examples of using "max tokens" for controlling the length of
AI-generated content while maintaining context and coherence.
Understanding "max tokens" in Prompting
The "max tokens" parameter sets an upper limit on the number of tokens
(words or characters) in the AI-generated response. This feature helps
you manage the length of the output, ensuring it remains concise and
within specified boundaries.
- Example without "max tokens" Limitation
Prompt:
Describe the history of space exploration from the first moon
landing to recent Mars missions.
Response (No "max tokens" Limitation):
Space exploration has a rich history that began with the historic
Apollo 11 moon landing in 1969. Over the decades, humanity has
made remarkable strides in reaching the stars. Recent missions to
Mars, like the Perseverance rover, continue to push the
boundaries of our understanding of the cosmos.
- Example with "max tokens" Limitation (max tokens=50)
Prompt:
Provide a concise overview of space exploration milestones.
Response ("max tokens" Limited to 50):
Space exploration has seen remarkable milestones, from Apollo 11
to Mars missions.
Tips for Using "max tokens" Parameter
- Determine an Appropriate Limit:
Choose a value for "max tokens" that aligns with your content
requirements, ensuring it's neither too short nor too verbose.
- Balance Conciseness with Context:
Be mindful of maintaining context and coherence in the response
even when using "max tokens" to limit length.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
16
Considerations
- "Max tokens" is effective when you want to control the length of
AI-generated content, especially for applications with character
or word limits.
- It helps prevent excessively long or verbose responses.
- Example Prompt for Experimentation
Prompt:
Explain the concept of artificial intelligence in a succinct
manner with a "max tokens" limit of 30.
Response ("max tokens" Limited to 30):
Artificial intelligence is the simulation of human intelligence
by machines.
Experimenting with “max tokens” allows you to control the length of AI
responses for concise and focused information. Adjust the parameter to
align with your preferences for response length and the specific
requirements of your prompt.
FREQUENCY PENALTY
Frequency penalty is a parameter that discourages the repetition of
already generated tokens in AI responses. This section explores the
principles and examples of using frequency penalty to enhance the
diversity and richness of generated content.
Understanding Frequency Penalty
Frequency penalty plays a crucial role in avoiding monotonous or
repetitive language in AI responses. By penalizing the recurrence of
tokens, you encourage the model to explore a broader vocabulary and
generate more diverse content.
- Example without Frequency Penalty
Prompt:
Describe a serene mountain landscape.
Response (No Frequency Penalty):
The serene mountain landscape features towering peaks covered in
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
17
snow. The air is crisp, and nature thrives in this peaceful
environment.
- Example with Frequency Penalty
Prompt:
Describe a serene mountain landscape with a frequency penalty to
discourage repetitive language.
Response (Frequency Penalty Applied):
The tranquil mountain scenery showcases towering peaks adorned
with snow. The atmosphere is refreshing, and the natural
surroundings flourish in this serene environment.
Tips for Using Frequency Penalty
- Balancing Repetition:
Adjust the frequency penalty to balance the avoidance of
repetition with maintaining coherence in the response.
- Customization:
Experiment with different frequency penalty values to find the
right level of discouragement for token repetition.
Considerations
- Frequency penalty is valuable when you want to elevate the
linguistic variety in AI-generated responses.
- Find a frequency penalty value that aligns with your preference
for language richness and minimizes redundancy.
- Example Prompt for Experimentation
Prompt:
Craft a short story about a detective solving a mystery, applying
a frequency penalty to promote varied language use.
Response (Frequency Penalty Experimentation):
Detective Harper delved into the enigma, untangling clues that
led to a labyrinth of secrets. Each revelation added a layer of
complexity, making the resolution a riveting exploration of
mystery and intrigue.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
18
Experimenting with frequency penalty allows you to enhance the
diversity of language in AI-generated content. Adjust the parameter to
find the right balance that discourages repetition while maintaining
the coherence and fluency of the response.
PRESENCE PENALTY
Presence penalty is a parameter designed to discourage the generation
of tokens that are not present in the input prompt. The following
section explores the principles and examples of using presence penalty
to refine AI responses and align them more closely with the provided
context.
Understanding Presence Penalty
Presence penalty guides the AI to stay contextually relevant by
penalizing the inclusion of tokens that stray from the input prompt.
It helps ensure generated content remains coherent and in line with
the specified context.
- Example without Presence Penalty
Prompt:
Explain the principles of quantum mechanics.
Response (No Presence Penalty):
Quantum mechanics involves the study of subatomic particles and
their behavior, exploring concepts like superposition and
entanglement.
- Example with Presence Penalty
Prompt:
Explain the principles of quantum mechanics with a presence
penalty to stay closely aligned with the provided context.
Response (Presence Penalty Applied):
Quantum mechanics delves into the intricate behaviors of
subatomic particles, introducing concepts such as superposition
and entanglement to unravel the mysteries of quantum reality.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
19
Tips for Using Presence Penalty
- Contextual Alignment:
Adjust the presence penalty to strike a balance between staying
true to the input prompt and allowing for creative exploration.
- Fine-Tuning Relevance:
Experiment with different presence penalty values to find the
optimal level that maintains relevance without stifling
creativity.
Considerations
Presence penalty is beneficial when you want to ensure AI-generated
content remains closely tied to the context provided in the prompt.
It helps prevent the generation of content that may diverge too far
from the specified subject matter.
- Example Prompt for Experimentation
Prompt:
Describe a futuristic cityscape with presence penalty applied to
keep the narrative closely aligned with the futuristic context.
Response (Presence Penalty Experimentation):
In the futuristic cityscape, towering skyscrapers touch the
clouds, connected by sleek bridges and adorned with vibrant
holographic displays. The bustling streets hum with advanced
technology, creating a harmonious blend of innovation and urban
aesthetics.
Experimenting with presence penalty allows you to maintain contextual
relevance in AI-generated content. Adjust the parameter to strike the
right balance between alignment with the input prompt and the creative
exploration of ideas.
PROMPT LENGTH
The "prompt length" refers to the number of tokens (words or
characters) in the prompt provided to the AI. This section explores
the principles and examples of managing prompt length for effective
prompting, balancing context, and AI-generated content.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
20
Understanding "Prompt Length" in Prompting
Prompt length plays a crucial role in instructing the AI and
influencing its response. Managing the length of the prompt allows you
to provide sufficient context while ensuring clarity and focus in the
generated content.
- Example without Consideration for Prompt Length
Prompt:
Explain the concept of renewable energy sources, their
importance, and their impact on the environment.
Response (No Prompt Length Consideration):
Renewable energy sources, such as solar, wind, and hydroelectric
power, play a significant role in reducing our reliance on fossil
fuels. They are vital for mitigating climate change and
preserving the environment.
- Example with Consideration for Prompt Length (Concise Prompt)
Prompt:
Define renewable energy briefly.
Response (Concise Prompt with Length Consideration):
Renewable energy includes sources like solar, wind, and hydro
power, which reduce reliance on fossil fuels and combat climate
change.
Tips for Managing Prompt Length
- Focus on Essentials:
Craft prompts that emphasize the most critical aspects or details
to maintain clarity and conciseness.
- Avoid Overly Complex Prompts:
Keep prompts straightforward and free from unnecessary
elaboration to optimize AI understanding.
Considerations
- Prompt length impacts the AI's understanding and response. A
well-structured prompt balances the amount of context provided
with the need for clarity.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
21
- Carefully manage prompt length to ensure that the generated
content aligns with your objectives and requirements.
- Example Prompt for Experimentation:
Prompt:
Describe the significance of biodiversity conservation in a
sentence with a concise prompt length.
Response (Concise Prompt with Length Consideration):
Biodiversity conservation is crucial for preserving the variety
of life on Earth and maintaining ecosystem stability.
Experimenting with prompt length allows you to effectively instruct
the AI while maintaining clarity and focus in the generated responses.
Balance the amount of context provided in the prompt to align with
your specific content goals.
MODEL CHOICE
"Model choice" in prompting involves selecting a specific AI model or
version to generate content based on your requirements. This guide
explores the principles and examples of using "model choice" for
tailored and specialized AI-generated content.
Understanding "Model Choice" in Prompting
"Model choice" allows you to specify which AI model or version should
be used for generating content. Different models may have unique
strengths, capabilities, and expertise, making it essential to select
the most suitable one for your task.
- Example without "Model Choice" Specification
Prompt:
Describe the process of photosynthesis.
Response (No "Model Choice" Specification):
Photosynthesis is the process by which green plants, algae, and
some bacteria convert light energy into chemical energy,
producing oxygen and glucose.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
22
- Example with "Model Choice" Specification (Selecting Scientific
Expertise Model)
Prompt:
Explain the process of photosynthesis using a scientific
perspective and select the model with scientific expertise.
Response ("Model Choice" with Scientific Expertise):
Photosynthesis, as viewed from a scientific lens, is the
intricate biochemical process through which green plants, algae,
and certain bacteria harness solar energy to synthesize organic
molecules like glucose, while releasing oxygen as a byproduct.
Tips for Using "Model Choice" Parameter
- Identify Task Requirements:
Determine the specific requirements or expertise needed for your
content, such as scientific knowledge or creative storytelling.
- Select the Appropriate Model:
Choose the AI model or version that aligns with your task's
requirements, such as a scientific model, creative writer model,
etc.
Considerations
- "Model choice" ensures that you leverage the expertise of a
specialized AI model to generate content that aligns with your
task's nature and requirements.
- It is effective wh
RESPONSE LENGTH
"Response length" in prompting refers to the explicit instruction to
control the number of tokens (words or characters) in the AI-generated
response. This guide explores the principles and examples of using
"response length" for precise control over the length and conciseness
of AI-generated content.
Understanding "Response Length" in Prompting
"Response length" involves providing instructions to the AI on the
desired length of the generated response. By specifying the number of
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
23
tokens, you can ensure that the AI's output aligns with your
requirements, whether it's a concise answer or a detailed explanation.
- Example without "Response Length" Specification
Prompt:
Explain the concept of climate change.
Response (No "Response Length" Specification):
Climate change is a complex phenomenon driven by the accumulation
of greenhouse gasses in the Earth's atmosphere, resulting in
global temperature rise and various environmental impacts.
- Example with "Response Length" Instruction (Limit to 50 words)
Prompt:
Describe the concept of climate change in 50 words or less.
Response ("Response Length" Limited to 50 words):
Climate change is caused by greenhouse gasses accumulating in the
atmosphere, leading to rising global temperatures and adverse
environmental effects.
Tips for Using "Response Length" Parameter
- Define the Limit:
Clearly specify the maximum number of tokens (words or
characters) for the response to ensure the AI adheres to the
desired length.
- Balance Detail and Conciseness:
When setting response length, strike a balance between providing
essential information and maintaining conciseness.
Considerations
- "Response length" allows you to exert precise control over the
length of AI-generated content, ensuring that it aligns with your
objectives and space constraints.
- It is effective when you require concise answers, brief
descriptions, or content that fits within specific word or
character limits.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
24
- Example Prompt for Experimentation
Prompt:
Explain the process of cellular respiration, providing a detailed
response within 100 words.
Response ("Response Length" Limited to 100 words):
Cellular respiration is the biochemical process in which cells
convert glucose and oxygen into energy, carbon dioxide, and
water. This vital process occurs in three stages: glycolysis, the
Krebs cycle, and the electron transport chain, ultimately
producing adenosine triphosphate (ATP) for cellular functions.
Experimenting with "response length" instructions allows you to
control the length and conciseness of AI-generated content. Specify
the desired word or character limit to align the response with your
content requirements, whether it's for brief summaries or
comprehensive explanations.
OTHER PROMPTING METHODS
DESIRED FORMAT
"Desired format" is a crucial parameter in prompting that specifies
how you want the AI-generated content to be structured or presented.
This section explores the principles and examples of using "desired
format" to effectively communicate your expectations and preferences
to the AI.
Understanding "Desired Format" in Prompting
"Desired format" involves explicitly specifying the structure, style,
or presentation of the AI-generated response. It helps ensure that the
content aligns with your expectations and requirements.
- Example without "Desired Format" Specification
Prompt:
Explain the concept of renewable energy.
Response (No "Desired Format" Specification):
Renewable energy refers to sources of energy that are naturally
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
25
replenished, such as solar power, wind energy, and hydropower.
- Example with "Desired Format" (Requesting a List Format)
Prompt:
Explain the concept of renewable energy in a bulleted list
Format.
Response ("Desired Format" as a List):
- Renewable energy sources are naturally replenished.
- Examples include solar power, wind energy, and hydropower.
Tips for Using "Desired Format" Parameter
- Specify the Format:
Clearly define the desired format, such as lists, paragraphs,
bullet points, or other structural elements.
- Alignment with Purpose:
Ensure that the chosen format aligns with the purpose and style
of the content.
Considerations
- "Desired format" helps you communicate your preferences for how
the AI-generated content should be structured or presented,
ensuring it meets your expectations.
- It is effective when you need content presented in a specific
manner, such as lists, paragraphs, or other structural formats.
- Example Prompt for Experimentation
Prompt:
Describe the benefits of regular exercise in a table
format, using "desired format" to structure the information.
Response ("Desired Format" as a Table):
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
26
Benefit Description
Exercise strengthens the heart and reduces
Improved Cardiovascular Health
the risk of heart disease.
Regular workouts build muscle mass and
Enhanced Muscle Strength
improve overall strength.
Physical activity helps reduce stress and
Stress Reduction
enhances mental well-being.
Experimenting with "desired format" in your prompts allows you to
specify how the AI-generated content should be structured or
presented. By defining the format, you can ensure that the responses
align with your expectations and effectively convey information in the
desired manner.
<PLACEHOLDERS> AS PARAMETERS
"<Placeholders> as parameters" is a powerful technique in prompting
that allows you to dynamically insert specific information into the
AI-generated response. The following section explores the principles
and examples of using placeholders as parameters to create
personalized and context-aware content.
Understanding "<Placeholders> as Parameters" in Prompting
"<Placeholders> as parameters" involves using designated markers
within the prompt to indicate where specific information should be
inserted into the response. These markers are replaced with relevant
details when generating the AI response.
- Example without "<Placeholders> as Parameters" Consideration
Prompt:
Describe a personalized fitness routine.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
27
Response (No "<Placeholders> as Parameters"):
A personalized fitness routine typically includes exercises like
cardio, strength training, and flexibility work.
- Example with "<Placeholders> as Parameters" (Dynamic Insertion):
Prompt:
Create a personalized fitness routine with placeholders for the
user's name and preferred exercises.
Response ("<Placeholders> as Parameters" for Personalization):
Hi [User's Name], your personalized fitness routine consists of
[Preferred Exercises]. This tailored plan will help you achieve
your fitness goals.
Tips for Using "<Placeholders> as Parameters" Parameter
- Designate Placeholder Tags:
Clearly define placeholder tags within the prompt to indicate
where specific information should be inserted.
- Provide Context:
Ensure that the placeholder tags are meaningful and provide
context for the information to be inserted.
Considerations
- "<Placeholders> as parameters" enable dynamic and context-aware
content generation, allowing you to create personalized responses
based on user-specific details.
- It is effective when you want to generate tailored content,
personalized messages, or contextually relevant information.
- Example Prompt for Experimentation
Prompt:
Generate a personalized birthday greeting for [User's Name], with
placeholders for their age and a heartfelt message.
Response ("<Placeholders> as Parameters" for Personalized
🎉
Greeting):
Happy [User's Age]th birthday, [User's Name]! May your special
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
28
day be filled with joy, laughter, and unforgettable moments.
Here's to another year of wonderful adventures and achievements.
Experimenting with "<Placeholders> as parameters" in your prompts
allows you to create personalized and context-aware AI-generated
content. Use this technique to dynamically insert specific
information, making your responses more relevant and engaging for
users.
<PLACEHOLDERS> AS INSTRUCTIONS
"<Placeholders> as instructions" is a versatile technique in prompting
that allows you to provide specific guidance or directives within the
prompt itself. This section explores the principles and examples of
using placeholders as instructions to effectively steer the AI's
response in a desired direction.
Understanding "<Placeholders> as Instructions" in Prompting
"<Placeholders> as instructions" involves using designated markers
within the prompt to provide explicit guidance or directives to the
AI. These markers instruct the AI on how to structure or approach the
response.
- Example without "<Placeholders> as Instructions" Consideration
Prompt:
Explain the process of photosynthesis.
Response (No "<Placeholders> as Instructions"):
Photosynthesis is the process by which green plants, algae, and
some bacteria convert light energy into chemical energy,
producing oxygen and glucose.
- Example with "<Placeholders> as Instructions" (Guiding the
Explanation):
Prompt:
Explain the process of photosynthesis using placeholders to
emphasize simplicity, importance, and a real-life example.
Response ("<Placeholders> as Instructions" for Guidance):
Photosynthesis is like nature's magic trick. It's how plants
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
29
create their food and give us [Placeholder for Importance:
"life-sustaining"] oxygen. Imagine it as a plant's sun-powered
kitchen, where they cook up [Placeholder for Simplicity: "simple
sugars"] glucose using light energy. Just like how we eat to
survive, plants photosynthesize to thrive.
For a real-life example, think of a lush forest. In this green
wonderland, trees and plants work tirelessly, soaking up sunlight
and inhaling carbon dioxide from the air. They combine these
elements with water, which they draw up through their roots like
a straw. Then, using the sun's energy, they perform their
incredible photosynthetic feat, creating glucose and releasing
oxygen as a byproduct. This process not only feeds the plants but
also provides us with the oxygen we breathe—a truly vital gift
from the natural world.
Tips for Using "<Placeholders> as Instructions" Parameter
- Clearly Define Placeholder Instructions:
Provide clear and concise instructions within the prompt to guide
the AI effectively.
- Use Descriptive Labels:
Ensure that placeholder instructions are labeled or described in
a way that communicates their purpose.
Considerations
- "<Placeholders> as instructions" offer a precise way to steer the
AI's response by providing specific guidance or directives,
resulting in content that aligns with your expectations.
- It is effective when you want to influence the style, tone, or
structure of the AI-generated content, ensuring it meets your
criteria.
- Example Prompt for Experimentation
Prompt:
Craft a persuasive argument using placeholders to emphasize the
importance of environmental conservation, the urgency of action,
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
30
and a call to action.
Response ("<Placeholders> as Instructions" for Persuasive
Argument):
[Placeholder for Importance: "Our planet's future"] is hanging in
the balance. The [Placeholder for Urgency: "clock is ticking"] on
environmental issues, and we can no longer afford to be passive
observers. It's time for all of us to step up and make a
difference.
Our natural world is a treasure trove of beauty, biodiversity,
and resources that sustain life. Yet, it's under siege from
pollution, deforestation, and climate change. The consequences of
inaction are dire. We risk losing species, ecosystems, and the
delicate balance of our planet's climate.
But here's the good news: [Placeholder for Call to Action: "We
have the power"] to reverse this course. By conserving resources,
reducing waste, supporting renewable energy, and advocating for
policies that protect our environment, we can turn the tide.
Let's be the stewards of the Earth that it desperately needs.
[Placeholder for Call to Action: "Join the movement"], take
action today, and ensure a sustainable and vibrant planet for
generations to come.[Placeholder for Call to Action: “Together,
we can make a world of difference!!!”].
Experimenting with "<Placeholders> as instructions" in your prompts
allows you to provide specific guidance and directives to the AI,
ensuring that the generated content aligns with your desired style,
tone, or approach. Use this technique to influence and shape the AI's
responses effectively.
SPECIFY TONE/STYLE
"Specify style/tone" is a critical parameter in prompting that allows
you to communicate the desired mood, writing style, or tone for the
AI-generated content. This guide explores the principles and examples
of using "specify style/tone" to ensure that the AI's responses align
with your intended emotional or stylistic requirements.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
31
Understanding "Specify Style/Tone" in Prompting
"Specify style/tone" involves explicitly indicating the mood, writing
style, or emotional tone you want the AI to convey in its response. It
helps ensure that the generated content matches your desired emotional
or stylistic expression.
- Example without "Specify Style/Tone" Consideration
Prompt:
Describe a haunted house.
Response (No "Specify Style/Tone" Consideration):
The haunted house is a spooky and eerie place with creaking
floors and ghostly apparitions.
- Example with "Specify Style/Tone" (Requesting a Playful Tone):
Prompt:
Describe a haunted house with a playful and whimsical tone.
Response ("Specify Style/Tone" for Playfulness):
The haunted house is a mischievous and whimsical abode, where
friendly ghosts play hide-and-seek amidst the creaking floors and
secret passages.
Tips for Using "Specify Style/Tone" Parameter
- Be Explicit:
Clearly state the desired style, tone, or mood, using adjectives
or descriptors that convey the emotional or stylistic
requirements.
- Alignment with Content:
Ensure that the chosen style/tone aligns with the content's
purpose and context.
Considerations
- "Specify style/tone" enables you to guide the AI's response by
providing clear emotional or stylistic instructions, resulting in
content that resonates with your intended expression.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
32
- It is effective when you need the AI-generated content to evoke a
specific emotional response or match a particular writing style
or tone.
- Example Prompt for Experimentation
Prompt:
Write a poem about a tranquil forest with "specify style/tone"
to convey a sense of serenity and calm.
Response ("Specify Style/Tone" for Serenity):
In the heart of the tranquil forest's embrace,
Where whispers of leaves lull nature's grace.
Serenity flows in a gentle, quiet stream,
A tranquil haven, a poet's dream.
Experimenting with "specify style/tone" in your prompts allows you to
direct the AI's response by conveying specific emotional or stylistic
requirements. Use this technique to ensure that the generated content
effectively communicates the desired mood, writing style, or tone.
SPECIFYING TARGET AUDIENCE PROMPTING
"Specifying target audience prompting" is a technique that involves
instructing the AI to generate responses while considering a
particular group or demographic as the intended audience. This guide
explores the principles and examples of using "specifying target
audience prompting" to tailor AI-generated content to a specific
readership.
Understanding "Specifying Target Audience Prompting"
"Specifying target audience prompting" is the process of guiding the
AI to generate responses while keeping a designated group of readers
or viewers in mind as the primary audience. It encourages the AI to
craft content that aligns with the interests, needs, and preferences
of the chosen audience.
- Example without "Specifying Target Audience Prompting"
Prompt:
Explain the benefits of exercise.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
33
Response (No "Specifying Target Audience Prompting"):
Exercise offers numerous advantages, including improved physical
fitness and overall health.
- Example with "Specifying Target Audience Prompting" (Tailored for
Seniors)
Prompt:
Explain the benefits of exercise for seniors, highlighting how it
enhances mobility and cognitive function.
Response ("Specifying Target Audience Prompting" for Seniors):
For seniors, regular exercise is a crucial component of
maintaining a healthy and active lifestyle. Engaging in physical
activity can significantly improve mobility and cognitive
function, promoting independence and overall well-being.
Tips for Using "Specifying Target Audience Prompting"
- Define the Audience:
Clearly specify the target audience or demographic for which the
content is intended.
- Consider Audience Interests:
Encourage the AI to address topics, concerns, or interests
relevant to the chosen audience.
Considerations
- "Specifying target audience prompting" is effective when you want
the AI to generate content that caters to the specific needs and
interests of a particular group or demographic.
- It leverages the AI's capacity to tailor content to the
preferences and requirements of different audiences, enhancing
relevance and engagement.
- Example Prompt for Experimentation
Prompt:
Write a blog post about the latest fashion trends for teenagers,
with a focus on casual wear for school and social events.
Response ("Specifying Target Audience Prompting" for Teenagers):
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
34
Hey there, fashion-savvy teenagers! Are you looking to up your
style game for school and those fun social gatherings? You're in
the right place. In this blog post, we'll explore the hottest
trends in casual wear that will have you standing out and feeling
confident.
From comfy athleisure outfits perfect for a day at school to
trendy streetwear ensembles that'll turn heads at social events,
we've got you covered. Discover the must-have pieces, color
palettes, and styling tips to create effortlessly cool looks that
reflect your unique personality.
Get ready to rock the hallways and make a statement wherever you
go. Let's dive into the world of teen fashion and uncover the
latest trends that speak to your youthful spirit!
Experimenting with "specifying target audience prompting" allows you
to guide the AI in tailoring content to the preferences and interests
of specific groups or demographics, ensuring that the generated
content resonates with the intended readers or viewers. Use this
technique when you want the AI-generated content to be highly relevant
and engaging for a particular audience.
OUTRO
As we wrap up our exploration of Prompt Engineering's fundamental
principles, it's clear that the journey into AI's capabilities has
barely begun. The foundational knowledge we've built together is just
the beginning, with vast landscapes of potential and innovation lying
ahead. Keep your curiosity kindled and your mind open as we prepare to
dive deeper into the art of prompting, where precision meets
creativity in our next installment. The adventure continues, and the
best is yet to come.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
35
Prompt Engineering Guide
Elevate Your Communication: Mastering the Art of Prompt Engineering
PART 2 - ADVANCED PROMPTING TECHNIQUES
Author : Lampros Mousselimis
Email : [Link]@[Link]
LinkedIn : [Link]
Version : 0.0.1
TABLE OF CONTENTS
ADVANCED PROMPTING TECHNIQUES............................................... 5
HYPER-PARAMETERS OF LLMs.................................................... 5
Echo..................................................................... 5
Stop Sequences........................................................... 5
Logit Bias............................................................... 5
Beam Search.............................................................. 5
Input Noise.............................................................. 6
Output Noise............................................................. 6
Reinforcement Learning from Human Feedback (RLHF)........................ 6
Best-of.................................................................. 6
USAGE EXAMPLES OF HYPER-PARAMETERS TUNING................................... 6
ECHO..................................................................... 6
Understanding "Echo" in Prompting..................................... 7
- Example without "Echo" Consideration............................. 7
- Example with "Echo" Parameter.................................... 7
Tips for Using "Echo" Parameter....................................... 7
- Emphasize Key Instructions:...................................... 7
- Balance with Clarity:............................................ 7
Considerations........................................................ 7
- Example Prompt for Experimentation............................... 8
STOP SEQUENCES........................................................... 8
Understanding "Stop Sequences" in Prompting........................... 8
- Example without "Stop Sequence" Consideration.................... 8
- Example with "Stop Sequence" Instruction......................... 9
Tips for Using "Stop Sequences" Parameter............................. 9
- Specify the Stopping Point:...................................... 9
- Use for Precision:............................................... 9
Considerations........................................................ 9
- Example Prompt for Experimentation............................... 9
LOGIT BIAS.............................................................. 10
Understanding "Logit Bias" in Prompting.............................. 10
- Example without "Logit Bias" Consideration...................... 10
- Example with "Logit Bias" Modification (Emphasizing "Interactive
Learning")........................................................ 10
Tips for Using "Logit Bias" Parameter................................ 11
- Identify Key Tokens:............................................ 11
- Assign Bias Values:............................................. 11
Considerations....................................................... 11
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 1
- Example Prompt for Experimentation.............................. 11
BEAM SEARCH............................................................. 12
Understanding "Beam Search" in Prompting............................. 12
- Example Without "Beam Search" Consideration..................... 12
- Example with "Beam Search" (Beam Width = 3)..................... 12
Tips for Using "Beam Search" Parameter............................... 13
- Set the Beam Width:............................................. 13
- Balance Exploration and Efficiency:............................. 13
Considerations....................................................... 13
- Example Prompt for Experimentation.............................. 13
INPUT NOISE............................................................. 14
Understanding "Input Noise" in Prompting............................. 14
- Example without "Input Noise" Consideration..................... 14
- Example with "Input Noise" (Introducing Random Noise)........... 14
Tips for Using "Input Noise" Parameter............................... 14
- Define the Type of Noise:....................................... 14
- Encourage Creativity:........................................... 14
Considerations....................................................... 15
- Example Prompt for Experimentation.............................. 15
OUTPUT NOISE............................................................ 15
Understanding "Output Noise" in Prompting............................ 15
- Example without "Output Noise" Consideration.................... 15
- Example with "Output Noise" (Introducing Random Noise).......... 16
Tips for Using "Output Noise" Parameter.............................. 16
- Specify the Level of Noise:..................................... 16
- Promote Creativity:............................................. 16
Considerations....................................................... 16
- Example Prompt for Experimentation.............................. 16
RLHF [REINFORCEMENT LEARNING FROM HUMAN FEEDBACK]....................... 17
Understanding RLHF in Prompting...................................... 17
- Example without RLHF Consideration.............................. 17
- Example with RLHF (Human Feedback Integration).................. 17
Tips for Using RLHF in Prompting..................................... 18
- Collect Human Feedback:......................................... 18
- Iterative Improvement:.......................................... 18
Considerations....................................................... 18
BEST OF................................................................. 19
Understanding "Best of" in Prompting................................. 19
- Example without "Best of" Consideration......................... 19
- Example with "Best of" Parameter (best of 3):................... 19
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 2
Tips for Using "Best of" Parameter................................... 19
- Specify the Number of Attempts:................................. 19
- Define Criteria for Selection:.................................. 19
Considerations....................................................... 20
- Example Prompt for Experimentation.............................. 20
OTHER PROMPTING METHODS................................................. 20
MANY-EXAMPLES PROMPTING................................................. 20
Understanding "Many-Examples Prompting".............................. 20
- Example without "Many-Examples Prompting" Consideration......... 21
- Example with "Many-Examples Prompting" (Providing Multiple
Examples)......................................................... 21
Tips for Using "Many-Examples Prompting"............................. 21
- Include Diverse Examples:....................................... 21
- Clarity in Instruction:......................................... 21
Considerations....................................................... 21
- Example Prompt for Experimentation.............................. 22
ZERO-SHOT PROMPTING..................................................... 22
Understanding "Zero-Shot Prompting".................................. 22
- Example Without "Zero-Shot Prompting" Consideration............. 22
- Example with "Zero-Shot Prompting" (Requesting an Explanation).. 23
Tips for Using "Zero-Shot Prompting"................................. 23
- Ask Open-Ended Questions:....................................... 23
- Trust the AI's Knowledge:....................................... 23
Considerations....................................................... 23
- Example Prompt for Experimentation.............................. 23
FEW-SHOT PROMPTING...................................................... 24
Understanding "Few-Shot Prompting"................................... 24
- Example without "Few-Shot Prompting" Consideration.............. 24
- Example with "Few-Shot Prompting" (Providing Examples).......... 25
Tips for Using "Few-Shot Prompting".................................. 25
- Include Relevant Examples:...................................... 25
- Clear Instruction:.............................................. 25
Considerations....................................................... 25
- Example Prompt for Experimentation.............................. 25
KNOWLEDGE GENERATION PROMPTING.......................................... 27
Understanding "Knowledge Generation Prompting"....................... 27
- Example without "Knowledge Generation Prompting" Consideration.. 27
- Example with "Knowledge Generation Prompting" (Seeking New
Insights)......................................................... 27
Tips for Using "Knowledge Generation Prompting"...................... 27
- Phrase Open-Ended Questions:.................................... 27
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 3
- Specify the Scope:.............................................. 28
Considerations....................................................... 28
- Example Prompt for Experimentation.............................. 28
KNOWLEDGE INTEGRATION PROMPTING......................................... 28
Understanding "Knowledge Integration Prompting"...................... 29
- Example without "Knowledge Integration Prompting" Consideration. 29
- Example with "Knowledge Integration Prompting" (Incorporating
Existing Knowledge)............................................... 29
Tips for Using "Knowledge Integration Prompting"..................... 29
- Specify Sources:................................................ 29
- Provide Context:................................................ 30
Considerations....................................................... 30
- Example Prompt for Experimentation.............................. 30
SELF-REFINEMENT PROMPTING............................................... 30
Understanding "Self-Refinement Prompting"............................ 31
- Example without "Self-Refinement Prompting" Consideration....... 31
- Example with "Self-Refinement Prompting" (Iterative Improvement) 31
Tips for Using "Self-Refinement Prompting"........................... 31
- Provide Specific Feedback:...................................... 31
- Iterate as Needed:.............................................. 32
Considerations....................................................... 32
- Example Prompt for Experimentation.............................. 32
PROBLEM ORIENTED PROMPTING.............................................. 32
Understanding "Problem-Oriented Prompting"........................... 33
- Example without "Problem-Oriented Prompting".................... 33
- Example with "Problem-Oriented Prompting" (Addressing Energy
Sustainability)................................................... 33
Tips for Using "Problem-Oriented Prompting".......................... 34
- Clearly Define the Problem:..................................... 34
- Encourage Solution-Oriented Responses:.......................... 34
Considerations....................................................... 34
- Example Prompt for Experimentation.............................. 34
PROBLEM FORMULATION PROMPTING........................................... 35
Understanding "Problem Formulation Prompting"........................ 36
- Example without "Problem Formulation Prompting"................. 36
- Example with "Problem Formulation Prompting" (Defining the
Challenge)........................................................ 36
Tips for Using "Problem Formulation Prompting"....................... 36
- Clearly Define the Problem:..................................... 36
- Encourage Contextual Responses:................................. 36
Considerations....................................................... 37
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 4
- Example Prompt for Experimentation.............................. 37
OUTRO................................................................... 38
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 5
ADVANCED PROMPTING TECHNIQUES
Building upon the solid foundation laid in our first installment, we
now venture into the realm of Advanced Prompting Techniques, unlocking
a new level of creativity and specificity in AI-generated content.
This chapter is designed for those ready to take their Prompt
Engineering skills to the next level, offering strategies that refine
and tailor AI outputs with unprecedented precision. As we delve into
the nuances of advanced hyperparameters and innovative prompting
methods, you'll learn how to guide AI in producing content that not
only resonates with your intended audience but also embodies the depth
and detail akin to human creativity. Prepare to elevate your AI
interactions as we explore the artistry behind advanced prompting.
HYPER-PARAMETERS OF LLMs
When working with large language models (LLMs) like GPT-3 or GPT-4,
there are several hyperparameters that you can tune to influence the
behavior and output of the model. Here's an extensive list of some
common hyperparameters along with a brief explanation of each:
Echo
Determines whether the prompt should be included in the model's
output.
Stop Sequences
These are specific tokens or sequences where the model will stop
generating further output.
Logit Bias
Allows you to increase or decrease the likelihood of specific
tokens appearing in the output.
Beam Search
Used in some models for generating output by exploring multiple
paths and choosing the one with the highest overall score.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 6
Input Noise
Adds randomness to the input embeddings, which can sometimes lead
to more creative or varied outputs.
Output Noise
Similar to input noise, but adds randomness to the output
generation process.
Reinforcement Learning from Human Feedback (RLHF)
Some models are fine-tuned using human feedback, which can be a
factor in how they respond.
Best-of
Specifies the number of times the model should generate an output
before choosing the best one. It's like running multiple
simulations and picking the most suitable response.
It's important to note that the availability and exact behavior of
these hyperparameters can vary depending on the specific model and
platform you are using. Additionally, the optimal settings for these
hyperparameters can depend greatly on the specific task or type of
response you are aiming to generate. Experimentation and tweaking are
often necessary to achieve the desired output.
USAGE EXAMPLES OF HYPER-PARAMETERS TUNING
ECHO
The "echo" parameter in prompting instructs the AI to incorporate the
input prompt within the generated response, often providing context or
reinforcement of the initial instruction. This section explores the
principles and examples of using "echo" for more context-aware
AI-generated content.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 7
Understanding "Echo" in Prompting
"Echo" involves including the input prompt or a modified version of it
within the AI-generated response. This technique helps reinforce the
context of the instruction and ensures that the response remains
closely tied to the initial prompt.
- Example without "Echo" Consideration
Prompt:
Describe the life cycle of a butterfly.
Response (No "Echo" Consideration):
The life cycle of a butterfly consists of four stages: egg,
larva, pupa, and adult. Each stage serves a specific purpose in
the transformation from a caterpillar to a beautiful butterfly.
- Example with "Echo" Parameter
Prompt:
Describe the life cycle of a butterfly, and explain how it
undergoes metamorphosis.
Response ("Echo" Included):
The life cycle of a butterfly, which undergoes metamorphosis,
consists of four stages. In this transformation, the butterfly
progresses through the egg stage, followed by the larva or
caterpillar, then the pupa or chrysalis, and finally emerges as a
magnificent adult butterfly.
Tips for Using "Echo" Parameter
- Emphasize Key Instructions:
Use "echo" to reiterate or emphasize key instructions or elements
from the prompt to maintain context.
- Balance with Clarity:
Ensure that the echoed prompt enhances clarity and relevance
without making the response overly repetitive.
Considerations
- "Echo" reinforces the context of the instruction, making the
generated content more closely tied to the initial prompt.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 8
- It is effective when you want to ensure that the response remains
contextually relevant and aligned with the original instruction.
- Example Prompt for Experimentation
Prompt:
Explain the concept of climate change, emphasizing its
environmental impact and the importance of mitigation measures,
with the inclusion of the prompt in the response.
Response ("Echo" Included):
Climate change, with its significant environmental impact,
underscores the urgency of implementing effective mitigation
measures. In understanding climate change, it's crucial to
recognize the importance of reducing greenhouse gas emissions and
adopting sustainable practices to safeguard our planet.
Experimenting with the "echo" parameter allows you to reinforce the
context of the instruction within the AI-generated response.
Incorporate key elements from the prompt to maintain clarity and
relevance while ensuring that the response aligns closely with the
initial instruction.
STOP SEQUENCES
"Stop sequences" are specific instructions within a prompt that signal
the AI to halt or conclude its response at a designated point. This
guide explores the principles and examples of using "stop sequences"
for precise and controlled AI-generated content.
Understanding "Stop Sequences" in Prompting
"Stop sequences" are prompts that include instructions to guide the AI
on when and where to conclude its response. These instructions help
ensure that the generated content ends at a specific point, providing
clarity and control over the length and focus of the response.
- Example without "Stop Sequence" Consideration
Prompt:
Write about the history of the internet.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page 9
Response (No "Stop Sequence" Consideration):
The history of the internet is a vast and complex topic, spanning
several decades. It began with the development of ARPANET in the
late 1960s and evolved into the global network we use today,
revolutionizing communication and information sharing.
- Example with "Stop Sequence" Instruction
Prompt:
Describe the history of the internet, and stop after summarizing
its impact on communication.
Response ("Stop Sequence" Included):
The history of the internet is a vast and complex topic, spanning
several decades. It began with the development of ARPANET in the
late 1960s and evolved into the global network we use today,
revolutionizing communication. [Stop]
Tips for Using "Stop Sequences" Parameter
- Specify the Stopping Point:
Clearly indicate where the AI should conclude its response to
achieve the desired level of detail.
- Use for Precision:
Employ "stop sequences" when precision and control over the
response's length and focus are crucial.
Considerations
- "Stop sequences" provide explicit instructions for ending the
AI-generated response at a designated point, ensuring clarity and
control.
- They are effective when you want to specify the conclusion or
limit the length of the generated content.
- Example Prompt for Experimentation
Prompt:
Explain the concept of renewable energy, and stop after
describing its environmental benefits.
Response ("Stop Sequence" Included):
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
10
Renewable energy harnesses natural resources like sunlight, wind,
and water to generate clean power. Its environmental benefits
include reduced greenhouse gas emissions and a sustainable energy
source. [Stop]
Experimenting with "stop sequences" allows you to precisely control
the point at which the AI-generated response concludes. Specify the
stopping point within the prompt to achieve the desired level of
detail and focus in the generated content.
LOGIT BIAS
The "logit bias" parameter in prompting allows you to adjust the
model's behavior by modifying the likelihood of certain tokens
appearing in the generated response. The following sub-chapter
explores the principles and examples of using "logit bias" for
fine-tuning AI-generated content to align with specific requirements.
Understanding "Logit Bias" in Prompting
"Logit bias" enables you to influence the model's token generation
probabilities by assigning higher or lower bias values to specific
tokens or token groups. This technique allows you to emphasize or
de-emphasize certain words or concepts in the generated content.
- Example without "Logit Bias" Consideration
Prompt:
Write a paragraph about the benefits of technology in education.
Response (No "Logit Bias" Consideration):
Technology has transformed education in numerous ways, providing
access to a wealth of information and interactive learning
opportunities.
- Example with "Logit Bias" Modification (Emphasizing "Interactive
Learning")
Prompt:
Describe the advantages of technology in education, with a focus
on interactive learning, and adjust the "logit bias" accordingly.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
11
Response ("Logit Bias" Adjusted for Emphasis):
Technology has revolutionized education, with a particular
emphasis on interactive learning. It offers students engaging and
immersive experiences, fostering deeper understanding and
knowledge retention.
Tips for Using "Logit Bias" Parameter
- Identify Key Tokens:
Determine which tokens or concepts you want to emphasize or
de-emphasize in the response.
- Assign Bias Values:
Adjust the "logit bias" values to prioritize or diminish the
likelihood of specific tokens appearing.
Considerations
- "Logit bias" allows for targeted modifications of token
generation probabilities, making it effective for emphasizing
specific content or concepts.
- It is useful when you want to ensure that certain words or ideas
are prominently featured in the AI-generated content.
- Example Prompt for Experimentation
Prompt:
Write a product description for a new smartphone, emphasizing its
advanced camera capabilities and adjust the "logit bias"
accordingly.
Response ("Logit Bias" Adjusted for Emphasis on Camera):
Introducing the latest smartphone with cutting-edge camera
capabilities. Our device boasts state-of-the-art camera
technology, ensuring breathtaking photos and videos with every
click. [Logit Bias: "camera" +2, "technology" +1]
Experimenting with the "logit bias" parameter allows you to fine-tune
AI-generated content to emphasize or de-emphasize specific tokens or
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
12
concepts. Assign bias values strategically to achieve the desired
focus and emphasis in the generated response.
BEAM SEARCH
"Beam search" is a search algorithm used in prompting to select the
most likely sequence of tokens in AI-generated content. This guide
explores the principles and examples of using "beam search" for
refining and enhancing AI-generated responses.
Understanding "Beam Search" in Prompting
"Beam search" is an algorithm that explores multiple potential
sequences of tokens during text generation. It evaluates and selects
the most likely sequence based on a predefined width parameter called
the "beam width." This technique improves the quality and coherence of
AI-generated content.
- Example Without "Beam Search" Consideration
Prompt:
Write a summary of the benefits of reading books.
Response (No "Beam Search" Consideration):
Reading books offers various advantages, such as knowledge
acquisition, improved vocabulary, and enhanced empathy.
- Example with "Beam Search" (Beam Width = 3)
Prompt:
Summarize the benefits of reading books, considering a "beam
search" with a width of 3.
Response ("Beam Search" with Width = 3):
Reading books provides numerous advantages, including the
acquisition of knowledge, expansion of vocabulary, and
development of empathy and emotional intelligence.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
13
Tips for Using "Beam Search" Parameter
- Set the Beam Width:
Choose an appropriate beam width value that suits your content
requirements. A larger beam width explores more possibilities but
may increase response generation time.
- Balance Exploration and Efficiency:
Experiment with different beam widths to strike a balance between
exploring diverse options and generating responses efficiently.
Considerations
- "Beam search" enhances the quality and coherence of AI-generated
content by selecting the most likely sequence of tokens.
- It is effective when you want to improve the fluency, coherence,
and relevance of the generated responses.
- Example Prompt for Experimentation
Prompt:
Write a dialogue between two characters discussing the impact of
technology in society, using "beam search" with a width of 5.
Response ("Beam Search" with Width = 5):
Character 1: Technology has undoubtedly reshaped society in
countless ways.
Character 2: Absolutely! From communication to healthcare, it's
had a profound impact.
Character 1: And it continues to evolve at an astonishing pace,
affecting every aspect of our lives.
Experimenting with "beam search" allows you to improve the quality and
coherence of AI-generated content by selecting the most likely token
sequences. Adjust the beam width to balance exploration and efficiency
based on your specific content requirements.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
14
INPUT NOISE
"Input noise" is a parameter in prompting that involves adding random
or controlled variations to the input prompt. This entry guide
explores the principles and examples of using "input noise" to
introduce creativity, diversity, and unpredictability into
AI-generated content.
Understanding "Input Noise" in Prompting
"Input noise" involves injecting randomness or controlled variations
into the prompt given to the AI. By introducing noise, you can
encourage more creative, diverse, and unexpected responses from the AI
model.
- Example without "Input Noise" Consideration
Prompt:
Describe a typical day at the beach.
Response (No "Input Noise" Consideration):
A typical day at the beach involves relaxing under the sun,
swimming in the ocean, and building sandcastles with family and
friends.
- Example with "Input Noise" (Introducing Random Noise)
Prompt:
Describe a memorable day at the beach with random input noise.
Response ("Input Noise" Injected):
On a memorable day at the beach, a surprise visit from dolphins
added magic to our experience. We played beach volleyball, and
a sandcastle competition led to some hilarious creations.
Tips for Using "Input Noise" Parameter
- Define the Type of Noise:
Specify the type and extent of noise you want to introduce,
whether it's entirely random or follows specific guidelines.
- Encourage Creativity:
Use "input noise" to encourage the AI to generate more
imaginative, diverse, and unconventional responses.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
15
Considerations
- "Input noise" injects variability and unpredictability into
AI-generated content, fostering creativity and generating unique
responses.
- It is effective when you want to break away from predictable
answers and explore more imaginative and diverse content.
- Example Prompt for Experimentation
Prompt:
Tell a story about an unexpected adventure in a haunted house
with random input noise.
Response ("Input Noise" Injected):
In a creaky haunted house, we stumbled upon a hidden door that
led to a secret chamber filled with ancient treasures. We
encountered friendly ghosts who guided us through puzzles, making
it, an unforgettable adventure.
Experimenting with "input noise" allows you to infuse creativity,
diversity, and unpredictability into AI-generated content. Inject the
desired level of noise to encourage the generation of unique and
imaginative responses that break away from the ordinary.
OUTPUT NOISE
"Output noise" is a parameter in prompting that involves introducing
random or controlled variations to the generated AI responses. The
following section explores the principles and examples of using
"output noise" to add unpredictability and diversity to AI-generated
content.
Understanding "Output Noise" in Prompting
"Output noise" refers to the deliberate introduction of randomness or
controlled variations into the AI-generated responses. This parameter
aims to make the responses less predictable and more diverse,
enhancing creativity and unpredictability.
- Example without "Output Noise" Consideration
Prompt:
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
16
Describe the process of photosynthesis.
Response (No "Output Noise" Consideration):
Photosynthesis is the process by which green plants, algae, and
some bacteria convert light energy into chemical energy,
producing oxygen and glucose.
- Example with "Output Noise" (Introducing Random Noise)
Prompt:
Describe the process of photosynthesis with random output noise.
Response ("Output Noise" Injected):
Photosynthesis is the mystical dance of chlorophyll, where plants
and sunlight engage in an enchanting tango. The result? The
magical creation of oxygen, the breath of life, and sugary nectar
for the plant's sweet tooth.
Tips for Using "Output Noise" Parameter
- Specify the Level of Noise:
Determine the extent and nature of the noise you want to
introduce, whether it's entirely random or follows specific
guidelines.
- Promote Creativity:
Use "output noise" to encourage the AI to generate more creative,
diverse, and unexpected responses.
Considerations
- "Output noise" adds variability and unpredictability to
AI-generated content, fostering creativity and generating unique
responses.
- It is effective when you want to break away from predictable
answers and explore more imaginative and diverse content.
- Example Prompt for Experimentation
Prompt:
Describe a futuristic cityscape with random output noise.
Response ("Output Noise" Injected):
In the city of tomorrow, towering skyscrapers pierce the heavens,
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
17
their glass façades reflecting neon dreams. Hovering vehicles
glide through the air, leaving trails of stardust, while
holographic billboards paint the streets with a symphony of
colors and illusions.
Experimenting with "output noise" allows you to infuse creativity,
diversity, and unpredictability into AI-generated content. Inject the
desired level of noise to encourage the generation of unique and
imaginative responses that break away from the ordinary.
RLHF [REINFORCEMENT LEARNING FROM HUMAN FEEDBACK]
"RLHF" (Reinforcement Learning from Human Feedback) is an advanced
technique in prompting that involves providing reinforcement signals
or feedback to guide the AI's response generation. This section
explores the principles and examples of using RLHF to improve
AI-generated content through human guidance and feedback.
Understanding RLHF in Prompting
RLHF is a technique that integrates reinforcement signals or feedback
from human evaluators into the AI's training process. It leverages
human expertise to refine and enhance the AI's responses over time.
- Example without RLHF Consideration
Prompt:
Write a summary of a scientific paper on climate change.
Response (No RLHF Consideration):
The scientific paper discusses the various aspects of climate
change, including its causes, impacts, and potential solutions.
- Example with RLHF (Human Feedback Integration)
Prompt:
Generate a summary of a scientific paper on climate
change and refine the response based on human feedback.
Response (RLHF-Enhanced):
The scientific paper delves into the intricate web of climate
change, exploring its multifaceted causes, far-reaching impacts,
and innovative solutions. [Refined based on human feedback]
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
18
Tips for Using RLHF in Prompting
- Collect Human Feedback:
Gather valuable feedback from human evaluators to guide the AI's
response refinement process.
- Iterative Improvement:
Use RLHF iteratively to train the AI model progressively and
enhance response quality.
Considerations
- RLHF is an advanced technique that leverages human feedback to
improve the quality, accuracy, and relevance of AI-generated
content.
- It is effective when you seek to continuously refine and enhance
the AI's responses to meet specific quality standards or
objectives.
- Example Prompt for Experimentation
Prompt:
Write an essay on the ethical implications of artificial
intelligence in healthcare, incorporating human feedback to
ensure thorough and thoughtful analysis.
Response (RLHF-Enhanced):
The ethical implications of artificial intelligence in healthcare
are a complex tapestry, woven with threads of improved
diagnostics, patient privacy concerns, and equitable access.
[Enhanced through iterative feedback]
Using RLHF in prompting allows you to integrate human expertise and
feedback into the AI's response generation process, leading to more
refined and high-quality content. Employ this technique iteratively to
continually improve the AI's responses and meet specific quality
standards or objectives.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
19
BEST OF
The "best of" parameter in prompting allows you to specify the number
of times the model should generate an output before selecting the best
one. In the following section we are going to explore the principles
and examples of using "best of" for more refined and optimized
AI-generated content.
Understanding "Best of" in Prompting
"Best of" instructs the AI to run multiple simulations, generating
multiple responses, and then selecting the best-suited response based
on specified criteria. This technique enhances the quality and
relevance of the generated content.
- Example without "Best of" Consideration
Prompt:
Write a summary of the key findings in the research paper.
Response (No "Best of" Consideration):
The research paper discusses various findings related to the
study's objectives, including statistical data and significant
conclusions.
- Example with "Best of" Parameter (best of 3):
Prompt:
Summarize the research paper's key findings, selecting the best
summary from three attempts.
Response ("Best of" with 3 Attempts):
The research paper presents groundbreaking findings on the impact
of climate change on Arctic ecosystems, emphasizing the urgency
of conservation efforts.
Tips for Using "Best of" Parameter
- Specify the Number of Attempts:
Choose an appropriate number of attempts for the "best of"
parameter based on your quality requirements.
- Define Criteria for Selection:
Clearly outline the criteria for selecting the best response,
whether it's based on coherence, accuracy, or other factors.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
20
Considerations
- "Best of" enhances the quality and relevance of AI-generated
content by allowing for multiple attempts and selecting the most
suitable response.
- It's effective when precision and quality are paramount in the
generated content.
- Example Prompt for Experimentation
Prompt:
Write a product description for a new smartphone, selecting the
best description from three attempts based on clarity and
persuasiveness.
Response ("Best of" with 3 Attempts):
Introducing the latest smartphone innovation that seamlessly
blends cutting-edge technology with sleek design. Experience
unrivaled performance, stunning visuals, and an exceptional
camera that captures memories in vivid detail. Elevate your
mobile experience with our new smartphone today.
Experimenting with the "best of" parameter enables you to refine and
optimize AI-generated content by selecting the most suitable response
from multiple attempts. Specify the number of attempts and criteria
for selection to align with your content quality goals.
OTHER PROMPTING METHODS
MANY-EXAMPLES PROMPTING
"Many-Examples Prompting" is an effective technique that involves
providing multiple examples or instances within the prompt to guide
the AI in generating responses. This guide explores the principles and
examples of using "many-examples prompting" to improve the quality and
specificity of AI-generated content.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
21
Understanding "Many-Examples Prompting"
"Many-examples prompting" entails offering several examples,
instances, or scenarios related to the desired content in the prompt.
By presenting multiple examples, you help the AI understand the
context and generate responses that are more diverse and relevant.
- Example without "Many-Examples Prompting" Consideration
Prompt:
Describe a tropical fruit.
Response (No "Many-Examples Prompting"):
A tropical fruit is a type of fruit that grows in tropical
climates. Examples include bananas, pineapples, and mangoes.
- Example with "Many-Examples Prompting" (Providing Multiple
Examples)
Prompt:
Describe various tropical fruits such as bananas, pineapples,
mangoes, and papayas.
Response ("Many-Examples Prompting"):
Tropical fruits are a delightful variety, each with its unique
flavors and characteristics. For instance, bananas offer
creaminess, pineapples bring a tangy burst, mangoes offer a sweet
tropical taste, and papayas provide a delightful blend of flavors
and textures.
Tips for Using "Many-Examples Prompting"
- Include Diverse Examples:
Provide a range of examples or instances related to the topic to
ensure a more comprehensive understanding by the AI.
- Clarity in Instruction:
Make sure the AI recognizes that these examples are meant to be
incorporated or addressed in the response.
Considerations
- "Many-examples prompting" enhances the AI's grasp of the context
and desired content by offering a broader range of examples or
instances.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
22
- It is effective when you want the AI-generated content to be more
detailed, specific, and contextually rich.
- Example Prompt for Experimentation
Prompt:
Write a product description for a versatile kitchen appliance
that can blend, chop, and mix ingredients. Provide examples of
dishes it can help prepare.
Response ("Many-Examples Prompting"):
Introducing our versatile kitchen appliance—a true culinary
companion! With this innovative kitchen gadget, you can
effortlessly blend smoothies, chop vegetables for salads, and mix
batter for pancakes and cakes. Imagine creating a refreshing
strawberry banana smoothie, preparing a crisp garden salad, or
whipping up a fluffy pancake stack—all made easier with this
indispensable kitchen tool.
Experimenting with "many-examples prompting" in your prompts allows
you to provide the AI with a broader understanding of the desired
content. By offering multiple examples, you can generate responses
that are more detailed, diverse, and contextually relevant.
ZERO-SHOT PROMPTING
"Zero-shot prompting" is a technique that involves requesting the AI
to generate responses without providing any specific training
examples. This guide explores the principles and examples of using
"zero-shot prompting" to leverage the AI's general knowledge and
creativity effectively.
Understanding "Zero-Shot Prompting"
"Zero-shot prompting" is a method where you prompt the AI to generate
responses or information on a topic without giving it any explicit
examples or prior training data. It relies on the AI's inherent
understanding and general knowledge to generate relevant content.
- Example Without "Zero-Shot Prompting" Consideration
Prompt:
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
23
Explain the concept of quantum mechanics.
Response (No "Zero-Shot Prompting"):
Quantum mechanics is a branch of physics that deals with the
behavior of subatomic particles. It's a complex field that
includes concepts like wave-particle duality and quantum
superposition.
- Example with "Zero-Shot Prompting" (Requesting an Explanation)
Prompt:
Please explain quantum mechanics.
Response ("Zero-Shot Prompting"):
Quantum mechanics is a fundamental theory in physics that
describes the behavior of matter and energy on atomic and
subatomic scales. It introduces the concept of wave-particle
duality, where particles like electrons exhibit both
particle-like and wave-like properties. Additionally, quantum
superposition allows particles to exist in multiple states
simultaneously until measured, which is a stark departure from
classical physics.
Tips for Using "Zero-Shot Prompting"
- Ask Open-Ended Questions:
Phrase your prompts as open-ended questions or requests for
explanations, information, or creative content on a given topic.
- Trust the AI's Knowledge:
Zero-shot prompts rely on the AI's general knowledge and ability
to generate content based on the context provided.
Considerations
- "Zero-shot prompting" is useful when you want the AI to
demonstrate its general knowledge, provide explanations, or
generate content on topics without specific training examples.
- It leverages the AI's broad understanding and creativity, making
it suitable for a wide range of topics and requests.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
24
- Example Prompt for Experimentation
Prompt:
Write a brief essay on the impact of artificial intelligence on
modern society.
Response ("Zero-Shot Prompting" for Essay):
Artificial intelligence has rapidly transformed modern society in
numerous ways. From enhancing healthcare diagnostics and
revolutionizing the way we shop online to automating routine
tasks and powering self-driving cars, AI's influence is
ubiquitous. It challenges us with ethical questions about privacy
and job displacement while offering unprecedented opportunities
for innovation and growth. As we navigate this AI-driven era,
it's crucial to harness its potential for the betterment of
humanity while addressing its associated challenges.
Experimenting with "zero-shot prompting" allows you to tap into the
AI's general knowledge and creative capabilities. Use this technique
when you want the AI to provide explanations, information, or content
on a variety of topics without providing specific training examples.
FEW-SHOT PROMPTING
"Few-shot prompting" is a technique that involves providing the AI
with a limited number of examples or instances related to the desired
content in the prompt. This guide explores the principles and examples
of using "few-shot prompting" to enhance the AI's understanding and
generate more specific responses.
Understanding "Few-Shot Prompting"
"Few-shot prompting" is a method where you prompt the AI with a small
number of specific training examples or instances to guide its
response. It helps the AI understand the context and generate content
that is more focused and relevant.
- Example without "Few-Shot Prompting" Consideration
Prompt:
Describe a famous scientist.
Response (No "Few-Shot Prompting"):
A famous scientist is someone who has made significant
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
25
contributions to their field of study and has gained recognition
for their work.
- Example with "Few-Shot Prompting" (Providing Examples)
Prompt:
Describe a famous scientist such as Albert Einstein, Marie Curie,
or Isaac Newton.
Response ("Few-Shot Prompting"):
Some of the most renowned scientists in history include Albert
Einstein, known for his theory of relativity; Marie Curie, a
pioneer in radioactivity research; and Isaac Newton, famous for
his laws of motion and universal gravitation.
Tips for Using "Few-Shot Prompting"
- Include Relevant Examples:
Choose examples that are directly related to the topic or context
to help the AI generate more targeted responses.
- Clear Instruction:
Ensure that the AI recognizes that the examples provided are
meant to be incorporated or referenced in the response.
Considerations
- "Few-shot prompting" enhances the AI's grasp of the context by
offering specific training examples, resulting in content that is
more detailed and contextually rich.
- It is effective when you want the AI-generated content to be more
specific, focused, and relevant to the examples provided.
- Example Prompt for Experimentation
Prompt:
Write a summary of a famous book, using "few-shot prompting" by
providing examples such as "To Kill a Mockingbird," "Pride and
Prejudice," and "1984."
Response ("Few-Shot Prompting" for Book Summary):
Certainly! Here's a summary of a famous book using "few-shot
prompting" with examples from "To Kill a Mockingbird," "Pride and
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
26
Prejudice," and "1984."
In "To Kill a Mockingbird" by Harper Lee, the story revolves
around racial injustice in the American South during the 1930s.
It follows the perspective of Scout Finch, a young girl who
learns about empathy and morality as her father, Atticus Finch,
defends an innocent Black man accused of raping a White woman.
The novel is a poignant exploration of prejudice, compassion, and
the loss of innocence.
"Pride and Prejudice" by Jane Austen is a classic novel set in
the early 19th century. It focuses on the social and romantic
interactions of Elizabeth Bennet and Mr. Darcy. Through sharp wit
and social commentary, Austen explores themes of love, class, and
societal norms, all while highlighting the importance of
self-awareness and personal growth.
"1984" by George Orwell is a dystopian masterpiece that paints a
bleak picture of a totalitarian society. The novel introduces
readers to the oppressive regime of Big Brother, where freedom of
thought and individuality are suppressed. The protagonist,
Winston Smith, rebels against the surveillance state and seeks to
reclaim his own identity in a world dominated by propaganda and
thought control.
These three novels, "To Kill a Mockingbird," "Pride and
Prejudice," and "1984," each offer unique perspectives on
society, morality, and the human condition. They continue to be
celebrated for their thought-provoking themes and timeless
relevance.
Experimenting with "few-shot prompting" in your prompts allows you to
provide the AI with specific training examples to enhance its
understanding and generate more focused and contextually relevant
responses. Use this technique when you want the AI to generate content
that aligns closely with the provided examples.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
27
KNOWLEDGE GENERATION PROMPTING
"Knowledge generation prompting" is a technique that involves
instructing the AI to generate new information, facts, or insights on
a given topic. This guide explores the principles and examples of
using "knowledge generation prompting" to harness the AI's capacity to
provide valuable and informative content.
Understanding "Knowledge Generation Prompting"
"Knowledge generation prompting" is the process of prompting the AI to
create new knowledge or insights on a specific topic. It encourages
the AI to generate information that may not be readily available or
widely known.
- Example without "Knowledge Generation Prompting" Consideration
Prompt:
Explain the concept of renewable energy.
Response (No "Knowledge Generation Prompting"):
Renewable energy refers to energy sources that are replenished
naturally and can be used indefinitely. Examples include solar
power, wind energy, and hydropower.
- Example with "Knowledge Generation Prompting" (Seeking New
Insights)
Prompt:
Generate innovative ideas for harnessing renewable energy sources
in urban areas.
Response ("Knowledge Generation Prompting"):
Harnessing renewable energy in urban areas can be taken to new
heights by integrating solar-powered street lights with smart
grids for efficient energy distribution. Rooftop gardens with
wind turbines and rainwater harvesting systems can also maximize
resource utilization and reduce urban heat island effects.
Tips for Using "Knowledge Generation Prompting"
- Phrase Open-Ended Questions:
Frame your prompts as open-ended questions that encourage the AI
to provide creative and informative responses.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
28
- Specify the Scope:
Clearly define the scope of the knowledge or insights you seek,
and guide the AI with additional instructions if necessary.
Considerations
- "Knowledge generation prompting" is effective when you want the
AI to provide fresh perspectives, innovative ideas, or new
insights on a topic.
- It leverages the AI's capacity to think creatively and generate
information that may not be readily available in existing
sources.
- Example Prompt for Experimentation
Prompt:
Explore novel solutions for sustainable agriculture practices
using "knowledge generation prompting."
Response ("Knowledge Generation Prompting" for Sustainable
Agriculture):
Sustainable agriculture can benefit from innovative practices
like vertical farming in urban spaces, where crops are grown in
stacked layers using minimal space and resources. Additionally,
AI-driven precision agriculture can optimize crop yields by
monitoring soil conditions, weather, and pest infestations in
real-time. These advancements can help ensure food security while
minimizing environmental impact.
Experimenting with "knowledge generation prompting" in your prompts
allows you to tap into the AI's creative potential and generate fresh
insights or information on various topics. Use this technique when you
want the AI to provide innovative ideas or generate knowledge that
goes beyond existing sources.
KNOWLEDGE INTEGRATION PROMPTING
"Knowledge integration prompting" is a technique that involves
instructing the AI to integrate existing knowledge or information into
its response. This guide explores the principles and examples of using
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
29
"knowledge integration prompting" to leverage the AI's ability to
incorporate relevant facts and details from various sources.
Understanding "Knowledge Integration Prompting"
"Knowledge integration prompting" entails prompting the AI to
incorporate existing knowledge or information into its response. It
encourages the AI to synthesize facts, details, or insights from
various sources into a coherent and informative answer.
- Example without "Knowledge Integration Prompting" Consideration
Prompt:
Explain the impact of climate change on marine ecosystems.
Response (No "Knowledge Integration Prompting"):
Climate change affects marine ecosystems by causing rising sea
temperatures, ocean acidification, and disrupting the food chain.
- Example with "Knowledge Integration Prompting" (Incorporating
Existing Knowledge)
Prompt:
Discuss the impact of climate change on marine ecosystems,
integrating information from the IPCC report and recent studies.
Response ("Knowledge Integration Prompting"):
According to the Intergovernmental Panel on Climate Change (IPCC)
report, climate change has led to rising sea temperatures,
resulting in coral bleaching and affecting the distribution of
marine species. Recent studies have shown that ocean
acidification, driven by increased carbon dioxide levels, poses a
threat to shellfish and other marine organisms. These findings
emphasize the urgent need for global climate action to safeguard
our oceans and marine life.
Tips for Using "Knowledge Integration Prompting"
- Specify Sources:
If necessary, mention specific sources or references from which
you want the AI to integrate information.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
30
- Provide Context:
Ensure that the AI understands how the integrated knowledge
relates to the overall response.
Considerations
- "Knowledge integration prompting" is effective when you want the
AI to provide responses that incorporate relevant facts, details,
or insights from existing sources.
- It leverages the AI's capacity to synthesize information and
generate responses that are well-informed and comprehensive.
- Example Prompt for Experimentation
Prompt:
Discuss the recent advancements in artificial intelligence,
integrating information from reputable sources like MIT
Technology Review and IEEE Spectrum.
Response ("Knowledge Integration Prompting" for AI Advancements):
Recent advancements in artificial intelligence, as reported by
MIT Technology Review and IEEE Spectrum, include breakthroughs in
natural language processing, computer vision, and autonomous
systems. These innovations have practical applications in
healthcare, finance, and autonomous vehicles. Notably, research
on ethical AI and AI safety measures is gaining prominence,
emphasizing responsible AI development.
Experimenting with "knowledge integration prompting" in your prompts
allows you to instruct the AI to incorporate relevant knowledge or
information from various sources into its responses. Use this
technique when you want the AI to provide well-informed and
comprehensive answers that integrate existing facts and details.
SELF-REFINEMENT PROMPTING
"Self-refinement prompting" is a technique that involves instructing
the AI to iteratively improve its response based on initial feedback.
This guide explores the principles and examples of using
"self-refinement prompting" to enhance the quality and accuracy of
AI-generated content.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
31
Understanding "Self-Refinement Prompting"
"Self-refinement prompting" is the process of prompting the AI to
generate an initial response and then provide feedback or guidance for
further refinement. It encourages the AI to iterate on its responses
to align better with your expectations.
- Example without "Self-Refinement Prompting" Consideration
Prompt:
Write a summary of climate change.
Response (No "Self-Refinement Prompting"):
Climate change refers to long-term alterations in Earth's
temperature and weather patterns. It is primarily driven by human
activities such as burning fossil fuels and deforestation.
- Example with "Self-Refinement Prompting" (Iterative Improvement)
Prompt:
Write a summary of climate change, and refine your response based
on clarity and completeness.
Response ("Self-Refinement Prompting"):
Climate change is a complex phenomenon encompassing long-term
shifts in Earth's temperature and weather patterns. It arises
from various factors, including human activities like burning
fossil fuels, deforestation, and industrial processes. To enhance
clarity and completeness, it's important to emphasize the role of
greenhouse gasses, their impact on global warming, and the need
for international efforts to mitigate its consequences.
Tips for Using "Self-Refinement Prompting"
- Provide Specific Feedback:
Offer clear feedback or guidance to help the AI understand the
areas that require improvement.
- Iterate as Needed:
Use this technique iteratively, refining the response based on
feedback until it aligns with your expectations.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
32
Considerations
- "Self-refinement prompting" is effective when you want to work
collaboratively with the AI to improve the quality, clarity, or
completeness of its responses.
- It leverages the AI's capacity to learn from feedback and adjust
its answers accordingly.
- Example Prompt for Experimentation
Prompt:
Describe the benefits and challenges of renewable energy sources,
and iteratively refine your response for clarity and balance.
Response ("Self-Refinement Prompting" for Renewable Energy):
Renewable energy sources offer numerous benefits, including
reduced greenhouse gas emissions, improved air quality, and
energy security. However, challenges such as intermittency and
storage limitations need to be addressed. To enhance clarity,
let's emphasize the role of solar and wind energy in reducing
carbon footprints and the need for advanced energy storage
solutions. Additionally, we should mention the economic
advantages and potential job creation associated with renewable
energy initiatives.
Experimenting with "self-refinement prompting" in your prompts allows
you to collaboratively refine the AI's responses based on feedback,
ensuring they align better with your expectations in terms of quality,
clarity, and completeness. Use this technique when you want to
iteratively improve the AI-generated content.
PROBLEM ORIENTED PROMPTING
"Problem-oriented prompting" is a technique that involves instructing
the AI to generate responses focused on addressing a specific problem
or challenge. The following section explores the principles and
examples of using "problem-oriented prompting" to harness the AI's
problem-solving capabilities effectively.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
33
Understanding "Problem-Oriented Prompting"
"Problem-oriented prompting" is the process of guiding the AI to
generate responses that revolve around identifying, analyzing, and
providing solutions for a particular problem or challenge. It
encourages the AI to approach content generation with a
problem-solving mindset.
- Example without "Problem-Oriented Prompting"
Prompt:
Explain the concept of renewable energy sources.
Response (No "Problem-Oriented Prompting"):
Renewable energy sources are energy resources that can be
naturally replenished, such as solar and wind energy.
- Example with "Problem-Oriented Prompting" (Addressing Energy
Sustainability)
Prompt:
Discuss the importance of renewable energy sources in addressing
the challenge of climate change and reducing greenhouse gas
emissions.
Response ("Problem-Oriented Prompting" for Climate Change):
Renewable energy sources play a pivotal role in combating
climate change by offering sustainable alternatives to fossil
fuels. The problem of rising greenhouse gas emissions and their
impact on our planet's climate necessitates a shift toward
cleaner energy sources.
Solar and wind energy, for example, offer renewable and
emissions-free power generation solutions. By investing in these
technologies, we can significantly reduce our carbon footprint
and mitigate the adverse effects of climate change.
Embracing renewable energy sources is not just an environmental
choice; it's a crucial step in addressing the global challenge of
climate change and ensuring a sustainable future for generations
to come.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
34
Tips for Using "Problem-Oriented Prompting"
- Clearly Define the Problem:
Specify the problem or challenge you want the AI to address
explicitly.
- Encourage Solution-Oriented Responses:
Prompt the AI to provide solutions, recommendations, or insights
related to the identified problem.
Considerations
- "Problem-oriented prompting" is effective when you want the AI to
provide content that focuses on identifying and addressing
specific challenges, making it suitable for educational,
informational, or problem-solving contexts.
- It leverages the AI's capacity to approach content generation
with a problem-solving mindset, offering valuable insights and
solutions.
- Example Prompt for Experimentation
Prompt:
Explain the challenges associated with urban congestion and
propose innovative solutions to alleviate traffic problems in
cities.
Response ("Problem-Oriented Prompting" for Urban Congestion):
Urban congestion poses a significant challenge in cities
worldwide, leading to traffic jams, increased pollution, and
wasted time. To tackle this problem effectively, we need
innovative solutions that prioritize efficiency and
sustainability.
1. Promoting Public Transportation: Investing in efficient
public transportation systems, including buses, subways, and
light rail, can reduce the number of private vehicles on the
road. Encouraging the use of public transit through incentives
and improved services can alleviate congestion.
2. Smart Traffic Management: Implementing smart traffic
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
35
management systems that leverage data and technology can optimize
traffic flow. Adaptive traffic signals, real-time congestion
alerts, and dynamic routing can help reduce gridlock.
3. Supporting Alternative Transportation: Promoting cycling,
walking, and ridesharing options can provide viable alternatives
to traditional car commuting. Designing pedestrian-friendly urban
spaces and bike lanes encourages eco-friendly transportation.
4. Remote Work and Flexible Hours: Encouraging remote work and
flexible work hours can help spread out commute times, reducing
peak-hour congestion.
Solving the challenge of urban congestion requires a
multi-faceted approach that combines infrastructure development,
technology integration, and changes in commuting behavior. By
addressing this problem strategically, cities can create more
livable, sustainable environments for their residents.
Experimenting with "problem-oriented prompting" allows you to guide
the AI in providing content that focuses on identifying and solving
specific challenges or problems, offering valuable insights and
recommendations. Use this technique when you want the AI-generated
content to address real-world problems effectively.
PROBLEM FORMULATION PROMPTING
"Problem formulation prompting" is a technique that involves
instructing the AI to generate responses by first defining and framing
a problem or question before providing a solution or explanation. This
guide explores the principles and examples of using "problem
formulation prompting" to encourage structured problem-solving and
content generation.
Understanding "Problem Formulation Prompting"
"Problem formulation prompting" is the process of guiding the AI to
frame a problem, question, or challenge before generating content that
addresses it. It encourages the AI to provide solutions or
explanations within the context of a well-defined problem.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
36
- Example without "Problem Formulation Prompting"
Prompt:
Explain the importance of time management.
Response (No "Problem Formulation Prompting"):
Time management is essential for productivity and achieving
goals.
- Example with "Problem Formulation Prompting" (Defining the
Challenge)
Prompt:
Identify and frame the challenges associated with poor time
management, and then provide strategies for improving it.
Response ("Problem Formulation Prompting" for Time Management):
The challenge of poor time management often manifests as missed
deadlines, increased stress, and decreased productivity. To
address this issue effectively, we must first understand the
underlying challenges.
Some common challenges include procrastination, difficulty
prioritizing tasks, and lack of effective planning. Now, let's
explore strategies for overcoming these challenges and improving
time management.
Tips for Using "Problem Formulation Prompting"
- Clearly Define the Problem:
Begin your prompt by specifying the problem, challenge, or
question you want the AI to address.
- Encourage Contextual Responses:
Prompt the AI to provide solutions, explanations, or insights
within the context of the defined problem.
Considerations
- "Problem formulation prompting" is effective when you want the AI
to provide content that addresses a particular challenge or
problem in a structured and context-aware manner.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
37
- It leverages the AI's capacity to approach content generation by
first framing and understanding the problem before offering
solutions or explanations.
- Example Prompt for Experimentation
Prompt:
Frame the problem of food waste in households, outlining its
various aspects and contributing factors. Then, propose practical
solutions to reduce food waste at home.
Response ("Problem Formulation Prompting" for Food Waste):
The problem of food waste in households is multi-faceted,
encompassing various aspects and contributing factors.
Understanding these elements is essential before proposing
effective solutions.
Problem Aspects:
- Overbuying groceries
- Improper storage of perishables
- Neglecting leftovers
- Lack of meal planning
- Unawareness of expiration dates
Contributing Factors:
- Busy lifestyles
- Lack of awareness
- Inefficient storage solutions
Now, let's explore practical solutions to address each aspect and
factor, ultimately reducing food waste and promoting
sustainability at home.
Experimenting with "problem formulation prompting" allows you to guide
the AI in providing content that defines and frames a problem or
challenge before offering solutions, making it suitable for structured
problem-solving, explanations, or recommendations. Use this technique
when you want the AI-generated content to address specific challenges
in a well-organized manner.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
38
OUTRO
Having journeyed through the intricate world of advanced prompting
techniques, we stand at the threshold of even greater depths of AI's
cognitive capabilities. The strategies we've explored open new avenues
for precision and creativity, yet the horizon of what's possible
extends far beyond. Anticipate a leap into cognitive simulation and
expertise emulation in our next post, where the boundaries between
human and machine intelligence blur. The exploration deepens,
promising insights and techniques that will astound and inspire.
COPYRIGHT ©2024 National Bank of [Link] RIGHTS RESERVED page
39