Providing a model with a small number of examples (usually in the prompt) to guide its behavior and format before it generates an answer.
Few-shot prompting embeds a handful of input→output examples in the prompt; the model infers the pattern via in-context learning and applies it to the new input: no training involved. Example quality dominates: representative, diverse, edge-case-covering examples teach the pattern; sloppy ones teach the sloppiness.
Few-shot is the highest-leverage quality upgrade between plain prompting and fine-tuning: minutes of effort, often large accuracy and format-consistency gains. It's the standard production pattern for extraction, classification, and any task where output shape matters.
Typically 3–8: enough to cover the pattern and key edge cases, few enough to control token cost. Beyond ~10, gains usually flatten: at that point curate better examples or consider fine-tuning.
Few-shot wins for speed and flexibility; fine-tuning wins when example sets grow large, latency/cost per call matters at volume, or behavior must hold without long prompts. Measure both against your eval set when stakes justify it.
Models attend to patterns in context: inconsistent formatting or biased ordering (e.g. all positives first) skews outputs. Keep examples uniformly formatted and shuffled across classes.