Zero-Shot vs Few-Shot Prompting

Zero-shot prompting gives instructions without worked examples; few-shot prompting adds examples of the desired input-to-output pattern. Examples help define ambiguous labels or formats, but poor examples can teach the wrong rule.

Published by HiddenPrompts · Updated

1 min read

Zero-shot

A zero-shot prompt describes the task without examples. It is efficient for familiar work with an unambiguous output contract. Start here to discover what the model already understands.

Few-shot

Few-shot prompting adds representative input-output pairs. Use it when labels, tone, edge cases, or formatting are difficult to describe precisely. Examples should cover meaningful variation, not repeat the same easy case.

Avoid accidental rules

Models may copy irrelevant details from examples. Make examples internally consistent, anonymize sensitive data, and state which traits should generalize.

Evaluate

Test on cases unlike the examples. If performance collapses, the prompt may be memorizing surface patterns instead of applying the intended rule.

Worked example

Authored teaching example, not a recorded model response.

Classify feedback as BUG, REQUEST or QUESTION.
Example input: The export button crashes.
Example output: BUG
Example input: Please add CSV export.
Example output: REQUEST
New input: Does export include archived records?
Return one label only.

How to check the result

Hold back examples from testing. Include ambiguous feedback and check whether your labels are defined well enough for a person to apply consistently. Do not judge quality only on examples already in the prompt.

Sources and further reading

Learn the method

Testing Method · Contact

Prompt Structure Checker