AI glossary · Prompts
Few-shot
In one sentence
Few-shot prompting is a technique where you include a handful of worked examples in the instruction, so the AI model copies the format, tone or judgement you want without having to be retrained.
Also known as: few-shot prompting · few-shot learning · in-context learning · prompting with examples
What is few-shot prompting?
Sometimes showing is easier than explaining. You could spend a paragraph describing your company’s tone of voice, or you could show three replies you like. Few-shot is the second option: putting a few input and output examples into the prompt so the model follows the pattern.
Put it to work
AI agents that look after your customers
From €49/mo + VAT
Voice, WhatsApp and email with the phone line included: agent, numbers and CRM in one fee.
See plans and pricingThe name comes from “shots” in the sense of attempts. It’s the opposite of zero-shot, where the model gets the task with no examples at all. Today’s language models are very good at picking up patterns from their context, and few-shot makes the most of that.
Related to this term
UTIO agents
- Available 24/7 in 26 languages
- Set it up yourself for €0: built from your website
- 14-day free trial, no card needed
From €49/mo + VAT
See plans and pricingHow it works
Strictly speaking, the model doesn’t learn anything: nothing inside it changes. The examples simply sit in its context window and steer the reply. That’s also why you pay for them in tokens on every call.
It works best when:
- The examples are varied: an easy one, an ambiguous one, one that usually goes wrong.
- The format is identical throughout: same structure, same labels.
- There’s no accidental pattern for the model to copy, such as every answer being “positive”.
It’s handy for classifying, pulling data out in a fixed format or keeping a consistent writing style.
Example
A craft gin distillery in the Scottish Borders gets lots of messages through its website and wants to tag them for the right person: visit, purchase, trade or other. Given the task alone, the model hesitates over messages from bars. With three examples, it stops hesitating:
Classify the message: visit, purchase, trade or other.
Message: "Do you run tastings on Saturday for a group of 6?"
Category: visit
Message: "I run a bar in Edinburgh and would like your gin on our menu."
Category: trade
Message: "Can you send 2 bottles of the pink gin to London?"
Category: purchase
Message: "{new message}"
Category:
The bar example makes the difference: it shows the judgement call that kept going wrong.
What it means for your business
Few-shot is the quickest way to correct an AI that doesn’t get your judgement right. If you review an AI agent’s replies and see it always slipping up on the same kind of case, a good example often fixes it better than yet another written rule.
At UTIO, the agent starts in draft mode: you review what it proposes, and those corrections are the raw material for tuning it. If you build your own tools, UTIO’s AI API generates and classifies text with the prompts you send it, examples included.
Frequently asked questions
How many examples should a few-shot prompt have?
Two to five is usually enough. More examples improve accuracy up to a point, but each one costs tokens on every call. What matters is that they're varied and cover the cases that most often get mixed up.
Is few-shot the same as fine-tuning?
No. With few-shot, the examples sit inside the prompt and the model doesn't change. Fine-tuning retrains the model on many examples. Few-shot can be tested in minutes; fine-tuning makes sense when you have hundreds of examples or very high volume.
What does one-shot mean?
It's the case with a single example. Zero-shot means none at all, and few-shot means a handful.
Related terms
- Zero-shot
Zero-shot is when an AI model completes a task from the instruction alone, without any prior examples of how to do it. It manages thanks to what it already learned during training.
- Prompt
A prompt is the instruction or text you give an AI model to get something done: a question, a command, a document to summarise or a mix of all three. Much of what the model gives back depends on the prompt.
- Prompt engineering
Prompt engineering is the work of designing, testing and refining the instructions given to an AI model so that it answers well consistently, not just once.
- Fine-tuning
Fine-tuning means further training an AI model that's already been pre-trained, using a small set of your own examples, so it specialises in a particular task, format or style without starting from scratch.
- Text classification
Text classification is the AI task of automatically assigning one or more categories to a piece of text, such as an email or a message: type of request, topic, priority or language. It's the basis for sorting, prioritising and routing work.
Updated on