사고의 나무: 대형 언어 모델을 통한 의도적 문제 해결
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)'를 소개한다. 이는 언어 모델 프롬프팅에 널리 사용되는 '생각의 사슬(Chain of Thought)' 접근법을 일반화하고, 문제 해결을 위한 중간 단계로 기능하는 일관된 텍스트 단위(생각)에 대한 탐색을 가능하게 한다. 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.