Few-shot learning

August 21, 202610 min read

You were trying to get Claude to write in your voice — the slightly informal, direct tone you use in professional emails. You’d asked it to ‘write like me’ and the result was fine but not quite right. Then someone suggested: paste in three of your actual emails and ask it to match the style. You tried it. The difference was immediate.

What happened in that moment has a name. You’d just used few-shot learning — or more precisely, few-shot prompting — and without knowing it, you’d applied one of the most powerful techniques in how AI tools work. The AI didn’t rewrite its underlying code. It didn’t get new training data. It simply looked at three examples of what you wanted, extracted the pattern, and applied it.

Few-shot learning is the technical name for something that sounds, when you hear the plain-English version, completely obvious: giving an AI a few examples before asking it to do something makes the results significantly better. But understanding why it works — and how to use it deliberately — turns it from a happy accident into a reliable technique.

What Is Few-Shot Learning?

Few-shot learning is a capability of AI systems that allows them to understand and perform a new task based on just a small number of examples — sometimes as few as one, sometimes two or three, rarely more than ten.

The term comes from machine learning research, where the question was: how many examples does a model need to learn something new? Traditional machine learning required thousands or millions of labelled examples to train a model to do any task reliably. Few-shot learning refers to the ability to do it with far fewer — sometimes with none at all.

This is possible because modern AI models are trained on enormous amounts of data before they ever encounter your examples. By the time you give Claude three examples of how you write, it already has a rich understanding of language, style, tone, and structure from its training. Your examples don’t teach it what language is — they show it which part of its existing knowledge to apply to your specific request.

Few-shot learning is an AI’s ability to understand and perform a new task from just a handful of examples — typically between one and ten. It works because the model already has broad knowledge from its training; your examples tell it which specific pattern to apply. You use few-shot learning every time you show ChatGPT or Claude a few examples before asking it to do something.

You’re Already a Few-Shot Learner

Before explaining how AI does this, it’s worth recognising that humans are extraordinarily good at few-shot learning. It’s one of the defining features of human intelligence — and one of the things that has historically distinguished human learning from traditional machine learning.

Everyday exampleWhat your brain is actually doingWhat this is called
You meet someone new at work and recognise their face the next time you see them — even in a different settingYou saw their face once or twice, extracted the features that make it distinctive, and built a pattern you can match against in future encounters. You didn’t need to see them five hundred times.Face recognition
You read a word you’ve never seen before in a sentence and understand what it probably means from contextYou used the surrounding words, your understanding of grammar, and your existing vocabulary to infer the meaning from one or two examples of usage. No dictionary needed.Vocabulary acquisition
You hear a new song by an artist you know and recognise their style immediatelyYou extracted the patterns that characterise this artist — their sonic signature — from previous exposure, and immediately match the new song against those patterns.Style recognition
You try a dish you’ve never eaten before and can describe what’s in itYour previous experience of flavours gives you a reference library. Even one taste of something new lets you compare it against existing patterns and identify components.Taste and smell recognition
A colleague uses an unfamiliar abbreviation in two emails and you know what it means by the thirdYou inferred meaning from context across two examples and generalised to the new instance without needing it explained explicitly.Language pattern inference
You see a new road sign you’ve never seen before and work out what it meansYou apply your general understanding of the visual language of road signs — colour conventions, shape conventions, symbol conventions — to interpret a new instance you’ve never seen.Visual symbol interpretation

In every one of these cases, you’re doing what few-shot learning describes: extracting a pattern from a small number of examples and generalising it to new instances. The reason AI researchers have worked so hard to give AI models this capability is precisely because it’s so central to how intelligent beings learn. You’ve been doing it your whole life without needing a name for it.

Zero-Shot, Few-Shot, Many-Shot — The Spectrum

Few-shot learning is one point on a spectrum of how many examples an AI needs to perform a task. Understanding the whole spectrum makes it clearer what’s actually going on:

TypeWhat it meansExample promptWhen to use it
Zero-shotNo examples at all — just a description or instruction.Translate this sentence into Spanish.Works for tasks the model already understands well. Fails for tasks that need more context or a specific format.
One-shotExactly one example before the task.Here’s an example of a product description: [example]. Now write one for this product: [product].Better than zero-shot when format matters. One example establishes the pattern to follow.
Few-shotTwo to ten examples before the task.Here are three examples of the tone I want: [1], [2], [3]. Now write in this style about [topic].The sweet spot for most practical tasks. Enough examples to establish a clear pattern without overwhelming the context.
Many-shotDozens or hundreds of examples — typically through fine-tuning rather than prompting.Training a model on hundreds of examples of a specific document type before deploying it for that task.Used when few-shot isn’t enough — usually requires technical setup beyond everyday prompting.
zero-shot vs few-shot vs many-shot learning – how many examples AI needs explained simply

The amber row — few-shot — is the sweet spot for most practical everyday use. It’s enough examples to make the pattern clear without overwhelming the conversation. And critically, it requires no technical setup: you just include the examples in your message before making your request.

How Few-Shot Learning Works — Without the Jargon

When you give an AI model a few examples, here’s what’s actually happening — in plain English:

The model has existing, broad knowledge

Claude, ChatGPT, and similar models have been trained on enormous amounts of text — books, articles, websites, code, conversations — and have developed a rich internal model of how language works, what different styles look like, how different types of writing are structured. They already know what formal English sounds like. They already know what a product description is. They already know how emails tend to be structured. The concept of few-shot learning was brought into mainstream AI discussion by the 2020 paper ‘Language Models are Few-Shot Learners’ — the research that introduced GPT-3 and demonstrated how large language models could perform new tasks from just a handful of examples, without any retraining. It’s the academic origin of the technique, readable in abstract even without a technical background.

Your examples tell it which part of that knowledge to activate

When you provide three examples of your writing style, you’re not teaching the model something new. You’re pointing it at a specific corner of its existing knowledge. ‘These three examples’ is the model’s cue to find the patterns that distinguish this kind of writing from other kinds it knows — and to apply those patterns to your request.

The process is closer to recognition than learning in the way we usually think of it. You’re not retraining the model. You’re giving it a reference set to calibrate against.

It extracts the pattern and applies it

The model analyses the examples you’ve provided — not consciously, but computationally — extracting whatever is consistent across them: the tone, the sentence length, the vocabulary level, the structure, the way paragraphs begin. It then generates its response in a way that matches those patterns.

This is why the quality of the examples matters. Consistent, clear examples produce consistent, accurate outputs. Inconsistent or poorly chosen examples produce muddled results — which is the main practical limitation of the technique.

How to Use Few-Shot Learning Right Now

You don’t need to understand machine learning to use few-shot learning. You just need to include examples before your request. Here are the scenarios where it makes the biggest difference:

Matching your writing style

This is the most immediately useful application. If you want AI to write in your voice — for emails, reports, social posts, or any other context — paste in two or three examples of your actual writing before making the request. The more consistent the examples (all from the same register, the same purpose), the better the match.

Getting a specific format

If you want output in a specific structure — a particular type of bullet list, a certain meeting summary format, a specific kind of product description — show the model what that format looks like before asking for it. One clear example of the format you want is often enough.

Establishing a tone or persona

If you need AI to write in a particular voice — a brand voice, a character’s voice, a professional register — examples ground the output more effectively than instructions alone. ‘Write in a warm but professional tone’ is vague. Three examples of warm-but-professional writing is specific.

COPY THIS PROMPT — FEW-SHOT STYLE MATCHINGI want you to write in my style. Here are three examples of how I write:Example 1: [paste an email or piece of writing]Example 2: [paste another example]Example 3: [paste a third example]Now, using the same tone, sentence structure, vocabulary level, and general feel as those examples, write the following for me:[describe what you want written]

The structure of this prompt is few-shot learning in action. The three examples are your ‘training set’ within the conversation — you’re showing the AI the pattern before asking it to apply the pattern. The more specific and consistent your examples, the better the result.

The main practical limitation of few-shot learning is that your examples define the pattern — so the quality of your examples determines the quality of the output. Three inconsistent examples produce an inconsistent result. Examples that represent your worst writing rather than your best will anchor the AI to the wrong pattern. And if your examples are so specific that they don’t actually capture the general pattern you’re after, the model will match the examples rather than the underlying style they’re meant to represent. Choosing good examples is the skill — and it comes with practice.

Where Few-Shot Learning Matters Beyond Prompting

Few-shot learning isn’t only a prompting technique you use in chat — it’s a fundamental capability that shapes how AI is built and deployed across many applications.

Medical image analysis: Training AI to recognise a rare condition from a small number of confirmed cases. Traditional machine learning needed thousands of labelled images per condition — a barrier for rare diseases. Few-shot learning makes it possible to build useful models from the small datasets that exist.

Language translation for low-resource languages: Most of the world’s languages have very little digital text available for training. Few-shot learning allows translation models to work for languages where the training data is scarce rather than only for the major languages with abundant data.

Personalised AI assistants: When an AI assistant learns to respond in your preferred way based on a few interactions with you — adjusting formality, detail level, or focus — it’s applying few-shot learning principles to personalise its behaviour from minimal examples.

Rapid adaptation to new tasks: In enterprise and professional contexts, few-shot learning allows AI systems to be quickly adapted to new document types, workflows, or use cases without retraining from scratch. A model that can learn a new form format or a new categorisation system from five examples is dramatically more practical than one that requires thousands.