AdaPlanner: Adaptive Planning from Feedback with Language Models

Haotian Sun, Yuchen Zhuang, Lingkai Kong, Bo Dai, Chao Zhang

Large language models (LLMs) have recently demonstrated immense potential as autonomous agents for sequential decision-making tasks. However, turning them into reliable agents remains difficult. AdaPlanner is a closed-loop framework that transforms LLMs into adaptive agents capable of refining their plans in real-time based on environmental feedback. By utilizing code-style prompting and a novel "Refine-Then-Resume" mechanism, AdaPlanner achieves state-of-the-art performance on complex sequential tasks while using up to 600x fewer samples than previous training-based methods.

The Problem: Static Plans and Local Fixes

Most existing approaches for LLM-based agents fall into two primary traps:

  1. Open-Loop Planning: The agent generates a static, step-by-step plan and executes it blindly. If the initial plan is slightly off or the environment changes unexpectedly, the agent fails without attempting to recover.
  2. Implicit Closed-Loop Planning: Methods like ReAct allow the agent to change its next action based on immediate feedback, but they do not allow the agent to rethink its entire future plan. This often leads to "local" fixes that fail to address broader task-level failures.

Furthermore, LLMs are prone to "hallucination"—generating actions that are impossible in the current environment—and often require massive amounts of expert demonstrations to learn complex task structures.

Comparison of planning architectures: Open-Loop, Implicit Closed-Loop, and AdaPlanner's Explicit Closed-Loop.

The AdaPlanner Approach

To overcome these limitations, the researchers introduce AdaPlanner, an architecture that treats the LLM as both a Planner and a Refiner. It relies on three key pillars:

1. Code-Based Prompting

Instead of natural language, AdaPlanner uses Pythonic code to represent plans. This includes comments for sub-goals and assert statements to verify if a step was successful. Code is inherently less ambiguous than natural language, which forces the LLM to decompose tasks logically and significantly reduces hallucinations.

2. Adaptive Refinement Strategies

AdaPlanner dynamically adjusts to the environment using two distinct feedback loops:

  • In-Plan Refinement: When the environment behaves as expected, the agent uses a special ask_llm() function to parse natural language observations into useful variables (like object IDs) for future steps.
  • Out-of-Plan Refinement: If an assertion fails (e.g., "I thought I was holding the lettuce, but I'm not"), the agent triggers a "Refine-Then-Resume" process. Instead of restarting the entire episode, it generates a new plan starting from the current failure point.
AdaPlanner's code-based prompting and out-of-plan refinement process in action.

3. Skill Discovery

AdaPlanner maintains a "Skill Memory." When it successfully completes a task, it archives the successful plan. If it encounters a similar task later, it retrieves these plans to use as few-shot exemplars, drastically improving sample efficiency over time.

Key Results and Insights

The researchers evaluated AdaPlanner on two major benchmarks: ALFWorld (embodied household tasks) and MiniWoB++ (digital web-interaction tasks).

  • State-of-the-Art Performance: AdaPlanner achieved an overall success rate of 91.79% in ALFWorld and 91.11% in MiniWoB++ (on tasks with feedback), outperforming popular baselines like ReAct and Reflexion.
  • Extreme Sample Efficiency: In MiniWoB++, AdaPlanner achieved performance comparable to CC-Net (a state-of-the-art training-based model) while using 600x fewer samples. In ALFWorld, it required 2x fewer samples than its closest competitors.
  • Shorter Trajectories: Because it can hot-fix plans rather than just reacting step-by-step or restarting from scratch, AdaPlanner completes tasks in significantly fewer steps.
  • Code as the "Language of Thought": The paper demonstrates that simply switching from natural language prompts to code prompts can nearly double success rates in some environments (e.g., ALFWorld success jumped from 46% to 81% in ablation studies).

Limitations and Future Work

While AdaPlanner is highly efficient, it still requires a small number of few-shot expert demonstrations to handle very complex tasks initially. A promising future direction is "Zero-Shot AdaPlanner"—developing mechanisms that allow the agent to explore and discover these initial skills entirely on its own without any human-provided examples. Additionally, exploring more specialized domain-specific languages for planning could further reduce errors and improve agent reasoning.

Summary updated

BibTeX
@inproceedings{sun2023adaplanner,
  author = {Haotian Sun and Yuchen Zhuang and Lingkai Kong and Bo Dai and Chao Zhang},
  title = {{AdaPlanner: Adaptive Planning from Feedback with Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=rnKgbKmelt},
}
Figure