Welcome back! In our previous lesson, we established the foundation for effective AI interaction using the Persona, Task, Context, and Format (PTCF) framework. You learned how to transform a simple question into a detailed brief that gets you a more relevant, structured, and professional response.
Now, we'll build on that foundation to tackle more complex problems. Some tasks aren't about getting a single piece of information but require a multi-step logical process, like evaluating an investment, debugging code, or creating a strategic plan. For these, we need to guide the AI's reasoning process itself.
This lesson focuses on exactly that. Our learning outcome is to apply chain-of-thought prompting to guide AI through complex problems step-by-step. You'll learn how to prompt an AI not just to give you an answer, but to "show its work," which dramatically improves the accuracy, reliability, and transparency of its outputs.
1. What is Chain-of-Thought (CoT) Prompting?
At its core, Chain-of-Thought (CoT) prompting is a technique that encourages a Large Language Model (LLM) to break down a complex problem into a series of intermediate, sequential steps before arriving at a final answer.
Think back to a math or engineering problem: you wouldn't just write down the final answer. You'd show the intermediate calculations and logical steps. This allows you (or a teacher) to verify the process and catch errors. CoT prompting applies the same principle to AI. Instead of letting the AI make an intuitive leap to a conclusion, you instruct it to reason through the problem step by step.
To see this in action, let's watch a brief segment from a video that explains this concept clearly.
You SUCK at Prompting AI (Here's the secret)
In this clip from 'You SUCK at Prompting AI,' NetworkChuck demonstrates how telling the AI to 'think step by step'—the essence of CoT prompting—improves both accuracy and our trust in the output by revealing the AI's reasoning process.
About 13 and a half minutes in, watch the segment on Chain-of-Thought prompting. Pay attention to how the simple instruction to think step-by-step changes the AI's output from just an answer to a reasoned process.
As the video shows, this simple addition does two critical things:
- Improves Accuracy: By forcing the model to break the problem down, it's less likely to make logical errors or miss nuances.
- Increases Trust: You can see how the AI reached its conclusion, allowing you to validate its logic. This is essential for any high-stakes professional work.
This structured approach can be visualized as a clear workflow.

2. The Power of CoT for Complex Analysis
While CoT is useful for many tasks, it is particularly powerful in fields like finance and strategy, where the reasoning behind a conclusion is often as important—if not more so—than the conclusion itself. A simple "yes" or "no" on an investment is useless without the supporting analysis.
The Corporate Finance Institute has a great article on this very topic. It explains why CoT is so well-suited for financial analysis, moving the AI from a simple data summarizer to a genuine analytical partner.
Chain-of-Thought (CoT) Prompting in AI-Powered Financial Analysis
This article, 'Chain-of-Thought (CoT) Prompting in AI-Powered Financial Analysis,' explains the value of this technique specifically for your field. It highlights how CoT enhances accuracy and analytical depth.
Please read the sections titled 'Key Characteristics of CoT Prompting' and 'Why a CoT Approach Works Better for Financial Analysis'—review both sections directly under their headings. Focus on how CoT helps reduce 'hallucinations' and enables a more systematic assessment of financial data.
As the article points out, CoT allows you to guide the AI through a logical sequence, ensuring it connects data points and considers problems from multiple angles before synthesizing a final recommendation. The versatility of this technique makes it applicable to a wide range of problems, from math puzzles to commonsense reasoning.

3. How to Implement Chain-of-Thought
There are two primary ways to implement CoT prompting. Both are simple to use but have different strengths.
Chain of Thought Prompting Explained (with examples)
The Codecademy article 'Chain of Thought Prompting Explained' provides clear definitions and examples for the main types of CoT prompting. It's a great practical guide.
First, read the introduction 'What is chain of thought prompting?' to learn the core definition. Then, read the sections 'Zero-shot chain-of-thought (Zero-shot CoT) prompting' (zero-shot prompting) and 'Few-shot chain-of-thought (Few-shot CoT) prompting' (few-shot prompting). Focus on the simple phrases used for zero-shot and the example-based structure of few-shot.
Let's summarize the key methods from the article:
-
Zero-Shot CoT: This is the simplest method. You don't provide any examples; you just append a simple phrase to your prompt, like:
"Let's think step by step.""Work this out in a step-by-step way to be sure we have the right answer.""Show your work."
This is a low-effort way to significantly improve reasoning on a wide range of tasks. Most modern LLMs, like Gemini, are highly responsive to these instructions.
-
Few-Shot CoT: This is a more advanced and robust technique. You provide the AI with one or more examples (the "shots") of a similar problem being solved with a step-by-step process. The AI then uses these examples as a template for solving your new problem.
Example (from the article):
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now? A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5 + 6 = 11. The answer is 11. Q: [Your new, similar problem here] A:This method is extremely powerful when you need the AI to follow a very specific analytical format or reasoning pattern.
For the Python Programmer:
Given your proficiency in Python, you might be interested to know that these prompting techniques can be programmatically implemented. The same Codecademy article you just read has a section titled "How to implement chain of thought prompting in LangChain applications?" (resource_id: [LINK](https://www.codecademy.com/article/chain-of-thought-cot-prompting), section 5) which provides Python code snippets using langchain-google-genai to call Gemini Pro. This is an excellent resource if you want to see how to build these powerful prompts into an application.
4. Activity: Applying CoT to Financial Analysis
Let's put this into practice with a task relevant to your work. We'll use Google Gemini to analyze a hypothetical investment opportunity, first without CoT and then with it.
Scenario: You are evaluating a fictional B2B SaaS company, "InnovateSphere," for a potential growth equity investment. Here is the summary you've been given:
Company: InnovateSphere Inc.
Sector: B2B SaaS (Enterprise Workflow Automation)
Financials:
- Year 1 Revenue: $5M
- Year 2 Revenue: $15M
- Year 3 Revenue: $25M
- Net Profit Margin (Y3): -10% (driven by high R&D and Sales & Marketing spend)
- Debt: $2M in venture debt.
Market Position: Strong product with high customer satisfaction but facing new competition from a large, well-funded legacy player entering the market.
Step 1: The Vague Prompt (Without CoT)
Go to Google Gemini and enter the following prompt:
Based on this summary, should we invest in InnovateSphere?
[Paste the company summary here]
Review the output. It will likely give a balanced but somewhat generic answer, listing pros and cons without a clear, structured analytical flow. It's a "maybe," but not a very actionable one.
Step 2: The CoT Prompt
Now, let's try again, this time guiding Gemini's reasoning process. Copy and paste this structured prompt into a new chat:
Act as a cautious and detail-oriented growth equity analyst.
Your task is to evaluate the investment potential of InnovateSphere based on the provided summary. Do not give a final answer until you have completed a step-by-step analysis.
Here is the summary:Company: InnovateSphere Inc.Sector: B2B SaaS (Enterprise Workflow Automation)Financials:- Year 1 Revenue: $5M- Year 2 Revenue: $15M- Year 3 Revenue: $25M- Net Profit Margin (Y3): -10% (driven by high R&D and Sales & Marketing spend)- Debt: $2M in venture debt.Market Position: Strong product with high customer satisfaction but facing new competition from a large, well-funded legacy player entering the market.
Now, think step by step through the following analysis:1. **Revenue Growth Analysis:** Calculate the year-over-year growth rates for Y2 and Y3. Comment on the growth trajectory (accelerating or decelerating).2. **Profitability Analysis:** Analyze the -10% net margin. Is this a major concern for a growth-stage SaaS company? Explain why or why not.3. **Risk Assessment:** Identify the two primary risks based on the summary provided.4. **Synthesized Recommendation:** Based ONLY on your analysis in steps 1-3, provide a final investment recommendation (e.g., "Proceed with due diligence," "Monitor but do not invest now," "Avoid"). Justify your recommendation by summarizing the key factors.
Step 3: Compare the Outputs
Compare the second response to the first. You should notice a significant improvement:
- The output follows your exact structure.
- It performs actual calculations (YoY growth).
- It provides context-aware analysis (explaining why a negative margin might be acceptable for a SaaS company).
- The final recommendation is explicitly tied to the preceding analytical steps, creating a transparent and defensible argument.
This is an output you can actually use as a first draft for a deal memo.
Conclusion
You have now added a powerful new technique to your AI toolkit. By guiding the AI to "think step by step," you can unlock a higher level of analytical capability.
Here are the key takeaways from this lesson:
- CoT for Complexity: Chain-of-Thought prompting is ideal for complex problems that require reasoning, calculation, or multi-step analysis.
- Show Your Work: CoT forces the AI to expose its reasoning, improving accuracy and making the output more transparent and trustworthy.
- Zero-Shot vs. Few-Shot: You can use a simple phrase ("think step by step") for a quick boost in reasoning (zero-shot), or provide detailed examples (few-shot) for tasks requiring a specific format.
- A Professional's Tool: For fields like finance, engineering, and programming, CoT transforms the AI from a simple search engine into a genuine analytical assistant.
In our next lesson, we will focus on iterative refinement techniques. Now that you can generate a strong, reasoned first draft with CoT, the next step is learning how to fine-tune that output through a structured back-and-forth conversation with the AI. CoT makes this process much easier because you can reference specific steps in the AI's logic to request corrections or expansions.