A transformer does a fixed amount of computation per generated token (one forward pass). For a hard problem, a single token of output is a tiny compute budget — the model must compress the entire multi-step reasoning into one forward pass, which it cannot do reliably.
Formally, think of the model as approximating p(a∣q). Marginalising over reasoning paths r:
Q: Roger has 5 tennis balls. He buys 2 cans of 3 balls each.
How many balls does he have now?
A: Roger starts with 5 balls. 2 cans × 3 balls = 6 balls.
5 + 6 = 11. The answer is 11.
Q: <your new question>
A:
Why this step? The exemplar demonstrates the format: reason first, then "The answer is X". The model pattern-matches and reproduces that structure.
Imagine a hard maths puzzle. If I force you to shout the answer instantly, you'll probably guess wrong. But if I let you write your working on scrap paper first — "okay, 23 apples, take away 20, that's 3, add 6, that's 9" — you'll get it right way more often. Chain-of-thought is just handing the AI a scrap paper and saying "show your working before you answer." And if you ask three friends to do the working separately and they mostly say "9", you trust 9 — that's self-consistency.
Chain-of-thought ka simple funda ye hai: model ko seedha answer maangne ke bajaye, hum bolte hain "step by step socho aur apna working likho." Kyun? Kyunki ek transformer har token ke liye sirf ek forward pass karta hai — matlab ek fixed compute budget. Agar hard problem ka answer ek hi token me nikaalna pade, to model ke paas sochne ki jagah hi nahi bachti. Har reasoning token likhne se model ko extra compute milta hai aur wo partial results scrap paper ki tarah likh ke rakh leta hai. Isi liye maths aur logic wale sawaalon me CoT ka accuracy kaafi badh jaata hai.
Do tareeke hain. Few-shot CoT me aap prompt me 2-3 solved examples dete ho jisme reasoning bhi dikhaya gaya ho — model pattern copy kar leta hai. Zero-shot CoT me bas ek jaadu wala phrase "Let's think step by step" laga do, examples ki zaroorat nahi. Dono ka goal same hai: model ko reasoning-mode me daalna.
Ek powerful upgrade hai self-consistency: ek hi sawaal ke liye thodi temperature ke saath kai alag-alag chains sample karo, har chain ka final answer nikaalo, aur majority vote le lo. Logic ye hai ki sahi answer tak pahunchne ke bahut saare valid raaste hote hain, par galtiyaan bikhri hui hoti hain — to vote karne se sahi answer upar aa jaata hai.
Ek important baat yaad rakho (exam trap): CoT mainly bade models me kaam karta hai — chhote models me kabhi kabhi ulta bigaad bhi deta hai. Aur jo chain model likhta hai wo hamesha "sacchi" wajah nahi hoti — kabhi kabhi model bas plausible bahaana bana deta hai (faithfulness problem). To chain sahi dikhe iska matlab answer bhi sahi ho, ye zaroori nahi.