AJ Learning Hub logoAJ Learning Hub

Few-shot Prompting

Few-shot prompting gives the model a handful of example input-output pairs in the prompt to show it exactly what you want.

Analogy

Like showing a new hire two or three completed samples before asking them to do the next one.

Why it matters

Adding a few examples sharply improves accuracy and formatting consistency for tricky extraction or classification steps.

In practice

Showing three messages already labeled Sales/Support/Spam, then asking the model to label a fourth.

Related terms:Zero-shot PromptingChain-of-ThoughtStructured Output