Design an experiment to determine empirically whether few-shot prompting outperforms zero-shot for a specific task on your production model.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
You're an AI engineer running a production LLM app for medical-document summarization on Claude Sonnet 4.x. The current prompt is zero-shot. A team member proposes adding few-shot examples to improve quality. Design the experiment (golden set, metrics, statistical analysis, decision criteria) that would let you confidently say 'few-shot beats zero-shot for this task on this model' or 'zero-shot is fine, save the tokens'. Be specific about what makes the experiment statistically sound.
Build a 100-300 pair golden set with held-out test, score on 2-3 orthogonal metrics with bootstrap confidence intervals, pre-register the win threshold, and weigh the lift against the token-cost delta.
Imagine you want to know whether a new recipe is actually better than your old one. You do not just cook each version once for your family and see who smiles more. You cook both versions for fifty different people, you score on three dimensions (taste, appearance, how full they felt), you decide in advance that better means at least four points higher on taste, and you check whether the gap is bigger than the normal day-to-day variation in how good your cooking is. Then you also count what each version cost in groceries. Only when the new recipe wins on taste by a clear margin and the extra cost is worth it do you say it is actually better. The prompt experiment works the same way.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: golden-set construction + 2-3 orthogonal metrics + bootstrap CIs + pre-registered threshold + cost accounting + common pitfalls (small N, cherry-picked examples, single metric, post-hoc threshold).
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Declaring a few-shot win after running ten examples and looking at point-estimate accuracy, ignoring noise floor, multi-dimension metrics, and the token-cost delta.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.