Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models

Andy Zhou,Kai Yan,Michal Shlapentokh-Rothman,Haohan Wang,Yu-Xiong Wang
2024-06-06
Abstract:While language models (LMs) have shown potential across a range of decision-making tasks, their reliance on simple acting processes limits their broad deployment as autonomous agents. In this paper, we introduce Language Agent Tree Search (LATS) -- the first general framework that synergizes the capabilities of LMs in reasoning, acting, and planning. By leveraging the in-context learning ability of LMs, we integrate Monte Carlo Tree Search into LATS to enable LMs as agents, along with LM-powered value functions and self-reflections for proficient exploration and enhanced decision-making. A key feature of our approach is the incorporation of an environment for external feedback, which offers a more deliberate and adaptive problem-solving mechanism that surpasses the constraints of existing techniques. Our experimental evaluation across diverse domains, including programming, interactive question-answering (QA), web navigation, and math, validates the effectiveness and generality of LATS in decision-making while maintaining competitive or improved reasoning performance. Notably, LATS achieves state-of-the-art pass@1 accuracy (92.7%) for programming on HumanEval with GPT-4 and demonstrates gradient-free performance (average score of 75.9) comparable to gradient-based fine-tuning for web navigation on WebShop with GPT-3.5. Code can be found at <a class="link-external link-https" href="https://github.com/lapisrocks/LanguageAgentTreeSearch" rel="external noopener nofollow">this https URL</a>
Artificial Intelligence,Computation and Language,Computer Vision and Pattern Recognition,Machine Learning
What problem does this paper attempt to address?
This paper presents a framework called Language Agent Tree Search (LATS) to address the limitations of language models in decision tasks. Although current language models show potential in inference, action, and planning, they rely on simple action processes, restricting their widespread application as autonomous agents. LATS is the first generic framework that integrates inference, action, and planning capabilities, leveraging the contextual learning ability of language models combined with Monte Carlo tree search (MCTS), enabling language models to act as agents and efficiently explore and make decisions through self-reflection and value functions. The key innovation of LATS is the introduction of an external environment to provide feedback, making the problem-solving mechanism more cautious and adaptive, surpassing the limitations of existing techniques. Experimental evaluations demonstrate that LATS improves decision effectiveness in various domains such as programming, interactive question-answering, web navigation, and mathematics while maintaining or enhancing reasoning performance. For example, in programming tasks, LATS using GPT-4 achieves a pass@1 accuracy of 92.7% on HumanEval and an average score of 75.9 in gradient-free performance on WebShop, comparable to gradient-based fine-tuning. In conclusion, this paper addresses the problem of enhancing the inference, action, and planning capabilities of language models in complex decision tasks by creating a unified framework that allows the model to better adapt to environmental feedback and make wiser and more flexible decisions.