Usage & Prompting

Few-Shot

Two or three good examples in the prompt, input and desired output, and the hit rate often jumps. The model picks up format, tone, and standard from the examples without anything being trained. Few-shot offers the best ratio of effort to effect that working with language models has to offer.

An example

Instead of describing the sorting rules, you attach three worked cases: a complaint and its correct category, then another, then another. It is especially effective to use the borderline cases the team debated longest: the miscalculated follow-up delivery, the advice complaint that is really a product complaint. It is on exactly these cases that the model learns the house rule that appears in no description.

A closer look

Two to five examples in the prompt fix format, level of detail, and tone. More important than their number is their selection: they should cover the range, including the awkward cases.

Why it matters

Few-shot is usually the cheapest real improvement: it costs a few hundred tokens per request and no training run. The comparison with fine-tuning is clear: examples in the prompt can be changed instantly, are traceable at any time, and are tied to no particular model. Only when the examples become so numerous that they exceed the context window or the budget is a switch worthwhile. A practical side effect: the collection of examples doubles as documentation. Anyone who reads the cases understands the house rule.

Commonly misunderstood

Examples have more influence than instructions. If all three examples are short, the answer will be short, even if the text explicitly says otherwise.