Artificial Intelligence
Few-shot prompting
Appears inAI-901AIF-C01Gen AI Leader
Prompt engineering technique where several examples of the desired input-output are included in the prompt before the actual request, helping the model understand the expected format or style without fine-tuning. Zero-shot includes no examples; one-shot includes exactly one.
On the exam
In AI-901, AIF-C01, and GENAI-L it's one of the most frequently tested prompting techniques. Question: get the model to always respond in a specific JSON format without retraining → include 2-3 examples in the prompt (few-shot).
Related terms
- Chain-of-thought promptingPrompt engineering technique where the model is instructed to make its reasoning explicit step by step before giving the final answer, improving performance on logical or mathematical reasoning tasks.
- Large language model (LLM)AI model trained on enormous amounts of text that can generate, summarize, translate, and reason over natural language. The foundation of conversational assistants and generative AI tools.