Menu
CoddyTech

Zero-Shot vs Few-Shot

Part of the Prompting Techniques section of Coddy's AI Prompts journey. Lesson 1 of 24.

So far you have described what you want in words. That is zero-shot prompting: the AI gets an instruction and zero examples. It works well for common jobs like summarizing or translating, where the AI already knows what a good answer looks like.

Some patterns are easier to show than to describe. Say your calendar writes dates as the day, then the first three letters of the month. You could explain that rule, and the AI might still get it wrong. Or you could show it:

Rewrite each date in the same style as the examples. Reply with the date only.
2026-03-14: 14 Mar
2025-11-02: 2 Nov
2026-07-09:
9 Jul

That is few-shot prompting: a short instruction, a few examples (the shots) of input and output, then the new input. The AI spots the pattern and continues it. Two or three examples are usually enough.

Keep the one-line instruction on top: in the same style as the examples points the AI at the pattern, and Reply with the date only keeps the reply clean. Small models love to wrap an answer in a friendly sentence, and the instruction is what keeps the reply as clean as the examples.

challenge icon

Challenge

Easy

At Coddy Café, staff usernames follow a house style: Maria Silva becomes silva.m and John Park becomes park.j.

Don't explain the rule. Show the AI these two examples, then ask for the username of Tom Baker.

The AI's response must:

  • Start with Tom Baker's username, in the house style, on its first line
bugsy Main icon

Start this challenge with Coddy's AI tutor

What is Bugsy?
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Prompting Techniques