GlossaryTechnology

Few-Shot Prompting

Term 94 of 268 · Technology

In one sentence

Few-shot prompting is a technique that includes a handful of solved examples inside the prompt so a language model learns the pattern of the task without retraining, improving the accuracy and format of its answer.

Reviewed by Juan Manuel Garrido

Co-founder of VantegrateLinkedIn

Few-Shot Prompting definition

Few-shot prompting is a prompt engineering technique that gives an LLM a handful of solved examples inside the same prompt, so it can infer the pattern of the task and apply it to a new case. Instead of retraining the model, you guide it with demonstrations: you show it what an input and its correct output look like, and the model generalizes that behavior.

The word "shot" refers to each example or demonstration. When you give none, it is called zero-shot; with a single example, one-shot; with several, few-shot. It is a form of in-context learning: the model does not change its weights, it simply uses the examples in the prompt as an immediate reference for that specific query.

In practice, this technique is one of the core tools for getting AI agents to answer with the tone, format and criteria the business needs, without relying on a costly fine-tuning process.

How it works in practice

The mechanism is straightforward: you build a prompt that first presents several example pairs (input and desired output) and leaves the real input you want solved at the end. The model reads those examples, detects the implicit pattern (which classification to use, which response structure, which tone) and completes the last case following that same logic. There is no training and no change to the model: everything happens in a single call, inside the context window.

A clear, everyday example in LatAm: a consumer goods company wants to automatically classify incoming WhatsApp messages into categories such as "complaint", "price inquiry" or "catalog request". Instead of coding rules or training a model, it shows the LLM three or four real messages that are already labeled ("I need to know how much the 12-pack case costs" goes in as a price inquiry; "The product arrived damaged" goes in as a complaint) and then passes it the new message. The model replicates the criterion with high consistency because it has examples from the business itself right in front of it.

Why it matters for the business

The big advantage of few-shot prompting is the ratio of effort to result. You go from a generic answer to one aligned with your internal rules without writing code, without training datasets and without waiting through long cycles. That makes it ideal for validating ideas quickly, for tasks that change often and for cases where you do not have enough data volume for fine-tuning. It also reduces hallucinations in formatting tasks, because the examples narrow down what is expected and what is not.

Some typical uses where it performs very well:

  • Classification and tagging of leads, tickets or messages according to the company's own categories.
  • Structured extraction of data from free text (for example, pulling the name, tax ID (CUIT) and amount from an email and returning them in a fixed format).
  • Standardizing tone and format in customer service replies or summaries.
  • Data transformation: turning a loose description into a normalized field.

Common mistakes

The first mistake is choosing examples that are not representative, or that are all of the same type: if your three demonstrations cover only the easy case, the model will fail on the edge cases. Which examples you pick matters as much as how many. The second mistake is flooding the context window with dozens of examples on the assumption that more is always better; past a certain point, you add cost in tokens and noise without gaining accuracy. The third is not pinning down the output format in the examples: if you show inconsistent answers, the model inherits that inconsistency. The practical recommendation is to use few examples that are well curated, diverse and in the exact format you want to receive.

How it differs from other techniques

Few-shot is usually compared with zero-shot and with fine-tuning, because they solve the same problem (getting the model to do what you need) by different routes:

AspectZero-shotFew-shot promptingFine-tuning
Examples in the promptNoneA handfulNot applicable (they go into training)
Changes the modelNoNoYes, adjusts its weights
Cost to implementMinimalLowHigh (data and compute)
Speed to iterateImmediateImmediateSlow (requires retraining)
Best whenThe task is simple or generalYou need to guide format or criteriaYou have high volume and a stable use case

The rule of thumb: always start with zero-shot; if the answer falls short of the standard, add examples (few-shot); and only if the task is high-volume, very specific and stable over time should you consider the jump to fine-tuning. For most business processes, few-shot prompting covers the need with a fraction of the effort.

Share
Frequently asked questions

FAQs about Few-Shot Prompting

What is few-shot prompting?

Few-shot prompting is a prompt engineering technique in which a handful of solved examples are included inside the prompt so a language model can infer the pattern of the task and apply it to a new case. It does not retrain the model: it guides it with demonstrations so it answers with the expected format, tone and criteria.

What is the difference between zero-shot, one-shot and few-shot?

Each 'shot' is an example inside the prompt. Zero-shot means asking the model to do the task without any example, using only the instruction. One-shot includes a single reference example. Few-shot includes several examples. The more relevant examples you add, the more the model's behavior is narrowed down, although past a certain point you gain little accuracy and spend more on tokens.

When should you use few-shot prompting instead of fine-tuning?

Few-shot prompting is the better choice when you need fast results, you do not have a large training dataset or the task changes often, because it does not require retraining anything or writing code. Fine-tuning only makes sense when the task is high-volume, very specific and stable over time, since it adjusts the model's weights and costs far more in data and compute.

How many examples should a few-shot prompt include?

There is no fixed number, and what matters most is not quantity but quality: examples that are representative, diverse (covering both easy cases and edge cases) and in the exact output format you want. Adding too many examples floods the context window, makes the call more expensive and rarely improves accuracy.

Does few-shot prompting reduce model hallucinations?

It helps reduce them in formatting and classification tasks, because the examples narrow down what kind of answer is expected and what is not, leaving the model less room to make things up. It is not a complete solution: for tasks that depend on factual information, it is best combined with techniques such as RAG (retrieval of real data) and guardrails that validate the output before it is used.

An AI agent that already knows how to do this

We implement AI agents on the CRM you already use, for sales, collections and support. Tell us which process eats your day and we will tell you straight whether an agent solves it.

Keep exploring

Related terms

From the glossary

Related questions

We solve it with

AI Agents

What AI agents are when applied to sales, collections and support, and how they are implemented on the CRM you already use.

How AI Agents solve it
The full suite
Now that you know what it is, see how it gets solved

Five AI products that work on top of the CRM you already use. They don't replace your system: they add the layer you do by hand today.