🔧 Basic Techniques

Master the fundamental prompting methods and strategies that form the foundation of effective AI communication

← Back to Prompt Engineering Guide

🚀 Getting Started with Basic Techniques

These fundamental techniques are the building blocks of effective prompt engineering. Master these basics before moving to advanced strategies.

🎯 Zero-shot vs Few-shot Prompting

Understanding when and how to use examples in your prompts can dramatically improve AI performance.

🎯 Zero-shot Prompting

Asking the AI to perform a task without providing any examples. Best for simple, straightforward tasks.

❌ Vague Zero-shot

"Write a story."

✅ Clear Zero-shot

"Write a 300-word science fiction story about time travel, suitable for teenagers."

💡 When to Use Zero-shot
  • Simple, well-defined tasks
  • When you need quick results
  • For creative, open-ended requests
  • When examples might limit creativity

📚 Few-shot Prompting

Providing 1-3 examples to guide the AI's understanding and improve output quality.

❌ Poor Few-shot

"Write a poem like this: Roses are red, violets are blue. Now write another one."

✅ Effective Few-shot

"Write a haiku about nature. Here are examples:
Morning dew glistens
On spider's web, fragile thread
Nature's artwork shines

Now write a haiku about mountains."

💡 When to Use Few-shot
  • Complex or specific tasks
  • When you need consistent formatting
  • For tasks requiring specific style
  • When quality is critical

🎭 Instruction vs Role Prompting

Two different approaches to getting the AI to behave in specific ways.

📝 Instruction Prompting

Directly telling the AI what to do with clear, specific instructions.

❌ Unclear Instructions

"Make this better."

✅ Clear Instructions

"Rewrite this paragraph to be more concise. Reduce it from 150 words to 75 words while maintaining all key information. Use active voice and clear, simple language."

💡 Best for:
  • Specific, actionable tasks
  • When you need precise control
  • Technical or analytical work
  • Format and structure requirements

🎭 Role Prompting

Asking the AI to adopt a specific persona or expertise to guide its behavior.

❌ Vague Role

"Act like an expert."

✅ Specific Role

"You are a senior marketing consultant with 15 years of experience in B2B SaaS. You specialize in customer acquisition strategies and have helped companies like Salesforce and HubSpot grow their customer base. Provide strategic advice for our startup's go-to-market strategy."

💡 Best for:
  • Creative and strategic thinking
  • When you want expert-level insights
  • Complex problem-solving
  • Generating innovative ideas

🎛️ Output Control Techniques

Techniques to ensure the AI produces exactly the type and format of output you need.

📏 Format Specification

Explicitly defining how you want the output structured and formatted.

❌ No Format Specified

"Analyze this data and give me insights."

✅ Format Specified

"Analyze this data and provide insights in the following format:
Key Findings: [3-5 bullet points]
Trends: [2-3 observations]
Recommendations: [3 actionable suggestions]
Data Quality: [assessment of data reliability]"

🔢 Length & Detail Control

Specifying exactly how long or detailed you want the response to be.

❌ Unclear Length

"Write a summary."

✅ Specific Length

"Write a 150-word executive summary of this report. Focus on the top 3 key findings and 2 actionable recommendations. Use bullet points for easy scanning."

🔄 Iterative Refinement

The process of continuously improving your prompts based on AI outputs and feedback.

Step-by-Step Prompt Improvement

Watch how a prompt evolves through multiple iterations:

🔄 Iteration 1: Basic Prompt

"Write about climate change."

Result: Too broad, generic content

🔄 Iteration 2: Add Specificity

"Write a 300-word article about the impact of climate change on coastal cities."

Result: Better focus, but still generic

🔄 Iteration 3: Add Examples & Format

"Write a 300-word article about the impact of climate change on coastal cities. Focus on Miami, New Orleans, and Venice. Include specific examples of flooding events and economic costs. Structure as: Introduction, Problem, Examples, Solutions, Conclusion."

Result: Much more specific and actionable

🧠 Chain-of-Thought Prompting

Encouraging the AI to show its reasoning process step-by-step for better accuracy and transparency.

💭 What is Chain-of-Thought?

Asking the AI to break down complex problems into steps and show its reasoning process.

❌ Direct Question

"What's the answer to 15% of 240?"

✅ Chain-of-Thought

"Let's solve this step by step: What is 15% of 240? Show your work and explain each step of your calculation."

💡 Benefits of Chain-of-Thought
  • Better accuracy on complex problems
  • Easier to spot errors
  • More transparent reasoning
  • Educational for users

🔍 When to Use Chain-of-Thought

Best for complex reasoning, math problems, logical puzzles, and multi-step analysis.

🎯 Perfect Use Cases
  • Mathematical calculations
  • Logical reasoning problems
  • Multi-step analysis
  • Decision-making processes
  • Problem-solving scenarios

📋 Quick Reference Guide

Essential techniques at a glance:

🎯 Zero-shot

No examples needed for simple tasks

📚 Few-shot

1-3 examples for complex tasks

📝 Instructions

Clear, specific commands

🎭 Roles

Expert personas for insights

📏 Format

Specify output structure

🔄 Iterate

Refine based on results

🧠 Chain-of-Thought

Show reasoning steps

🔢 Control

Manage length and detail