Skip to content
mentoor

Topic 1 of 5 · 3 min read

Why examples beat descriptions

Goal: Decide when an example will steer the output better than a description, and turn a long format description into one example.

When you cannot describe what you want in a few clear words, show one example of it. A model copies what it sees far more reliably than it follows a long description of a style.

Check yourself · 1 of 3

What does few-shot prompting mean?

Choose one answer

Why it matters

Describing a format in words is hard. Try to explain "a friendly but short product note with the price at the end" and you will write three sentences that still leave room for guesses. How friendly? How short? What does "at the end" look like? One sample answers all of these at once: the length, the tone, the order, the punctuation, even how a price is written.

This is called few-shot prompting when you give a few samples, and one-shot when you give one. Giving none is zero-shot. The idea was named in the GPT-3 paper (Brown et al., 2020), and every major tool, including Claude, ChatGPT, Gemini and Copilot, responds to it.

How to do it

  1. Write the task in one plain sentence.
  2. Notice which parts of your description are about shape: length, tone, layout, labels. These are the parts an example does better.
  3. Write one real sample of a finished answer, by hand, the way you want it.
  4. Put the sample in the prompt, say it is an example, then give the new input.
  5. Keep the description for the parts an example cannot show, such as "never mention discounts".

Before and after

Before: Turn each support ticket into a one-line summary. Start with the product area in capitals, then a dash, then what the customer wants in plain words, no more than twelve words, no full stop, and do not repeat the customer's name.

The model will follow most of this and break some of it. A reader also has to parse the rule to check the output.

After: Turn each support ticket into a one-line summary, like this example.

Ticket: "Hi, I'm Priya. I was charged twice for my March plan and need one refund." Summary: BILLING - wants refund for duplicate March charge

Ticket: "The export button on the reports page does nothing when I click it." Summary:

The second prompt is shorter, and the model now has the exact format to continue.

What goes wrong

  • The example is the wrong shape. If your sample has a full stop and the rules say no full stop, the model usually follows the sample.
  • You describe what the example already shows. Repeating the rules in words wastes space and can clash with the sample.
  • You use an example when a rule is needed. An example cannot say "never promise a refund date". State rules in words, and use examples for form.

Examples

A long format rule becomes one sample

Description: "Write a meeting action item with the owner first, then the task, then the date in brackets, all in one line."

Example instead: "Action item: Sam - send the revised budget to finance (by 12 Dec)"

Give the sample and the model reproduces the order, the dash and the bracket style without any rule about them.

Tone is easier to show than to name

Asking for a "warm, professional but not stiff" reply means different things to different people. Paste one reply you wrote and liked, say "match this tone", and the model has something concrete to match.

Key points

  • An example shows format, tone and length at once, which a description does only in pieces.
  • Zero-shot means no examples, one-shot means one, few-shot means a few.
  • Use examples for shape and style, and words for hard rules the example cannot show.
  • If the example and the written rules disagree, the model often follows the example.
  • Write the example yourself, by hand, in exactly the form you want back.

Common mistakes

  • Writing a long format description when one sample would do.
  • Giving an example that breaks the written rules, so the two instructions clash.
  • Expecting an example to carry a hard rule such as "never quote prices".
  • Using a sample you have not read closely, so a stray typo or odd layout gets copied.

Check yourself · 2 of 3

You need replies in a very specific layout: a label, a dash, then a short phrase. What is usually the quickest way to get that layout?

Choose one answer

Check yourself · 3 of 3

Your prompt says "no full stop at the end of the summary", but your sample summary ends with one. What is the likely result?

Choose one answer

Practice items, not counted towards your mastery.

Start here