Module 3 — Advanced Prompting Strategies
Chain-of-Thought & Advanced Reasoning
Chain-of-thought (CoT) prompting instructs the model to show its reasoning step by step before reaching a conclusion. This dramatically improves performance on tasks requiring logic, math, or multi-step analysis.
Simple prompt: "Is 17 a prime number?" CoT prompt: "Is 17 a prime number? Think step by step."
The CoT version produces: "To determine if 17 is prime, I need to check if it's divisible by any number other than 1 and itself. 17 ÷ 2 = 8.5 (not divisible), 17 ÷ 3 = 5.67 (not divisible), 17 ÷ 4 = 4.25 (not divisible). I only need to check up to √17 ≈ 4.1. Since 17 isn't divisible by 2, 3, or 4, it is prime."
Why does CoT work? By forcing the model to generate intermediate reasoning steps, it creates a more structured path through the problem space, reducing the chance of reasoning errors.
Tree-of-thought extends CoT by exploring multiple reasoning paths simultaneously, evaluating each, and selecting the most promising. Self-consistency generates multiple CoT solutions and takes the majority answer, improving reliability.
Structured output formatting is another advanced technique: requesting responses in JSON, markdown tables, or specific formats. This is essential for building AI-powered workflows where outputs need to be parsed by other systems.
Prompt Chaining for Complex Workflows
Prompt chaining breaks complex tasks into sequential steps, where the output of one prompt becomes the input to the next. This is more reliable than asking the model to handle everything in a single prompt.
Example workflow for analysing a business report:
Step 1 (Extract): "Read this report and extract: revenue figures, key metrics, and notable changes. Output as a structured list."
Step 2 (Analyse): "Given these extracted metrics [output from Step 1], identify the three most significant trends and explain what's driving each."
Step 3 (Recommend): "Based on these trends [output from Step 2], generate three strategic recommendations for the executive team, including expected impact and implementation timeline."
Each step is focused, manageable, and produces high-quality output that feeds into the next. This is far more reliable than a single prompt like "Analyse this report and give me recommendations."
Prompt chaining enables building sophisticated AI workflows — multi-step processes where AI handles each stage. Examples: customer support ticket triage → categorisation → response drafting → quality check; or: research question → literature search → synthesis → report generation.
The key principle: decompose complex tasks into simple, well-defined steps. Each step should have a single clear objective, specific input, and defined output format.
Key Takeaways
- Chain-of-thought prompting improves reasoning by making intermediate steps explicit
- Structured output (JSON, tables) enables AI integration into automated workflows
- Prompt chaining decomposes complex tasks into reliable sequential steps
- Each chain step should have a single objective, clear input, and defined output format
- Complex single prompts are less reliable than well-designed prompt chains
Exercises & Activities
Design a Prompt Chain
Design a 3-step prompt chain for one of these business tasks: (a) Analysing a competitor's website and generating a competitive intelligence report, (b) Processing customer feedback data and generating an improvement roadmap, (c) Reviewing a contract and generating a risk assessment. For each step, write the full prompt, specify the expected output format, and explain how the output feeds into the next step.
CoT vs. Direct Comparison
Choose a complex reasoning task (e.g., 'Should a company with $10M revenue and 20% margins invest $2M in AI infrastructure?'). First, ask an AI to answer directly. Then, ask the same question with 'Think step by step, considering all factors.' Compare the quality, depth, and accuracy of both responses. Document your findings.
Interactive AI Tutor Session
Copy this prompt and paste it into your preferred AI assistant (ChatGPT, Claude, Gemini) to begin your interactive tutoring session for this module.
"You are an advanced prompt engineering instructor. Teach chain-of-thought prompting and explain why it improves reasoning. Demonstrate structured output formatting (JSON, markdown tables). Show how prompt chaining breaks complex tasks into steps. Ask the student to design a 3-step prompt chain for analysing a business report: extract key metrics → identify trends → generate executive summary."
