Tree of Thoughts Prompting: Branch, Score, and Backtrack
Tree of thoughts prompting explained: explore multiple reasoning branches, score them, and backtrack. Practical ToT for GPT-5.6, Claude, and Gemini in 2026.
Generate optimized prompts for ChatGPT, Claude & more
Free prompt generator — no account needed.
Try Prompt Generator →Tree of thoughts prompting means you make a language model explore several partial solutions in parallel, score each branch, then expand the best ones or abandon dead ends. Yao et al. (2023) framed tree of thoughts (ToT) as deliberate problem solving: thoughts become nodes in a search tree, and you choose which nodes grow. Use ToT when one linear chain gets stuck, when early choices lock a bad plan, or when you can score intermediate states.
You will leave with a plain definition, a paste-ready branch-and-score loop, examples for GPT-5.6 Sol, Terra, and Luna, Claude Fable 5, Opus 5, and Sonnet 5, plus Gemini 3.5 Flash and Gemini 3.1 Pro, and rules for when ToT wastes tokens.
What tree of thoughts prompting is (and who it helps)
Chain-of-thought walks one path from question to answer. Tree of thoughts keeps several candidate paths alive at once. At each step you ask the model for k next thoughts, score those thoughts against your goal, then continue from the top-scoring nodes. If a branch fails a check, you prune it and expand a sibling instead of rewriting the whole answer from scratch.
That search shape matches planning and puzzle work. Product strategy with three viable approaches, a pricing model with mutually exclusive assumptions, a debugging plan where the first hypothesis can be wrong, a creative brief where you need two distinct concepts before you pick one: these jobs reward branching. Classification, short rewrite, and single-field extraction do not. Those tasks want a direct prompt or a small chain, not a tree.
Teams that gain the most from ToT:
- Engineers and researchers who need searchable intermediate states with a score you can log
- PMs and operators who compare two or three plans before committing budget
- Solo builders who watch linear CoT invent a wrong first step and never recover
Skip ToT when latency budgets are tight, when you lack a scoring rule, and when a reasoning-class model already solves the task with a short goal-plus-constraints prompt. A tree multiplies calls. You pay for width and depth.
How tree of thoughts prompting works in practice
The loop has four moves: propose, score, expand, stop. Propose asks the model for k distinct next thoughts from the current state. Score rates each thought with a rubric you wrote (pass/fail, 0-2, or a short verbal verdict plus a numeric rank). Expand picks the top m thoughts and repeats propose from those states. Stop triggers when a leaf meets your success check or when you hit a budget of calls, tokens, or depth.
Keep the state explicit. Store each node as a short block: node id, parent id, thought text, score, status (open, pruned, done). Paste only the active path plus the sibling scores the model needs. Dumping the full conversation into every call recreates lost-in-the-middle noise and invites the model to reuse a pruned idea.
Name the success check before you open the first branch. Examples: "plan covers cost, risk, and owner for each step," "equation set balances," "root cause cites a log line." Without that check, scoring becomes taste, and taste drifts across runs. Freeze the rubric in the same file as the propose prompt so teammates score the same way.
Propose and score prompts you can paste
Propose (example): "Current state: [paste]. Goal: [one sentence]. List 3 next thoughts as distinct approaches. Each thought: 2-4 sentences, no final answer yet, no overlap with the others. Label them A, B, C. Return only the three thoughts."
Score: "Goal: [same sentence]. Rubric: 0 = blocks the goal or invents facts; 1 = partial, missing one required angle; 2 = advances the goal with a testable next step. Score thoughts A, B, C. Output a markdown table: Thought, Score, One-line reason. Then list the top 2 labels to expand. Thoughts: [paste]."
Final synthesis (after you pick a leaf): "Using only the winning path below, write the deliverable in [format]. Do not revive pruned branches. Path: [paste]."
A worked tree of thoughts prompting example
Task: choose a rollout plan for a feature that can ship as (A) full launch, (B) 10% canary, or (C) wait one sprint for a dependency. Propose three next thoughts from the blank state. Score them on risk coverage, time-to-learn, and rollback cost. Expand the top two. On the second level, ask for concrete checklists. Score again. Stop when one leaf has owners, metrics, and a kill switch.
A linear CoT reply might lock onto "full launch" in sentence one and rationalize for the rest of the page. The tree forces the canary and wait options to compete with numbers. You still decide; the model supplies ranked options you can reject. Save the node log so a later review can see why the canary won.
A step-by-step workflow to run ToT without a framework
You can run tree of thoughts prompting in chat before you write a line of orchestration code. Treat the first session as a lab notebook. Automate only after two sample problems clear your rubric with a budget you accept. Frameworks help later; a broken propose prompt stays broken inside LangChain or a custom loop.
Start from a task where you already know the failure mode of a single chain: early commitment, missing alternative, or no intermediate check. Write the goal in one sentence and the stop rule in one sentence. Cap width (k) at 3 and depth at 2 for the first experiment. Raise width only when scores stay tied. Raise depth only when leaves still lack a verifiable next step.
Budget tokens up front. A depth-2 tree with k=3 and m=2 can mean roughly a handful of propose calls, matching score calls, and one synthesis. Route propose and synthesis to a mid-tier chat model when the thoughts are short plans. Route hard scoring to a reasoning-class model when the rubric has multi-hop constraints. That split often beats one flagship model on every node.
If the propose brief is still a messy paragraph, paste it into PromptMake /text, pick the model that will run propose, and harden the returned instruction with your labels and length limits. Soften the sell to yourself: the tool shapes one node prompt; you still own the tree design and the scores.
Steps 1-3: Goal, rubric, and first propose
- Write the goal and the stop check in two lines. Example stop check: "Leaf includes owners, metrics, and a rollback."
- Write the score rubric with numeric ranks and banned moves (invented metrics, vague owners, overlapping thoughts).
- Run the propose prompt once from the empty or seed state. Reject the batch if two thoughts restate each other; regenerate with "make A, B, C mutually exclusive."
Stop here if you cannot score the three thoughts in under a minute by hand. A rubric you cannot apply will not help an automated judge either. Tighten the rubric before you add depth.
Steps 4-6: Score, expand, synthesize
- Run the score prompt. Keep the top m thoughts (usually 2). Mark the rest pruned with a one-line reason in your log.
- For each open node, run propose again with that node as Current state. Score the new children. Prune to your depth or call budget.
- Pick the winning leaf, run synthesis, then spot-check against the stop rule. If synthesis sneaks in content from a pruned branch, delete it and re-run synthesis with a harder ban line.
Freeze propose, score, and synthesis text after two clean sample problems. Re-open a prompt only when the product goal changes or a new model class shifts how scores look.
Tree of thoughts vs chain-of-thought vs prompt chaining
Chain-of-thought is one path inside one reply. You ask for intermediate steps, then a final answer. Self-consistency samples several full chains and majority-votes the answer, but each sample is still a chain, and you usually discard the losing traces without backtracking mid-path.
Prompt chaining is a pipeline across separate calls: decompose, draft, critique, format. Each stage has one job and a handoff you can edit. Chaining gates quality over time. Tree of thoughts searches alternatives inside the reasoning itself. You can put a small ToT loop inside one stage of a chain (for example, only the plan stage branches), but the tree is about competing thoughts, and the chain is about stage contracts.
Use CoT when a single path with visible steps is enough and cost must stay low. Use chaining when research, prose, and schema need separate gates or different models. Use tree of thoughts prompting when early forks matter and you can score partial states. If you need all three, keep them nested with clear budgets: chain on the outside, ToT only on the stage that has real forks, CoT only if a chat model still needs step scaffolding on a leaf.
Common mistakes that waste a tree
Scoring without a rubric turns ToT into theater. The model ranks its own ideas with praise words, and every branch looks "promising." Fix: numeric scores tied to the stop check.
Width without diversity produces three paraphrases of one idea. Fix: demand mutually exclusive approaches in the propose prompt, and regenerate when labels collapse.
Unlimited depth burns money. Fix: depth 2 default, depth 3 only for puzzles with a clear partial-credit test.
Mixing propose and score in one call lets the model favor the branch it wrote last. Fix: separate calls, or at least separate labeled sections with the score pass forbidden from rewriting thoughts.
Running full ToT on a reasoning-class model for a task that model already solves with a direct spec doubles cost. Fix: try goal, constraints, and format first on Sol, Fable 5, Opus 5, or Gemini 3.1 Pro. Add a tree only when that baseline fails your eval set.
Saving no node log means you cannot debug a bad final answer. Fix: keep a markdown table of nodes next to the deliverable.
Model notes for tree of thoughts in 2026
As of mid-2026, name models like this in production notes: GPT-5.6 Sol (flagship), Terra, and Luna on OpenAI; Claude Fable 5, Opus 5, and Sonnet 5 on Anthropic; Gemini 3.5 Flash and Gemini 3.1 Pro on Google. Match node type to model class instead of putting the flagship on every propose.
Propose favors breadth and obedience to format. Claude Sonnet 5, GPT-5.6 Terra or Luna, and Gemini 3.5 Flash handle short labeled thoughts well when you cap length and ban overlap. Keep temperature moderate so branches differ without turning into noise.
Score favors multi-condition judgment. GPT-5.6 Sol, Claude Opus 5 or Fable 5, and Gemini 3.1 Pro fit hard rubrics. Give them goal, rubric, and the candidate thoughts. Skip "think step by step" scaffolding on those models; they already allocate internal reasoning. Ask for a table of scores and the expand list, not an essay.
Synthesis favors clean delivery. Sonnet 5 or Terra can turn a winning path into the customer-facing artifact. Flash can map the same path into JSON when the contract is strict. Re-run synthesis alone if format fails; leave the tree intact.
Example: GPT-5.6 Sol as score judge
"Goal: pick rollout options that maximize learning in seven days with a kill switch. Rubric: 0 = no metric or no rollback; 1 = missing owner or vague metric; 2 = owner, metric, rollback all present. Score A, B, C. Table: Thought, Score, Reason. Then name the top 2 to expand. Thoughts: [paste]."
Run this on Sol after Terra or Luna wrote the thoughts. Keep the score prompt free of rewrite instructions so the judge ranks instead of polishing losers into winners.
Example: Claude Sonnet 5 propose + Gemini Flash synthesis
Propose on Sonnet 5: "From state [paste], list 3 mutually exclusive next thoughts for a pricing experiment. Each thought: hypothesis, user segment, primary metric. Labels A, B, C. No final recommendation."
Synthesis on Gemini 3.5 Flash after you pick a leaf: "Convert this winning path into JSON keys hypothesis, segment, metric, rollback. JSON only. Path: [paste]."
Flash as the last hop keeps format cheap. Sonnet holds the branch text. If JSON validation fails, re-run Flash; do not reopen the tree.
How to start today (and where PromptMake fits)
Pick one problem where a single CoT answer locked onto a bad first step last week. Write a one-line goal and a one-line stop check. Run propose → score → expand once by hand with k=3 and depth=2. Save every node in a table.
For a rough node brief, use PromptMake /text to turn that brief into a model-ready instruction for the target model, then paste it into your ToT notes. Keep scoring and prune decisions on your side. The free tier is enough to draft propose and score prompts without standing up your own enhancer.
After two clean sample trees, automate the thinnest loop you can: a script that calls propose and score with your frozen text, or a checklist for a human operator. Add agent frameworks later. A clear branch-and-score notebook beats a clever graph that hides which node lied.
FAQ
What is tree of thoughts prompting in plain terms?
Tree of thoughts prompting is a way to explore several partial answers at once, score them, and grow the best ones. Each partial answer is a thought node. You prune weak nodes and expand strong ones until a leaf meets your success check. The final deliverable comes from the winning path, not from the first idea the model wrote.
How is tree of thoughts different from chain-of-thought?
Chain-of-thought follows one reasoning path in a single reply. Tree of thoughts keeps multiple paths, scores intermediate states, and can backtrack when a branch fails. CoT costs less and fits many tasks. ToT costs more and fits problems where the first fork can ruin the whole answer.
How is tree of thoughts different from prompt chaining?
Prompt chaining splits work across stages such as research, draft, critique, and format. Tree of thoughts searches alternative thoughts inside a reasoning problem. You can run a small ToT loop inside one chain stage when that stage has real forks. Judge chains by stage contracts; judge trees by score quality and prune discipline.
When should I use tree of thoughts prompting?
Use it when the task has meaningful early choices, when you can score partial states, and when a wrong first step is expensive. Planning, multi-option product decisions, and puzzles with checkable intermediates fit. Skip ToT for extraction, short rewrites, and any job a direct prompt or a reasoning model already passes on your eval set.
Which models should run which ToT steps in 2026?
Put propose on Claude Sonnet 5, GPT-5.6 Terra or Luna, or Gemini 3.5 Flash. Put hard scoring on GPT-5.6 Sol, Claude Opus 5 or Fable 5, or Gemini 3.1 Pro. Put synthesis on a format-strong chat model, with Flash as a cheap JSON hop when the schema is strict. Name the model next to each node prompt so teammates do not swap seats by accident.
How do I implement tree of thought prompting without code?
Use three labeled chats or message blocks for propose, score, and synthesize. Paste only the current state into propose, paste candidates into score, and log nodes in a markdown table. Expand the top scores by hand for one more level, then synthesize the winner. Automate after the manual loop works twice.
How do I start tree of thoughts prompting for free?
Run one real problem with k=3 and depth=2 in a free chat tier. Save the node table. If propose or score instructions are still messy, draft those prompts with PromptMake /text on the free tier, then keep the scores and prune calls yourself. Freeze the prompts after two sample trees pass your stop check.
Ready to generate your own prompts?
Free. No sign-up required. Works with all major AI models.