The art of few-shot prompting lies in example selection and presentation.
The PRIME Framework for Examples
Pattern-rich - Examples clearly show the pattern Relevant - Directly related to desired output Incremental - Build complexity gradually Minimal - Just enough to convey pattern Explicit - Patterns made obvious
Example Set Strategies
Strategy 1: The Golden Triangle Three examples that cover: - Best case (ideal example) - Edge case (boundary example) - Counter case (what to avoid)
```text "Write customer service responses. Examples:
BEST CASE (friendly, helpful): 'I understand how frustrating that must be! Let me fix this right away. I've processed your refund and added a 20% discount for your next order.'
EDGE CASE (firm but fair): 'While our policy doesn't typically cover this situation, I can see why you're upset. Let me offer a one-time exception, and credit your account.'
AVOID (cold, corporate): 'Per our terms of service section 4.2, this request falls outside standard parameters. Your ticket has been closed.'
Now respond to: 'Your product broke after 2 days!'" ```text Strategy 2: The Progressive Build Start simple, add complexity:
```text "Create product descriptions following these examples:
SIMPLE: 'Soft cotton. Hard to beat.' MEDIUM: 'Soft Egyptian cotton meets unbeatable comfort. Your skin will thank you.' COMPLEX: 'Soft as morning clouds, strong as your ambition. Egyptian cotton that transforms rest into restoration.'
Pattern: Increasing length, metaphor, and emotional connection. Now write for: silk pillowcase" ```text Strategy 3: The Dimension Matrix Examples across multiple variables:
```text "Write email openings. Note how tone and length vary by context:
FORMAL/SHORT: 'I hope this message finds you well.' FORMAL/LONG: 'I trust this communication finds you in good spirits and excellent health as we approach the quarter's end.' CASUAL/SHORT: 'Hey there!' CASUAL/LONG: 'Hope you're having an awesome week and crushing those goals we talked about!'
Now write: Semi-formal/Medium length for a colleague" ```text