Zero-shot prompting#
Zero-shot = you give instructions only, with no examples. Modern models handle many tasks this way:
Classify the sentiment of this review as positive, negative or neutral:
"The trainer explained recursion really well, but the AC was not working."
Zero-shot works well when the task is common and the expected output is obvious.
Few-shot prompting#
Few-shot = you include a few examples (usually 2-5) of input → output. The model picks up the pattern: style, format, length, labels, level of detail.
Convert each course feedback into a category and a one-line action.
Feedback: "The lab computers keep freezing during practicals."
Category: Infrastructure
Action: Ask IT to check lab PCs before Monday batch.
Feedback: "Please share recordings, I missed two classes due to exams."
Category: Content access
Action: Upload class recordings to the student portal.
Feedback: "Sir goes too fast in the OOP chapter."
Category: Teaching pace
Action: Add one revision session for OOP with extra practice.
Feedback: "Fee receipt not received for the second instalment."
Category:
The model continues the pattern and produces a category and an action in exactly your format.
Zero-shot = AI को सिर्फ निर्देश देना, कोई उदाहरण नहीं। Few-shot = निर्देश के साथ 2-5 उदाहरण देना - "ऐसे input पर ऐसा output चाहिए"।
इसे ऐसे समझें: नए employee को सिर्फ बोलकर समझाने से अच्छा है कि आप उसे पहले से भरे हुए 2-3 form दिखा दें। फिर वह उसी तरह बाकी form भर देगा। AI भी उदाहरण देखकर आपका format, भाषा, लंबाई और style तुरंत पकड़ लेता है।
जब आपका format खास हो, categories आपकी अपनी हों, या style बताना मुश्किल हो - तब few-shot सबसे ज़्यादा काम आता है।
Zero, one or few?#
| Technique | Examples | Use when |
|---|---|---|
| Zero-shot | 0 | Common tasks with obvious output (summarise, translate, explain) |
| One-shot | 1 | You mainly need to show the format |
| Few-shot | 2-5+ | Custom categories, specific style, tricky formats, consistent tone |
How to choose good examples#
- Cover different cases - include easy and tricky inputs, and every category at least once.
- Vary the surface - different lengths, topics and wording, so the model doesn't copy irrelevant details.
- Be 100% correct and consistent - the model will copy mistakes too.
- Use the exact format you want back - same labels, same capitalisation, same separators.
- Keep them realistic - examples like your real data work best.
If all your examples are about mobile phones, the model may bring phones into answers about laptops. If all examples are short, answers will be short. Examples teach everything they contain, not just what you intended.
Wrapping examples in tags#
For longer examples, tags keep things clear:
Write a product description in our brand style. Here are examples:
<example>
Product: Steel water bottle 1L
Description: Cold for 24 hours, hot for 12. Leak-proof lid, fits every
bag side pocket. Your daily hydration partner - from college to office.
</example>
<example>
Product: Cotton laptop sleeve 15"
Description: Soft cotton outside, padded inside. Slim enough for any
backpack, tough enough for daily commutes. Your laptop's best friend.
</example>
Now write one for:
Product: Wireless mouse with silent clicks
Few-shot for classification - a common business use#
Examples + instructions = best of both#
Examples show the pattern; instructions explain the rules. Use both:
Rewrite each sentence in simple Hindi for Class 6 students.
Rules: use common words, keep English technical terms in brackets.
English: The CPU processes instructions.
Hindi: CPU (सीपीयू) निर्देशों (instructions) को पूरा करता है।
English: RAM stores data temporarily.
Hindi:
Summary#
- Zero-shot: instructions only - fine for common tasks.
- Few-shot: 2-5 input→output examples teach format, style and custom labels.
- Choose examples that are correct, varied, realistic and in your exact output format.
- Wrap long examples in
<example>tags; combine examples with clear rules.