Few-Shot Prompting
Definition
Few-shot prompting is a prompt engineering technique in which a small number of worked examples—typically between one and ten input-output pairs—are embedded directly in the prompt sent to a large language model. These examples demonstrate the desired task format, reasoning style, or output structure, allowing the model to infer the pattern and apply it to a new input. The examples function as in-context demonstrations rather than training data: they influence the model's behavior for that specific inference call without modifying the model's underlying weights.
In commerce and enterprise AI development, few-shot prompting is a foundational technique for standardizing model outputs and improving reliability on structured tasks. When building an AI tool to extract product attributes from unstructured supplier descriptions, including several examples of correctly formatted extraction results in the prompt dramatically improves the consistency and accuracy of outputs compared to a zero-shot instruction alone. Few-shot prompting is particularly valuable for domain-specific tasks where the terminology, output schema, or reasoning conventions differ from general-purpose language patterns—such as generating standardized product titles, classifying customer intent into a taxonomy, or formatting API-ready JSON from natural language input. The quality of the selected examples matters significantly: diverse, representative, and correctly labeled examples yield substantially better results than arbitrary or poorly curated ones.
Related Terms
Source
Last updated: May 12, 2026