Skip to content
hubai.uk Help me choose
A LITTLE DIRECTION GOES A LONG WAYHelp me chooseToo many tools, not enough time? Tell us about your work and budget. We’ll help you make a shortlist.Find my fit
Language & prompts

Few-shot prompting

Also called: few-shot

By HubAI editorial team · Source checked: 24 October 2026

What 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.

AN EVERYDAY EXAMPLE · ILLUSTRATIVE

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.

FROM DEFINITION TO DOING

Teach a pattern without teaching an accident

A short exercise · use fictional or non-sensitive material.

  1. Invent three enquiries and label them Billing, Delivery or Other. Make their lengths different.
  2. Provide those examples, then ask for a label for a fourth enquiry.
  3. Test an ambiguous enquiry and one outside the categories. Check that your examples did not teach a shortcut based on length.
Ask yourself

Can the system handle a case that looks different but means the same thing?

Find a ready-made prompt for your next task →

Did that make it clearer?

Suggest an improvementReport a problemWhatsAppLinkedIn
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 ↗