Notes

Few-Shot Prompting

Show, don't tell. When describing a task in words gets you nowhere, put two or three worked examples in the prompt and let the model infer the pattern from them. That is few-shot prompting, and it requires no training run at all.

Why examples work without training

The weights never change. The examples condition the next prediction instead: after three cases of a review followed by a sentiment label, the most likely continuation after a fourth review is a label in the same form. This is in-context learning, the behaviour GPT-3 made famous, and it does the most work when a task is easy to demonstrate but hard to specify — an output shape, a house tone, an unusual labelling rubric.

Where it gets fragile
  • Examples teach format far more reliably than reasoning; demonstrations carrying deliberately wrong labels still improve results, because what they convey is the shape of the answer.
  • Scores move with example order, label balance and even delimiters, so a prompt that tests well may be sitting on a fluke.
  • Every example is tokens in every call — cost, latency and context budget you pay forever rather than once.
When to stop

Two to five well-chosen examples capture most of the gain. Past that, returns flatten and you are paying rent on a demonstration; if you need thousands of examples' worth of behaviour, that is the signal for supervised fine-tuning. And if the gap is missing knowledge rather than missing form, examples will not close it — retrieval will.

Few-shot prompting places a handful of worked input-output examples in the prompt so the model infers the task from demonstration rather than instruction. No weights change: the examples condition the next prediction, an effect called in-context learning. It is the cheapest way to pin down output format and an unusual labelling rubric. The costs are real — examples consume context on every call, and results shift with their order and wording.

Think of starting a new job. Someone could explain the filing system to you in detail, or they could just show you three forms that were already filled in correctly and let you copy the pattern. The second way is usually faster. Few-shot prompting is that second way, applied to an AI assistant: instead of describing what you want, you paste in two or three finished examples. The assistant picks up the pattern and follows it. Nothing about the AI is retrained — the examples only live in that one conversation, so you have to include them every time you ask.