One-Shot and Few-Shot Prompting
Spoke & Chain now wants more than a label: for each email, a small record with the category, the bike part mentioned and how urgent it is. Describing the exact layout in words took a paragraph and still produced three different formats. Showing two finished examples fixed it in minutes.
The rule
Show, don't tell: the model copies the examples you give.
A one-shot prompt includes one worked example of input and output; a few-shot prompt includes several, often two to five. The model spots the pattern and continues it for the new input. Examples teach things that are hard to describe:
- the exact format, down to spacing and punctuation;
- the judgement on borderline cases;
- the tone and length of a written answer.
Extract a record from each email.
Email: My rear brake squeals and I ride to work tomorrow.
Record: category=repair; part=brake; urgency=high
Email: Could you tell me when the blue bottle cage is back in stock?
Record: category=order; part=bottle cage; urgency=low
Email: The chain I bought last week snapped. I'd like my money back.
Record:The model answers in exactly the layout it was shown, for example category=refund; part=chain; urgency=medium. No paragraph of format rules was needed.
That power cuts both ways. The model copies everything about the examples, including accidents: if all your examples are short, answers get short; if most are labelled repair, it leans toward repair; if the last example is order, that label gets a small extra pull.
The shortcut
Choose examples like a mini test set: cover each output, include one hard case, keep one format, mix the order.
Cover the labels
One email each for repair, order, refund and other, so no label dominates.
Keep examples realistic. Invented, overly tidy examples teach the model a world that does not match your inbox. Real emails, lightly anonymised, work best. Also watch the cost: every example is sent on every call, so four short examples usually beat twelve long ones. Add examples only while the test set keeps improving.
Drills
Answer fast — trust the rule.
What is a one-shot prompt?
Which is few-shot prompting best at teaching?
Five of six examples are labelled repair. What is the likely effect?
Which set of examples is best for the triage prompt?
Remember
- Show, don't tell: the model copies the examples you give.
- Shortcut: cover each output, include a hard case, one format, mixed order.
- Trap: accidental patterns in examples — imbalance, odd order, unrealistic tidiness.
