What is 'few-shot prompting'?
Select an answer to reveal the explanation.
Short Explanation
Few-shot prompting is like showing a new employee a few examples of how you want work done before they start. You give the model sample input-output pairs so it picks up the pattern without lengthy instructions.
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 means no examples, one-shot means one example, and few-shot typically means 2-5 examples. The option about sending multiple API requests simultaneously describes parallel API calls or concurrency, not prompting with examples. The option about limiting Claude's response to a small number of sentences describes output length limits, such as a max_tokens parameter. The option about using a smaller, cheaper model for initial requests before escalating to a larger model describes model routing or cascading, which is a different architectural pattern.