Instruction Agent: Enhancing Agent with Expert Demonstration

Yinheng Li, Hailey Hultquist, Justin Wagle, Kazuhito Koishida · Submission to ICLR 2026 · Withdrawn

TL;DR

While graphical user interface (GUI) agents have advanced rapidly, they still stumble on complex, long-horizon tasks and idiosyncratic user workflows. Instruction Agent is a training-free, test-time framework that converts a single human demonstration into step-by-step natural language instructions and executes them reliably using separate grounding, verification, and backtracking modules. On 20 challenging OSWorld tasks that leading autonomous agents completely failed to solve (0% success), Instruction Agent achieves a 60% success rate.

What Problem Does This Paper Address?

State-of-the-art vision-language GUI agents (such as OpenAI's CUA or Agent-S2) interact with digital systems by predicting actions directly from visual screenshots. However, they frequently break down in real-world scenarios due to:

  1. Unintuitive UI elements that defy zero-shot reasoning.
  2. Compounding errors in long-horizon workflows, where overall success degrades exponentially with task length ($P_{\text{success}} = \prod p_i$).
  3. Personalized, non-standard user workflows (e.g., specific browser profiles or saved authentication paths) that cannot be deduced from a general prompt.

Prior efforts to incorporate human demonstrations typically rely on collecting massive trajectory datasets for offline imitation learning, which often fails to generalize to out-of-domain tasks. Simply passing raw demonstration trajectories directly to LLMs at test time has historically proven ineffective.

Methods

Instruction Agent introduces a modular, test-time architecture split into an Instructor and an Actor:

[Expert Demonstration] 
        │ (Screenshots + Mouse/Keyboard Inputs)
        ▼
   [Instructor] (GPT-4o generates step-by-step instructions & expected outcomes)
        │
        ▼
     [Actor]
        ├── 1. UI Grounder (UI-Tars 1.5 7B locates bounding boxes/coordinates)
        ├── 2. Executor (GPT-4o generates PyAutoGUI code)
        ├── 3. Verifier (GPT-4o inspects pre- and post-action screenshots)
        └── 4. Backtracker (Restores previous UI state if verifier flags a failure)
  • The Instructor Model: An ad-hoc recording tool captures pre- and post-action screenshots along with mouse and keyboard inputs. A multimodal LLM (GPT-4o) converts these raw logs into structured natural language instructions. Crucially, instructions describe both the action and its intended functional outcome (e.g., "click the Windows Start icon to open the Start menu").
  • The Actor Pipeline:
  • UI Grounder: Rather than having an end-to-end vision model write code directly, the authors decouple perception from execution. The open-source model UI-Tars 1.5 (7B) identifies UI coordinates based on the instructor's visual cues.
  • Executor: A backend LLM (GPT-4o) translates the high-level command and coordinates into executable Python (pyautogui) code.
  • Verifier: Compares screenshots taken before ($O_{i-1}$) and after ($O_i$) execution to verify whether the step produced the intended outcome.
  • Backtracker: If verification fails, a specialized sub-agent analyzes the current diverged state and the target state to execute recovery actions (e.g., clicking "Back" in a browser or closing an accidental popup) before retrying the step, preventing catastrophic failure cascades.

Datasets

  • OSWorld Benchmark: A standard, open-ended desktop environment evaluation benchmark consisting of 369 tasks across diverse desktop applications.
  • Evaluation Subset: The authors identified 130 tasks that the top three public open-source GUI agents on the OSWorld leaderboard (UI-TARS-1.5, Agent S2 w/ Gemini 2.5, and InfantAgent) all completely failed (0% success). They randomly sampled 20 tasks from this pool to test Instruction Agent's ability to automate previously unsolvable workflows using newly recorded human demonstrations.

Key Insights and Ideas

  • Decoupling Grounding from Code Synthesis: While vision-language grounding models can theoretically output executable code directly, using UI-Tars purely for coordinate prediction and prompting GPT-4o for code generation yielded substantially higher execution stability.
  • Intention-Aware Verification: LLM verifiers struggle to assess success from visual differences alone. Adding explicit descriptions of the expected outcome directly to each step's instruction enables the verifier to distinguish between superficial visual artifacts and true task progress.
  • Localized Backtracking Over Full Restarts: Instead of requiring full environment rollbacks or expensive snapshots, minor missteps (e.g., misclicks or popups) can be recovered using short, localized reverse-action planning, saving the trajectory before it irrecoverably diverges.

Key Results

  • Performance on Hard Tasks: On the 20 OSWorld tasks where top-ranked baselines achieved 0%, Instruction Agent achieved a 60% success rate (approaching the 72.36% human benchmark across OSWorld).
  • Ablation Studies:
  • Full Instruction Agent: 60%
  • Without Backtracker: 45%
  • Without Verifier & Backtracker: 40% In the 20 test tasks, 5 required at least one retry, and 2 required the backtracker to actively restore the UI state after an erroneous action.

Limitations and Future Work

  • Severe Divergence: Backtracking struggles when an error fundamentally breaks the application state beyond simple recovery steps (e.g., closing popups or hitting "Back").
  • Cost and Inference Latency: Relying on proprietary LLM APIs (GPT-4o) across the Instructor, Executor, Verifier, and Backtracker introduces API latency and cost.
  • Future Directions: The authors aim to improve backtracking search policies and evaluate smaller, fine-tuned open-source models capable of running locally on edge devices.

Summary updated

BibTeX
@misc{li2025instruction,
  author = {Yinheng Li and Hailey Hultquist and Justin Wagle and Kazuhito Koishida},
  title = {{Instruction Agent: Enhancing Agent with Expert Demonstration}},
  year = {2025},
  eprint = {2509.07098},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.07098},
}
Figure