ChatPaper.aiChatPaper

思維樹:利用大型語言模型進行有意識的問題解決

Tree of Thoughts: Deliberate Problem Solving with Large Language Models

May 17, 2023
作者: Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Thomas L. Griffiths, Yuan Cao, Karthik Narasimhan
cs.AI

摘要

語言模型越來越廣泛地應用於各種一般性問題解決任務,但在推理過程中仍受限於基於標記的、從左到右的決策過程。這意味著它們在需要探索、策略性預視或初始決策至關重要的任務中可能會出現不足。為了克服這些挑戰,我們引入了一個新的語言模型推理框架,稱為“思維樹”(Tree of Thoughts,ToT),它廣泛應用於促使語言模型的流行“思維鏈”方法,並實現對作為問題解決中間步驟的連貫文本單元(思維)的探索。ToT使語言模型能夠通過考慮多個不同的推理路徑和自我評估選擇來進行蓄意的決策,以決定下一步行動,同時在必要時向前或向後追溯,以做出全局性選擇。我們的實驗表明,ToT顯著增強了語言模型在需要複雜規劃或搜索的三項新任務中的問題解決能力:24點遊戲、創意寫作和小型填字遊戲。例如,在24點遊戲中,儘管只有使用思維鏈提示的GPT-4解決了4%的任務,我們的方法實現了74%的成功率。所有提示的代碼存儲庫:https://github.com/ysymyth/tree-of-thought-llm。
English
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/ysymyth/tree-of-thought-llm.
PDF121December 15, 2024