Prompting is the process of giving specific instructions, questions, or examples to a Large Language Model (LLM) like ChatGPT to guide its output toward the desired goal.
In other words, its about how you are making conversation with an LLM.
Goal of Prompting
- To clarify the task for the AI.
- To control the format, tone, and depth of the output.
- To encourage reasoning or multi-step thinking.
- To reduce hallucination by narrowing the context.
| Type | Description | Example |
|---|---|---|
| Zero-Shot | No examples given | “Summarize this text.” |
| One-Shot | One example given | “Example: Dog → perro; Cat → ?” |
| Few-Shot | Multiple examples | “Translate the following… cat→chat, dog→chien…” |
| Chain-of-Thought | Ask to reason step by step | “Think step by step.” |
| Role-Based | Assign an identity | “You are a Python teacher.” |
| Self-Reflexive | Ask model to review itself | “Check and improve your answer.” |
Below are some examples , just for reference. I hope we are not moving to do a GridSearch to find which prompt works better ? Who Knows ???
1. Zero Shot Prompting
Ask the model to perform a task without prior examples.
Examples
- “Write a poem about deep learning.”
- “Summarize this paragraph in 2 lines.”
- “Explain quantum computing in simple terms.”
- “Generate a SQL query to find all customers who made purchases in the last month.”
2. One-Shot Prompting
Provide one example to show the expected format.
Examples
- Example
Q: What is the capital of Japan?
A: Tokyo
Q: What is the capital of Italy? ➜ Output: Rome - Example
English → Spanish
cat → gato
dog → ? ➜ Output: perro - Example
Input: “Increase brightness”
Output: “Adjusting display to +10% brightness”
Input: “Lower volume” → ? ➜ Output: “Decreasing sound by 10%”
3. Few-Shot Prompting
Give multiple examples to teach the model a consistent pattern.
Examples
- Sentiment Classification
- “I love this movie!” → Positive“This is terrible.” → Negative“It’s okay, not great.” → Neutral“The acting was amazing!” → ?
- SQL Generation
- “List all employees.” →
SELECT * FROM employees;“ List all products.” →SELECT * FROM products;“List all customers.” → ?
SELECT * FROM customers; - “List all employees.” →
4. Chain-of-Thought Prompting (CoT)
Ask the model to think step by step before answering.
Examples
- “If 4 pens cost ₹20, how much do 10 pens cost? Think step by step.”
➜ Step: 1 pen = ₹5 → 10 × 5 = ₹50 - “Why does the sun appear red during sunset? Explain step by step.”
➜ Step 1: Sunlight passes through thicker atmosphere → Step 2: Blue light scatters → Step 3: Red light reaches eyes. - “You have 12 marbles, give 4 to a friend. How many left? Explain.”
➜ Step: 12 − 4 = 8 marbles.
5. ReAct Prompting (Reason + Act)
Combine reasoning and action explicitly.
Examples
- “You’re a travel planner. Think about ideal locations for a short vacation from Chennai. Then list 3 options.”
- “You are an SRE. Think about why the API latency is high. Then suggest 3 mitigation steps.”
- “You are a data analyst. Think about how to visualize daily user logins. Then produce the Matplotlib code.”
6. Self-Consistency Prompting
Ask for multiple reasoning paths to get the most reliable answer.
Examples
- “What is 25% of 160? Give 3 reasoning paths and pick the best.”
➜ All lead to 40. - “How many minutes in 3.5 hours? Solve in 2 ways and choose consistent.”
➜ 3.5×60 = 210. - “If the train leaves at 3 PM and travels 2.5 hours, what time will it reach?”
➜ 5:30 PM via all methods.
7. Socratic Prompting
Use a question-driven approach to guide understanding.
Examples:
- “What happens when we drop an object? Why? What is that force called?”
- “If databases use indexes, what is their purpose? How do they help?”
- “If a model overfits, what could that mean about its training data?”
