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:
| Aspect | Zero-shot | Few-shot prompting | Fine-tuning |
|---|---|---|---|
| Examples in the prompt | None | A handful | Not applicable (they go into training) |
| Changes the model | No | No | Yes, adjusts its weights |
| Cost to implement | Minimal | Low | High (data and compute) |
| Speed to iterate | Immediate | Immediate | Slow (requires retraining) |
| Best when | The task is simple or general | You need to guide format or criteria | You 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.
FAQs about Few-Shot Prompting
What is 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?
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?
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?
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?
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.
Related terms
- Prompt EngineeringPrompt engineering is the practice of designing, structuring and refining the instructions given to a generative AI model so it returns accurate, useful and reliable answers, by adjusting the context, format, examples and constraints.
- PromptA prompt is the natural language input instruction an AI model receives to generate a response. It defines the task, context, format and tone the user expects, and the quality of the result depends directly on how clear it is.
- Fine-TuningFine-tuning is the process of retraining an existing language model on your own examples so it learns a specific style, domain or task. It adjusts the model's internal weights, unlike prompting, which only changes the instructions.
- Context WindowThe context window is the maximum amount of information (measured in tokens) that a language model can process at once, adding up the user's question, the instructions, the attached data and the response it generates.
- Generative AIGenerative AI is a branch of artificial intelligence that creates new content (text, images, code, audio) from patterns learned from large volumes of data, instead of only classifying or predicting on existing data.
- Human-in-the-LoopHuman-in-the-loop (HITL) is a design in which a person supervises, validates or corrects an AI system's decisions before they are executed, combining the model's speed with human judgment at critical or high-risk steps.
Related questions
- What is an LLM in simple terms?in LLM (Large Language Model)
- What is temperature in an LLM?in LLM Temperature
- What is machine learning?in Machine Learning
- What is natural language processing?in Natural Language Processing (NLP)
- What is process automation?in Process Automation
- What is RAG (retrieval-augmented generation)?in RAG (Retrieval-Augmented Generation)
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 itFive 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.





