Skip to content

Learning path · Foundations · 06

Zero-Shot and Few-Shot Learning

Zero-shot asks the model to perform a task with instructions alone; few-shot adds inline examples that demonstrate the desired input-output pattern.

Why it matters

  • Examples often beat longer prose for format adherence.
  • Few-shot is a cheap alternative to fine-tuning for narrow formats.
  • Example selection affects bias and failure modes.

Key ideas

  • Instruction-only
  • In-context examples
  • Pattern transfer

Start zero-shot when the task is familiar to the model and the output schema is simple. Add few-shot examples when you need a particular JSON shape, classification boundary, or tone. Curate examples for edge cases you care about—not only happy paths. In RAG pipelines, few-shot can teach citation format or refusal behaviour without retraining weights. Watch token budget: five good examples may outperform twenty mediocre ones. Rotate examples when eval slices show bias toward particular vendors, geographies, or customer tiers represented disproportionately in demonstrations.

Updated 2026-08-09 · Full learning path