What is 'few-shot prompting'?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Few-shot prompting is like showing a new employee a few examples of how you want work done before they start. The examples teach the pattern without lengthy instructions.
Full explanation below image
Full Explanation
Few-shot prompting involves including example input-output pairs in the prompt before asking Claude to handle the actual task. For example, showing 2-3 examples of how to classify customer emails before asking it to classify a new one. This technique leverages Claude's in-context learning ability to infer patterns from examples. Zero-shot = no examples. One-shot = one example. Few-shot = 2-5 examples typically. Option A describes parallel API calls (concurrency). Option C describes output length limits (max_tokens parameter). Option D describes model routing or cascading — a different architectural pattern.