AI Glossary · Definition

Few-Shot Prompting

Giving the AI 1–3 examples in your prompt so it copies the pattern. Probably the single fastest way to improve outputs.

The plain-English definition

Few-shot prompting means including a small number of input/output examples in your prompt before asking the AI to handle a new case. The model sees the pattern and copies it. This is dramatically more reliable than describing what you want in words.

Few-shot example

Convert these review snippets into 5-star ratings.

"Worst dinner of my life." → 1
"It was fine, nothing special." → 3
"Best burger in the city, will go back." → 5
"Decent fries but cold." →

The AI now produces "2" because it sees the pattern. Without those three examples, you'd get the rating plus a paragraph of unsolicited explanation.

When to use few-shot

How many examples?

Two or three is usually enough. One example often isn't (the model might think it's a coincidence). Five+ rarely helps more than three and just wastes tokens.

Pro tip: pick edge cases

The best few-shot examples aren't the easy ones — they're the boundary cases. Show the AI a normal case, a tricky case, and an edge case. This teaches it the rules better than three normal cases.

Related terms

Copied