Cross-cutting

Few-shot prompting

Few-shot prompting provides the model with example input-output pairs in the prompt to demonstrate the desired pattern before asking it to handle the actual input. 'Here are 3 examples of how to classify emails... now classify this one'. Few-shot consistently outperforms zero-shot on tasks with structured output or unusual format requirements.

Updated

Few-shot exploits the LLM's pattern-matching capability without requiring fine-tuning. The trade-off is context cost (examples take tokens) and the risk that the model overfits to surface patterns in the examples rather than the underlying intent. Production guidance: 3-5 examples is usually the sweet spot; examples should cover the variety of cases (not all easy or all hard); the order matters (recent examples weight more); and the format should match exactly the expected output. For genuinely novel tasks, few-shot can move accuracy from 40% to 85% without any model change.

See the term at work

Stride keeps stories, architecture decisions, tests and delivery data in one workspace, where the terms in this glossary are things you can open.