Skip to catalogue

few-shot prompting

Few-shot prompting provides worked examples of the desired task behavior.

Use this when A natural-language instruction leaves the expected output format ambiguous.

without the term

“The AI keeps formatting the output slightly differently each time. Can I just show it a couple of examples of exactly what I want so it copies the pattern?”

with the term · How do you ask a model for few-shot prompting?

Add a few representative examples for this output contract. Evaluate on separate cases, including one that should be rejected.

XBlueskyLinkedIn

What is few-shot prompting?

The prompt includes a few worked input and output examples. They must be consistent and cover the distinctions the model needs, because the model copies the examples more than the instructions.

Why does few-shot prompting matter when vibe coding?

Inconsistent examples can teach the wrong behavior more strongly than the instruction.

How do you do few-shot prompting?

Use a small consistent set and evaluate on different inputs.

What goes wrong with few-shot prompting?

Reusing the demonstrations as the entire evaluation set.

adjacent

reviewed

report a correction