Back to Home
Prompt Engineering
🟢 Beginner · 7–10 min

One-shot vs Few-shot Prompting

By putting a few examples inside your prompt, you show the AI exactly the pattern to follow. One example is one-shot. A few examples is few-shot.

This is a simple learning demo. The AI outputs below are predefined to show the idea, not a real AI model.

Overview

Show, don't just tell

In the last lesson you asked the AI to do a task with no examples (zero-shot). That works great for common tasks. But when a task is unusual, or you need a very specific answer format, plain instructions can miss.

The fix is simple: put examples right inside the prompt. Each example shows the model the exact input → output pattern you want. Give one example and it is one-shot. Give a few and it is few-shot.

Zero-shot vs One-shot vs Few-shot

One idea, three amounts of help

Remember, a "shot" is one example. The only thing that changes below is how many examples you include before the real question.

🎯

0 examples = zero-shot  ·  1 example = one-shot  ·  a few examples = few-shot. More examples usually means a clearer pattern for the model to copy.

🟢 Zero-shot 0 examples
Classify this ticket: "I cannot login"
🔵 One-shot 1 example
"App keeps crashing" → Technical Issue Classify this ticket: "I cannot login"
🟣 Few-shot 3 examples
"App keeps crashing" → Technical Issue "Refund not received" → Billing "Change my address" → Account Access Classify this ticket: "I cannot login"
Why examples help

Examples remove the guesswork

An instruction says what to do. An example also shows how the answer should look. That extra clarity helps the model in three ways:

Shows the format. The model sees the exact shape of a good answer (a short label, not a paragraph).
Sets the categories. Your examples reveal which labels exist, so the model stops inventing its own.
Teaches your style. The model copies your wording and tone, making answers consistent every time.
Interactive: teach the AI with examples

Add examples and watch the answer improve

The AI must sort this new ticket into the right team. Right now it has no examples, so it is guessing. Click “+ Add example” to show it how similar tickets were handled, and watch its answer get sharper.

Example tickets you can add
AI answer for “I cannot login” Zero-shot
How sure the AI is
When examples help most

Reach for one-shot / few-shot when…

You need an exact format (a label, JSON, a fixed layout).
The task uses your own categories or private rules.
Zero-shot gives inconsistent results across tries.
The task is unusual or tricky to describe in words.
Keep in mind

Examples are not free

Each example takes up space (tokens) and can cost a little more.
Biased examples teach the wrong pattern, garbage in, garbage out.
If a task is simple and common, zero-shot is often enough.
Use clear, correct examples that cover your real categories.
Rule of thumb: start with zero-shot. If it struggles, add one example, then a few more only if needed.
🔑
Key takeaways
  • • A "shot" is one example inside the prompt.
  • One-shot = 1 example, few-shot = a few examples.
  • • Examples show the model the format, categories, and style you want.
  • • More (good) examples usually means a clearer pattern and steadier answers.
  • • Start zero-shot, then add examples only when you need them.