Examples in Prompts

12 min read

Sometimes words alone cannot show the model what you want. A few examples can. In this lesson you learn zero-shot, one-shot and few-shot prompts, and how to choose good examples.

New words

Zero-shot
A prompt with an instruction but no examples.
One-shot
A prompt with exactly one example.
Few-shot
A prompt with a small number of examples, usually 2 to 5.
Example (shot)
A sample input with the exact answer you want for it.
Label
The name of the group you give to an input, such as "praise".
Classification
Putting each input into one of a few fixed groups.
Pattern
A repeating shape that the model notices and copies.

What you will learn

  1. Show me, do not tell me
  2. Zero-shot, one-shot and few-shot
  3. Why examples work
  4. Worked example: messy customer SMS
  5. Choosing good examples
  6. How many examples?
  7. Two common mistakes
  8. Try it: add examples and test
  9. Trade-offs, and real systems
  10. Try it today, and key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap