AI Utility

Few-Shot Learning Prompt Template: Zero-Shot vs. One-Shot vs. Few-Shot

These three terms describe how many worked examples a prompt includes before asking the model to complete a new case — and the right number depends on how much the task benefits from having a pattern to follow versus how much it just adds unnecessary length.

Zero-Shot: No Examples

Just a task description and the input to complete, with no demonstrations at all:

Classify the sentiment of this review as Positive, Negative, or Neutral.
Input: Setup was confusing but once it worked, I loved it.
Output:

This works fine for tasks the model already handles reliably from instructions alone — simple classification, straightforward rewrites, well-known formats. It's the fastest to write and the shortest prompt, at the cost of leaving more room for the model to interpret ambiguous instructions its own way.

One-Shot: A Single Example

One worked example added before the query — a reasonable starting point when a task's expected format isn't obvious from the instruction alone:

Classify the sentiment of this review as Positive, Negative, or Neutral.
Input: The battery life is incredible, lasts two full days.
Output: Positive

Input: Setup was confusing but once it worked, I loved it.
Output:

A single example establishes the expected output format clearly, but it can't demonstrate a full range of cases on its own — one positive example doesn't show how a negative or ambiguous case should be handled.

Few-Shot: Multiple Examples (Typically 2-5)

Enough examples to actually demonstrate the range of cases the task involves — one from each category, or examples spanning the difficulty the task presents:

Classify the sentiment of this review as Positive, Negative, or Neutral.
Input: The battery life is incredible, lasts two full days.
Output: Positive

Input: Arrived broken and customer service never replied.
Output: Negative

Input: It does what it says. Nothing more, nothing less.
Output: Neutral

Input: Setup was confusing but once it worked, I loved it.
Output:

This is genuinely "few-shot" in the sense the term is normally used — enough demonstrations to show a pattern across multiple cases, not just confirm a single format.

Choosing the Right Level

Start with zero-shot for straightforward tasks and only add examples if the output format or edge-case handling isn't coming out as expected. One example is often enough to fix a formatting issue; a genuinely ambiguous or multi-category task usually benefits from the fuller few-shot range. Adding examples has a real cost in prompt length, so it's worth adding only as many as the task actually needs to demonstrate its range.

Build your prompt at whatever shot level fits your task

Try the Few-Shot Prompt Builder