A Zero-Shot Language Agent for Computer Control with Structured Reflection

Tao Li, Gang Li, Zhiwei Deng, Bryan Wang, Yang Li

Introduction

Autonomous agents capable of controlling computer interfaces—navigating websites, filling forms, and executing software tasks—represent a significant frontier in AI. Traditionally, these agents have relied on "expert traces," or step-by-step human demonstrations, to learn task execution. However, this reliance creates bottlenecks in scalability and generalization. Researchers have now introduced a zero-shot agent that bypasses the need for human examples by utilizing a staged planning approach combined with a structured reflection mechanism to learn through trial and error.

Addressing the Expert Trace Bottleneck

The prevailing paradigm for computer control agents faces two primary challenges. First, collecting expert data for every conceivable task is prohibitively expensive. Second, agents trained on specific traces often fail to generalize when encountering unfamiliar interfaces.

Furthermore, the research identifies a subtle "cheating" problem in existing benchmarks: many models utilize full HTML page sources that contain information not yet visible to a human user (such as data hidden within unclicked tabs). To create a more realistic autonomous agent, this work enforces a "consistent screen" policy, ensuring the agent only interacts with information currently visible on the screen.

Example of the 'cheating' problem where HTML reveals hidden tab content before interaction.

Methodology

The proposed framework, built on the PaLM 2 large language model (LLM), introduces three core innovations to enable zero-shot control:

Compact Screen Representation

Rather than processing raw, verbose HTML, the agent uses a simplified UI representation. HTML elements are only expanded when the agent specifically interacts with them, preventing "telepathic" access to hidden data and keeping the context window manageable.

The agent's simplified HTML representation, mapping UI elements to specific IDs and positions.

Staged Plan-And-Follow

To balance efficiency and accuracy, the agent employs "staged planning." Instead of planning one step at a time or attempting to map out an entire multi-page task, the agent analyzes the current screen and plans all executable actions for that specific view as a single batch. This approach reduces LLM planning calls by 60% to 90% in various scenarios.

Structured Reflection and Thought Management

When a task fails, the agent performs a self-reflection to pinpoint the erroneous step. This "learned lesson" is stored in structured memory. In subsequent attempts, the agent is forced to use the corrected action and is explicitly barred from repeating the failed action via a "disabled action set."

Key Insights and Results

The research demonstrates that an LLM’s capacity for self-criticism can effectively substitute for human demonstrations. By analyzing its own failures, the agent "bootstraps" its way to success without ever seeing an expert trace.

Evaluation on the MiniWoB++ benchmark revealed several key findings:

  • Zero-Shot Superiority: On "1-screen-n-step" tasks (multiple actions on one page), the agent achieved a 97.3% completion rate, outperforming state-of-the-art models like RCI and AdaPlanner that utilize few-shot examples.
  • Iterative Improvement: On complex multi-screen tasks, performance improved from 73.5% on the first attempt to 87.3% after five trials, proving the efficacy of the Structured Reflection mechanism.
  • Statistical Significance: Improvements gained through multiple rounds of reflection were confirmed to be statistically significant ($p < 0.05$).

Limitations and Future Directions

While highly effective for click-based interactions, the agent faces challenges in constraining "bad typing" or "bad scrolling" actions, as these lack unique IDs for easy disabling. Additionally, extremely long tasks can eventually exceed the LLM's context window for reflection memory. Future work will explore integrating multimodal data (Vision-Language Models) to handle visual UI elements and implementing more persistent long-term memory to prevent agents from getting stuck in repetitive loops.

Summary updated

BibTeX
@inproceedings{li2023zero,
  author = {Tao Li and Gang Li and Zhiwei Deng and Bryan Wang and Yang Li},
  title = {{A Zero-Shot Language Agent for Computer Control with Structured Reflection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.753},
}
Figure