Home Module 1 Module 2: Building Blocks

Module 2: Fundamental Building Blocks
Prompting 101

Master the techniques that solve 90% of practical tasks in professional environments. From zero-shot to role-playing, learn the core patterns of effective AI communication.

Estimated time: 4-5 hours
6 Practical Exercises
Intermediate Level
Professional Applications

Course Progress

🎯 Module Objective

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.

Exercise 2.1: Zero-shot vs Few-shot Prompting Beginner

Task: Create two versions of the same task:

  1. Zero-shot: Classify these reviews as Positive, Neutral or Negative without examples
  2. Few-shot: Provide 3 examples before classifying
  3. Test both approaches on 5 different reviews
  4. 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"
Prompt Examples

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
Exercise 2.2: Instructional Prompting and Roles Intermediate

Task: Rewrite these vague prompts into specific prompts with roles:

  1. Vague: "Talk about investments"
  2. Vague: "Analyze this text"
  3. 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.)
Rewritten Examples

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

🛠️ Professional Patterns

These reusable patterns solve common business problems efficiently. Each pattern includes clear structure, constraints, and output formatting for reliable results.

Pattern 1: Entity Extraction Template Template

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": ""
}
Pattern 2: Variant Generation Template Template

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.
Exercise 2.3: Pattern Design for Specific Tasks Advanced

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.

Pattern Templates

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

🎯 Marketing Applications
Advanced prompting techniques for data-driven marketing strategies, omnichannel campaigns, and ethical AI integration.
Few-shot Complex Content Generation for Health Brand:
"Example 1: Eco campaign - 'Daily Sustainability'. Example 2: Tech - 'Ethical Innovation'. Generate 5 content pieces for health brand, incorporate multimodal (text+image description)."
Zero-shot Omnichannel Strategy for E-commerce:
"Develop omnichannel plan for e-commerce: Include API integration, customer journey mapping. Format as textual diagram with nodes."
Zero-shot Sustainability Audit:
"Audit campaign for environmental impact: Carbon footprint metrics, suggest green alternatives. Format table with KPI."
🔄 Role-playing & Structured Techniques
Professional simulations, crisis management, and global localization with structured prompt frameworks.
Role-playing Iterative Crisis Management:
"You are a PR expert. Simulate crisis: Data leak. Iterate responses with feedback loop, integrate legal compliance. Output: Phased plan."
Role-playing Global Localization Strategy:
"You are a strategist. Localize US campaign for Asia: Cultural adaptation, use web_search for insights. Output: Country variations."
Structured Predictive Analytics Framework:
"<task>Predict trend.</task> <context>Sales data Q1-Q4.</context> <tool>Use code_execution for regression.</tool> <output>Forecast JSON with confidence intervals.</output>"

Ready for Advanced Techniques?

Module 2: 100% complete Overall progress: 40%