Module 1 • Lesson 435 mins

Curate Diverse Few-Shot Examples, Don't List Them All

Curate 2–4 high-variance few-shot examples instead of listing dozens of repetitive variants, maximizing the ROI of few-shot learning.

Rules for curating 2–4 high-variance few-shot examples

Curate Diverse Few-Shot Examples, Don't List Them All

The first three lessons of Module 1 focused on curating context and personas. This lesson moves to another technical lever that directly governs output consistency: curating Few-Shot Examples.

Running Example: The Product Manager of FreelanceFlow needs AI to standardize Jira bug ticket titles from unstructured user complaints.

TIẾP CẬN CŨ / LỖI THỜI
Repetitive Few-Shot (15 identical patterns)
Consumes context budget wastefully, teaches zero new patterns
CHUẨN AI PM / HIỆN ĐẠI
Diverse Few-Shot (3–4 high-variance cases)
Standardizes behavior, covers edge cases robustly, saves tokens

Select 2–4 High-Variance Examples Instead of Listing Repetitive Variants

Few-shot prompting yields the highest return on investment (ROI) for steering model output without complex rule descriptions. However, the most common trap is packing dozens of structurally identical examples.

The Golden Rule: You only need 2 to 4 high-variance examples representing distinct operational axes:

  1. A Straight Case: Clean, unambiguous input representing 80% of standard production workflows.
  2. An Edge Case: Vague, incomplete data, or inputs containing multiple simultaneous issues.
  3. A Common Misconception Case: A scenario where models frequently make incorrect assumptions without explicit grounding.

Adding structurally redundant examples teaches the model no new patterns - it merely burns attention budget that should protect critical boundary conditions.

Exercise 2.1: The FreelanceFlow PM wants AI to automatically generate standardized Jira ticket titles formatted as [Module] - [Concise Issue Description] from raw user complaints. Below are 6 candidate Input/Output pairs:

  1. Input: "When I tap pay with Visa card the app freezes completely, no feedback, had to force restart." → Output: [Payment] - App freezes during Visa card checkout
  2. Input: "Wallet balance displays $500 but transaction history sum equals $480, missing $20 with no record." → Output: [Wallet] - Displayed balance mismatches transaction history sum
  3. Input: "Ugh app is terrible, always laggy, fix it please." → Output: [Performance] - General lag reported (Lacks specific reproduction steps)
  4. Input: "I sent $100 to split lunch, friend confirmed receiving only $40. Not sure if system glitch or friend issue." → Output: [Transfers] - Transfer amount mismatch between sender and receiver (Audit log required)
  5. Input: "App crashed when I went into settings and tapped change language to English." → Output: [Settings] - Crash when switching language to English
  6. Input: "Promo code threw an error, then refresh wiped my whole cart, also homepage loads slower recently." → Output: [Cart & Promos] - Cart items cleared after voucher error + refresh (Secondary feedback on home load speed)

Select the 3 most effective examples to include in the few-shot prompt. Justify why the other 3 should be eliminated based on pattern redundancy principles.