Master the core prompting techniques that form the foundation of professional AI communication. Learn when and how to apply zero-shot, few-shot, role-playing, and structured prompting for maximum effectiveness.
You will master:- Zero-shot vs Few-shot prompting strategies
- Role-playing and instructional prompting
- Pattern design for common professional tasks
- Marketing and business applications
- Structured output formatting
- Multi-turn conversation design
Core Prompting Techniques
Zero-shot Prompting
Instructions without examples. Best for simple, well-defined tasks where the model has sufficient training data.
Few-shot Prompting
Provide examples before the task. Ideal for complex outputs, specific formats, or teaching new patterns.
Role-playing
Assign specific personas to the AI. Enhances context understanding and generates more appropriate responses.
Structured Prompting
Use explicit formatting, separators, and constraints. Ensures consistent outputs for automation and integration.
Task: Create two versions of the same task:
- Zero-shot: Classify these reviews as Positive, Neutral or Negative without examples
- Few-shot: Provide 3 examples before classifying
- Test both approaches on 5 different reviews
- Measure accuracy by comparing with your human classification
Test reviews:
- "Product arrived broken, customer service non-existent"
- "Good but expensive, delivery on time"
- "Exactly what I was looking for, recommended!"
- "Not bad, but there were better options"
- "⭐⭐⭐⭐⭐ Excellent value for money"
Zero-shot:
Classify this review as Positive, Neutral or Negative:
"Product arrived broken, customer service non-existent"
Sentiment:
Few-shot:
Classify these reviews:
"Excellent service, I'll definitely return!" → Positive
"Product okay, but expensive for what it offers" → Neutral
"Expected more, I don't recommend it" → Negative
"Product arrived broken, customer service non-existent" →
Expected results: Few-shot should be more accurate, especially for borderline cases.
When to Use Each Technique
✅ Zero-shot Best For:
- Simple classification tasks
- Information extraction
- Basic Q&A
- When you don't have examples
- Quick prototyping
- Cost-sensitive applications
✅ Few-shot Best For:
- Complex output formats
- Teaching specific styles
- Consistency across outputs
- Domain-specific language
- Handling edge cases
- Production systems
✅ Role-playing Best For:
- Professional consultations
- Creative writing
- Customer service simulations
- Educational scenarios
- Multi-perspective analysis
- Brand voice consistency
Task: Rewrite these vague prompts into specific prompts with roles:
- Vague: "Talk about investments"
- Vague: "Analyze this text"
- Vague: "Generate some content"
Requirements:
- Assign a specific role to the model
- Define the output format
- Specify tone and style
- Add constraints (length, structure, etc.)
1. Investments:
You are a financial advisor specialized in young professionals (25-35 years old).
Explain the 3 best ETFs to start investing with a budget of €100/month.
Structure:
1. ETF name + ticker
2. Why it's suitable for beginners
3. Main risks
4. Potential 5-year return (conservative estimate)
Tone: reassuring but professional, avoid excessive jargon.
2. Text analysis:
You are a senior SEO editor. Analyze this blog article for:
• Readability (score 1-10)
• Keyword density and placement
• H2/H3 structure
• Call-to-action effectiveness
Provide 3 concrete recommendations to improve ranking.
Patterns for Common Tasks
These reusable patterns solve common business problems efficiently. Each pattern includes clear structure, constraints, and output formatting for reliable results.
Extract structured information from unstructured text:
EXTRACT the following entities from the text:
- FULL_NAME
- CONTACT_EMAIL
- MAIN_PROBLEM
- URGENCY_LEVEL (high/medium/low)
- REQUEST_DATE
Text: [INSERT_TEXT]
Output format JSON:
{
"name": "",
"email": "",
"problem": "",
"urgency": "",
"date": ""
}
Generate multiple variations while maintaining guidelines:
Generate 5 variants of [CONTENT_TYPE] for [CONTEXT].
Requirements:
- Length: [LENGTH]
- Tone: [TONO]
- Keywords to include: [KEYWORDS]
- Avoid: [AVOID]
Format: numbered list with brief explanation for each variant.
Task: Design prompts for these specific tasks:
| Task | Requirements |
|---|---|
| Entity extraction | From customer email, extract: name, email, problem, urgency |
| Variant generation | 5 variants of subject line for marketing email |
| Data validation | Verify that these data are consistent and complete |
| Context-aware translation | Translate IT technical terms maintaining meaning |
Bonus: Create a reusable template for each type of task.
Entity Extraction Template:
EXTRACT the following entities from the text:
- FULL_NAME
- CONTACT_EMAIL
- MAIN_PROBLEM
- URGENCY_LEVEL (high/medium/low)
- REQUEST_DATE
Text: [INSERT_TEXT]
Output format JSON:
{
"name": "",
"email": "",
"problem": "",
"urgency": "",
"date": ""
}
Variant Generation Template:
Generate 5 variants of [CONTENT_TYPE] for [CONTEXT].
Requirements:
- Length: [LENGTH]
- Tone: [TONE]
- Keywords to include: [KEYWORDS]
- Avoid: [AVOID]
Format: numbered list with brief explanation for each variant.
Professional Applications
"Example 1: Eco campaign - 'Daily Sustainability'. Example 2: Tech - 'Ethical Innovation'. Generate 5 content pieces for health brand, incorporate multimodal (text+image description)."
"Develop omnichannel plan for e-commerce: Include API integration, customer journey mapping. Format as textual diagram with nodes."
"Audit campaign for environmental impact: Carbon footprint metrics, suggest green alternatives. Format table with KPI."
"You are a PR expert. Simulate crisis: Data leak. Iterate responses with feedback loop, integrate legal compliance. Output: Phased plan."
"You are a strategist. Localize US campaign for Asia: Cultural adaptation, use web_search for insights. Output: Country variations."
"<task>Predict trend.</task> <context>Sales data Q1-Q4.</context> <tool>Use code_execution for regression.</tool> <output>Forecast JSON with confidence intervals.</output>"