What Is Prompting?

Prompting is the process of providing instructions or "prompts" to an artificial intelligence system, particularly with chatbots like ChatGPT or Claude. When you provide your AI with a clear question, a specific task, or a creative prompt with context, it zooms in and generates higher quality results.
What Is GIGO?
GIGO stands for “Garbage In, Garbage Out", the quality of your input determines the quality of your output. If you provide unclear, incomplete, or nonsensical inputs to an AI model, you’ll get similarly poor results in return.
Bad vs Good Prompt
| Prompt | Likely result | |
|---|---|---|
| Bad | "Tell me about Python." | A vague, generic overview. You don't know if you'll get the snake, the language, or its history. |
| Good | "You are a programming tutor. Explain Python lists to a beginner in under 150 words, with one code example." | A focused, beginner-friendly answer with an example, at the right length. |
The Importance of Prompts
A prompt is the initial input or instruction you give to an AI model. Think of it like this:
- If you want output “4, 5, 6”, you should provide input “1, 2, 3”
- If you instead provide “a, b, c”, you won’t get the numerical sequence you desire
AI-generated prompts can be generic if you don't give them enough context, so you should review and customize them.
Prompting Formats:
There are several established formats for structuring prompts:
- Alpaca Prompt Format
### Instruction: [Task to perform]
### Input: [User input]
### Response: [Expected output]
Example:
### Instruction: Add the two numbers.
### Input: 2 and 2
### Response: 4
<s>[INST] <<SYS>>
[Your system message here — optional, but useful for setting the tone or behavior of the model.]
<</SYS>>
[Your instruction or question here — this is what you want the model to respond to.] [/INST]
[The model's response goes here]
Example:
<s>[INST] <<SYS>>
You are a helpful and friendly assistant.
<</SYS>>
How do I make spaghetti carbonara? [/INST]
- ChatML
Example:
<|im_start|>system
You are a code explainer.<|im_end|>
<|im_start|>user
Explain this Python snippet.<|im_end|>
Prompt Types:
- Zero shot prompting:
Zero shot prompting means that the prompt will not contain any kind of examples.

Example:
Prompt: “Write a short story about a journey through space.”
AI Output: The stars glittered like diamonds against the vast emptiness of space. As the spaceship zoomed past distant ...
- Few shot prompting:
Few shot prompting means giving prompts with some examples.

Example:
Classify the sentiment of each review as Positive or Negative.Review: "Great phone, super fast and the screen is gorgeous!" Sentiment: Positive
Review: "Battery died in a day and the camera is blurry." Sentiment: Negative
Review: "Delivery was quick and the packaging was perfect." Sentiment: Positive
Review: "The camera quality is amazing, totally worth the price." Sentiment:
output: Positive
- Chain-of-Thought Prompting (add just before Self-consistency, since it leads into it)
Chain-of-thought (CoT) prompting asks the model to reason step by step before giving the final answer. This improves accuracy on math, logic, and multi-step problems.
Q: A shop sells pens at 12 rupees each. I buy 5 pens and pay with a 100 rupee note. How much change do I get? Think step by step.AI Output: "5 pens cost 5 × 12 = 60 rupees. Change = 100 − 60 = 40 rupees. Answer: 40 rupees."
Self-consistency builds on this idea: it runs chain-of-thought several times and picks the answer most runs agree on.
- Self-consistency prompting:
Self-consistency prompting is a technique where an AI model generates multiple responses for the same query, each through a different reasoning path. It then selects the final answer using aggregation techniques such as majority voting, choosing the most consistent output.

Example : Basic Arithmetic Reasoning
Prompt 1: "If I have 3 apples and I give away 1 apple, how many apples do I have left? Think step by step."- Without Self-Consistency (Single Response)
In a standard approach without self-consistency, the model generates only one answer based on a single reasoning path.
Model Answer: "I have 2 apples left."
This answer may be correct, but it depends on a single reasoning path and is not verified. 2. With Self-Consistency Prompting (Multiple Responses)
With self-consistency prompting, the model generates multiple answers using different reasoning paths to improve reliability.
Response 1: "I start with 3 apples. If I give 1 apple away, I subtract 1 from 3, leaving me with 2 apples."
Response 2: "I have 3 apples. After giving 1 apple away, I have 3 - 1 = 2 apples left."
Response 3: "If I take away 1 apple from my 3, that leaves me with 2 apples." Aggregation: All three responses agree that the correct answer is 2 apples. Since the responses are consistent, the final answer is selected as 2 apples.
However, if the responses had differed, for example:Response 1: "I have 3 apples. I give away 1, so I have 1 apple left." Response 2: "3 apples minus 1 apple is 2 apples."
Response 3: "3 apples minus 1 is 2 apples." Here, there is one response saying 1 apple and two responses saying 2 apples. Model would select 2 apples as the final answer since it is the more consistent answer.
- Persona based prompting
- Persona prompting controls how the model sounds and what expertise it brings. You give it an identity or voice, then ask for a single piece of output.
- Example:
Prompt: "You are a senior nutritionist with 15 years of experience.
Explain why protein is important after a workout, in simple language
for a beginner."
- Role-playing prompting
- Role-playing prompting sets up an interactive scenario where the model plays a character and you play another. It's a back-and-forth, not a one-shot answer.
- Example:
Prompt: "Act as an interviewer for a Node.js developer position. I am the candidate. Ask me one question at a time, wait for my answer, then give brief feedback before moving to the next question."
Comments
Join the discussionNo comments yet. Be the first to comment.
