Definition
Few-Shot Prompting
Few-shot prompting is the technique of including a handful of worked examples in a prompt to show a model exactly what you want before asking it to perform the task. The examples demonstrate the input-output pattern, format, and style, steering the model far more reliably than instructions alone — without any retraining of the underlying model.
Key takeaways
- Few-shot prompting includes a handful of worked examples in the prompt to show a model the exact input-output pattern before asking it to perform the task.
- The examples live in the prompt at inference time, so it steers behavior with no retraining of the underlying model.
- It sits between zero-shot (instructions only) and fine-tuning, and is cheap to iterate — changing the examples reshapes behavior instantly.
- Example quality and selection matter more than quantity; representative, correctly formatted examples that cover tricky cases do the work.
Large models are strong pattern-matchers, and few-shot prompting exploits that directly. Instead of only describing the task, you show two to five complete examples of the input and the desired output, then present the real input. The model infers the pattern from the demonstrations and continues it, which is especially powerful for enforcing a precise output format or a subtle classification distinction that prose struggles to pin down.
It sits on a spectrum. Zero-shot prompting gives instructions and no examples; few-shot adds a small number; the examples live entirely in the prompt at inference time, so nothing about the model is changed. This makes it cheap and immediate to iterate on — adjusting the examples reshapes behavior without a training run.
The quality and selection of examples matter more than their quantity. Representative, correct, consistently formatted examples that cover the tricky cases lift performance; sloppy or skewed ones teach the wrong pattern. The cost is the context space and tokens the examples consume, which competes with room for the actual input.
Planoda's AI features rely on carefully chosen in-prompt examples to keep structured output consistent, rather than fine-tuning a separate model for each task.
Related terms
- Zero-Shot PromptingZero-shot prompting is asking a model to perform a task using instructions alone, with no examples provided. It relies on the broad capabilities the model learned in training to generalize to a task it was never explicitly shown. It is the simplest, fastest way to prompt, and modern models handle many tasks well from a clear instruction by itself.
- System PromptA system prompt is a set of instructions given to a language model before any user input, defining its role, behavior, tone, constraints, and the tools or knowledge it should use. It frames every response in the conversation that follows. Unlike a user message, it sets the persistent ground rules the model is meant to honor throughout an interaction.
- Chain-of-ThoughtChain-of-thought is a prompting technique that asks a model to reason through a problem step by step before giving its final answer. By generating intermediate reasoning rather than jumping straight to a conclusion, models perform markedly better on multi-step tasks like math, logic, and complex analysis — the explicit steps act as scratch work that improves the result.
- Fine-TuningFine-tuning is the process of further training a pretrained language model on a smaller, task-specific dataset so it adapts to a particular domain, format, or style. Rather than training from scratch, it adjusts the existing model's weights on curated examples, producing a specialized variant that performs a narrow task more reliably than the base model.
- Large Language Model (LLM)A large language model is an AI system trained on vast amounts of text to predict and generate language, enabling it to answer questions, summarize, write, and reason over natural language. LLMs power modern AI assistants and agents. They are probabilistic next-token predictors, which makes them remarkably capable but also prone to confident errors.