Language models

What is few-shot prompting?

In short

Few-shot prompting is giving an AI model a few examples of the input and the answer you want before asking your real question. The model picks up the pattern and follows it, with no training needed.

Describing a format in words is hard. Showing it is easy. With two to five good examples, a model matches your tone, length, structure and labels far more reliably. Zero-shot means no examples, one-shot means one.

Mini course

3 short lessons, about 2 minutes in total

  1. Show, don't tell
  2. Choosing good examples
  3. When to go further

Lesson 1

Show, don't tell

Language models are very good at continuing patterns. If your prompt contains a few pairs of 'input, then the answer I want', the model sees the pattern and continues it for your new input. This works for tone, length, structure, labels and even subtle judgment calls that are hard to explain in rules.

One prompt
2-5 examples
New task
Model copies pattern
Answer in your format
A few worked examples in the prompt show the model the exact pattern you want, without any training

Tap a box to open that concept

It is often the fastest way to go from inconsistent answers to answers you can use.

Lesson 2

Choosing good examples

Use real cases from your business. Cover the variety: a short one and a long one, an easy one and a borderline one. Make sure every example is exactly right, because the model will copy errors as faithfully as good habits. Keep the format identical across examples.

If results drift, add an example of the case that went wrong.

Lesson 3

When to go further

Few-shot prompts make each request longer, which costs a little more. If you run the same task thousands of times a day, or the examples no longer fit, it may be time to consider fine-tuning or a retrieval setup that picks the most relevant examples automatically.

  1. Customers find youHow customers and AI tools find the companySEOGEOGoogle AI Overviews
  2. AI in daily workTools staff and customers useChatbotAI copilotVoice AI
  3. Building blocksHow AI connects to data and systemsRAG (retrieval-augmented generation)AI agentMCP (Model Context Protocol)
  4. AI modelsThe models that understand and createFew-shot promptingLarge language model (LLM)Generative AIMachine learning
  5. DataCompany data, gathered and cleanedData warehouseETLData quality
  6. InfrastructureCloud, networks and systems underneathCloud computingDatabaseAPI key
Trust and rulesSecurity, law and control in every layerGDPR and AIEU AI ActAI guardrails
Where Few-shot prompting sits in a company's AI setup

For most small and medium companies, well-chosen examples in the prompt are enough.

An everyday example

To sort customer emails, you show three emails with the right label, such as 'invoice question', 'complaint' and 'order change', then paste the new email. The model labels it the same way.

How companies use it

Companies use few-shot prompts to get consistent product texts, email replies, data extraction and classification without the cost of fine-tuning a model.

Frequently asked questions

How many examples should I use?

Few-shot prompting usually works best with two to five examples. Pick varied ones that cover the tricky cases, not five almost identical ones.

Is few-shot prompting the same as fine-tuning?

Few-shot prompting is not the same as fine-tuning. Few-shot puts examples in each prompt, while fine-tuning changes the model with many examples once.

Can bad examples hurt?

Bad examples in a few-shot prompt can hurt. The model copies what it sees, including mistakes and quirks, so check the examples carefully.

In depth: Few-shot prompting

The full picture, about 4 minutes of reading

Show the model what you mean

Few-shot prompting is a simple way to get better and more consistent answers from an AI model. Before you ask your real question, you show the model a few examples of the kind of input you have and the answer you want for each. The model notices the pattern and follows it for your new input. No training, no special software, just a better prompt, the text you send to the model.

The name describes how many examples you give. Zero-shot means you only describe the task. One-shot means you add one example. Few-shot usually means two to five. The idea is the same as with a new colleague: you can explain at length how a customer reply should sound, or you can show three good replies and say "like these". Most people learn faster from the examples, and so do language models.

Why examples work so well

Language models are, at their core, very good at continuing patterns. During training they read huge amounts of text and learned to predict what comes next. When your prompt contains a few pairs of "here is an input, here is the answer", the most natural continuation of that text is another answer in the same style.

Examples carry information that is hard to put into words. Tone, length, level of detail, which fields to fill in, how to handle a missing value, where to draw the line between two categories: all of this is visible in a good example, even if you would struggle to write it as a rule. A description such as "be friendly but brief" means different things to different readers. Three short, friendly replies leave much less room for guessing.

That is also why few-shot prompting often gives more stable output. The same request, run many times, drifts less when the model has a clear pattern to copy.

How to build a few-shot prompt

A good few-shot prompt has four parts, in this order.

First, a short instruction that says what the task is, such as "Sort each customer email into one of these categories: invoice question, complaint, order change, other."

Second, the examples. Each one shows an input and the exact answer you want, in the same layout every time. Clear markers help, such as "Email:" and "Category:".

Third, the new input, in the same layout as the examples.

Fourth, the place where the answer should go, left empty, such as "Category:" with nothing after it.

Choose examples from your real work, not invented ones. Cover the variety: a short case and a long one, an easy case and a borderline one. If one category is often confused with another, include an example of each side of that line. Keep the examples in mixed order, so the model does not learn that the answer to the third one is always "complaint".

Where it goes wrong

The model copies what it sees, faithfully. If an example has a typo, a wrong label or an odd phrase, that will show up in the answers too. Every example needs to be exactly right.

Examples that are too similar teach too little. Five nearly identical emails all labeled "invoice question" mostly teach the model that the answer is usually "invoice question". Variety matters more than number.

Examples can also pull too hard. If all your sample replies mention a discount, the model may start offering discounts where none apply. Read a batch of answers after adding examples, not just the first one.

Finally, examples add length. Each request carries them, which costs a little more and leaves less room in the model's context window, the limit on how much text it can consider at once. Long documents as examples can crowd out the material the model actually needs.

When to go further

Few-shot prompting is the right first step for most text tasks: classification, extracting fields from emails, writing product descriptions in a house style, rewriting text into a set format. It is quick to try and easy to change.

Two situations call for something more. The first is when the task needs many examples to be covered, more than fit comfortably in a prompt. Then a system can store a larger library of examples and pick the few most similar ones for each new input automatically, using the same kind of search that powers RAG, retrieval-augmented generation.

The second is very high volume with a stable task. If the same task runs thousands of times a day and the format never changes, fine-tuning, training a model further on many examples once, can make each request shorter and cheaper. For most small and mid-size companies, well-chosen examples in the prompt go a long way before that is needed.

What it means for a small business

For a small business, few-shot prompting is one of the cheapest ways to make AI output fit how the company actually works. Collect a handful of your best real examples for each recurring text task: replies to common questions, quotes, product texts, meeting summaries, invoice data. Save them in a shared document or as part of a saved prompt or custom assistant, so everyone uses the same ones.

When answers drift or a new kind of case comes up, add or swap an example rather than writing a longer instruction. Review the examples now and then, since an outdated price or policy in an example will be repeated in every answer built on it.

Curious what this could mean for your company? Book a call.

Book a call