7. Thinking step by step

A transformative technique for complex tasks: asking the AI to think out loud before answering.

Why it works

When you let the AI "think out loud," breaking down the problem into intermediate steps, you significantly increase its precision.

Basic example

Without thinking:

Is this movie review positive or negative?

"This movie blew my mind with its freshness and originality. By the way, I've been living under a rock since 1900."

The AI might take "blew my mind" literally and miss the sarcasm.

With step-by-step thinking:

Analyze whether this review is positive or negative.

Review: "This movie blew my mind with its freshness and originality. By the way, I've been living under a rock since 1900."

First, write the arguments in favor of each interpretation in <positive_arguments> and <negative_arguments>. Then, give your final answer.

Complete example: business strategy

Our software company has €150M in annual revenue in the U.S.

<market_data> - Asian market: €500,000M, growing 12% annually - Local competitors: 2 main ones with 30% combined share - Our product has features they don't offer </market_data>

<financial_data> - Initial investment: €2.5M - Projected year 1 revenue: €200M </financial_data>

Analyze whether we should expand into Asia. Think step by step considering:

  1. Market potential
  2. Competition
  3. Financial projections

Use <analysis> for your reasoning and <recommendation> for your final conclusion.

Recommended structure

An effective pattern is:

[Provide relevant information]

Analyze [specific task]. Think step by step considering:

  1. [Factor 1]
  2. [Factor 2]
  3. [Factor 3]

<thinking> [Space for reasoning] </thinking>

<answer> [Space for conclusion] </answer>

Practical example: math problem

Without step-by-step thinking, AIs can make errors in problems that require multiple operations:

Simple but tricky problem:

Is 2+2×5 equal to 20 or 12?

Possible answer: "20" (order-of-operations error)

With explicit thinking:

Is 2+2×5 equal to 20 or 12?

Solve step by step inside <steps>, then give your answer in <result>.

Correct answer:

<steps> Step 1: Identify the order of operations (multiplication first, then addition) Step 2: Calculate 2×5 = 10 Step 3: Calculate 2+10 = 12 </steps>

<result> 12 </result>

This kind of explicit thinking prevents common errors and lets you verify the reasoning.

When to use this technique

Step-by-step thinking is especially valuable for:

  • Complex problems: Decisions with multiple factors to consider.
  • Analytical tasks: Evaluations that require weighing pros and cons.
  • Logical reasoning: Problems where the process matters as much as the answer.
  • Verification: When you need to understand how it reached a conclusion.
  • Transparency: Situations where you must justify the decision to others.
  • Error detection: Explicit reasoning lets you identify logical flaws.
  • Math problems: Calculations that require multiple operations.
  • Nuanced analysis: Such as detecting sarcasm, irony, or cultural context

Asking the AI to think step by step is transformative for complex tasks. When you break the problem down into intermediate steps and let the AI reason out loud, precision improves dramatically.

You now know how to make the AI reason correctly. Now it is time to get it to present the information exactly as you need it. In the next lesson you will learn to format outputs so they are useful and actionable from the first try.

This work is under a Attribution-NonCommercial-NoDerivatives 4.0 International license.

Desafíos de programación atemporales y multiparadigmáticos

Desafíos de programación atemporales y multiparadigmáticos

Te encuentras ante un librillo de actividades, divididas en 2 niveles de dificultad. Te enfrentarás a los casos más comunes que te puedes encontrar en pruebas técnicas o aprender conceptos elementales de programación.

Buy the book

Will you buy me a coffee?

This is how I keep writing without ads or paywalls.

Comments

There are no comments yet.