Back to glossary
Techniques

Few-Shot Prompting

Including 2-5 input-output examples in the prompt to teach a pattern.

Definition

Few-shot prompting is a technique where you provide a language model with a small number of input-output examples (typically 2-5) directly in the prompt to guide its behavior on a new task. The model reads the examples, recognizes the input-output pattern, and applies it to your real input. Few-shot is the workhorse technique for custom classification, structured extraction, brand-voice generation, and any task where the desired output style is hard to describe but easy to demonstrate.

Example

Q: 'I love this product!' A: positive\nQ: 'Worst purchase ever.' A: negative\nQ: 'It's okay, nothing special.' A: ?

When to use

Custom classifications, brand-voice content, structured extraction, when output style is easier to show than explain.

Also known as

few shot, few-shot prompting

Related terms

Free Chrome Extension

Stop rewriting prompts. Start shipping.

Works with ChatGPT, Claude, Gemini, Grok, Midjourney, Ideogram, Veo3 & Kling. 5.0★ on the Chrome Web Store.

Add to Chrome — Free