语言模型正越来越多地被部署用于广泛任务中的通用问题求解,但在推理过程中仍局限于词元级、从左到右的决策过程。这意味着它们在需要探索、战略性前瞻或初始决策起关键作用的任务中可能表现不足。为了克服这些挑战,我们引入了一种新的语言模型推理框架——思维树(Tree of Thoughts,ToT),该框架推广了流行的思维链(Chain of Thought)提示方法,并支持对作为问题求解中间步骤的连贯文本单元(思维)进行探索。ToT 使语言模型能够通过考虑多条不同的推理路径并自我评估选择来决定下一步行动,同时在必要时进行前瞻或回溯以做出全局选择,从而实现深思熟虑的决策。我们的实验表明,ToT 在三个需要非平凡规划或搜索的新任务上显著增强了语言模型的问题求解能力:24 点游戏(Game of 24)、创意写作(Creative Writing)和迷你填字游戏(Mini Crosswords)。例如,在 24 点游戏中,使用思维链提示的 GPT-4 仅解决了 4% 的任务,而我们的方法达到了 74% 的成功率。代码仓库及所有提示:https://github.com/princeton-nlp/tree-of-thought-llm。
英文摘要:
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.
Compositional Reasoning with Transformers, RNNs, and Chain of Thought
Courant Institute of Mathematical Sciences(Courant数学科学研究所);New York University(纽约大学);Center for Data Science(数据科学中心);Center for Computational Mathematics(计算数学中心);Flatiron Institute(Flatiron研究所)
Generating Chain-of-Thoughts with a Pairwise-Comparison Approach to Searching for the Most Promising Intermediate Thought
Center for Advanced Intelligence Project, RIKEN(理化学研究所先进智能项目中心);University of North Carolina at Chapel Hill(北卡罗来纳大学教堂山分校);Graduate School of Frontier Sciences, The University of Tokyo(东京大学前沿科学研究生院)
Brain-Inspired Two-Stage Approach: Enhancing Mathematical Reasoning by Imitating Human Thought Processes
School of Information Science and Technology, ShanghaiTech University(上海科技大学信息科学与技术学院);Shanghai Innovation Center for Processor Technologies(上海处理器技术创新中心);School of Information Science and Technology, University of Science and Technology of China(中国科学技术大学信息科学与技术学院)
Critic-CoT: Boosting the reasoning abilities of large language model via Chain-of-thoughts Critic
Chinese Information Processing Laboratory, Institute of Software, Chinese Academy of Sciences(中国科学院软件研究所信息处理实验室);University of Chinese Academy of Sciences(中国科学院大学);Xiaohongshu Inc(小红书公司)
CAP-CoT: Cycle Adversarial Prompt for Improving Chain of Thoughts in LLM Reasoning
Department of Electronic Engineering, Kyung Hee University(韩国庆熙大学电子工程系);School of Computer Science and Engineering, University of Electronic Science and Technology of China(中国电子科技大学计算机科学与工程学院);Henan Polytechnic University(河南理工大学);School of Computing, Kyung Hee University(韩国庆熙大学计算机学院)
Heuristic Classification of Thoughts Prompting (HCoT): Integrating Expert System Heuristics for Structured Reasoning into Large Language Models
Computer Network Information Center, Chinese Academy of Sciences(中国科学院计算机网络信息中心);Shenyang Aerospace University(沈阳航空航天大学);ZGC LAB, Beijing,China(北京ZGC实验室);Institute for Network Sciences and Cyberspace, Tsinghua University(清华大学网络科学与网络空间研究院)