Chapter 3 · Part 2

Show, don't tell

Try describing your favorite writer's style in words, precisely enough that a stranger could imitate it. Hard, right? Now imagine just handing the stranger three paragraphs and saying "like this." Instantly clearer.

Prompts work the same way. Some things — formats, tones, edge-case conventions — are painful to describe and trivial to demonstrate. The technique is called few-shot prompting: put two or three worked examples of input → output in your prompt, then give the real input. The model picks up the pattern and continues it.

Scroll to watch a format click into place.

Zero-shot: the task described in words only. The model returns the right facts…

scroll

Learning without learning

Something remarkable is happening here. The model behaves as if it learned your format — but nothing about it changed. No weights were updated (that only happens in training, long before you showed up). Instead, attention lets every new token it writes look back at your examples and imitate their structure. This is called in-context learning: the "learning" lives entirely inside the prompt, and vanishes when the conversation ends.

That makes examples the cheapest customization there is — no fine-tuning, no training data, just a better prompt.

a few-shot prompt
Extract the name and city as JSON.

Liam Ortiz — Austin HQ
→ {"name": "Liam Ortiz", "city": "Austin"}

Sofia Rossi — Milan branch
→ {"name": "Sofia Rossi", "city": "Milan"}

Maya Chen — Berlin office

Choosing examples that pull their weight

A few practical rules:

  • Two to five is plenty. One example can be mistaken for coincidence; a few establish a rule.
  • Make them consistent. The model imitates everything — spacing, casing, punctuation. Sloppy examples teach sloppy output.
  • Cover the tricky cases. If empty values should become null, include an example where that happens. Edge cases are exactly what descriptions forget.
  • Show, and tell. Examples pair beautifully with the instructions from Chapter 2 — the words state the rule, the examples nail it down.

Examples fix what the output looks like. But some failures are about reasoning — the model confidently botching a problem it should be able to solve. For those, the fix is giving it room to think.