AI Glossary
Few-shot (learning from a few examples)
few-shot learning, learning from a few examples, few shot
Few-shot is a technique in which you show the model a few examples of correct answers inside the prompt itself, steering its behavior without any training. It works within a single request.
- Examples go into the prompt, with no change to the model's weights.
- It pins down the answer's format and style faster than a written description.
- It takes up room in the context window, so you choose the number of examples carefully.
Few-shot answers the situation where a description of the task alone is not enough and the model misses the expected format or style. Instead of fine-tuning the model, you add a few examples of input-output pairs to the prompt, and the model recognizes the pattern and continues it in its own answer.
The technique is cheaper and faster than fine-tuning, because it does not change the model's weights and works straight away. But it has a limit: the examples take up room in the context window, so you include only as many as actually improve the result.
Related terms
In guides