brainax

What is few-shot prompting

Few-shot means you first show the model 2–3 ready "input → output" examples in your prompt, then give a new input. "Shot" here means example. Zero-shot is a task with no examples at all. The model continues text, so it spots the pattern and writes the next answer in the same style: instead of describing what you want, you show it.

A few-shot prompt has three parts: a short task, examples with identical labels ("Item: … Description: …"), and a new "Item: …" with an empty "Description:". 2–5 examples are usually enough. The catch: the model copies everything it sees, typos and wrong prices included, and similar examples narrow the answer. So examples must be correct and varied.

Covered in the lessonShow an example: few-shotOpen the lesson →

More terms from this course