LATS: A Unified Framework Uniting Reasoning, Acting, and Planning for LLM Agents
Introduction
As large language models (LLMs) are increasingly used in decision-making tasks, expectations for their capabilities as autonomous agents have grown. Traditional LLM agents, however, often follow a simple linear execution pattern and struggle with the deliberation and multi-step planning required by complex tasks. LATS (Language Agent Tree Search) is a novel, general framework that integrates an LLM's reasoning, acting, and planning abilities. Drawing on Monte Carlo Tree Search (MCTS) from model-based reinforcement learning, LATS systematically searches the space of potential actions, using the language model simultaneously as agent, value function, and optimizer. Its key innovation is an external environment feedback mechanism that enables self-reflection and adaptation, making LATS the first framework to combine reasoning, acting, and planning to boost LLM performance.
How LATS Works
LATS organizes the model's decisions in a language agent tree where each node represents a partial decision sequence (task input plus prior reasoning/action steps, with context and environment observations). Key components:
- Nodes and state representation: each node stores current context and observations from the environment (e.g., the question, intermediate reasoning, and tool results).
- Action sampling and search: the LLM acts as a policy network, sampling multiple candidate next steps at each node. MCTS then performs selection, expansion, simulation, and backpropagation, balancing exploration and exploitation.
- Value function: the LLM is prompted to score each node's state with a scalar value, optionally incorporating environment feedback (e.g., code execution results).
- Self-reflection: when a search reaches a terminal node with an unsatisfactory result (e.g., failed tests, wrong answer), the model generates a reflection text summarizing errors and improvements. Reflections plus failed trajectories are stored in external memory and reused in later iterations—learning from experience without gradient updates.
- Environment interaction: feedback from the environment (page content, compile errors, test results) serves both as reward signal for value updates and as input to reflection, making decisions responsive to the external world rather than internal knowledge alone.
- vs. CoT: CoT generates a single linear reasoning chain prone to error accumulation; LATS explores multiple paths in parallel and corrects errors via feedback and reflection.
- vs. ReAct: ReAct interleaves thinking and acting reflexively with one candidate per step; LATS extends this loop into multi-candidate tree search with foresight.
- vs. ToT: ToT searches trees of reasoning with simple DFS/BFS and a single heuristic, without environment interaction; LATS searches over reasoning plus actions, uses MCTS for better exploration/exploitation, and adds self-reflection.
- vs. RAP: both use MCTS, but RAP's "environment" is simulated purely by the LLM with no real feedback and no reflection; LATS interacts with a real environment and learns from failures.
- vs. Self-Refine: Self-Refine post-processes a single solution; LATS reflects on multiple failed paths during search, guiding pruning and expansion.
- vs. Beam Search: beam search uses a static scoring function and fixed width; MCTS dynamically updates node values from real feedback and adapts exploration via UCB-style criteria.
- vs. Reflexion: Reflexion reflects in a single interaction thread; LATS embeds reflection into parallel tree search, guiding the search process itself.
- Reasoning tasks: accuracy/F1 for QA (HotPotQA), Pass@k for code generation (94.4% Pass@1 on HumanEval).
- Decision tasks: average score on WebShop (75.9), plus success rate and efficiency (steps/time).
- Search efficiency and cost: number of search steps, candidates generated, and runtime; LATS uses pruning and feedback-guided evaluation to keep search complexity controllable.
- Baselines: LATS outperforms ReAct-only, ToT-only (no environment feedback), and Reflexion-only (single-thread reflection) variants, and matches gradient-tuned models on WebShop without training.
Comparison with Mainstream Methods
LATS is compared with CoT, ReAct, Tree-of-Thought (ToT), RAP, Self-Refine, Beam Search, and Reflexion across five dimensions: reasoning, acting, planning, self-reflection, and external memory.
| Method | Reasoning | Acting | Planning | Self-reflection | External memory | |---|---|---|---|---|---| | CoT | ✓ | ✗ | ✗ | ✗ | ✗ | | ReAct | ✓ | ✓ | ✗ | ✗ | ✗ | | ToT | ✓ | ✗ | ✓ | ✓ | ✓ | | RAP | ✓ | ✗ | ✓ | ✗ | ✓ | | Self-Refine | ✓ | ✗ | ✗ | ✓ | ✗ | | Beam Search | ✓ | ✗ | ✗ | ✓ | ✗ | | Reflexion | ✓ | ✓ | ✗ | ✓ | ✓ | | LATS | ✓ | ✓ | ✓ | ✓ | ✓ |
Key contrasts:
LATS is not a simple concatenation of these techniques but an integration with synergistic effects: it reportedly doubles ReAct's performance on HotPotQA and improves WebShop average score by 22.1%.
Experiments and Results
Code Generation (HumanEval)
LATS couples the LLM with a Python execution environment: candidate code is generated during tree search, executed, and evaluated on tests, with error messages feeding reflection. With GPT-4, LATS achieves 94.4% Pass@1 on HumanEval—a state-of-the-art result—without any fine-tuning, demonstrating the power of gradient-free optimization via search and feedback.
Multi-hop QA (HotPotQA)
The model issues retrieval queries, reasons over retrieved passages, and receives feedback on answer correctness. LATS doubles GPT-3.5's accuracy compared to ReAct, by exploring multiple retrieval/reasoning paths, adapting strategies from feedback, and reflecting on failed attempts.
Web Navigation (WebShop)
In this simulated shopping environment, the agent browses, searches, and purchases items. With GPT-3.5, LATS averages 75.9 points, significantly above baselines and close to gradient-tuned models—without any parameter updates—showing strong sequential decision-making in a novel interactive environment.
Performance Evaluation and Metrics
Conclusion
LATS is the first framework to unify reasoning, acting, and planning for LLM agents. By combining MCTS-based search, environment feedback, and self-reflection with external memory, it overcomes the limited flexibility, perception, and adaptability of prior approaches. Experiments across code generation, QA, and web navigation show record-setting or significantly improved results without gradient fine-tuning. The findings suggest that explicit planning/search and rich environmental feedback are crucial ingredients for building more capable and adaptive LLM-based agents, pointing future research toward combining classical planning algorithms with modern language models.
*Note: the original post is a long-form Chinese survey with embedded charts and styling; this article presents its full technical content in English.*