TL;DR
This paper introduces Dynamic Planning of Thoughts (D-PoT), a framework that enables Large Language Model (LLM) agents to automate smartphone tasks by continuously refining plans based on real-time visual feedback. By replacing exhaustive chat histories with a concise, evolving execution log, D-PoT increases task accuracy by 12.7% over GPT-4V baselines while reducing computational overhead by 75%.
The Challenge: The History Paradox in GUI Automation
Automating Graphical User Interfaces (GUIs)—such as navigating a smartphone to purchase an item or check system settings—is a "long-episode" challenge. In these dynamic environments, every action alters the screen state, and a single error can derail the entire sequence.
Existing LLM agents typically rely on ReAct (Reason + Act), which maintains a full history of every thought and action in a dialogue chain. However, the authors identify a "history paradox": while context is necessary, performance actually degrades as history grows. GUI tasks generate thousands of tokens per turn due to complex screen descriptions; this "noise" distracts the LLM, leading to latency and "hallucinated" actions where the agent loses track of its progress.
Methodology: Dynamic Planning of Thoughts (D-PoT)
The authors propose D-PoT, which treats planning as a living process rather than a static initialization. The framework operates through a cyclical three-stage loop:
- Planning Initialization: Given a goal and a screenshot, the LLM generates a multi-step plan and identifies the immediate next step.
- Dynamic Adjustment: After executing an action and receiving a new screenshot, the agent appends a natural language description of the executed step to a dedicated Execution History.
- Refinement: The updated history and new visual state are used to "re-plan." If the UI changed unexpectedly, the agent adjusts future steps accordingly.
To further enhance performance, D-PoT w/ reference retrieves similar successful task goals from a database to provide the LLM with in-context examples of effective plan structures.
Experimental Evaluation
The study utilizes the AITW (Android in the Wild) dataset, a massive benchmark comprising over 715,000 episodes across 350+ applications. The evaluation covers five subsets: General, Install, GoogleApps, Single, and WebShopping. To facilitate LLM processing, raw screenshots were converted into textual "screen captions" (HTML-like structures) using OCR and IconNet.
Key Insights and Results
- The "Sweet Spot" of History: Standard ReAct agents peak at a history length of just 2 turns before performance plummets. D-PoT bypasses this by using summarized execution history, allowing the agent to retain context without being overwhelmed by token bloat.
- Mitigating Hallucinations: Forcing the model to generate a plan before an action acts as a cognitive buffer, aligning the model’s internal state with the visual reality of the screen and reducing invalid clicks.
- Performance Gains: D-PoT achieved an overall accuracy of 47.36%, significantly outperforming the GPT-4V zero-shot baseline of 34.66%.
- Efficiency: D-PoT reduced inference costs from ~101k to ~25k tokens per episode—a 75% reduction—while simultaneously improving execution speed.
Limitations and Future Directions
Despite these advancements, the authors noted three persistent error types: LLM bias toward specific apps (e.g., preferring Google Search over Chrome), instruction overlap where multiple actions are technically correct, and occasional confusion regarding physical gestures like swipe directions. Future work will focus on better grounding physical gestures and de-biasing LLMs from preferred UI paths.
Summary updated