Zero-shot and Few-shot Prompting
A prompt is an instruction plus context. Examples can clarify the pattern you want, but they do not remove the need to test the result.
Zero-shot prompting
A zero-shot prompt asks the model to perform a task without giving examples. It is a useful baseline and often works well when the task is familiar and the instruction is specific.
Few-shot prompting
Few-shot prompting supplies examples of inputs and desired outputs. Examples can demonstrate tone, labels, boundaries and formatting more precisely than a long verbal description.
Examples should be representative. A poor or inconsistent example set teaches the wrong pattern, and examples that contain sensitive data create avoidable exposure.
A disciplined comparison
- Keep the task and evaluation criteria constant.
- Change only whether examples are present.
- Use several test inputs, not one cherry-picked example.
- Record failure cases as well as successful outputs.
Sign in to access the lab and homework
The lesson explanation is free to read. Create a free learner account to use the practical exercise, submit homework and track your progress.
CREATE FREE ACCOUNT →