arXiv:2611.06544cs.CVNov 2026

Manuscript Offprint

arXiv:2611.06544

MKD2World: A Typed Spatial MarkDown World Model For Web Agents

Zhihao Nan, Sifan Zhou, Yiming Cheng, Jinkai Zheng, Zheng Zhu, Si Shi, Ming Li, Fei Yu

ABSTRACT

Graphical user interface (GUI) agents can improve decision-making with world-model foresight, provided that predicted states accurately reflect post-action interfaces. Existing state representations fail to jointly capture interface layout, UI semantics, and explicit locations. We introduce Typed Spatial Markdown (TSM), a Markdown-style textual state representation for desktop web interfaces. TSM serializes block-level and atomic-level UI elements according to their spatial relationships, jointly encoding their types, visual semantics, explicit locations, optional control states, and hierarchical membership. To train a screenshot-to-TSM renderer, we construct AtomBlock-WebUI, a dataset with precise annotations at both granularities. By injecting element-type labels into HTML and directly extracting bounding boxes after rendering, we avoid annotation errors caused by post-hoc inference from webpage structures. Building on TSM, we propose MKD2World, a desktop web world model trained in two stages for current-state description and action-conditioned next-state prediction. During inference, the web agent queries MKD2World as needed and performs a “digest” step, in which it interprets each predicted state and extracts task-relevant evidence for selecting the best action. Experiments show that MKD2World-9B achieves an EleF1 score of 26.50 on the out-of-domain test set, outperforming GPT-5.6-Sol(14.98) by 11.52 points. Across Online-Mind2Web tasks, MKD2World-9B improves the success rate of the Qwen3.5-35B web agent from 22.94% to 37.61%, achieving competitive performance among leading open-source GUI world models. Code is available at https://github.com/OmniAI-Lab-CUHKSZ/MKD2World.

1 INTRODUCTION

With the development of vision-language models (VLMs), graphical user interface (GUI) agents have become capable of completing interactive tasks in real-world scenarios (Cao et al., 2026a; Hu et al., 2026; Zhou et al., 2026). At each decision step, an agent generates an executable action based on the task objective, current interface, and historical information. However, without sufficient understanding of webpage dynamics—including the functions of user interface (UI) controls and the logic of interface transitions—it may generate ineffective actions that increase interaction costs or cause irreversible errors, such as accidentally deleting important data or leaking private information (Shen et al., 2026b; Liu et al., 2026). Action-conditioned world models offer a promising way to anticipate future interface states before execution, helping agents assess whether candidate actions advance the task while reducing risky real interactions (Mei et al., 2026; Gu et al., 2025).

The usefulness of such foresight depends on what state a world model predicts. Figure 1 compares representative GUI state representations and highlights the desired trade-off: preserving a complete, structured interface state without incurring the cost of pixel-level reconstruction. We argue that, to distinguish the consequences of candidate actions, a predicted state should preserve a complete yet structured account of the post-action interface, including both the elements that change and the surrounding context needed to interpret those changes—their semantics, locations, control states, and

Figure

Figure 1: Comparing GUI state representations for world models. TSM better balances a complete, structured interface state with low reconstruction cost.

structural relations. At the same time, it should avoid the cost and instability of reconstructing every visual detail of a webpage. Existing GUI world models represent states as free-form descriptions of interface changes, structured interface representations such as the Accessibility Tree (AXTree) and Document Object Model (DOM) (Zuo et al., 2026), HTML rendered into webpages (Koh et al., 2026), or images generated directly by image generation models (Guan et al., 2026). Free-form text concisely conveys major changes but loses layout structure and substantial information from the next interface. Common AXTree and DOM serializations preserve parts of the interface structure, yet often omit explicit element locations and have incomplete visual semantics (Wu et al., 2023). Other structured textual representations retain some layout and locations, but support limited element types and omit UI control states, complete visual semantics, or interface block structure (Cao et al., 2026b). HTML-rendered images may omit actual images or deviate from the real layout, whereas pure image-generation approaches are costly and often distort fine-grained text (Zheng et al., 2026; Luo et al., 2025). Thus, these representations do not adequately balance preserving a complete, structured interface state with avoiding the burden of full visual reconstruction. This limits the completeness of the interface information available to a world model and, in turn, to downstream agent reasoning.

To address this bottleneck, we introduce Typed Spatial Markdown (TSM), a structured and spatially grounded state representation for desktop Web interfaces. TSM organizes rendered Web UIs into block-level and atomic-level elements according to their spatial relationships. Each entry encodes its type, visual semantics, bounding box, optional control state, and hierarchical membership, jointly capturing what an element is, where it appears, what it conveys, and how it is organized. Markdown provides a readable hierarchical serialization of this structured state. By retaining the interface information needed to compare action-induced changes without reconstructing the full pixel-level interface, TSM provides a compact and directly comparable state space for action-conditioned world modeling and downstream agent reasoning.

Learning this state space from screenshots requires reliable UI element types and locations. Existing desktop Web UI datasets often extract them from the DOM or AXTree through rule-based parsing (Wu et al., 2023; Gurbuz et al., 2026). However, HTML structures are highly heterogeneous across webpages: tags and class names are typically tied to page styling and interactions, while role attributes are often incomplete, making unified and reliable semantic annotations difficult to obtain (Gou et al., 2025). Post-hoc DOM parsing can therefore assign types to visually invisible elements or yield misaligned bounding boxes; visual models may likewise localize elements away from their actual positions (Fu et al., 2026). To reduce ambiguities introduced by such post-hoc semantic inference, we construct AtomBlock-WebUI. A VLM generates HTML with reference to real webpage layouts and explicitly injects predefined UI element types. After rendering, we directly extract the coordinates of the corresponding typed DOM nodes. This pipeline provides visually aligned type and location supervision for the dual-granularity UI detector in our TSM renderer.

Building on TSM and AtomBlock-WebUI, we introduce MKD2World, an action-conditioned desktop Web world model that predicts future TSM states from screenshots and candidate actions. MKD2World first learns to reconstruct the current interface in the TSM state space, and then learns action-conditioned state transitions with transition-aware objectives that emphasize the elements changed by an action. At inference time, it simulates a next TSM state for each candidate action. We further train the GUI agent to understand TSM and design a digest-based inference strategy, through which the agent interprets predicted typed, spatial, and stateful changes to select the action that best advances the user objective. The main contributions of this work are as follows:

  • Typed Spatial Markdown (TSM). We propose TSM, a structured and spatially grounded Web UI state representation that encodes UI semantics, explicit spatial information, control states, and hierarchical structures, together with a screenshot-to-TSM renderer.

  • AtomBlock-WebUI Dataset. We construct a 9.7k-scale desktop Web UI annotation dataset using a pre-injected automated annotation pipeline, providing element types and bounding boxes for both block-level and atomic-level UI elements to train the dual-granularity UI detector in the screenshot-to-TSM renderer.

  • MKD2World: A TSM World Model for Web Agents. We propose MKD2World, an action-conditioned desktop Web world model that predicts future TSM states from screenshots and candidate actions. MKD2World uses a two-stage training scheme with transition-aware objectives, and supports uncertainty-triggered, digest-based action selection by TSM-aware Web agents.

  • Comprehensive Evaluation and Online Validation. We propose EleF1 to evaluate TSM prediction accuracy, and demonstrate strong out-of-domain prediction and consistent decision-making gains on Online-Mind2Web and VisualWebArena.