Few-Shot Done Right

FewShot

Part of: Advanced Prompting Patterns

You ask a model to classify reviews as positive or negative and it keeps replying with paragraphs of analysis. You wanted one word, not an essay. The fix is not a longer instruction; it is two examples. Show it the exact input-output shape twice and it picks up the pattern. What it is Few-shot prompting means putting a handful of worked examples (each an input paired with the exact output you want) directly into the prompt before your real input. The model reads the pattern and continues it. Zero-shot is "just tell it what to do." Few-shot is "show it what done looks like." This is in-context learning : the model adapts to your task from examples in the prompt alone, without any training or weight changes. The examples teach format, tone, edge-case handling, and label vocabulary all at once, things that are awkward to describe in words but easy to demonstrate. How it works A few-shot prompt is built from three parts: an optional instruction, then example pairs, then your real input left open for the model to complete. Notice the model only has to write one more token to fit the established shape. The examples did the heavy lifting of defining the task. What makes few-shot work well

Challenge: Few-Shot Classifier