MODULE 2 – PROMPT ENGINEERING
IMPORTANT NOTE TO STUDENTS
These notes are strictly prepared in alignment with the textbook “Ajantha Devi Vairamani & Anand Nayyar,
Prompt Engineering: Empowering Communication (CRC Press, 2024)” and the prescribed syllabus. You
must first refer to the textbook for every topic. If you still find any concept difficult to understand, then use
these notes as your supporting reference. If the topic remains unclear even after that, please come to me
directly for further explanation.
Source: Ajantha Devi Vairamani & Anand Nayyar, Prompt Engineering: Empowering
Communication (CRC Press, 2024)
CHAPTER 1 – THE FUNDAMENTALS OF PROMPT
ENGINEERING
1.1 Defining the Discipline
Prompt Engineering is a sophisticated, multidisciplinary field that lies at the intersection of
linguistics, cognitive psychology, and artificial intelligence. It is not merely about posing
questions to a chatbot; it is about architecting language strategically so that the model interprets
human intent with maximum precision. When we interact with large language models (LLMs)
such as ChatGPT, Bard, or Claude, our words act as the programming interface. The prompt
becomes a linguistic command that activates specific reasoning pathways inside the model’s
neural network.
A prompt is thus more than a query it is an instructional ecosystem. It contains four crucial
components that interact dynamically: the instruction (the task or objective), the context
(background or domain within which the model should operate), the input (the raw data or
content to be processed), and the output indicator (how the user expects the answer to be
structured). When all these components are expressed clearly, the AI’s interpretation becomes
much more controlled, coherent, and purpose-driven.
For example, if one simply writes, “Explain climate change,” the model might generate a
lengthy, general essay covering multiple domains. However, if the prompt reads, “As an
environmental policy expert, explain the economic consequences of climate change in
developing nations in about 250 words for a magazine article,” the instruction now shapes
tone, style, depth, and focus. The model’s linguistic output, in turn, mirrors the specificity of
human direction. The first prompt asks; the second commands with clarity.
In this sense, prompt engineering is analogous to directing a skilled musician: vague gestures
produce noise; precise guidance produces harmony. Every effective prompt must therefore
balance explicit direction (to reduce ambiguity) with linguistic openness (to allow creativity).
Too much constraint suffocates creativity; too little results in chaos.
1.2 Historical Context and Evolution
By- Ritam Rajak | DEPT. OF CSE (AI& ML)
While the term “Prompt Engineering” gained recognition only in the early 2020s, its
intellectual heritage traces back to the earliest experiments in human–computer interaction.
Understanding its historical trajectory reveals how we evolved from simple keyword triggers
to full-scale conversational reasoning.
The journey began in the 1960s with Joseph Weizenbaum’s ELIZA, a primitive chatbot
designed to mimic a psychotherapist. ELIZA operated entirely through pattern-matching rules:
when a user typed “I feel lonely,” it detected the word “feel” and replied, “Do you often feel
lonely?”—a formulaic but psychologically suggestive response. Though it lacked
understanding, ELIZA demonstrated the power of phrasing; a single word could change how
the program reacted. This was the first glimpse of how input form shapes machine behaviour.
The 1970s witnessed a major leap through Terry Winograd’s SHRDLU, which could follow
instructions such as “Place the red block on top of the green cube.” SHRDLU not only parsed
natural language but reasoned about the relationships between objects in its virtual “blocks
world.” It marked the transition from rigid keyword commands to contextual understanding—
an early form of what modern prompt engineers strive to achieve.
By the 1990s, template-based conversational systems like ALICE and Jabberwacky introduced
reusable response structures. Developers discovered that embedding roles, tone, and structure
into templates improved reliability. A typical pattern might read: “Hello [name], how can I
assist you today?”—the ancestor of the modern “system prompt.” Though mechanical, these
templates proved that pre-defined instruction improves consistency, a cornerstone principle of
modern prompting.
The true revolution, however, began in 2017 with the advent of the Transformer architecture.
Models like BERT, GPT-2, and GPT-3 could handle long textual dependencies and generate
fluent, contextually aware prose. For the first time, machines could respond to conversational
nuance without predefined templates. By 2023, with models such as ChatGPT and GPT-4,
prompting replaced programming as the primary means of human–AI communication.
A vivid modern example: earlier chatbots required structured commands like
“summarize:text=‘Article on renewable energy’.” Today, one can simply say, “Summarise
this research paper on solar energy in simple terms for school students,” and the model infers
both function and tone. Thus, the evolution of prompt engineering parallels AI’s evolution from
mechanical syntax to contextual semantics—from keyword control to conversational
intelligence.
1.3 Core Types of Prompts
Prompts can be broadly classified into three essential categories, each serving distinct
communicative functions: natural language prompts, system prompts, and conditional prompts.
Natural language prompts use ordinary human phrasing to express goals. They are
conversational and often rely on implied meaning. For instance, a student might write, “Can
you explain how photosynthesis happens?” The model, reading tone and intent, will produce
an educational yet informal response. These prompts are ideal for exploratory, descriptive, or
narrative tasks because they align closely with everyday dialogue.
By- Ritam Rajak | DEPT. OF CSE (AI& ML)
System prompts, by contrast, are pre-engineered textual instructions embedded within the AI’s
underlying framework. They define fixed behavioural rules such as, “Always reply politely,”
or “Respond in JSON format.” For example, customer-service chatbots include hidden system
prompts that ensure every answer begins courteously (“I understand your concern”). System
prompts thus ensure consistency, tone discipline, and compliance—particularly vital in
domains like law, healthcare, or finance.
Conditional prompts introduce logic-driven control. They employ reasoning clauses such as
“If condition X is true, then perform Y.” For instance, a teacher training an AI tutor might
write: “If the student’s answer is correct, praise briefly; if incorrect, explain the right
reasoning with an example.” This type of prompt blends language and logic to create adaptive
responses. It transforms static AI into a reactive learning assistant.
In advanced applications, prompt engineers often combine these three types to achieve layered
control. For example, in a tutoring application, one may use a system prompt to maintain tone
(“always be encouraging”), natural language for explanation, and conditional logic for
evaluation (“if student score < 50, suggest revision topics”). This triadic structure demonstrates
how prompt types can merge to form complex interactive systems.
1.4 Operational Principles
Prompt engineering follows the same spirit as scientific experimentation—clear hypotheses,
controlled testing, and iterative refinement. The first and most crucial principle is
understanding the objective. Before crafting a prompt, one must ask: what is the purpose of
this interaction? What is the desired outcome, tone, and level of depth? A researcher
summarising a paper requires precision; a novelist generating ideas requires imagination. The
purpose defines everything else.
The second principle is clarity and specificity. Vague wording yields vague output. For
instance, “Explain gravity” may result in a high-level description. Instead, “Explain gravity in
simple terms with an example of how it affects tides on Earth” transforms the model’s response
into a focused educational explanation. Clarity ensures that no interpretive space remains for
irrelevant expansion.
The third principle is demonstration through examples. Providing examples inside prompts—
known as few-shot prompting—enables the model to recognise patterns and mimic structure.
For example, showing how an informal phrase is converted into a formal one helps the AI
replicate the same linguistic transformation for unseen inputs.
Finally, the fourth principle is iterative experimentation. Because LLMs generate probabilistic
text, even minor wording changes—such as replacing “describe” with “summarise
concisely”—can drastically alter tone and detail. The best prompt engineers continuously test,
revise, and document outputs. This feedback cycle mirrors human learning: hypothesis → test
→ result → refinement.
A classroom example illustrates this clearly. A student might begin with the prompt, “Write
about renewable energy.” The teacher encourages refinement: “Write a 250-word persuasive
essay explaining why renewable energy should replace fossil fuels, using two economic
arguments and one environmental benefit.” When students compare both outputs, they
By- Ritam Rajak | DEPT. OF CSE (AI& ML)
immediately perceive how structure improves clarity. This exercise embodies the iterative
nature of prompt mastery.
1.5 Impact on Communication
Prompt engineering revolutionises how humans communicate with technology—and,
indirectly, with one another. It forces users to think critically about intent, tone, and precision.
The process of designing an effective prompt refines human reasoning because it demands
clarity before communication.
For example, a medical professional might ask an LLM: “What are the symptoms of diabetes?”
This could return a long list. But by reframing as, “Summarise the five most common early
symptoms of Type 2 diabetes in adults for inclusion in a patient-awareness brochure,” the
professional gains a practical, audience-specific answer. In this way, prompt design enhances
human thought structure: users must define context, target, and scope before asking.
Prompt engineering also strengthens cross-cultural and multilingual communication. By
embedding cultural cues in prompts, users guide tone and phrasing for specific audiences.
Asking, “Translate this paragraph into Japanese suitable for a business meeting,” ensures
formality and decorum, while “Translate into casual Japanese for a friend” yields warmth and
informality.
This discipline thus becomes a tool of empowerment. It gives individuals—students,
researchers, or professionals—the ability to control how AI communicates on their behalf,
thereby reinforcing the human values of intention, respect, and clarity in every exchange.
1.6 Future Trajectory
As the field matures, prompt engineering is moving toward structured formalisation.
Researchers are developing prompt design languages—syntaxes that combine natural text with
machine-readable control codes.
Future models will likely employ self-adaptive prompting, where the system automatically
refines unclear instructions by querying the user for clarification. For example, when given the
vague prompt “Explain AI,” a future model may respond, “Would you like a technical or
simplified explanation?”—thus bridging intent gaps autonomously.
Explainability will also become vital. Imagine a legal assistant AI that can show which words
in a prompt influenced its final reasoning. Such transparency will be crucial for accountability.
Ethically, the discipline will face challenges in bias mitigation. The wording of a prompt can
unconsciously introduce prejudice, as in asking, “Why do women prefer certain jobs?”—which
assumes a false premise. Responsible prompting reframes this as, “What social and cultural
factors have historically influenced women’s employment patterns?” The difference between
bias and neutrality lies entirely in phrasing. Thus, future prompt engineers will not only design
for efficiency but for equity and fairness.
CHAPTER 3 – CORE TECHNIQUES (FOCUS ON
CHATGPT)
By- Ritam Rajak | DEPT. OF CSE (AI& ML)
3.1 Instruction Prompt Technique
The instruction technique is the foundation of all LLM communication. It uses direct, action-
oriented statements to dictate tasks. The more explicit the command, the more reliable the
response.
Consider this scenario: A business student wants an AI to write a marketing proposal. If they
simply write “Write a proposal for a new product,” the model will produce a generic draft.
But if they refine it to “Prepare a 500-word marketing proposal for an eco-friendly water
bottle aimed at university students. Include a short market analysis, pricing strategy, and social
media campaign ideas,” the result becomes detailed, structured, and aligned with academic
expectations.
Instruction prompts often include role framing to guide the model’s tone and knowledge depth.
Writing “Act as a seasoned business consultant and provide recommendations for market entry
in Southeast Asia” signals both expertise and professionalism. In contrast, “Act as a student
writing a project summary on Asian markets” produces an academic tone with learning
emphasis. The role shapes the response persona.
By combining clear instructions, contextual roles, and explicit constraints, the instruction
technique creates the highest precision possible without additional examples. It is the linguistic
equivalent of issuing a step-by-step protocol in a scientific experiment.
3.2 The “Shot” Prompting Hierarchy
This hierarchy governs the level of contextual guidance embedded within a prompt.
In Zero-Shot Prompting, the model receives only the instruction. For instance, “Write a poem
about oceans.” The model relies on prior training to improvise content. This approach is useful
for creative or open-ended exploration but may produce uneven quality.
One-Shot Prompting provides one example before asking the real question. For example:
“Example:
Input: ‘Describe a sunrise in one line.’
Output: ‘A golden light dissolves the night’s last shadow.’
Now describe a sunset in one line.”
The model imitates structure and poetic style. This technique helps control tone and pattern
with minimal effort.
Few-Shot Prompting involves multiple examples. Suppose a user provides three formatted
book reviews, each consisting of summary, critique, and rating, and then asks the model to
review a new title in the same format. The model extracts stylistic patterns and replicates them
faithfully. Few-shot prompting is invaluable for classification, summarisation, or translation
tasks where consistency matters.
For example, a sentiment-analysis exercise might use:
Example 1: “The movie was thrilling and full of suspense – Positive.”
Example 2: “The story was dull and predictable – Negative.”
Now classify: “The performance was adequate but uninspiring.”
The model correctly labels it Neutral, understanding context from examples.
By- Ritam Rajak | DEPT. OF CSE (AI& ML)
This hierarchy mirrors the human learning process: zero-shot equates to guessing, one-shot
resembles learning from a single demonstration, and few-shot reflects pattern mastery.
3.3 Self-Consistency Prompt
Self-consistency prompting ensures logical coherence and factual stability. It is especially
important when dealing with reasoning, calculations, or sensitive topics that demand evidence.
The basic idea is to anchor the model’s reasoning to explicit facts or authoritative data. For
example, when prompting, “Based on WHO data, explain the health effects of air pollution
without referring to unverified claims,” the boundaries are predefined. The model must operate
within them.
In mathematical reasoning, a user might write, “Solve this problem step-by-step and verify each
step before giving the final answer.” The self-verification clause forces the model to re-
evaluate its logic, reducing error. Similarly, in legal analysis, a prompt might specify, “Cite
only laws from the Indian Penal Code; ignore international examples.” This prevents factual
drift.
Another variant involves comparative reasoning. For instance, “Generate three different ways
to interpret this historical event and then decide which interpretation aligns best with scholarly
consensus.” Here, the model weighs alternatives before concluding—achieving internal
consistency akin to human deliberation.
In academic, scientific, and journalistic contexts, self-consistency prompting is essential
because it transforms AI from a text generator into a reasoning collaborator.
CHAPTER 4 – PROMPTS FOR CREATIVE THINKING
4.1 Unlocking Imagination and Innovation
Creative prompts unleash the model’s capacity for divergent thinking—the ability to produce
multiple, novel ideas from a single concept. When humans use creative prompts, they engage
in co-creation with the machine.
For instance, a teacher might ask, “Imagine a world where trees could talk. Write a dialogue
between a child and a banyan tree discussing deforestation.” Such prompts blend
environmental education with creative storytelling, encouraging empathy and imagination
simultaneously.
In corporate settings, creative prompting fosters innovation. A manager might challenge
employees: “If our company operated underwater, how would our logistics, design, and
communication systems change?” This absurd hypothetical stimulates creative problem-
solving unconstrained by reality, later translating into practical design innovations.
Creative prompts can also reframe perspective. For artists: “Describe happiness without using
the words ‘happy’ or ‘joy.’” For engineers: “Invent a low-cost solution to urban flooding using
principles from nature.” Each prompt compels lateral reasoning and symbolic association,
activating the cognitive processes underlying creativity.
By- Ritam Rajak | DEPT. OF CSE (AI& ML)
Thus, creative prompting transcends entertainment—it becomes a structured methodology for
innovation across disciplines, encouraging learners and professionals to think beyond linear
logic.
CHAPTER 5 – PROMPTS FOR EFFECTIVE WRITING
5.1 Igniting the Writing Process
Writing prompts act as the ignition key of the creative and analytical mind. They provide
direction, constraint, and momentum—the three elements often missing when a writer faces a
blank page.
For example, “Write a letter from your future self describing your proudest achievement”
engages introspection and narrative technique. The prompt’s emotional and temporal framing
naturally inspires reflection and structure.
In academic writing, prompts refine precision. “Summarise five peer-reviewed papers on
renewable energy focusing on their methodologies, not results” forces analytical rather than
descriptive writing. In contrast, “Argue why solar energy will dominate India’s energy future
by 2040, citing policy initiatives” encourages persuasive reasoning grounded in evidence.
Educators employ prompts to build writing stamina and control. Exercises like “Describe the
smell of rain without mentioning the word ‘rain’” teach sensory specificity. Similarly, “Re-
write a news article as a satire piece” builds adaptability and tone awareness.
Professionally, writing prompts enhance productivity. Journalists might use “Draft a 300-word
summary of today’s budget speech highlighting tax reforms and public welfare schemes.”
Corporate teams might write “Compose a motivational email from the CEO addressing
employees after a challenging quarter.” In each case, prompts transform intention into
structured communication.
At a deeper level, writing prompts mirror the essence of prompt engineering itself: they
discipline the act of thought. They force writers to articulate exactly what they wish to express
and in what form, turning abstract intention into tangible text.
By- Ritam Rajak | DEPT. OF CSE (AI& ML)