WriteMyAIPromptFree, no sign-up

Few-shot prompting

Few-shot prompting is giving a model several worked examples of a task inside the prompt so it can infer the pattern and apply it to new input.

Two to five examples is the usual range; beyond that, returns diminish and context is consumed. The examples must be consistent with each other — mixed formatting across examples teaches the model that formatting is optional. Cover edge cases deliberately, because the model will generalise from what it sees.

Related terms

One-shot prompting
One-shot prompting is giving a model exactly one worked example of the task before asking it to perform that task.
Zero-shot prompting
Zero-shot prompting is asking a model to perform a task using instructions alone, without showing it any completed examples.
Pattern matching
Pattern matching is a model’s tendency to continue the structure it has been shown, which is why consistent examples change output more reliably than described rules.

More on techniques

See the full glossary, read the guides, or put it into practice in the prompt builder.