0% found this document useful (0 votes)
11 views13 pages

Writing Prompts

The document outlines various types of AI prompting techniques, including self-consistency, zero-shot, one-shot, few-shot, and role-based prompting, with examples for each. It emphasizes the importance of clarity and specificity in prompts to improve AI responses and includes a series of exercises for students to practice refining prompts for better outcomes. Additionally, it discusses the ethical considerations in prompt design and provides a structured approach to tackling engineering challenges through iterative prompt refinement.

Uploaded by

Swathi Y
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views13 pages

Writing Prompts

The document outlines various types of AI prompting techniques, including self-consistency, zero-shot, one-shot, few-shot, and role-based prompting, with examples for each. It emphasizes the importance of clarity and specificity in prompts to improve AI responses and includes a series of exercises for students to practice refining prompts for better outcomes. Additionally, it discusses the ethical considerations in prompt design and provides a structured approach to tackling engineering challenges through iterative prompt refinement.

Uploaded by

Swathi Y
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Prompts

Self-Consistency Prompt
A self-consistency prompt makes sure the AI does not change facts or
contradict itself while answering. It keeps the information the same
throughout the response.
Example
Prompt: In this story:

– The main character is a girl named Anu.

– She is 10 years old.

– She loves drawing.

Write a short story and make sure these facts do not change.
Anu is a 10-year-old girl who loves drawing. Every day after school, she takes
her sketchbook to the park and draws birds and flowers. Her dream is to become
a great artist one day.
Here, the facts stayed the same:
 Name: Anu
 Age: 10
 Hobby: Drawing
✔️No contradictions → self-consistent
Example
Prompt:
Raju is a 7-year-old boy who is afraid of dogs. Write 4–5 lines about him
and keep these facts the same.
Raju is a 7-year-old boy who always avoids dogs because he is scared of them.
When he sees a dog on the street, he quickly walks away. He hopes one day he
will overcome his fear.
Example — Dialogue
Prompt:
Create a dialogue between a teacher and a student.
Important facts: The student’s name is Kavya and she has lost her book.
Teacher: Kavya, why are you upset?

Kavya: Ma’am, I lost my book.

Teacher: Don’t worry, we will try to find it together.

Kavya: Thank you, Ma’am.


➡️Kavya’s problem remains the same throughout.
In all examples, no fact changes →

✔Same names

✔ Same details

✔ Same location or behavior

✔ No contradictions
That is Self-Consistency Prompting in a simple and practical way!
1. Basic Prompt writing: Create two different prompts to ask an AI about
the topic "Electricity." The first prompt should be vague, and the second
prompt should be clear and specific. Compare the responses you get and
describe which prompt gave a better answer and why.
Vague Prompt:
"Tell me about electricity."
Clear & Specific Prompt:
"Explain how electricity is generated in power plants and distributed to homes,
using simple language suitable for high school students."
Comparison (for students to observe):
 The vague prompt will give a broad, generic answer.
 The clear prompt will give a focused, structured explanation, easier to
understand.

2. Zero-Shot Prompting: Create a prompt that asks an AI to explain Ohm’s


Law without giving any example or background. Evaluate how well the AI
explains the concept based on your prompt alone.
Zero-Shot Prompt:
"Explain Ohm’s Law."
Evaluation Point for Students:
 The AI will define Ohm’s Law directly (relationship between voltage,
current, resistance).
 Since no examples/background are given, the explanation may feel
abstract or too technical for beginners.
Correct way:
"Explain Ohm’s Law in simple words. Give a real-life example, like how
current, voltage, and resistance work in a household bulb circuit. Also, provide
the mathematical formula with a short explanation."
3. One-Shot and Few-Shot Prompting: Provide the AI with a single
example of how to calculate the resistance in a simple circuit. Then write
your own prompt asking the AI to solve a similar resistance calculation.
After that, add two more examples to your prompt and observe any
changes in the AI’s response quality.
One-Shot Prompt (give 1 example first, then ask a new one):
"Example: In a circuit with 10 V voltage and 2 A current, resistance = V/I =
10/2 = 5 Ω.
Now, calculate the resistance if the voltage is 12 V and the current is 3 A."
Few-Shot Prompt (give 3 examples, then ask a new one):
"Example 1: Voltage = 10 V, Current = 2 A → Resistance = 10/2 = 5 Ω.
Example 2: Voltage = 15 V, Current = 3 A → Resistance = 15/3 = 5 Ω.
Example 3: Voltage = 20 V, Current = 4 A → Resistance = 20/4 = 5 Ω.
Now, calculate the resistance if the voltage is 18 V and the current is 6 A."
Observation for students:
 One-shot → AI understands the pattern from a single example.
 Few-shot → AI gives a more structured, reliable answer, following the
example style closely.

4. Chain-of-Thought Prompting: Develop a prompt that guides the AI step-


by-step through calculating current flow in a circuit using Ohm’s Law with
resistors in series. Then, ask a final question for the AI to solve. Analyze
how breaking down the reasoning steps impacts the accuracy of the answer.

Reasoning-Guided Prompt (steps, not inner thoughts):


“Use Ohm’s Law to find current in a series circuit. Output only these 4 bullets:
1. Known values
2. Equivalent resistance Req=R1+R2+… (show the sum)
3. Compute I=V/Req (show numbers)
4. Final answer with units (round to 2 decimals).
Data: V=24 V; R1=3 Ω, R2=5 Ω, R3=4 Ω
Then ask a final question (new numbers, same format):
“Now solve another one using the same 4-bullet format:
V=18 V; R1=2Ω, R2=2Ω, R3=1Ω, R4=3Ω. What is I?”
What students should notice (one line):
 Breaking the task into numbered steps reduces mistakes (forces correct
series sum → then I=V/Req) and makes the answer easy to check.

5. Prompt Refinement: Start with an ambiguous prompt related to the


"Water Cycle." Test the AI’s response, note the confusion or errors, and
then refine your prompt to make it clearer and more specific. Repeat this
process twice and record how the AI’s responses improve with each
refinement.
Role-Based Prompting: Create three prompts asking the AI to explain
"Newton’s Laws of Motion," each with a different role instruction: (a) as
an expert engineer, (b) as a high school teacher, (c) as a beginner. Compare
the tone, detail, and style of the responses.

Prompt Refinement (Water Cycle)


1. Ambiguous Prompt:
“Tell me about the water cycle.”
 (AI gives a generic, maybe long or unfocused response.)
2. Refined Prompt:
“Explain the water cycle briefly with its main stages.”
 (AI gets more structured: evaporation → condensation → precipitation →
collection.)
3. More Refined Prompt:
“Explain the water cycle in 4–5 short bullet points for 8 th grade students, using
simple words.”
 (AI gives a clear, concise, student-friendly answer.)
Observation for students: Each refinement reduces vagueness and
improves clarity.
Role-Based Prompting (Newton’s Laws of Motion)
a) As an Expert Engineer:
“You are an expert mechanical engineer. Explain Newton’s Laws of Motion with
technical depth and real-world engineering applications.”
b) As a High School Teacher:
“You are a high school physics teacher. Explain Newton’s Laws of Motion
simply with everyday life examples for students.”
c) As a Beginner:
“Imagine you are a beginner who just learned Newton’s Laws of Motion.
Explain them in your own simple words.”
Observation for students:
 Engineer → technical, detailed, professional tone.
 Teacher → simple, structured, educational tone.
 Beginner → very basic, casual, less precise.

6. Creative Engineering Problem Prompts: Craft a prompt that asks the AI


to brainstorm ideas for designing a low-cost water purification system
suitable for rural areas. Encourage creativity by adding phrases like
“limited resources” and “sustainability”.
“Brainstorm innovative ideas for designing a low-cost water purification
system suitable for rural areas. Focus on limited resources, local availability of
materials, and sustainability. Present at least 3 ideas with brief explanations.”
This shows students how adding constraints (“low-cost,” “limited resources,”
“sustainability”) makes the AI’s response more creative and practical than a
plain “design a water purifier” prompt.

7. Ethical Prompt Design Discussion: Identify a biased prompt related to


job descriptions (e.g. language with respect to a gender). Rewrite the
prompt to remove bias and create a neutral, inclusive version. Explain why
this revision is more ethical.
Biased Prompt (example):
“Write a job description for a salesman who is energetic and young.”
Neutral & Inclusive Prompt:
“Write a job description for a sales representative highlighting key skills and
responsibilities, ensuring it is inclusive and free from age or gender bias.”
Why More Ethical?
 Removes gendered term (salesman → sales representative).
 Avoids age bias (young → focus on skills/abilities).
 Encourages equal opportunity language, fair to all applicants.
This shows students how small prompt changes can shift outputs from
biased → ethical.

8. Simulated Customer Support Chatbot: Develop a prompt that instructs


the AI to play the role of a technical support agent helping a customer
troubleshoot a failure in an electronic circuit. Include instructions to keep
the tone friendly and professional and to ask diagnostic questions.
“Act as a technical support agent. A customer reports that their electronic
circuit is not working. Keep your tone friendly and professional. Start by asking
simple diagnostic questions (like power supply, wiring, or component issues)
and guide the customer step by step toward troubleshooting.”
This shows students how role + tone + task instructions = a more realistic,
useful chatbot response.

9. Multi-Language Prompting: Develop a prompt that asks the AI to


translate a simple engineering glossary (5 technical terms) from English to
your native language. Then modify the prompt to request additional
explanations of these terms in the translated language.
Step 1 – Basic Multi-Language Prompt (translation only):
“Translate the following 5 engineering terms into [Your Native Language]:
1. Voltage
2. Current
3. Resistance
4. Power
5. Circuit”
Step 2 – Modified Prompt (translation + explanation):
“Translate the following 5 engineering terms into Kannada language and give a
one-line explanation for each term in the same language:
1. Voltage
2. Current
3. Resistance
4. Power
5. Circuit”
Students will notice how the second prompt adds context and depth instead
of plain translation.
Output (Kannada):
1. ವೋಲ್ಟೇಜ್
2. ಕರೆಂಟ್
3. ಪ್ರತಿರೋಧ
4. ಶಕ್ತಿ
5. ವಲಯ
Step 2 – Translation + Explanation Prompt:
“Translate the following 5 engineering terms into Kannada and give a one-line
explanation for each term in Kannada.”
Output (Kannada with explanation):
1. ವೋಲ್ಟೇಜ್ (Voltage): ಎರಡು ಬಿಂದುಗಳ ನಡುವಿನ ವಿದ್ಯುತ್
ಭಿನ್ನತೆ.
2. ಕರೆಂಟ್ (Current): ವಲಯದಲ್ಲಿ ಹರಿಯುವ ವಿದ್ಯುತ್ ಪ್ರವಾಹ.
3. ಪ್ರತಿರೋಧ (Resistance): ವಿದ್ಯುತ್ ಪ್ರವಾಹಕ್ಕೆ ವಿರೋಧ ನೀಡುವ
ಗುಣ.
4. ಶಕ್ತಿ (Power): ನಿರ್ದಿಷ್ಟ ಸಮಯದಲ್ಲಿ ಬಳಸುವ ಅಥವಾ
ಉತ್ಪಾದಿಸುವ ವಿದ್ಯುತ್ ಪ್ರಮಾಣ.
5. ವಲಯ (Circuit): ವಿದ್ಯುತ್ ಹರಿಯಲು ರೂಪಿಸಲಾದ ಮುಚ್ಚಿದ ಮಾರ್ಗ.

10. Review a curated set of different prompt types (e.g., for summarization,
information extraction, paraphrasing, question answering) from a “Prompt
Gallery.” For each prompt type, match it with a real-world task (e.g.,
summarizing a lecture note, extracting names from a project report). Test
at least three prompt templates on an AI tool or by role-play (students
simulate being the AI), with varied wording. Record the outcomes and
discuss which prompt (or template) was most effective for each task, and
explain why you think it worked best. Reflect on how changing small parts
of a prompt can alter model response quality, completeness, or accuracy.

Prompt Gallery – Types, Tasks & Templates


1. Summarization
 Real-world task: Summarizing a long lecture note.
 Prompt Template 1: “Summarize the following lecture note in 5 bullet
points.”
 Prompt Template 2: “Write a 100-word summary highlighting only key
concepts.”
 Prompt Template 3: “Summarize this text as if explaining to a 10th-grade
student.”
 Observation: Bullet-point version is often clearer for quick review; the
“10th-grade” style makes it simpler for learners.
2. Information Extraction
 Real-world task: Extracting names of students and their roles from a
project report.
 Prompt Template 1: “List only the names of students from this project
report.”
 Prompt Template 2: “Extract names and match them with their roles
(e.g., Team Leader, Designer). Present in a table.”
 Prompt Template 3: “Identify key contributors from this report and
categorize by responsibility.”
 Observation: The “table format” version is most effective because it
organizes data cleanly.
3. Paraphrasing
 Real-world task: Rewriting a paragraph in simple words for a
presentation.
 Prompt Template 1: “Paraphrase the following paragraph in simpler
language.”
 Prompt Template 2: “Rewrite this text in formal academic style.”
 Prompt Template 3: “Rephrase this paragraph for a 2-minute class
presentation.”
 Observation: The “presentation” version aligns best with purpose →
shorter, audience-friendly.
4. Question Answering
 Real-world task: Preparing for an exam with quick answers.
 Prompt Template 1: “Answer this question in one line.”
 Prompt Template 2: “Give a detailed answer with an example.”
 Prompt Template 3: “Answer as if you are a teacher explaining to
students.”
 Observation: Teacher-style answers balance clarity + completeness; one-
line answers are too brief for learning.
Classroom Flow
1. Divide students into groups (each plays either AI or evaluator).
2. Each group tests different templates on the same task.
3. Groups compare responses → discuss which worked best and why.
4. Reflect: How small prompt changes (bullet points, style, target audience)
change the quality, completeness, or clarity of answers.
This way, students don’t just see the outputs — they role-play + analyze
how wording impacts AI quality.

11. Choose a real engineering challenge or societal problem relevant to your


field (e.g., “Reducing plastic waste in campus cafeterias” or “Optimizing
solar panel placement on campus rooftops”). Draft an initial prompt that
asks an AI to propose practical solutions. Share the AI’s (or peer’s) answer
in small groups and identify aspects that are missing, vague, or not
actionable. Refine your prompt based on feedback (e.g., specify constraints,
ask for step-by-step solutions, or require a list of pros and cons). Repeat the
process one more time, refining again for further clarity or specificity.
Document the entire prompt-refinement process and share the best solution
generated, along with a brief analysis of how prompt improvements led to
better responses.

Challenge: Optimizing Solar Panel Placement on Campus Rooftops


Prompt v1 — Initial (intentionally broad)
“Propose practical solutions for optimizing solar panel placement on our
campus rooftops to maximize energy output and minimize cost.”
What students will likely find missing: assumptions, roof/shade constraints,
budget, safety/codes, step-by-step plan, measurable outputs.

Prompt v2 — Refined with context + steps


“Our campus has 4 buildings with mixed roof types (flat RCC & sloped metal)
in Mangalore, India. Budget is ₹25,00,000 with grid-tied, net-metered systems
allowed.
Task: Provide a step-by-step plan to optimize solar placement.
Include:
1. Assumptions (insolation source, panel W/m², setbacks)
2. Usable roof area per building (state method)
3. Estimated capacity (kWp) and annual yield (kWh)
4. 2 layout options with brief pros/cons
5. High-level cost and payback estimate
6. Key risks & mitigations.”
Improvement students will see: structured reasoning, quantified outputs,
clearer decisions.

Prompt v3 — Refined further with constraints + deliverables


“Using the same campus, add these constraints: roof load limit = [kg/m²],
obstacle & tree shading present (heights up to [m]), reserved roof areas = [m²],
target payback ≤ 4 years, maintenance access corridors = [m].
Deliverables (required):
 Table: per-building usable area, capacity (kWp), annual yield (kWh),
cost, payback
 3 scenarios: (A) max energy, (B) least cost, (C) balanced — each with
pros/cons
 Regulatory checklist (electrical/code/net-metering)
 Bill of materials (top-level) and O&M plan (bullets)
 Gantt-style timeline (milestones)
 Acceptance criteria (what success looks like)
Format the response with headings and bullet points.”
Why this works best: precise constraints + required artifacts → complete,
comparable, and actionable output.

Quick debrief prompts for students (one-liners)


 After v1: What key data/assumptions were missing? Which parts were
vague or not actionable?
 After v2: What got quantified? What decisions became clearer? What’s
still not specified?
 After v3: Which scenario best fits our constraints and why?

You might also like