Skip to content
AI & Machine Learning

Few-Shot Prompting

Definition

Few-shot prompting is including a handful of worked examples of a task in the prompt, so the model picks up the pattern and format from them without any retraining.

Diagram

Instruction

Tag each piece of feedback as bug, feature request or praise.

Examples (the “shots”)

“The export button does nothing on Safari.” → bug

“Could you add a dark mode?” → feature request

“Setup took two minutes. Lovely.” → praise

New input

“I get logged out every time I switch tabs.” → the model fills this in

The examples teach format and judgment at once, with no retraining. Pick ones that cover the tricky cases and all the labels, vary their order, and keep them realistic: models copy the examples’ length and style as well as their answers.

Case study

Worked example