Skip to main content
>_ supraj.dev
TOPIC AI
Chain of Thought thinking step-by-step before answering
IN 10 SECONDS

Instructing the model to write down its reasoning process step-by-step before outputting the final answer, which improves accuracy on logical, math, and coding tasks.

GOTCHA Chain-of-thought increases generation length, resulting in higher token costs and latency for simple questions.
HOW LOGICAL EXECUTIONS FLOW
01 Trigger prompt asks: 'If I have 3 apples and eat 1... Let's think step by step.'
02 Reasoning line LLM starts outputting its reasoning: 'First, I start with 3. Next, I subtract 1...'
03 Resolve answer model reaches final conclusion: 'Therefore, I have 2 left.'
POKE IT YOURSELF
ollama run llama3 \"Solve 123 * 45. Let's think step-by-step.\" — run chain-of-thought query