Few-Shot.
A prompting technique where you include a small number of input-output examples in the prompt to demonstrate the desired task format and behavior to the model.
Few-shot prompting means including 2–10 examples of a task in the prompt before asking the model to perform it on a new input. These examples serve as demonstrations — they show the model exactly what output format, style, and reasoning process you want, without requiring any model training or fine-tuning.
GPT-3's strong few-shot learning was a landmark demonstration of in-context learning at scale. By showing the model a few examples of translating English to French, or classifying news articles by topic, it could generalize to new instances immediately. This capability scales with model size — larger models exhibit stronger few-shot learning.
Few-shot prompting is most useful when the task has a specific output format (e.g., structured JSON extraction), when zero-shot prompting produces inconsistent results, or when the desired style differs from the model's defaults. The examples you choose matter: diverse, representative examples lead to better generalization than repetitive or unrepresentative ones.
Related terms.
- In-Context LearningThe ability of an LLM to learn from examples provided directly in the prompt, without any weight updates or training — just from seeing patterns in context.
- Zero-ShotThe ability of a model to perform a task correctly from just a description, with no examples — demonstrating that it has generalized the concept from training.
- Prompt EngineeringThe practice of crafting inputs, instructions, examples, and formatting to guide language models toward producing better, more accurate outputs.