Tree of Thoughts Prompting: 5 Recipes That Ship (2026)
Five copy-paste Tree of Thoughts (ToT) prompt recipes for 2026: the one-prompt expert panel, branch-score-pick, explicit backtracking, ToT for planning, and when to skip ToT and just use self-consistency.
Updated on August 18, 2026
On this page
Quick Answer
Tree of Thoughts (ToT) prompting makes the model branch. Instead of committing to one line of reasoning like chain of thought does, ToT generates several candidate "thoughts" at each step, scores them, keeps the promising branches, and prunes the rest. As of August 2026 the honest truth is this: the version from the original paper (Yao et al., 2023) is a search harness with a controller loop, not a single prompt. What most people actually ship is a one-prompt approximation that tells the model to explore and self-evaluate branches in a single call. This page gives you five copy-paste recipes for that, and tells you when to skip ToT and just use self-consistency instead.
Tree of Thoughts is worth it when a problem has real dead ends: planning, constraint puzzles, multi-step math where one wrong turn poisons the whole answer. It is a waste of tokens on tasks a single good chain already nails.
Recipe 1: The one-prompt panel (the version 90 percent of people ship)
Claim. You do not need a search framework to get most of the ToT lift. A single prompt that spins up a panel of experts, makes them expand one step at a time, and drops the weakest at each step gets you 80 percent of the benefit for one API call.
Receipt:
Imagine three independent experts solving this problem.
Each writes down one step of their reasoning, then shares it.
After each round, any expert whose step contains a mistake or a
dead end drops out and stops contributing.
Continue until one expert remains, or all agree.
Return only the surviving line of reasoning and the final answer.
Problem: {problem}
Why it works. Forcing the model to name multiple parallel attempts and then eliminate the bad ones mimics the expand-and-prune loop of real ToT without any orchestration code. The "drops out" instruction is the prune step. The "one step at a time" instruction is what stops it from collapsing back into a single chain.
Failure mode. On easy problems the experts trivially agree in round one and you paid triple the tokens for nothing. Gate it: only route hard or dead-end-prone prompts here.
Ship. Use it for logic puzzles, scheduling, and "find the flaw" tasks. Keep temperature at 0.7 so the branches actually differ. This one-prompt trick is the same idea popularized in dave1010's tree-of-thought-prompting repo (2023).
Cost to test: about $0.01 on a mid-tier model.
Recipe 2: Branch, score, pick
Claim. If you want the model to be honest about which branch is best, make it emit a numeric score per branch and select on the number, not on vibes.
Receipt:
Generate 3 distinct approaches to the task below. Label them A, B, C.
For each approach, write 2 sentences of reasoning, then rate how
likely it is to reach a correct, complete answer on a scale of 1 to 10.
Pick the highest-scoring approach and fully execute only that one.
If two approaches tie, pick the one with fewer assumptions.
Task: {task}
Why it works. The explicit 1 to 10 self-evaluation is the ToT "value function" done in-context. Making the model rate before it commits stops it from anchoring on the first idea, which is the single most common reasoning failure.
Failure mode. Models inflate their own scores. Everything is a 9. Counter it by asking for the reasoning before the number, and by telling it that a 10 must be reserved for approaches with zero assumptions.
Ship. Great for open-ended tasks with several valid strategies: query planning, refactor approaches, test-case design.
Cost to test: about $0.02, since you generate three short branches plus one full execution.
Recipe 3: Explicit backtracking
Claim. The real advantage of a tree over a chain is that you can walk back up. Tell the model it is allowed to abandon a branch and return to the last good node.
Receipt:
Solve step by step. At each step, if you notice the current path
cannot lead to a valid answer, write "BACKTRACK" on its own line,
state which earlier step you are returning to, and continue from there.
You may backtrack as many times as needed.
End with "FINAL:" followed by the answer.
Problem: {problem}
Why it works. Chain of thought cannot recover from an early wrong turn because it has no mechanism to undo. Naming an explicit BACKTRACK token gives the model permission to discard sunk-cost reasoning, which is exactly the pruning behavior ToT is built on.
Failure mode. Some models backtrack forever and never emit FINAL. Cap it: "You may backtrack at most twice." A hard limit turns an infinite loop into a bounded search.
Ship. Use for constraint satisfaction, unit-conversion chains, and anything where a single bad assumption cascades.
Cost to test: under $0.01, though token count varies with how much it backtracks.
Recipe 4: Tree of Thoughts for planning
Claim. ToT shines on problems the paper actually tested: Game of 24, creative writing under constraints, mini crosswords. For planning, make the branches be candidate plans, not candidate answers.
Receipt:
Goal: {goal}
Constraints: {constraints}
Propose 3 candidate plans. For each, list the steps, then note the
single most likely point of failure. Eliminate any plan whose failure
point is fatal. From the survivors, produce one merged plan that
borrows the strongest step from each. Output the merged plan only.
Why it works. Branching on plans surfaces the failure point of each strategy before you spend tokens executing it. The merge step is a cheap approximation of the ToT search choosing the best subtree, and it tends to beat any single plan.
Failure mode. The merge can produce a Frankenstein plan with contradictory steps. Add: "The merged plan must be internally consistent; drop any step that conflicts with another."
Ship. Project breakdowns, migration plans, multi-tool agent routing.
Cost to test: about $0.03.
Recipe 5: When to skip ToT and use self-consistency instead
Claim. Half the time you reach for Tree of Thoughts, plain self-consistency is cheaper and just as good. If the problem has a single verifiable answer, sample several chains and take the majority vote. No branch scoring, no backtracking.
Receipt:
Solve this problem 5 times independently, using a different reasoning
path each time. Do not let the runs influence each other.
Then report the answer that appears most often across the 5 runs.
Problem: {problem}
Why it works. For problems with a checkable final answer, voting over independent chains captures most of the robustness of a tree at a fraction of the prompt complexity. ToT earns its keep only when intermediate steps need to be evaluated and pruned, not just the final answer.
Failure mode. Self-consistency fails when every chain shares the same blind spot, so the majority is confidently wrong. That is your signal to move up to a real ToT with an evaluation step.
Ship. Reach for self-consistency first on math and classification. Escalate to ToT only when a wrong intermediate step, not just a wrong answer, is the problem.
Cost to test: about $0.02 for five short runs.
Tree of Thoughts vs Chain of Thought vs Self-Consistency
Pick the lightest tool that solves your problem:
- Chain of Thought: one linear path. Cheapest. Use it by default. See the chain of thought recipes.
- Self-Consistency: several independent chains, majority vote. Use it when the answer is verifiable and you want robustness.
- Tree of Thoughts: branch, evaluate, prune, backtrack. Use it only when intermediate steps have dead ends worth pruning. It is the most expensive of the three and the easiest to over-apply.
The mistake is treating ToT as a strictly better CoT. It is not. It is a search procedure, and search is only worth it when the space has real branches. Both the OpenAI prompt engineering guide (2026) and the Anthropic prompt engineering docs (2026) push chain of thought as the default for a reason: most tasks do not need a tree.
Written by
Sam Q.Sam Q. writes copy-paste prompt and API recipes for PromptAttic. Ships the working snippet first and saves the theory for the footnotes.
FAQ
What is tree of thoughts prompting?
Tree of Thoughts (ToT) prompting makes a model explore several candidate reasoning steps in parallel, score them, keep the promising branches, and prune the rest, instead of committing to a single chain. The original 2023 paper describes it as a search procedure with a controller loop; in practice most people ship a one-prompt approximation that asks the model to branch and self-evaluate in a single call.
What is the difference between tree of thoughts and chain of thought prompting?
Chain of thought follows one linear path of reasoning. Tree of thoughts branches into multiple paths, evaluates them, and can prune or backtrack. Chain of thought is cheaper and is the right default; tree of thoughts only pays off when intermediate steps have dead ends worth discarding, such as planning or constraint puzzles.
Can you give an example of a tree of thoughts prompt?
Yes. A common one-prompt version: 'Imagine three independent experts solving this problem. Each writes one step of reasoning, then shares it. After each round, any expert whose step contains a mistake drops out. Continue until one remains. Return only the surviving reasoning and the final answer.' This mimics the expand-and-prune loop without any orchestration code.
Is tree of thoughts prompting worth the extra cost?
Only for problems with real dead ends: planning, constraint satisfaction, and multi-step reasoning where one wrong turn poisons the answer. On tasks a single good chain already solves, ToT just triples your token cost for no gain. If the problem has one verifiable answer, self-consistency is usually cheaper and just as robust.
Do I need a framework to use tree of thoughts?
No. The paper-accurate version uses a search controller, but the one-prompt approximations in this guide run in a single API call on any 2026 model. Reach for a framework only when you need programmatic control over branch expansion, scoring, and backtracking at scale.
Related recipes
Chain of Thought Prompting: 6 Examples That Ship (2026)
Six paste-ready chain of thought prompting examples for 2026, each with its failure mode, plus when reasoning out loud makes the answer worse.
Self-Consistency Prompting: 5 Recipes That Ship (2026)
Self-consistency prompting in 2026: five copy-paste recipes that sample multiple reasoning paths and majority-vote the answer, plus a gate for when to skip it.
Least-to-Most Prompting: 6 Recipes That Ship (2026)
Least-to-most prompting for LLMs in 2026: six copy-paste recipes that decompose a hard problem into ordered subproblems and feed each answer forward, with the receipt, the reasoning, and the failure mode for each.