Papers › Tree of Thoughts: Deliberate Problem Solving with Large Language Models

Tree of Thoughts: Deliberate Problem Solving with Large Language Models

17 May 2023NeurIPS 2023 11arXiv:2305.10601archive 2025-07-28

Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Thomas L. Griffiths, Yuan Cao, Karthik Narasimhan

Language models are increasingly being deployed for general problem solving across a wide range of tasks, but are still confined to token-level, left-to-right decision-making processes during inference. This means they can fall short in tasks that require exploration, strategic lookahead, or where initial decisions play a pivotal role. To surmount these challenges, we introduce a new framework for language model inference, Tree of Thoughts (ToT), which generalizes over the popular Chain of Thought approach to prompting language models, and enables exploration over coherent units of text (thoughts) that serve as intermediate steps toward problem solving. ToT allows LMs to perform deliberate decision making by considering multiple different reasoning paths and self-evaluating choices to decide the next course of action, as well as looking ahead or backtracking when necessary to make global choices. Our experiments show that ToT significantly enhances language models' problem-solving abilities on three novel tasks requiring non-trivial planning or search: Game of 24, Creative Writing, and Mini Crosswords. For instance, in Game of 24, while GPT-4 with chain-of-thought prompting only solved 4% of tasks, our method achieved a success rate of 74%. Code repo with all prompts: https://github.com/princeton-nlp/tree-of-thought-llm.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2305.10601")

Code

Syntology Ran 7 of 24 code samples harvested from 6 repositories linked to this paper; 17 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 6 ran with no contract checked.

By repository: official repository: 2 samples from 1 repository, 0 ran; community (archive-listed): 21 samples from 4 repositories, 6 ran; community: 1 sample from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

princeton-nlp/tree-of-thought-llm officialmentioned in paperMIT report
ysymyth/tree-of-thought-llm officialmentioned in paperMIT report
appl-team/appl mentioned on GitHubMIT report
huiwy/reflection-on-trees mentioned on GitHub report
katamb/tree-of-thought-llm-ca mentioned on GitHubMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

24 samples harvested; 7 ran; 0 honoured the contract we drafted; 17 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
6ran
17unverified

Licence: 0 of the 24 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 6 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_current_numbers princeton-nlp/tree-of-thought-llm/src/tot/tasks/game24.py official repository unverified MIT (permissive) · e453ebba492daf39 · report
gpt_usage princeton-nlp/tree-of-thought-llm/src/tot/models.py official repository unverified MIT (permissive) · 1506be9f936c7be7 · report
DialogueState codelion/optillm/optillm/mcts.py community (archive-listed) ran Apache-2.0 (permissive) · 4a6a2716cd1ecfd3 · report
MCTS codelion/optillm/optillm/mcts.py community (archive-listed) ran Apache-2.0 (permissive) · c919c70de90b021d · report
MCTSAggregation huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) ran Apache-2.0 (permissive) · 6445e3fedf96a2dd · report
MCTSNode codelion/optillm/optillm/mcts.py community (archive-listed) ran Apache-2.0 (permissive) · 778fb657e40c2423 · report
MCTSNode huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) ran Apache-2.0 (permissive) · e508098731faf687 · report
MCTSResult huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) ran Apache-2.0 (permissive) · 583801f0a2465d0c · report
AlgorithmOutput huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) unverified Apache-2.0 (permissive) · 455bf868afcd3f83 · report
MCTS huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) unverified Apache-2.0 (permissive) · a60a888f98f637a1 · report
SearchAlgorithm huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) unverified Apache-2.0 (permissive) · 11e46ccab8c4b6b1 · report
SearchConfig huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) unverified Apache-2.0 (permissive) · 4b65b29a47508556 · report
WorldModel huiwy/reflection-on-trees/reasoners/algorithm/mcts.py community (archive-listed) unverified Apache-2.0 (permissive) · a843c8ac332d4291 · report
appl_dedent appl-team/appl/src/appl/core/compile.py community (archive-listed) unverified MIT (permissive) · 7eb3fea92922729c · report
clean_result katamb/tree-of-thought-llm-ca/src/tot/tasks/codeanalysis.py community (archive-listed) unverified MIT (permissive) · aee70aa81e74fa9a · report
dict_to_pydantic appl-team/appl/src/appl/caching/utils.py community (archive-listed) unverified MIT (permissive) · 9b3aebc249c853c6 · report
encode_to_uuid_v5 appl-team/appl/src/appl/caching/utils.py community (archive-listed) unverified MIT (permissive) · 64959a06bee3598c · report
find_dotenv appl-team/appl/src/appl/utils.py community (archive-listed) unverified MIT (permissive) · c4e580b088833502 · report
find_files appl-team/appl/src/appl/utils.py community (archive-listed) unverified MIT (permissive) · 06226fb0ae82092a · report
get_cwes katamb/tree-of-thought-llm-ca/src/tot/tasks/codeanalysis.py community (archive-listed) unverified MIT (permissive) · 1b66502a5e6457a6 · report
get_folder appl-team/appl/src/appl/utils.py community (archive-listed) unverified MIT (permissive) · 70d9d6c9c2ec99d8 · report
gpt_usage katamb/tree-of-thought-llm-ca/src/tot/models.py community (archive-listed) unverified MIT (permissive) · 605644c3d7369622 · report
pydantic_to_dict appl-team/appl/src/appl/caching/utils.py community (archive-listed) unverified MIT (permissive) · 71622f179ee00cfd · report
string_to_dict kyegomez/tree-of-thoughts/tree_of_thoughts/agent.py community ran · our draft was wrong Apache-2.0 (permissive) · f55d3d712d45739b · report

Tasks

Arithmetic ReasoningDecision MakingLanguage ModellingQuestion Answering

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Arithmetic Reasoning Game of 24 Tree of Thoughts (b=5) Success 0.74 #1 of 1 Archive leaderboard report
Question Answering TruthfulQA ToT EM 66.6 #30 of 33 Archive leaderboard report
Question Answering WebQuestions ToT EM 26.3 #27 of 37 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutGPT-4Label SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections