Few-shot prompting
Also called: few-shot
By HubAI editorial team · Source checked: 24 October 2026What does it mean?
Giving a model a small set of examples in the prompt to demonstrate the pattern you want. It usually changes the context for that request, not the model’s underlying weights.
Picture this
You provide three incoming enquiries paired with the correct category, then ask the model to categorise a fourth using the same labels.
Where you’ll come across it
Consistent formatting, tone and small classification tasks. Include a difficult example, not only obvious ones, and keep a separate set for testing.
What it doesn’t mean
Examples can teach an accidental pattern. If every complaint in your examples is long, the system may learn length rather than the actual meaning of a complaint.
Teach a pattern without teaching an accident
A short exercise · use fictional or non-sensitive material.
- Invent three enquiries and label them Billing, Delivery or Other. Make their lengths different.
- Provide those examples, then ask for a label for a fourth enquiry.
- Test an ambiguous enquiry and one outside the categories. Check that your examples did not teach a shortcut based on length.
Can the system handle a case that looks different but means the same thing?
Did that make it clearer?
Likes are a private on-page choice, not a public rating. For a correction or complaint, send the pre-filled form to our editorial inbox. Nothing is sent until you submit it.Check the source
Written and explained by HubAI. The reference below lets you go deeper; it is not an endorsement of a particular product.
Technical reference: developers.google.com ↗