Skip to content

What is Few-Shot Prompting?

A technique where a small number of input-output examples are included in the prompt to guide the model's behavior.

Few-shot prompting provides a language model with a handful of demonstration examples within the prompt itself, establishing a pattern the model should follow for subsequent inputs. Unlike fine-tuning, which permanently adjusts model weights, few-shot prompting operates entirely at inference time and requires no training data pipeline. It is particularly effective for teaching format conventions, domain-specific terminology, or nuanced classification rules. The tradeoff is that examples consume tokens from the context window, so practitioners must balance the number of examples against the space available for the actual task input and output.