All terms

Few-shot Learning

Getting a model to perform a task from just a handful of examples — often provided in the prompt for LLMs.

Large Language Models1 min read

Definition

Few-shot learning means adapting with a small number of labeled examples. With LLMs, those examples are often placed in the prompt (in-context learning) without updating weights.

Classic few-shot ML may also fine-tune or use metric learning on tiny datasets.

In simple terms

Showing a new hire three completed tickets and saying "do it like these" — they generalize the pattern without a full training course.

Where you see it

  • Prompting an LLM with 3 Somali→English translation pairs.
  • Classifying support intents from a few labeled messages in-context.

How it works

  1. 1.Select examples

    Diverse, clear demonstrations of the task.

  2. 2.Format the prompt

    Show input→output patterns, then the real query.

  3. 3.Generate

    Model continues in the demonstrated style.

Why it matters

  • Few-shot prompting unlocks new tasks without collecting thousands of labels.

Often confused

  • Few-shot always beats fine-tuning.

    For stable high-volume tasks, fine-tuning or RAG may outperform prompt examples alone.