Techniques

What Is Few-Shot Prompting?

Few-shot prompting is a technique where you provide an AI model with 2–5 examples of the input-output pattern you want before asking it to perform the same task on new input.

The Plain-English Explanation

Instead of just telling the AI what to do (zero-shot), you show it what you mean. You provide a few examples of inputs and the outputs you want, then give it a new input and let it follow the pattern. It's like training a new employee: rather than just describing the task, you show them three completed examples and say "now do this one."

Few-shot prompting dramatically improves consistency and format compliance. If you need AI outputs to match a specific style, follow a particular template, or use domain-specific terminology, showing examples is far more effective than trying to describe the requirements in words.

Why It Matters

Few-shot prompting is one of the most powerful practical techniques for getting consistent, high-quality AI outputs. It's particularly valuable for professionals who need AI outputs to match existing formats — report templates, brand voice guidelines, coding conventions, or documentation standards.

Examples in Practice

Common Misconceptions

Myth: You need many examples for few-shot to work.

Reality: Two to three well-chosen examples usually produce excellent results. More examples can help for complex tasks, but there are diminishing returns — and they use up valuable context window space.

Myth: Any examples will work.

Reality: The quality and relevance of your examples matter enormously. Examples should be representative of the task, demonstrate the format you want, and cover different scenarios. Bad examples produce bad outputs.

Myth: Few-shot prompting is complicated.

Reality: It's simply adding examples before your request. "Here are three examples of what I want: [example 1], [example 2], [example 3]. Now do this: [new input]." The concept is simple; the skill is choosing good examples.

Related Terms

Further Reading

Learn Few-Shot Prompting in Depth

Module 2 of Mastering AI Tools teaches few-shot prompting hands-on — including how to choose effective examples and when to use this technique versus others.

Explore Mastering AI Tools

Frequently Asked Questions

How many examples should I include?
Two to three is the sweet spot for most tasks. Use more (up to five) for complex formatting or specialised domains. Each example uses context window tokens, so balance quality with quantity.
Can I use few-shot prompting with any AI model?
Yes. Few-shot prompting works with ChatGPT, Claude, Gemini, and virtually every LLM. It's a universal technique that improves results across all models.
What makes a good few-shot example?
Good examples are realistic (use real-world inputs), diverse (cover different scenarios), clear (show the exact format you want), and concise (don't waste tokens on unnecessary detail).
Back to AI Glossary