Few-Shot Prompting
A prompting technique where you provide a small number of input-output examples before the actual query to guide the model's behavior and output format.
Structure
Format: [Example 1 input] -> [Example 1 output], [Example 2 input] -> [Example 2 output], ..., [Actual query] -> ? The model infers the pattern from examples and applies it to the new query.
Best Practices
Use 3-5 diverse examples. Order matters (put hardest examples last). Include edge cases. Ensure consistent formatting. Quality of examples matters more than quantity.