damngoodprompts

Few-shot prompting

Examples still help, but they work best when they define a hard boundary or voice target.

Last reviewed: August 10, 2026

The concept

Few-shot prompting means showing the model a small number of examples before asking it to handle a new case. It is still useful, but it is no longer the default answer to every prompt problem.

Modern instruction-tuned models already understand many common tasks. Examples matter most when the task has a local judgment boundary that plain instructions cannot describe well.

The current approach

Use examples to show a classification edge, a house writing style, a data mapping rule, or the difference between acceptable and unacceptable output. For a practical voice example, see writing and content drafting.

Classify the ticket reason.

Example:
Ticket: "I was charged twice after upgrading."
Reason: billing_error

Example:
Ticket: "Can I move from annual to monthly billing?"
Reason: plan_change

Ticket: "{{ticket_text}}"
Reason:

Two strong examples are often better than eight loose ones. Each example should teach a rule the model could otherwise miss.

When to skip examples

Skip examples when the requested output is simple, the task is already familiar, or the examples would be lower quality than the instruction. Bad examples anchor bad behavior.

For API work, compare few-shot prompting against structured output or tool calling before adding examples. If the problem is parseability, a schema is usually cleaner than another sample response.

What to avoid

  • Adding examples because an old template always had a “few-shot” section.
  • Mixing examples with different styles or output shapes.
  • Including examples that carry outdated facts.
  • Forgetting that examples cost context. In long-document tasks, those tokens may be better spent on the source material.

Source set