close
breadcrumb right arrowGlossary
breadcrumb right arrowFew-Shot Learning
Few-Shot Learning

Few-shot learning shows a model a handful of worked examples directly inside the prompt, a couple of sample inputs and their correct outputs, before asking it to handle a new, similar case the same way. The model isn't retrained; it simply uses those examples as an immediate pattern to follow for that one request.

This is a fast, low-cost way to steer a model toward a specific output format, tone, or classification scheme without the time and expense of fine-tuning, useful whenever zero-shot instructions alone don't reliably produce the exact structure or style a task requires.

Frequently Asked Questions

How many examples does few-shot prompting typically use?

Usually somewhere between two and ten, enough to establish a clear pattern without consuming so much of the prompt's space that little room is left for the actual task input.

How is few-shot different from fine-tuning?

Few-shot examples are included fresh in each prompt and have no lasting effect on the model itself. Fine-tuning actually updates the model's weights through additional training, a persistent, more expensive change rather than a per-request instruction.

When should a business use few-shot prompting instead of zero-shot?

When the desired output has a specific format, structure, or judgment style that plain instructions alone don't reliably produce, examples usually communicate that pattern more precisely than a written description can.

Can bad examples in a few-shot prompt hurt performance?

Yes, if the examples are inconsistent, mislabeled, or unrepresentative of the real task, the model will faithfully follow that flawed pattern, which is why the quality of the chosen examples matters as much as their quantity.

Does few-shot prompting increase the cost of a model call?

Yes, somewhat, since the examples themselves consume tokens as part of the prompt, adding a small but real cost and latency increase compared to a zero-shot instruction with no examples included.

How does an AI agent decide when to use few-shot prompting internally?

Typically it's a design decision made when building the agent for a specific step, not something the agent decides dynamically. Engineers add examples to whichever prompts benefit most from them, based on testing what actually improves accuracy for that task.