Lesson 3 of 6·7 min read

Chain-of-Thought and Few-Shot 🧠

Two techniques that dramatically improve AI response quality — especially for complex tasks where simple prompts lead to superficial results.


🎯 What You'll Learn

  • How Chain-of-Thought gets the AI to think structuredly
  • When Few-Shot examples are the better choice
  • Tree-of-Thought as the next level
  • When to use which technique — and when deliberately not to

Chain-of-Thought (CoT) 🔗

📖 Definition: With Chain-of-Thought Prompting, you ask the AI to think step by step instead of giving a direct answer. This significantly improves quality for reasoning tasks.

Without CoT:

"Should we invest in a CRM with AI integration?" → "Yes, AI CRMs offer many benefits like automation and better insights." (superficial)

With CoT:

"Should we invest in a CRM with AI integration? Think step by step:

  1. Analyze our current situation (50 employees, B2B, currently Excel)
  2. Evaluate the options (Salesforce AI, HubSpot AI, Pipedrive)
  3. Compare costs vs. benefits for 12 months
  4. Give a reasoned recommendation" → Structured 4-step analysis with justified recommendation

When to use CoT:

  • ✅ Complex decisions with multiple factors
  • ✅ Calculations and data analysis
  • ✅ Strategic evaluations
  • ✅ Problem diagnosis

When NOT to use CoT:

  • ❌ Simple factual questions (→ direct answer suffices)
  • ❌ Creative text generation (→ can inhibit spontaneity)
  • ❌ Brief summaries (→ makes the response unnecessarily long)

💡 Tip: A simple CoT trigger: append "Think step by step" to your prompt. Even that alone noticeably improves results for complex tasks.


Few-Shot Prompting 📋

📖 Definition: With Few-Shot Prompting, you give the AI examples of the desired output. The model learns style, format, and quality level from them.

Create product descriptions in the following style:

Example 1:
Product: Running Shoe X1
→ "The X1 combines cushioning and stability for ambitious
runners. Mesh upper for breathability, reactive sole
for explosive push-off power."

Example 2:
Product: Hiking Boot T3
→ "The T3 offers grip and comfort on any terrain.
Waterproof membrane for any weather, reinforced toe cap
for demanding trails."

Now create for:
Product: Business Sneaker M5
Target audience: Commuters who want to combine comfort and style

When to use Few-Shot:

  • ✅ Ensure consistent format across many outputs
  • ✅ Establish a specific writing style or tone
  • ✅ Demonstrate complex structures (e.g., JSON, CSV, special reports)
  • ✅ When the AI might "misunderstand" the desired output

Tree-of-Thought: The Next Level 🌳

Tree-of-Thought goes beyond linear CoT: the AI explores multiple thinking paths in parallel, evaluates them, and selects the best one.

Analyze whether we should launch a new product.
Explore three different perspectives:

Path 1: Market opportunity (demand, competition, timing)
Path 2: Internal capacity (team, budget, technology)
Path 3: Risk (cannibalization, reputation risk, costs)

Evaluate each path individually, then give an overall
recommendation that considers all three perspectives.

🔑 Remember: Tree-of-Thought is ideal for strategic decisions where multiple factors need to be weighed against each other.


Techniques Compared 📊

TechniqueStrengthEffortBest For
Zero-ShotFast, spontaneous⭐ LowSimple tasks, brainstorming
Few-ShotConsistent, formatted⭐⭐ MediumRecurring outputs with fixed style
Chain-of-ThoughtThorough, logical⭐⭐ MediumAnalyses, calculations, decisions
Tree-of-ThoughtHolistic, multi-perspective⭐⭐⭐ HighStrategic decisions
CoT + Few-ShotBest overall quality⭐⭐⭐ HighCritical tasks with high quality demands

🏢 Real-world example: A legal department uses CoT + Few-Shot for contract analysis: Few-Shot examples define the analysis format, CoT ensures thorough review of each clause. Result: Analysis time reduced from 2 hours to 15 minutes.


📋 Summary

  • Chain-of-Thought: AI thinks step by step → better results for complex tasks
  • Few-Shot: Examples define format and style → consistent outputs
  • Tree-of-Thought: Explore multiple perspectives in parallel → strategic decisions
  • The right technique depends on the task — not everything needs CoT
  • Combine techniques for maximum quality on critical tasks

🎯 Exercise: Take a complex question from your work and formulate three versions: Zero-Shot, with CoT, and with CoT + Few-Shot. Compare the results.


Next lesson: Prompts for Marketing and Content — proven templates for immediate use.

📝

Quiz

Question 1 of 4

Was bewirkt Chain-of-Thought Prompting?