Why examples work
When you show examples, the model doesn't guess your format, it matches the pattern it sees. This is called few-shot learning.
Zero-shot: just instructions
Few-shot: instructions + examples
Few-shot prompts are the easiest way to get consistent output.
Choosing good examples
Your examples teach the model what to do, so pick the ones you want to repeat.
- Use realistic inputs, not edge cases.
- Make the output format perfect.
- Include 1 or 2 varied examples.
The model learns from your examples, good or bad.
A bad example in your prompt teaches a bad habit.