Walkthrough

Zero-Shot, One-Shot, Few-Shot

Dial examples from zero to few and watch behavior lock in — plus how example choice, balance, and order quietly steer the model.

Steps · 0 / 5 done
  1. Establish the zero-shot baseline

    Zero-shot means instructions only, no examples — the right starting point, because modern models are strong instruction-followers and every example costs tokens on every future call. Run this on a handful of reviews and note where it wobbles.

    Classify the product review inside <review> tags as positive, negative, or mixed.
    Respond with only the label, lowercase.
    
    <review>
    The battery lasts forever, but the strap broke in a week.
    </review>
    VerifyObvious reviews classify correctly, but run several borderline ones and you'll see drift — 'mixed' vs 'negative' calls vary between runs.
  2. One shot to pin the format

    The first example's job is usually mechanical: it shows the exact output shape, killing preamble, capitalization drift, and explanation creep in one stroke. One demonstration outperforms three formatting rules.

    Classify the product review as positive, negative, or mixed. Respond with only the label, lowercase.
    
    Review: "Shipping was slow but the product itself is flawless."
    Label: mixed
    
    Review: "The battery lasts forever, but the strap broke in a week."
    Label:
    VerifyOutput is now exactly one lowercase word, every run — the example pinned the format.
  3. Few-shot: spend examples on the hard cases

    Extra examples should teach decisions, not repeat easy wins. Harvest your borderline cases — sarcasm, faint praise, flat factual complaints — and label them the way you want them handled. Each exemplar is a policy decision the model will imitate.

    Classify the product review as positive, negative, or mixed. Respond with only the label, lowercase.
    
    Review: "Shipping was slow but the product itself is flawless."
    Label: mixed
    
    Review: "Great, another update that breaks everything. Five stars."
    Label: negative
    
    Review: "Does what it says. Nothing more to add."
    Label: positive
    
    Review: "[paste review here]"
    Label:
    VerifyRe-run the Step 1 wobblers — sarcastic and flat reviews now land where your examples said they should.
  4. Balance and shuffle the label space

    Few-shot sets leak statistics: when most exemplars carry one label, predictions skew toward it (majority-label bias), and the final example's label bleeds into the prediction (recency bias). Audit every example set you ship against this checklist.

    Audit checklist for any few-shot set:
    1. Count labels — no label should dominate (aim within one of each other).
    2. Shuffle — never group all examples of one label together.
    3. Check the last example — its label nudges predictions; rotate it when testing.
    4. Cover the label set — a label with zero examples is a label the model avoids.
    VerifyAfter balancing, an ambiguous review classified five times no longer favors whichever label your examples over-represented.
  5. Know when to stop adding examples

    Returns diminish fast — two to five well-chosen exemplars capture most of the gain, and past that you're paying tokens per request forever. If a behavior needs many examples to teach, that's a signal the instruction is unclear or the labels themselves are fuzzy.

    Decision rule:
    - Format drift?                → 1 example
    - Borderline cases wrong?      → add 2-4 exemplars encoding those exact decisions
    - Still wrong after 5?         → rewrite the label definitions; examples can't fix fuzzy categories
    - Long transformations (rewrite, extract)? → 1-2 full worked examples beat 10 rules
    - Simple task, obvious output? → zero-shot, keep the tokens
    VerifyFor your own task you can name which bucket applies — and your prompt contains no example that isn't earning its tokens.
Check your understanding
Q1. Your five few-shot examples are all labeled 'spam' because those were handy. Now the classifier flags almost everything as spam. What happened?
Q2. Your zero-shot prompt classifies correctly but wraps every answer in 'Sure! The label is...'. What's the cheapest reliable fix?
· Tick off the 5 step(s) above.
· Score 100% on the quiz.