• Module 2 · Core Techniques
  • 2 min read
  • Builds: Your own prompt library

Zero-Shot vs. Few-Shot Prompting: When to Give the AI Examples

When to give the AI examples, and when to let it work from the instruction alone.

Key takeaway & what you'll build

A zero-shot prompt asks for the task with no examples; a few-shot prompt includes two or three examples of what good looks like. Use zero-shot for common tasks and few-shot when you need a specific style, format, or judgement. Good examples are varied, consistent in format, and as close to the real task as possible.

You'll build: Your own prompt library

Two ways to ask

Zero-shot means asking for the task with no examples: "Write a one-line description for a canvas tote bag." The model relies on its training, so you get a competent, typical answer.

Few-shot means including a few examples of the result you want, then the new case. The model copies the pattern: tone, length, structure, and judgement.

The same task, both ways

Zero-shot: "Write a one-line description for a canvas tote bag." A typical answer: "A stylish and durable canvas tote bag, perfect for shopping, work, or everyday adventures!"

Few-shot:

Write a one-line description in the same style as these examples.

Ceramic mug: Holds 12 oz of coffee and survives the dishwasher. That's it. That's the mug.
Wool beanie: Warm, itch-free, and plain enough to go with everything you own.

Canvas tote bag:

A typical answer: "Carries a week of groceries, folds flat, and won't fall apart by spring." The examples did what "dry, practical, no exclamation marks" would struggle to do on its own.

When to use each

  • Zero-shot for common tasks where a typical answer is fine: summaries, translations, simple explanations.
  • Few-shot when you need a particular style (your brand's), format (a fixed template), or judgement (how you'd classify or score something).

Writing good examples

  • Two or three is usually enough. More examples cost tokens and can over-constrain the answer.
  • Keep the format identical across examples, so the pattern is unmistakable.
  • Vary the content. If every example is about kitchenware, the model may assume the next one should be too.
  • Use real examples where you can: your best past work is the best teacher.
  • Watch for copying. If outputs echo your examples too closely, add "match the style, not the wording."

Try it

Pick a short task you do often, such as subject lines or product blurbs. In Ask Ace, run it zero-shot, then again with two of your own past examples. Note which answer you'd actually use.

Before and after

Product descriptions in a house style (example)

Before

Prompt

Write a one-line description for a canvas tote bag.

Output

A stylish and durable canvas tote bag, perfect for shopping, work, or everyday adventures!

After

Prompt

Write a one-line description in the same style as these examples.

Ceramic mug: Holds 12 oz of coffee and survives the dishwasher. That's it. That's the mug.
Wool beanie: Warm, itch-free, and plain enough to go with everything you own.

Canvas tote bag:

Output

Carries a week of groceries, folds flat, and won't fall apart by spring.

Two short examples set the tone (dry, practical, no exclamation marks) better than a list of adjectives would.

Ask the AI course tutor

The tutor knows this whole course. Pick a question to start a conversation about this lesson.