Large Language Models as Commonsense Knowledge for Large-Scale Task Planning

Zirui Zhao, Wee Sun Lee, David Hsu

Abstract

While Large Language Models (LLMs) demonstrate remarkable commonsense reasoning, they often fail in complex, multi-step task planning due to hallucinations and a lack of rigorous look-ahead mechanisms. This paper introduces LLM-MCTS, a framework that integrates LLMs into the Monte Carlo Tree Search (MCTS) algorithm. By using LLMs to provide a commonsense "world model" for state priors and a "heuristic policy" for action selection, the framework significantly enhances the efficiency and success rates of robotic task planning in large-scale environments. Experimental results in the VirtualHome simulator show that LLM-MCTS outperforms direct LLM policies, particularly in novel and compositional tasks.

Introduction

Consider a robot tasked with a household chore such as "put the fruit in the fridge." Success requires the robot to navigate a vast search space: it must know that fruit is likely on a kitchen counter rather than in a wardrobe, identify the correct sequence of actions to retrieve it, and adapt if the environment deviates from expectations.

Traditional planning algorithms like Monte Carlo Tree Search (MCTS) are theoretically robust but practically limited by the "curse of dimensionality"—the search space in a real-world house is too large to explore exhaustively. Conversely, using an LLM directly as a policy (an "L-Policy") leverages commonsense but lacks the internal mechanism for systematic search, often failing on novel or complex sequences. This research seeks to bridge this gap by using the commonsense of an LLM to prune the search tree of a classical planner, making large-scale task planning tractable.

The LLM-MCTS Framework

LLM-MCTS integrates LLMs into the MCTS loop in two primary capacities:

1. LLM as a Commonsense World Model

Instead of initiating a search with a uniform distribution over all possible object locations, the system queries the LLM for a prior belief distribution. For example, when searching for an apple, the LLM might suggest the "fridge" or "table" as high-probability locations. This allows the planner to prioritize searching likely areas first, effectively using commonsense to narrow the initial search space.

2. LLM as a Heuristic Policy

During the simulation (rollout) phase of MCTS, the system avoids random action selection. Instead, it utilizes the LLM to suggest promising plans. These suggestions serve as heuristics that guide the search toward high-reward branches without requiring the planner to blindly commit to them. If a suggested action leads to a failure in the simulation, the MCTS algorithm can "overrule" the LLM and explore alternative paths.

3. Theoretical Foundation: The MDL Principle

The authors justify this approach using the Minimum Description Length (MDL) principle. They argue that if the "rules of the world" (the model) are simpler to describe than the "optimal behavior" (the policy), then model-based planning is superior. For complex tasks where the policy would require a massive lookup table of every possible scenario, the LLM is better utilized as a compact world model rather than a direct policy executor.

Experimental Evaluation

The framework was evaluated using the VirtualHome 3D simulation platform. The researchers utilized 200 expert trajectories as few-shot examples for the LLM and tested the system on 800 tasks across three categories:

  • Simple: Single-item rearrangement.
  • Compositional (Comp): Tasks involving multiple items.
  • Novel: Tasks involving items or combinations not present in the few-shot examples.

Additional benchmarks included multi-digit multiplication and multi-hop travel planning to test the limits of LLM reasoning versus structured search.

Key Results and Insights

Superior Generalization

LLM-MCTS demonstrated a significant performance advantage over direct LLM policies. On the most challenging "Novel Compositional" tasks, LLM-MCTS (using GPT-3.5) achieved a success rate of 33-38%, whereas the direct GPT-3.5 Policy success rate dropped to a mere 5-7%. This suggests that search acts as a vital safety net, allowing the system to recover from LLM hallucinations.

Search Efficiency

Standard MCTS (using the UCT algorithm) without LLM guidance failed completely, recording a 0% success rate. This highlights that in large-scale environments, the search space is so vast that without commonsense pruning, a classical planner cannot find the "needle in the haystack."

Robustness

In "Unseen Apartments"—layouts entirely different from the training data—LLM-MCTS maintained its performance lead. This confirms that the commonsense knowledge embedded in LLMs generalizes more effectively than specific behavioral cloning or direct policy mapping.

Limitations and Future Directions

Despite its success, the primary bottleneck for LLM-MCTS is inference latency. Each planning step requires multiple calls to the LLM API, resulting in a decision time of approximately 67 seconds per action, compared to roughly 1 second for a direct policy. Furthermore, the system is sensitive to "translation fragility," where the LLM must map natural language to specific simulator APIs accurately.

Future work will focus on "distilling" LLM commonsense into smaller, local models to reduce latency and improving the handling of admissible actions to ensure the robot does not attempt impossible tasks. By refining the synergy between LLM intuition and MCTS rigor, robots can become more capable of navigating the complexities of the human world.

Summary updated

BibTeX
@inproceedings{zhao2023large,
  author = {Zirui Zhao and Wee Sun Lee and David Hsu},
  title = {{Large Language Models as Commonsense Knowledge for Large-Scale Task Planning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=Wjp1AYB8lH},
}
Figure