Few-shot Prompting: Teaching a Model with Examples

Few-shot Prompting

A method in which the model is given several examples of a task being performed before it has to carry out the main assignment. These examples serve as context and a pattern to follow, helping the model understand better what result is expected.​

AdvantagesDisadvantages
Increases the accuracy and relevance of answersRequires more time to prepare the prompt
Lets you tune the model to a specific format or styleMay limit the model's creativity if the examples are too narrow
Effective for tasks that require a particular approach or structureMay lead to over-reliance on the examples, when the model becomes dependent on the provided data and generalizes worse to new tasks

Example of a Few-shot prompt:

Creating headlines for articles:
Topic: "Scientists have discovered a new planet beyond the Solar System."
Headline: "A new planet: a discovery beyond the Solar System"
Topic: "Technologies of the future: how artificial intelligence will change the world."
Headline: "Artificial intelligence: technologies changing the future"
Topic: "Healthy eating tips from nutritionists."
Headline: "Healthy eating: recommendations from the experts"
Topic: "Environmental initiatives to save the planet."
Headline:

Try it in GPTunneL