MODULE – 5
CHAPTER -1
Introduction to Prompt Engineering
CHAPTER -2
Prompt Engineering Techniques for Chat GPT
CHAPTER -3
Prompts for Creative Thinking
CHAPTER -4
Prompts for Effective Writing
Prepared By: Prof. Ranjitha R
Dept. of CSE
DBIT, Bangalore
1.1 Introduction to Prompt Engineering
1.1.1 What is Prompt Engineering?
• It is the process of designing and optimizing prompts, or instructions, to guide generative AI models like large
language models (LLMs) to produce the desired output.
• Consider an LLM as a huge, intricate network of creativity and information.
• The goal of prompt engineering is to intertwine instructions and information into this web in a way that gently nudges the
LLM toward the intended result.
• A prompt is the query, directive, or example given to an LLM. It establishes the background, clarifies the assignment, and
provides the LLM answer framework.
• We can adjust the language, provide particulars, and apply different strategies to make the LLM’s output creative,
convincing, educational, or anything else we desire.
• Prompts are input instructions or cues that influence the model’s reaction to AI models.
• These prompts can be presented as conditional restrictions, system-defined instructions, or instructions in natural language.
• A brief passage of text known as a prompt serves as a roadmap for an LLM’s answer.
• It might be as straightforward as one sentence or as intricate as several clauses and directives.
Fig. 1 Prompt input
• The purpose of a prompt is to give the LLM just enough details to compared the question asked of it and to produce an
insightful and pertinent response.
Fig. 2 Components of Prompt
• Through the provision of unambiguous and explicit cues, developers can direct the behaviour of the model and impact the
output produced.
3.1 Introduction to Prompt Engineering Techniques
• “Introduction to Prompt Engineering Techniques” provides a foundational overview of the various methods employed to
guide the output of natural language processing models, with a specific focus on ChatGPT.
• This chapter serves as a gateway to understanding the complication of prompt engineering and its pivotal role in shaping
the responses generated by AI language models.
• Readers are introduced to the concept of prompt engineering, which involves crafting specific prompts or instructions to
direct the model’s output.
• The chapter outlines the importance of prompt engineering in ensuring that AI models like ChatGPT generate relevant,
accurate, and high-quality text responses across a variety of tasks and domains.
• Key topics covered in this introductory chapter include an overview of different prompt engineering techniques, such as
standard prompts, role prompting, seed-word prompting, and more.
• Readers will gain insight into how each technique operates and its potential applications in influencing ChatGPT’s text-
generation process.
• Moreover, the chapter sets the stage for exploring the practical implementation of prompt engineering techniques,
highlighting their versatility and adaptability to various scenarios.
• Through illustrative examples and discussions, readers will develop a solid understanding of how to effectively utilize
prompt engineering techniques to tailor ChatGPT’s responses to specific needs and requirements.
3.2 Instructions Prompt Technique
• The “Instructions Prompt Technique” is a method employed to guide the output of natural language processing models,
such as ChatGPT, by providing specific instructions for the model to follow.
• This technique ensures that the generated text aligns with the desired objectives and requirements of the task at hand.
• For example, if the task is to generate customer service responses, the instructions prompt might include guidelines such
as “responses should be professional and provide accurate information.”
• By providing these instructions, users can steer ChatGPT towards producing responses that meet the criteria of
professionalism and accuracy.
• Another example is generating a legal document.
• In this case, the instructions prompt might specify that “the document should be in compliance with relevant laws and
regulations.”
• This instruction ensures that the generated legal document adheres to legal standards and requirements.
• The Instructions Prompt Technique can also be combined with other prompt engineering methods for enhanced precision
and control over the model’s output.
• For instance, when generating a product review for a new smartphone, instructions might dictate that “the review should
be unbiased and informative.”.
• This instruction, along with role prompting to adopt the perspective of a tech expert and seed-word prompting to focus on
specific features of the smartphone, can result in a comprehensive and insightful product review.
3.3 Zero, One, and Few Shot Prompting
• “Zero, One, and Few Shot Prompting” is a prompt engineering technique utilized to enhance the capabilities of natural
language processing models like ChatGPT by providing varying degrees of contextual information during the inference
process.
• This technique is particularly useful when the model is tasked with generating responses based on limited examples or
context.
3.3.1 Zero Shot Prompting
• Zero Shot Prompting is a prompt engineering technique used in natural language processing models like ChatGPT to
generate responses without any specific examples or training data related to the given task.
• Instead of providing examples or context, users only offer a prompt or instruction to the model. For instance, if the task is
to generate a poem about nature, the user would input the prompt “Write a poem about nature” to ChatGPT.
• Without any additional context or examples, ChatGPT utilizes its pre-existing knowledge and understanding of language
to generate a poem about nature.
• This technique is particularly useful when users want the model to demonstrate its generalization capabilities and
produce responses based solely on its internal knowledge.
• It allows for more flexible and openended interactions with the model, where users can explore its creativity and ability
to generate text without relying on specific examples.
• However, it’s important to note that Zero Shot Prompting may sometimes result in responses that are less accurate or
relevant compared to prompts provided with examples or context.
• Users should be mindful of this limitation and consider employing other prompt engineering techniques, such as One Shot
Prompting or Few Shot Prompting, when more precise responses are required.
Fig. 3.1 Example of Zero Shot Prompting
3.3.2 One Shot Prompting
• One Shot Prompting is a prompt engineering technique utilized in natural language processing models such as ChatGPT
to generate responses based on a single example or instance provided by the user.
• In this approach, users supply the model with a specific example relevant to the task at hand, and the model then uses this
example to generate a response.
• For example, if the task is to summarize a given paragraph of text, the user would provide ChatGPT with a single
sentence from that paragraph.
• ChatGPT then leverages this example to understand the context and generate a summary that aligns with the provided
sentence.
• One Shot Prompting is particularly useful when users have limited examples or context available but still want the model
to produce accurate and relevant responses.
• By offering a single example, users can guide ChatGPT to generate responses that are consistent with the provided
context, leveraging the model’s ability to generalize from limited data.
Fig. 3.2 Example of One Shot Prompting
• However, it’s essential to note that the effectiveness of One Shot Prompting may vary depending on the complexity of the
task and the quality of the example provided.
• In some cases, providing additional examples or employing other prompt engineering techniques, such as Few Shot
Prompting, may be necessary to improve the accuracy and relevance of ChatGPT’s responses.
3.3.3 Few Shot Prompting
• Few Shot Prompting is a prompt engineering technique utilized in natural language processing models like ChatGPT to
generate responses based on a small number of examples or instances provided by the user.
• In this approach, users supply the model with a few relevant examples or instances related to the task at hand, and the
model then uses these examples to generate a response.
• For example, if the task is to generate a product review for a new smartphone, the user might provide ChatGPT with a
few sentences describing the smartphone’s features, specifications, and user experience.
• ChatGPT then leverages these examples to understand the context and generate a review that encompasses the provided
information.
• Few Shot Prompting allows users to provide additional context and guidance to ChatGPT, enabling the model to produce
more accurate and relevant responses compared to One Shot Prompting or Zero Shot Prompting.
• By offering a few examples, users can help ChatGPT better understand the nuances of the task and generate responses
that align closely with the provided context.
• However, it’s important to note that while Few Shot Prompting can enhance the model’s performance, it still relies on the
quality and relevance of the examples provided by the user.
• Users should ensure that the examples are representative of the task and contain sufficient information to guide ChatGPT
effectively.
• Additionally, users may need to experiment with the number and type of examples provided to optimize the model’s
performance for different tasks and domains.
3.4 Self-Consistency Prompt
• The Self-Consistency Prompt is a sophisticated prompt engineering technique employed in natural language processing
models like ChatGPT to ensure the coherence and logical consistency of the generated text.
• This technique involves providing the model with a prompt that contains key information, statements, or facts that users
want the generated text to adhere to or remain consistent with throughout the conversation.
• Unlike traditional prompts that simply instruct the model to generate text based on a given task or context, the Self-
Consistency Prompt includes specific elements aimed at guiding the model to maintain consistency and coherence.
• These elements could include background information, established facts, opinions, or constraints relevant to the
conversation topic.
Fig. 3.3 Example of Few Shot Prompting
• For instance, in a scenario where ChatGPT is engaged in a discussion about climate change, the Self-Consistency Prompt
might include scientific data, consensus statements, or commonly accepted principles related to climate science.
• By incorporating this information into the prompt, users guide ChatGPT to generate responses that align with the
provided context and remain consistent with established scientific knowledge throughout the conversation.
• The Self-Consistency Prompt is particularly valuable in situations where maintaining coherence and logical consistency
is crucial, such as educational content, technical discussions, or decision-making processes.
• By anchoring the conversation to specific information or constraints, users can ensure that ChatGPT generates responses
that are accurate, informative, and contextually appropriate.
• However, it’s essential to strike a balance when crafting Self-Consistency Prompts.
• Providing too much detail or overly restrictive instructions may limit the model’s flexibility and creativity, potentially
leading to repetitive or unnatural responses.
• Therefore, users should aim to provide sufficient guidance while allowing ChatGPT the freedom to generate diverse and
natural language responses within the established constraints.
4.1 Introduction “Prompts for Creative Thinking”
• “The Prompt Revolution: Empowering Communication through Effective Prompts” that invites readers to embrace their
inner creativity and explore new dimensions of thought.
• In a world that increasingly values innovation and originality, creative thinking has become an essential skill across
various domains.
• This chapter delves into the power of prompts as catalysts for igniting imagination, sparking innovative ideas, and
overcoming mental blocks.
• It explores a wide range of prompts designed to stimulate creative thinking and offers practical strategies for leveraging
them effectively.
• Readers will embark on a journey through different techniques and exercises that tap into their creative reservoirs.
• Whether seeking fresh ideas for problem-solving, brainstorming innovative solutions, or simply desiring to infuse more
creativity into their daily lives, this chapter provides a treasure trove of prompts to inspire and ignite the creative spark.
• From open-ended questions that challenge conventional thinking to playful prompts that encourage unconventional
associations, readers will discover how prompts can expand the boundaries of their imagination and unlock new
possibilities.
• By exploring diverse perspectives, connecting seemingly unrelated concepts, and embracing curiosity, readers will be
guided toward cultivating a mindset that embraces creative thinking.
• Through real-life examples and engaging exercises, readers will witness the transformative power of prompts in unlocking
their creative potential.
• They will learn how to break free from mental constraints, unleash their unique ideas, and embrace the joy of discovery.
• “Prompts for Creative Thinking” encourages readers to embrace the unknown, embrace ambiguity, and cultivate a mindset
of exploration.
• By incorporating these prompts into their personal and professional lives, readers will be equipped to overcome creative
hurdles, think outside the box, and approach challenges with fresh perspectives.
• Ultimately, this chapter serves as a roadmap for fostering creative thinking, allowing readers to tap into their innate
creativity and harness it as a valuable tool for problem-solving, innovation, and personal growth.
• Whether an aspiring artist, an entrepreneur, or a professional seeking fresh insight, “Prompts for Creative Thinking” offers
a wealth of inspiration, techniques, and prompts to empower readers on their creative journey.
4.2 Unlocking Imagination and Innovation
• It is a comprehensive guide comprising the top 50 prompts to ignite creativity and drive innovation within organizations.
• By encouraging brainstorming sessions, embracing failure as a learning opportunity, and fostering a culture of curiosity
and experimentation, this guide promotes an environment where employees feel empowered to think outside the box and
challenge conventional norms.
• It emphasizes the importance of cross disciplinary collaboration, diversity, and inclusion, while also advocating for
continuous learning and adaptation to emerging trends and technologies.
• Through clear goal-setting, autonomy, and recognition of innovative contributions, organizations can cultivate a dynamic
atmosphere that inspires employees to unlock their full creative potential and drive meaningful change.
Here are the top 10 prompts for unlocking imagination and fostering innovation:
1. How can unlocking creativity lead to breakthrough innovations?
2. The impact of a creative mindset on problem-solving and innovation.
3. Strategies for cultivating a culture of innovation through imagination.
4. The role of play and experimentation in stimulating imagination for innovation.
5. Inspiring a sense of wonder to fuel creative thinking in the workplace.
6. Can education systems enhance or inhibit imagination and innovation?
7. How embracing failure can foster a culture of innovation through imagination.
8. Integrating technology to amplify creative thinking and innovation.
9. The importance of interdisciplinary collaboration in unlocking innovation.
10. The role of leadership in fostering a culture of imagination and innovation. These prompts are intended to spark your
imagination, encourage innovative thinking, and inspire creative exploration. Feel free to adapt them, combine them, or use
them as a starting point for your imaginative ideas.
5.1 Introduction “Prompts for Effective Writing”
• is a chapter that unveils a treasure trove of inspiration and guidance to enhance writing skills and foster creative
expression.
• Whether you are an aspiring writer, a professional wordsmith, or someone seeking to improve your written
communication, this chapter provides a wealth of prompts and strategies to unlock your writing potential.
• The chapter begins by emphasizing the importance of effective writing and its impact across various domains.
• It explores the power of words to convey ideas, evoke emotions, and engage readers.
• From there, it dives into a collection of prompts specifically designed to spark creativity, overcome writer’s block, and
develop narrative skills.
• These prompts cover a wide range of genres, styles, and themes, catering to different interests and writing goals.
• From fiction to non-fiction, poetry to storytelling, and descriptive writing to persuasive pieces, readers will find prompts
that inspire and challenge them to explore new avenues of expression.
• Through thought-provoking prompts, writers will be encouraged to delve into their imagination, draw from personal
experiences, and observe the world with a fresh perspective.
• They will be prompted to create vivid characters, build immersive worlds, craft compelling narratives, and infuse their
writing with authentic voices.
• In addition to sparking creativity, the chapter provides practical strategies for overcoming common writing challenges.
• It offers techniques to conquer writer’s block, develop writing routines, and refine the craft of storytelling.
• It encourages writers to experiment with different writing exercises and prompts, pushing the boundaries of their comfort
zones and embracing the joy of the writing process.
• The chapter highlights the importance of revision and editing in the writing journey. It guides writers in refining their
work, enhancing clarity, and polishing their prose.
• By offering tips and techniques for self-editing and seeking feedback, writers can elevate the impact of their words and
communicate more effectively with their readers.
• “Prompts for Effective Writing” is a valuable resource for writers at all levels, providing a roadmap to inspire creativity,
overcome hurdles, and refine the art of written expression.
• Whether you are working on a novel, blog posts, essays, or simply seeking to improve your writing skills, these prompts
will guide you on a transformative writing journey, empowering you to captivate readers, articulate ideas with clarity, and
5.2 Igniting the Writing Process with Prompts
• “Igniting the Writing Process with Prompts” serves as a comprehensive guide to invigorate and streamline the writing
journey through the strategic use of prompts.
• Nestled within the pages of this chapter, writers find a treasure trove of inspiration and practical strategies tailored to fuel
creativity and overcome obstacles.
• From prompts designed to spark imagination and banish writer’s block to those crafted to refine storytelling skills and
enhance expression, this resource illuminates’ pathways for writers of all levels to navigate the intricacies of the writing
process with confidence and clarity.
• By harnessing the transformative power of prompts, writers are empowered to embark on transformative journeys, crafting
compelling narratives, and forging deeper connections with their audience.
Here are the 10 sample prompts to ignite the writing process and inspire creativity:
1. Explore the concept of time travel in a short story or essay.
2. Write about a character who discovers a hidden world within everyday objects.
3. Describe a day in the life of someone living on a different planet.
4. Use a photograph as inspiration to craft a short story or poem.
5. Write about a moment of serendipity that changes a character’s life.
6. Imagine a world where emotions are tangible and can be exchanged between people.
7. Create a story inspired by a vivid dream you’ve had recently.
8. Write a letter from your present self to your future self.
9. Craft a dialogue between two characters who communicate without speaking.
10. Explore the concept of a forbidden library with magical books. These prompts ignite your imagination, spark creativity,
and jumpstart the writing process. Use them as starting points for your unique stories, essays, or poems, and let your
creativity flow as you explore new ideas and perspectives.