Tree of Thoughts: Deliberate Problem Solving with Large Language Models

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.

A Formal Basis for theHeuristic Determination…A Formal Basis for the Heuristic Determination of Minimum Cost PathsChain of ThoughtPrompting Elicits…Chain of Thought Prompting Elicits Reasoning in Large Language ModelsInner Monologue:Embodied Reasoning…Inner Monologue: Embodied Reasoning through Planning with Language ModelsMaieutic Prompting:Logically Consistent…Maieutic Prompting: Logically Consistent Reasoning with Recursive ExplanationsFaithful Reasoning UsingLarge Language ModelsFaithful Reasoning Using Large Language ModelsSolving Math WordProblem via Cooperative…Solving Math Word Problem via Cooperative Reasoning induced Language ModelsLeast-to-Most PromptingEnables Complex…Least-to-Most Prompting Enables Complex Reasoning in Large Language ModelsReAct: SynergizingReasoning and Acting in…ReAct: Synergizing Reasoning and Acting in Language ModelsReasoning with LanguageModel is Planning with…Reasoning with Language Model is Planning with World ModelSelf-ConsistencyImproves Chain of…Self-Consistency Improves Chain of Thought Reasoning in Language ModelsLLaMA: Open andEfficient Foundation…LLaMA: Open and Efficient Foundation Language ModelsPaLM: Scaling LanguageModeling with PathwaysPaLM: Scaling Language Modeling with PathwaysThe Dawn of LMMs:Preliminary Exploration…The Dawn of LMMs: Preliminary Explorations with GPT-4V(ision)VoxPoser: Composable 3DValue Maps for Robotic…VoxPoser: Composable 3D Value Maps for Robotic Manipulation with Language ModelsBeyond Chain-of-Thought,Effective…Beyond Chain-of-Thought, Effective Graph-of-Thought Reasoning in Large Language ModelsPlan, Verify and Switch:Integrated Reasoning…Plan, Verify and Switch: Integrated Reasoning with Diverse X-of-ThoughtsUnleashing the CreativeMind: Language Model As…Unleashing the Creative Mind: Language Model As Hierarchical Policy For Improved Exploration on Challenging Problem SolvingGraph of Thoughts:Solving Elaborate…Graph of Thoughts: Solving Elaborate Problems with Large Language ModelsToolLLM: FacilitatingLarge Language Models t…ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIsSELF-DISCOVER: LargeLanguage Models…SELF-DISCOVER: Large Language Models Self-Compose Reasoning StructuresPrompting Large LanguageModels with…Prompting Large Language Models with Divide-and-Conquer Program for Discerning Problem SolvingMOKA: Open-VocabularyRobotic Manipulation…MOKA: Open-Vocabulary Robotic Manipulation through Mark-Based Visual PromptingMixture-of-AgentsEnhances Large Language…Mixture-of-Agents Enhances Large Language Model CapabilitiesGenoMAS: A Multi-AgentFramework for Scientifi…GenoMAS: A Multi-Agent Framework for Scientific Discovery via Code-Driven Gene Expression AnalysisTree of Thoughts:Deliberate Problem…Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsEarlier referencesFocus paperCiting papersOlderNewer

Click a node to pin it, click the empty canvas to go back to this paper, or hover to preview. Open a node’s page from its title.