← All topics
Knowledge

Reasoning techniques: think before you answer

Reasoning techniques trade extra tokens for accuracy on hard problems — chain-of-thought, self-consistency voting, ReAct's think-act loop, and tree search — but only when the failure is reasoning, not facts.

What it is

Reasoning techniques are prompting and control-flow tricks that make a model think before it answers instead of blurting the first token. You spend extra tokens deriving intermediate steps, and accuracy on hard problems goes up.

  • Chain-of-thought (CoT): ask for step-by-step working before the final answer.
  • Self-consistency: sample several CoT runs, then take the majority answer.
  • ReAct: interleave reasoning with real tool calls — think, act, observe, repeat.
  • Tree/Graph-of-Thought: branch into multiple paths and explore, not just one line.

When to use it

Reach for these when one-shot answers are wrong and the failure is *reasoning*, not missing facts.

  • CoT: math, logic, multi-constraint decisions — anything with steps.
  • Self-consistency: high-stakes answers where you can afford 3-5x the calls to vote out flukes.
  • ReAct: the task needs live data or actions — pair it with tool design and planning.
  • Tree/Graph-of-Thought: search-like problems with many viable paths (puzzles, planning).

Do not use them for simple lookups, classification, or extraction — the extra tokens buy nothing and just add latency and cost.

How it works

The core move is forcing intermediate tokens between question and answer.

  • CoT: append Let's think step by step. or give a worked example. The model writes its reasoning, then the answer.
  • Self-consistency: run the same CoT prompt N times at temperature > 0, collect the final answers, return the mode. Five runs, three say 42 → answer is 42.
  • ReAct: loop Thought → Action → Observation. Thought: I need the price. Action: search("X"). Observation: $9. → next thought.
  • Tree-of-Thought: generate several candidate next steps, score each, expand the best — a search over reasoning, not a straight line.

Watch out for

  • Reasoning is not truth. A confident chain can be confidently wrong — verify the answer, don't trust the prose. Treat it like any output behind a guardrail.
  • Cost scales fast. Self-consistency and tree search multiply token spend; measure whether the accuracy lift is worth it with real evals.
  • Exposed CoT can leak. Visible reasoning may reveal hidden instructions or sensitive logic — don't show it to end users by default.
  • More steps ≠ better. Past a point, longer chains drift off-track. Cap depth and let the model stop early.

Related patterns

Ask the swarm