Few-shot Prompting
Few-shot
Showing the model two or three examples of the task instead of describing it.
Few-shot prompting puts a few worked examples in the context so the model can infer the pattern: the input format, the expected output, the level of detail, the edge cases you care about. It is a form of in-context learning, since nothing is trained; the examples only live in that one request.
It is often more reliable than a paragraph of description, and it is usually more token-hungry. A careful choice of three examples can outperform a long rule list. A poor choice of three examples can pin down a wrong pattern, including a formatting quirk you did not want.
The main failure is picking unrepresentative examples. If every example you show is clean, the model will not know what to do with a messy one, and it will imitate your tidiness rather than your actual standard.
Related terms
Prompt
The input you give a model. The word covers more than the question you type.
Prompt Engineering
The craft of writing instructions a model follows reliably.
In-context Learning
The model adapts to a task from the context alone, without any training.
Evaluation
Measuring whether the system does the job, on a fixed set of cases, repeatedly.
Want this working inside your team?
It starts with one conversation about your workflow.