ScreenAgent: A Vision Language Model-driven Computer Control Agent

Runliang Niu, Jindong Li, Shiqi Wang, Yali Fu, Xiyu Hu, Xueyuan Leng, He Kong, Yi Chang, Qi Wang

Abstract

Large Language Models (LLM) can invoke a variety of tools and APIs to complete complex tasks. The computer, as the most powerful and universal tool, could potentially be controlled by a trained LLM agent. Powered by the computer, we can hopefully build a more generalized agent to assist humans in various daily digital works. In this paper, we construct an environment for a Vision Language Model (VLM) agent to interact with a real computer screen. Within this environment, the agent can observe screenshots and manipulate the Graphical User Interface (GUI) by outputting mouse and keyboard actions. We also design an automated control pipeline that includes planning, acting, and reflecting phases, guiding the agent to continuously interact with the environment and complete multi-step tasks. Additionally, we construct the ScreenAgent Dataset, which collects screenshots and action sequences when completing daily computer tasks. Finally, we train a model, ScreenAgent, which achieves comparable computer control capabilities to GPT-4V and demonstrated more precise UI positioning capabilities.

Introduction

While Large Language Models (LLMs) have mastered text-based tasks, using them to control a computer—the ultimate universal tool—remains a "grand challenge." Most existing agents are confined to specific sandboxes, like web browsers or mobile apps. Current research faces three major hurdles: the Environment Gap, where agents lack interaction with multi-purpose operating systems; the Control Gap, where models lack a robust "thinking chain" to recover from errors; and the Precision Gap, where general-purpose VLMs struggle to output exact pixel coordinates for small UI elements.

ScreenAgent addresses these gaps by providing a novel VLM agent designed to control real-world computer environments (Linux and Windows) through a continuous "Planning-Acting-Reflecting" loop.

The ScreenAgent Framework

The core of ScreenAgent is an automated control pipeline that enables continuous interaction with a desktop environment via VNC.

The ScreenAgent system architecture, illustrating the interaction between the VLM agent and the computer environment through a Planning-Acting-Reflecting loop.

The framework operates in three distinct phases:

  1. Planning: Upon receiving a high-level task (e.g., "Start the presentation from the third slide"), the agent decomposes it into logical sub-tasks based on the current screen state.
  2. Acting: The agent generates low-level mouse or keyboard actions (e.g., click(114, 360)) based on the provided screenshot.
  3. Reflecting: After execution, the agent observes the new screen state. It assesses whether the sub-task succeeded, needs a retry, or requires a complete replan. This "closed-loop" approach is critical for robustness, allowing the agent to self-correct.
A detailed flowchart of the ScreenAgent control pipeline, showing the iterative process of subtask execution and situational assessment.

The ScreenAgent Dataset

To train and evaluate the model, the authors introduced the ScreenAgent Dataset, a high-quality collection of 273 complete task sessions. It includes 3,903 screenshots across 39 sub-task categories such as Office, Entertainment, and OS Operations. Unlike datasets focused solely on HTML elements, this dataset captures raw pixel interactions on Linux and Windows desktops. The annotation process involved a "Human-in-the-loop" approach where GPT-4V's initial responses were human-corrected to create "golden" action sequences.

Experimental Results

ScreenAgent was evaluated using a new metric called the CC-Score (Agent Computer Control Score), which uses an alignment algorithm to compare predicted action sequences with ground truth, accounting for action types, button choices, and coordinate accuracy.

Key findings include:

  • Precision Supremacy: In mouse positioning accuracy, ScreenAgent scored 0.51, vastly outperforming GPT-4V (0.12) and LLaVA-1.5 (0.03). This demonstrates ScreenAgent's ability to hit small UI targets that general-purpose models miss.
  • Competitive Reasoning: ScreenAgent achieved an overall CC-Score of 0.61, nearly matching GPT-4V’s 0.63, despite being a more specialized model.
  • Instruction Following: The model achieved a 1.00 F1 score in "Reflecting Situation Assessment," matching GPT-4V in judging its own success or failure.

Conclusion and Limitations

ScreenAgent demonstrates the potential for VLMs to serve as generalist computer control agents. However, limitations remain. The model currently operates on single frames, lacking temporal memory for dynamic UI elements like animations. Additionally, while the reflection phase improves robustness, fine-grained reflection tasks (F1 score of 0.52) still show room for improvement, sometimes requiring human intervention for complex troubleshooting. Future work will focus on enhancing temporal reasoning and further closing the "human gap" in complex task execution.

Summary updated

BibTeX
@inproceedings{niu2024screenagent,
  author = {Runliang Niu and Jindong Li and Shiqi Wang and Yali Fu and Xiyu Hu and Xueyuan Leng and He Kong and Yi Chang and Qi Wang},
  title = {{ScreenAgent: A Vision Language Model-driven Computer Control Agent}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=EASZr8neEX},
}
Figure