few-shot prompting
Including a few worked input and output examples in the prompt to show the model the task and format.
In more detail
Brown and colleagues showed in 2020 that large models learn from such demonstrations without retraining. Later work found that the format and label balance of examples matter as much as their correctness, and that their order alone can swing accuracy, so treat order as a parameter and measure every change.
Related terms
- zero-shot prompting — Asking a model to do a task from instructions alone, with no worked examples in the prompt.
- in-context learning — A model picking up a task from instructions and examples in its prompt, with no change to its weights.
- majority label bias — The tendency of a few-shot prompt to favour the label that appears most often, or last, among its examples.
Taught in
- Zero-Shot And Few-Shot — AI Engineering: LLM Apps, RAG & Agents
- Reasoning Techniques — AI Engineering: LLM Apps, RAG & Agents
References
- Brown et al. (2020): Language Models are Few-Shot Learners
- Lu et al. (2022): Fantastically Ordered Prompts and Where to Find Them
- Min et al. (2022): Rethinking the Role of Demonstrations