Free preview5 min

What Is Few-Shot Prompting?

Reviewed by Human · Updated August 5, 2026

The myth: to get better AI output, you describe what you want more precisely. More adjectives, more rules, more edge-case caveats. The truth: past a certain point, description stops working — and the fix is to stop describing and start showing.

Why would three short examples beat three careful paragraphs of instructions?

What Is Few-Shot Prompting?

**Few-shot prompting**: including a small number of worked input-output examples inside your prompt so the model can copy the pattern. **Zero-shot prompting**: asking the model to do a task with instructions only — no examples. **In-context learning**: the model's ability to pick up a task pattern from examples in the prompt itself, without any retraining. This isn't a hack. It's the headline finding of the original GPT-3 paper, which showed that large models can learn tasks from demonstrations placed directly in the prompt (arxiv.org/abs/2005.14165). The model treats everything you write as evidence about what should come next — which is also why context is everything when you build a prompt. Examples are simply the highest-density evidence you can provide, and they slot into the same skeleton you learned in the anatomy of a prompt: role, context, task, examples, format.

One to five examples in the prompt = few-shot. Zero examples = zero-shot. Exactly one = one-shot.

Live Demo — AI Terminal

Here's a support-ticket classifier. The zero-shot version — "Classify this ticket by category and urgency" — returns a different format every run: sometimes a sentence, sometimes bullet points, sometimes labels nobody defined. Now watch what three examples do. Run this and check the output format.

Your prompt

Your turn

Take this zero-shot prompt and convert it to few-shot. Write two example pairs that lock in the output format you want.

Reflect

Which formatting decisions did your examples make for you that the original instruction left ambiguous?

end of module

You've finished this module.

Mark it complete to earn your XP and keep your streak alive.

Progress saved locally · Sign up to earn XP