Skip to main content
Lesson 7 of 16 · Mastering Prompts with Mistral

Chain of Thought

Lesson 7 of 16 Updated July 28, 2026 Beginner
On this page
  1. Reason step by step
  2. Simple CoT: one instruction is enough
  3. Structured CoT: guide the steps
  4. When to use Chain of Thought — and when to skip it
  5. CoT with few-shot
  6. Control reasoning verbosity
  7. Key takeaways

Reason step by step

Chain of Thought (CoT) is a technique that asks the model to detail its reasoning before giving its final answer. Instead of jumping straight to the conclusion, the model spells out each logical step, which significantly improves answer quality on tasks that require reasoning. With Mistral models, it delivers excellent results on logic, math, analysis, and decision-making.

To understand why this works, remember how the model generates text: token by token, with each token relying on all previous ones. When a model has to answer a complex question directly, it only has a few tokens to “think”—the answer must emerge almost immediately. By asking it to detail its reasoning, you give it the space to break the problem down into simple sub-problems, verify each step before moving to the next, spot relevant information among the provided data, and ultimately reduce reasoning errors like hallucinations. Written reasoning isn’t an afterthought: it’s where the computation happens.

Simple CoT: one instruction is enough

The most basic form consists of adding a simple instruction phrase to the end of your prompt:

A restaurant has 15 tables. Each table can seat 4 people.
The restaurant is 80% full. How many people are present?

Reason step by step before giving your answer.

The model will then produce something like:

Step 1: Total capacity = 15 tables × 4 people = 60 people
Step 2: Occupancy rate = 80% = 0.80
Step 3: People present = 60 × 0.80 = 48 people

Answer: 48 people are present in the restaurant.

Without the “reason step by step” instruction, the model might give “48” directly—correct here—but it could also make a mistake on an intermediate calculation without you being able to identify where. This is the second benefit of CoT, less known but just as valuable: visible reasoning is verifiable. When an answer seems odd to you, the faulty step jumps out.

Structured CoT: guide the steps

For more complex tasks, don’t just ask for reasoning: prescribe it. Imagine an investment analysis:

Evaluate whether this startup is a good investment.

Data:
- Revenue 2025: €2.3M (growth +45% YoY)
- Burn rate: €180K/month
- Runway: 14 months
- Addressable market: €500M
- Team: 22 people, 3 technical founders

Reason according to these steps:
1. Analyze financial health (revenue, burn, runway)
2. Evaluate market potential (size, current penetration)
3. Evaluate the team (skills, size)
4. Identify key risks (3 max)
5. Provide your conclusion with a confidence score (low/medium/high)

By prescribing the steps, you ensure the model covers all important aspects, in the right order, without skipping the one you care about. Left free, it might have glossed at length on the market and rushed the financial analysis; guided, it treats all five aspects systematically.

When to use Chain of Thought — and when to skip it

CoT is for tasks where you can go wrong along the way: multi-step math problems, estimates, data analysis (interpreting metrics, identifying trends), decision-making by comparing options, debugging code or error logs, logical reasoning, and deductions. In all these situations, each intermediate step is a checkpoint that prevents errors from propagating.

Conversely, CoT is useless—sometimes counterproductive—when there’s nothing to unfold. For a simple factual question like “What is the capital of Italy?”, it adds latency and tokens without improving anything. In creative writing, structured reasoning can even stifle creativity. Translation is more intuitive than logical, and reformulation requires no deduction. The right reflex: ask yourself if you would draft calculations for this task yourself. If not, spare the model.

CoT with few-shot

Combining Chain of Thought with the few-shot technique from the previous lesson is particularly powerful: instead of describing how to reason, you show it via a complete example of successful reasoning.

messages = [
    {
        "role": "system",
        "content": "You are an analyst who reasons step by step."
    },
    {
        "role": "user",
        "content": """An e-commerce site has 10,000 visitors/day, a conversion rate
of 2.5% and an average cart value of €65. What is the daily revenue?"""
    },
    {
        "role": "assistant",
        "content": """Reasoning:
1. Number of orders/day = 10,000 × 2.5% = 250 orders
2. Daily revenue = 250 × €65 = €16,250

Answer: Daily revenue is €16,250."""
    },
    {
        "role": "user",
        "content": """A SaaS has 5,000 active users, a monthly churn rate
of 3% and an average revenue per user of €49/month. What will the MRR
be in 3 months if no new customers arrive?"""
    }
]

The model will reproduce the same schema—a numbered “Reasoning” block, then an “Answer” line—for the new question. You get both the rigor of CoT and the format consistency of few-shot.

Control reasoning verbosity

Sometimes you want the reasoning but not a novel. You control the dosage in the instruction itself. For full reasoning, ask: “Detail every step of your reasoning before concluding.” For a tighter version: “Reason briefly (2-3 steps max) then give your answer.” And for production, the most useful variant separates reasoning and answer with tags:

Reason within <reasoning></reasoning> tags
then provide your final answer within <answer></answer> tags.

This last approach gives you the best of both worlds: your code extracts only the content of the <answer> tag to display to the end user, while the full reasoning remains available in the logs for debugging. When a response in production turns out wrong, you open the log and see exactly where the reasoning derailed.

Key takeaways

  • Chain of Thought asks the model to reason before answering—decisive for logic, calculation, and analysis
  • Guide the steps explicitly for complex tasks
  • Combine CoT and few-shot for maximum efficiency
  • Useless for simple questions or creative writing
  • Use XML tags to separate reasoning and answer in production