Core Prompting Techniques
Zero-Shot and Few-Shot Prompting
Two fundamental techniques separate beginners from power users: knowing when to just ask, and when to show examples first.
Zero-Shot: Just Ask Directly
Zero-shot means giving AI instructions without any examples.
When it works:
- Common, well-understood tasks
- Tasks AI has seen millions of times
- When you want creative freedom
Example:
"Write a professional out-of-office email for a vacation next week."
AI knows exactly what this means — no examples needed.
Few-Shot: Show Before You Tell
Few-shot means providing 2-5 examples before your actual request.
When it works:
- Specific style or format requirements
- Unique naming conventions
- Brand voice consistency
- Uncommon output patterns
Example:
Here are examples of our product feature names:
- "SmartSync" - automatic data synchronization
- "FlexAuth" - flexible authentication options
- "QuickPulse" - real-time analytics dashboard
Now, name a new feature that allows team collaboration on documents.
AI learns your naming pattern and follows it.
Side-by-Side Comparison
| Aspect | Zero-Shot | Few-Shot |
|---|---|---|
| Setup time | Fast | Takes longer |
| Best for | Common tasks | Custom patterns |
| Creativity | Higher | Constrained by examples |
| Consistency | Variable | More consistent |
Practical Business Examples
Zero-Shot (Common Task):
"Summarize this customer feedback in 3 bullet points: [feedback text]"
Few-Shot (Brand Voice):
Examples of our social media tone:
- "Your success is our favorite notification. 🎯"
- "Another feature request? Say no more. ✅"
- "Weekend mode: activated. Productivity: still crushing it. 💪"
Write a tweet announcing our new mobile app launch.
Few-Shot (Data Formatting):
Format customer names like these examples:
- "John Smith, NYC" → "J. Smith (New York)"
- "Maria Garcia, LA" → "M. Garcia (Los Angeles)"
Now format: "Robert Johnson, CHI"
How Many Examples?
| Situation | Recommended Examples |
|---|---|
| Simple pattern | 2-3 examples |
| Complex format | 3-5 examples |
| Unique style | 4-5 examples |
More than 5 examples rarely helps and wastes tokens (which costs money with paid APIs).
Key Takeaway
Use zero-shot for common tasks where AI already knows what you want. Use few-shot when you need specific patterns, formats, or styles that AI wouldn't guess on its own. The right choice saves time and improves results.
Next: Learn chain-of-thought prompting for complex problems that need step-by-step reasoning. :::