Glossary

Prompting

Few-Shot Prompting

Showing a model two to five worked examples of the desired input-output pattern before asking it to handle a new case.

Definition

Few-shot prompting provides the model with a handful of example pairs — input here, desired output here — before presenting the new input you actually want handled. The examples teach the model the format, the tone, and the level of judgement expected. It contrasts with zero-shot prompting (no examples) and many-shot prompting (dozens or hundreds, sometimes called in-context learning at scale).

Why it matters

For consistent stylistic output — brand voice, structured rewrites, classification with custom categories — few-shot is often the highest-leverage technique available. It is also the easiest way to teach a model nuance that is hard to describe in instructions: 'write like this' beats 'write in a warm but executive tone' almost every time. The usual mistakes are giving too many examples (wasted context, diminishing returns), giving examples that contradict each other, or giving examples that do not represent the range of inputs the model will actually see. Three or four diverse, high-quality examples typically outperform ten mediocre ones.

Examples

Effective few-shot

Three before-and-after pairs showing how the team rewrites support replies, followed by a new draft to handle the same way.

Wasted few-shot

Five examples that are all nearly identical, teaching nothing about variation.

Frequently asked

How many examples is best?

Usually two to five for style tasks. More if the task has many distinct categories.

Where in the prompt should examples go?

Most commonly after the instruction and before the new input, clearly delimited so the model recognises the pattern.

Can examples be too long?

Yes — they consume the context window. Keep them representative but compact.

Related terms

Put the concept to work

Open the rewrite engine and apply this principle to a draft of your own.

Try a rewrite