Glossary

Few-shot prompting

Few-shot prompting gives a model a handful of worked examples in the prompt to steer its format and behaviour, without any retraining.

Few-shot prompting is the technique of including a small number of worked examples directly in the prompt to show a model how you want it to respond — without changing any of the model's weights. The model reads the examples as part of its context, picks up the pattern, and applies it to your actual question.

Why it matters

A language model can do a remarkable amount just from instructions in plain text, but sometimes instructions alone leave room for interpretation. A few concrete examples remove that ambiguity. If you want answers in a specific format — a JSON object with certain keys, a one-sentence summary followed by three bullets, a response that always cites the passage number — showing the model two or three cases of input and desired output is often more reliable than describing the format in words.

This matters for document AI in particular. When extracting structured data from a document, a few-shot prompt can demonstrate the exact shape of the expected output far more precisely than a verbal description. The model learns from example rather than specification.

Few-shot prompting sits between zero-shot prompting (no examples at all, just instructions) and fine-tuning (actually retraining the model on thousands of examples). It costs nothing beyond a few extra tokens in the prompt, needs no training run, and can be updated instantly by changing the examples. For tasks where the output format matters as much as the content, it is often the most practical first step.

All terms
Ready when you are

Stop digging. Start asking.

Add Sidenote to Chrome, open any page in your wiki, and ask it the question you’ve been Slacking the team about.

7-day Pro trial · No card required · Free tier forever