Faculty Development Programme
on
Unleashing the Power of Generative AI
Hands on Session Day 1 (12/2/2025)
Prompt Engineering Practice Manual
Prompt Engineering Practice Manual is a guide to crafting effective and optimized prompts
for AI models. This manual covers essential techniques, from structuring prompts for
accuracy to refining them for better responses. In this manual, step-by-step guidance is
provided to master prompt engineering across various AI applications.Get ready to design
clear, powerful, and impactful prompts to enhance AI-driven interactions with ease!
What are prompts?
• Prompts involve instructions and context passed to a
language model to achieve a desired task
• Prompt engineering is the practice of developing and
optimizing prompts to efficiently use language models
(LMs) for a variety of applications
• Prompt engineering is a useful skill for AI engineers and
researchers to improve and efficiently use language models
What is prompt engineering?
Prompt engineering is a process of creating a set of prompts,
or questions, that are used to guide the user toward a desired
outcome. It is an effective tool for designers to create user
experiences that are easy to use and intuitive. This method is
often used in interactive design and software development, as
it allows users to easily understand how to interact with a
system or product..
Why Prompt Engineering?
• Why learn prompt engineering?
• Important for research, discoveries, and advancement
• Helps to test and evaluate the limitations of LLMs
• Enables all kinds of innovative applications on top of LLMs
First Basic Prompt
Instruction
The sky is
blue
The sky is a beautiful blue color during the day. The
blue of the sky is created by the Earth’s atmosphere
Response
scattering the sun’s light. The blue is a result of the
air molecules in the atmosphere reflecting the shorter
wavelength of blue light back to our eyes.
Model: “text-davinci-003”
temperature: 0.7
top-p: 1
Elements of a Prompt
• A prompt is composed with the following components:
• Instructions
• Context
• Input data
Output indicator
Classify the text into neutral, negative or positive
Text: I think the food was okay.
Sentiment:
Designing Prompts for Different Tasks
• In the next few slides, we will cover a few examples of
common tasks using different prompts
• Tasks covered:
• Text Summarization
• Question Answering
• Text Classification
• Role Playing
• Code Generation
• Reasoning
Text Summarization
Antibiotics are a type of medication used to treat
bacterial infections. They work by either killing the
bacteria or preventing them from reproducing, allowing
the body’s immune system to fight off the infection.
Context
Antibiotics are usually taken orally in the form of
pills, capsules, or liquid solutions, or sometimes
administered intravenously. They are not effective
against viral infections, and using them inappropriately
can lead to antibiotic resistance.
Instruction
Explain the above in one sentence:
Antibiotics are medications used to treat bacterial
infections by either killing the bacteria or stopping
them from reproducing, but they are not effective against
viruses and overuse can lead to antibiotic resistance.
Question Answering
Answer the question based on the context below. Keep the
answer short and concise. Respond "Unsure about answer"
if not sure about the answer.
Context: Teplizumab traces its roots to a New Jersey drug
company called Ortho Pharmaceutical. There, scientists
generated an early version of the antibody, dubbed OKT3.
Originally sourced from mice, the molecule was able to
bind to the surface of T cells and limit their cell-
killing potential. In 1986, it was approved to help
prevent organ rejection after kidney transplants, making
it the first therapeutic antibody allowed for human use.
Question: What was OKT3 originally sourced from?
Answer: Mice.
Text Classification
Classify the text into neutral, negative or positive.
Text: I think the food was okay.
Sentiment: Neutral
Role Playing
The following is a conversation with an AI research
assistant. The assistant tone is technical and
scientific.
Human: Hello, who are you?
AI: Greeting! I am an AI research assistant. How can I
help you today?
Human: Can you tell me about the creation of blackholes?
AI: Sure! Black holes are regions of spacetime where the
gravitational force is so strong that nothing, not even
light, can escape from it. They are created when a very
massive star dies and its core collapses in on itself,
forming a singularity of infinite density. The intense
gravity of the singularity pulls in all the matter and
radiation around it, creating the black hole.
Code Generation
“””
Table departments, columns = [DepartmentId,
DepartmentName]
Table students, columns = [DepartmentId, StudentId,
StudentName]
Create a MySQL query for all students in the Computer
Science Department
“””
SELECT StudentId, StudentName
FROM students
WHERE DepartmentId IN (SELECT DepartmentId FROM
departments WHERE DepartmentName = 'Computer Science');
Reasoning
The odd numbers in this group add up to an even number: 15,
32, 5, 13, 82, 7, 1.
Solve by breaking the problem into steps. First, identify
the odd numbers, add them, and indicate whether the result
is odd or even.
Odd numbers: 15, 5, 13, 7, 1
Sum: 41
41 is an odd number.
Prompt Engineering Techniques
• Many advanced prompting techniques have been
designed to improve performance on complex tasks
• Few-shot prompts
• Chain-of-thought (CoT) prompting
• Self-Consistency
• Zero-shot
Few-shot Prompts
• Few-shot prompting allows us to provide exemplars in
prompts to steer the model towards better performance
The odd numbers in this group add up to an even number: 4,
8, 9, 15, 12, 2, 1.
A: The answer is False.
The odd numbers in this group add up to an even number: 17,
10, 19, 4, 8, 12, 24.
A: The answer is True.
The odd numbers in this group add up to an even number: 16,
11, 14, 4, 8, 13, 24.
A: The answer is True.
The odd numbers in this group add up to an even number: 17,
9, 10, 12, 13, 4, 2.
A: The answer is False.
The odd numbers in this group add up to an even number: 15,
32, 5, 13, 82, 7, 1.
A: The answer is True.
Chain-of-Thought (CoT) Prompting
• Prompting can be further improved by instructing the
model to reason about the task when responding
• This is very useful for tasks that requiring reasoning
• You can combine it with few-shot prompting to get better results
• You can also do zero-shot CoT where exemplars are not
available
The odd numbers in this group add up to an even number: 4,
8, 9, 15, 12, 2, 1.
A: Adding all the odd numbers (9, 15, 1) gives 25. The
answer is False.
The odd numbers in this group add up to an even number: 15,
32, 5, 13, 82, 7, 1.
A: Adding all the odd numbers (15, 5, 13, 7, 1) gives 41.
The answer is False.
Zero-Shot CoT
• Involves adding "Let's think step by step" to the original
prompt
I went to the market and bought 10 apples. I gave 2 apples
to the neighbor and 2 to the repairman. I then went and
bought 5 more apples and ate 1. How many apples did I
remain with?
11 apples
I went to the market and bought 10 apples. I gave 2 apples
to the neighbor and 2 to the repairman. I then went and
bought 5 more apples and ate 1. How many apples did I
remain with?
Let's think step by step.
First, you started with 10 apples.
You gave away 2 apples to the neighbor and 2 to the
repairman, so you had 6 apples left.
Then you bought 5 more apples, so now you had 11 apples.
Finally, you ate 1 apple, so you would remain with 10
apples.
Self-Consistency
• Self-Consistency aims to improve on the naive greedy
decoding used in chain-of-thought prompting
• The idea is to sample multiple, diverse reasoning paths
through few-shot CoT, and use the generations to select
the most consistent answer.
• This helps to boost the performance of CoT prompting on
tasks involving arithmetic and commonsense reasoning
When I was 6 my sister was half my age. Now
I’m 70 how old is my sister?
35
Many examples were generated but the
model kept responding 35 as the answer
What Are GPT Tools?
GPT tools are AI-powered applications designed to assist in various
tasks like writing, designing, programming, and more. These tools
enhance productivity, streamline workflows, and inspire creativity.
From automating mundane tasks to offering expert-level insights,
GPT tools empower users across industries. Visual: An infographic
with examples of use cases (writing, coding, designing).
Categories of GPT Tools
• Most Popular Tools
• Writing Tools
• Productivity Tools
• Research & Analysis
• Education
• Lifestyle
• Programming
• Visual: Use icons for each category, e.g.,a pen for writing,a
cogwheel for productivity, etc.
Most Popular Tools:
Image Generator: Creates stunning visuals.
Scholar GPT: Access 200M+ academic resources.
Canva GPT: Designs presentations, logos, and more.
Writing Tools: AI Humanizer: Makes content more human-like.
Copywriter GPT: Creates viral marketing content.
Programming Tools:
Code Copilot: Assists with coding and debugging.
SQL Expert: Writes and optimizes SQL queries.
10 funny questions:
1. If you had a body, what would you eat for breakfast, and why is it
binary pancakes?
2. Can you create a conversation between a refrigerator and a
microwave about who does more work?
3. If school was a video game, what would be the cheat code to pass
exams?
4. Can you freestyle rap about Wi-Fi connection issues?
5. Do you dream of electric sheep, or is that just a PR rumor?
6. What’s the AI equivalent of hitting “snooze” on an alarm clock?
7. Can you explain quantum physics as if you’re trying to sell me a
pizza?
8. If procrastination were an Olympic sport, would I win gold?
9. If you had a pet, would it be a robot dog or a virtual cat? Why?
10. Can you roast me... but nicely, like a marshmallow?