Chain of Thought and Tree of Thought
Asha asks: "Two sleeper tickets are ₹1,180 each, plus a ₹35 booking fee per ticket. Is that under my ₹2,500 limit?" Answering in one breath, a model might say "Yes, ₹2,360" and forget the fees. Given room to work it through, it gets ₹2,430 — still yes, but now for the right reason. How a model is allowed to think changes what it gets right.
The rule
Let the model think in steps — one line of steps, or several branches compared.
Chain of thought (CoT) asks the model to write out intermediate reasoning before the final answer. Because the model produces one token at a time, the steps it has already written become part of its context, so later steps build on them instead of leaping:
Tickets: 2 × ₹1,180 = ₹2,360
Fees: 2 × ₹35 = ₹70
Total: ₹2,360 + ₹70 = ₹2,430
₹2,430 ≤ ₹2,500 → within budget, ₹70 to spare.You can trigger this with an instruction ("work through the calculation step by step, then give the answer on the last line") or with examples that show worked steps. Some models, often called reasoning models, are trained to do this kind of thinking on their own before answering.
Tree of thought (ToT) goes further for problems with several possible routes. Instead of one chain, it:
- Branches — proposes a few different partial approaches.
- Evaluates — scores each one against the goal.
- Prunes and expands — drops weak branches and develops the promising ones.
It is usually built as a loop in your program, calling the model several times, rather than as a single prompt.