Artificial Intelligence

Few-shot prompting

Definition

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.

Exam context

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).

Studying for one of these certifications?

Few-shot prompting is a concept that can show up on the exam. Check the full guide to see it in context.