Skip to main content

The Missing Guide to Prompt Engineering

Core Techniques You Should Master

These are the techniques that separate prompt engineering beginners from competent practitioners. Master these, and you'll see immediate improvements in your AI interactions.

Zero-Shot Prompting

Zero-shot prompting is the simplest approach: give the AI a task without any examples. It relies entirely on the model's training to understand what you want.

This technique works well for common tasks that the AI has seen many times during training. Translation, basic summarisation, and simple question-answering are perfect for zero-shot prompting.

Example: "Classify the following text as positive, negative, or neutral: 'I think the vacation was okay.'"

The AI can handle this because it has seen thousands of sentiment analysis examples during training. No additional guidance needed.

When to use zero-shot prompting: Use this approach for simple, well-defined tasks and common operations like translation or summarization. It's perfect when you need quick results without setup time, especially for tasks where the AI's default behaviour is already good enough.

Best practices for zero-shot prompting: Use clear, specific instructions and avoid ambiguous language. Stick to tasks the model handles well naturally. Be prepared to switch to a few-shot if the results are poor.

Common pitfalls: Don't assume the AI understands complex or domain-specific tasks. Avoid vague instructions like "analyze this." Don't expect consistent formatting without specifying it.

Few-Shot Prompting

Before asking the AI to perform the task, few-shot prompting provides examples of what you want. This is often the single most effective technique for improving AI performance.

The power of examples is remarkable. Even when the examples have randomised or incorrect labels, providing them still improves performance. The AI learns from the pattern and structure, not just the content.

Basic few-shot example:

Here are examples of how to write engaging email subject lines:

Product: Time tracking software Subject: "Stop losing 2 hours every day to poor time management"

Product: CRM systemSubject: "Why your sales team is missing 40% of follow-ups"

Now write a subject line for: Project management tool for remote teams.

Advanced few-shot example:

I need you to extract key information from customer feedback. Here's the format:

Feedback: "The app crashes every time I try to export data. This is really frustrating because I need those reports for my weekly meetings." Extracted info: {"issue": "app crashes during export", "impact": "blocks weekly reporting", "sentiment": "frustrated"}

Feedback: "Love the new dashboard design! Much easier to find what I need." Extracted info: {"issue": "none", "impact": "improved usability", "sentiment": "positive"}

Now extract information from: "The search function is slow but the results are usually accurate."

Choosing effective examples:

  • Use representative cases that cover the range of inputs you expect
  • Include edge cases or tricky scenarios
  • Maintain consistent formatting across all examples
  • Show the exact output format you want

How many examples to use:

  • Start with 2-3 examples for simple tasks
  • Use 5-7 examples for complex or nuanced tasks
  • Add more examples if you're seeing inconsistent results
  • Remember that more examples use more tokens and cost more

Follow The Clarity Principle For Clear, Direct, and Specific Prompt

This isn't really a separate technique. It's a principle that should guide every prompt you write. Remember, ambiguity is the enemy of good AI output.

The problem with vague prompts:

Models like ChatGPT and Claude can guess what you mean, but their guesses aren't reliable. In production environments, inconsistency kills user trust and breaks automated workflows.

Vague: "Write something about cybersecurity."

Specific: "Write a 100-word summary of the top 3 cybersecurity threats facing financial services in 2025. Use clear, concise language for a non-technical audience."

Model-specific guidance for clarity:

ChatGPT responds well to:

  • Crisp numeric constraints ("3 bullets," "under 50 words")
  • Formatting hints ("in JSON format")
  • Clear delimiters and structure

Claude tends to:

  • Over-explain unless boundaries are clearly defined
  • Benefit from explicit goals and tone cues
  • Need clear stopping conditions

Gemini works best with:

  • Hierarchical structure in prompts
  • Headings and stepwise formatting
  • Clear organisation of information

The Medical Coding Case Study

Here's how these techniques work in practice. A medical coding startup needed AI to extract billing codes from doctor transcripts. The initial results were terrible, with little to no accuracy.

The solution combined multiple core techniques:

Step 1: Started with clear, specific instructions about the task and output format.

Step 2: Added a few-shot examples showing correct coding decisions with explanations.

Step 3: Include edge cases and tricky scenarios in the examples.

Result: 70% improvement in accuracy.

The key insight: the examples didn't just show what to do. They also showed the reasoning process behind each decision, helping the AI understand not just the patterns but the logic.

Combining Core Techniques

The most effective prompts often combine multiple techniques:

Zero-shot + Clarity: "Translate the following French text to English, maintaining the formal tone: [text]"

Few-shot + Specificity: Provide 3 examples of the exact format you want, then ask for the same format with new input.

Persona + Task + Examples: Set a role, define the task clearly, and show examples of success.

When Core Techniques Aren't Enough

These core techniques handle most everyday prompt engineering needs. But sometimes you need more sophisticated approaches:

  • When the task requires complex reasoning
  • When you need the AI to check its own work
  • When simple examples don't capture the full complexity
  • When you're building production systems that need reliability

That's when you move to advanced techniques. But master these core approaches first. They're the foundation everything else builds on.

Practice Exercise

Try this exercise to cement your understanding:

  1. Pick a task you do regularly (writing emails, analysing data, creating content)
  2. Write a zero-shot prompt for it
  3. Add 2-3 examples to make it a few-shot
  4. Apply the clarity principle to make instructions more specific
  5. Compare the results

You'll likely see dramatic improvements just from this simple progression.