I’ve noticed that if I tell an AI to "Think step-by-step," it gets math problems right that it previously failed. Why does this work? Is the model actually "thinking," or is there a mechanical reason why increasing the number of output Tokens improves the logic of the final answer
3 answers
It’s about "Computation per Token." LLMs are auto-regressive—they predict the next token based on all previous tokens. If you ask for a final answer immediately, the model only has one "pass" at the logic. If you force it to write out its steps (Chain-of-Thought), it uses the previous steps as "working memory" to inform the next token. Essentially, the correct final answer becomes more statistically likely if the correct logical steps have already been written into the context.
Exactly. Think of it like a human doing mental math versus using a scratchpad. The "scratchpad" in this case is the growing context window. By externalizing the intermediate steps, the model reduces the probability of a "calculation drift" where it loses the thread of the original logic.
There is also a technique called Self-Consistency. You ask the model to generate three different "Chain-of-Thought" paths and then take the majority answer. This virtually eliminates random errors in logic.
We use this for our code generation tasks. If three separate "thoughts" lead to the same Python function, we can be much more confident in the output's reliability.
This is also why "Few-shot" prompting works so well. By providing a few examples of the reasoning process, you are teaching the model the pattern of how to utilize its attention mechanism for that specific task.