NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Video2Code: Generating Interactive Webpages from UI Videos via Action-Aware Revisit

Mingde Xu, Zhen Yang, Yan Wang, Yu Wang, Xijun Liu, Zijun Dou, Wenyi Hong, Xiaotao Gu, Bin Xu, Jie TangarXiv 2026

TL;DR

Video2Code introduces a novel coarse-to-fine framework for generating fully interactive webpages directly from UI interaction videos. By utilizing an action-aware revisit mechanism, it identifies and re-inspects critical interaction boundaries at high resolution, significantly improving the functional correctness of generated front-end code over standard video-language models.

What Problem Does This Paper Address?

Traditional UI-to-code generation relies heavily on static screenshots, which only capture layout and static appearance. This approach completely misses dynamic behaviors like dropdown menus, form inputs, or scroll-triggered transitions. While UI videos offer a natural solution by recording these interactive states, current video Vision-Language Models (VLMs) struggle to process them effectively.

Because standard video VLMs rely on sparse frame sampling or aggressive temporal compression to fit context budgets, they suffer from state-transition misalignment. They frequently miss brief but critical action boundaries (like a quick click or selection), resulting in generated code that looks visually correct initially but fails to function when a user interacts with it.

Figure 1: Motivating example of UI video-to-code generation. Static screenshots capture isolated UI states, while sparse video observation may miss short action boundaries. Video2Code revisits action-critical regions to recover complete state-action-state transitions for executable webpage behavior.

Methods

The authors frame UI video-to-code generation as an executable state-transition recovery problem. Instead of uniformly allocating its visual token budget across an entire video, Video2Code uses a two-round Action-Aware Revisit process:

  1. Coarse Video Reading: The model processes the entire video at a low temporal resolution to capture the global layout and interaction flow. During this pass, it predicts the exact timestamps of action-critical segments (e.g., clicks, text inputs, scrolls).
  2. Focused Segment Revisit: The model invokes a temporal clipping tool (extract_multi_segment) to extract these specific action-critical regions and re-examine them at a much higher temporal resolution.

Finally, the model combines the global context from the first pass with the high-resolution local evidence from the second pass to generate the complete, self-contained HTML, CSS, and JavaScript code.

Overview of the Video2Code architecture, illustrating the coarse-to-fine action-aware revisit mechanism.

Datasets

  • WebVidCoding: A new training dataset consisting of 12,000 fully annotated action-aligned video-code pairs (4,000 synthetic and 8,000 real-world examples) used to fine-tune the base model.
  • WebVideo2Code-Bench: A newly introduced evaluation benchmark containing two subsets: WebVideo2Code-Real (85 real-world webpages manually recorded from diverse domains) and WebVideo2Code-Syn (76 synthetic webpages generated via automated browser exploration).

Key Insights and Ideas

  • Transitions over Frames: For interactive UI generation, the fundamental unit of observation is not a single informative frame, but the complete state-action-state transition.
  • Smart Budget Allocation: Uniformly increasing video frame rates introduces massive computational overhead. Video2Code proves that a targeted, tool-based "revisit" strategy preserves both global context and fine-grained local details efficiently.
  • Action-Scroll Grouping: The authors discovered that some actions (like clicking a navigation link) require a subsequent scroll to reveal the new state. Grouping these dependent actions into a single segment prevents the model from losing contextual dependencies during clipping.

Key Results

  • Substantial Functional Boost: On the WebVideo2Code-Real benchmark, Video2Code dramatically boosted the functional correctness of its base open-source model (GLM-4.6V) from 29.85% to 61.99%, while also improving visual similarity from 70.94% to 82.06%.
  • Outperforming Larger Models: It significantly outperforms larger open-source baselines like Qwen3.5-122B-Thinking (which achieved 43.21% functional correctness) and approaches the performance of top-tier closed-source models like Gemini-3.1-Pro (71.64%).

Limitations and Future Work

  • Scope of Web Apps: The current benchmark focuses primarily on publicly accessible pages and does not cover complex scenarios involving user authentication, paywalls, personalization, or heavy backend-dependent logic.
  • Interaction Primitives: The verification tool and model are limited to common actions (clicks, text entry, selections, scrolls). It does not yet support advanced interactions like drag-and-drop, file uploads, canvas manipulations, or long-horizon external API workflows.

Summary updated

BibTeX
@misc{xu2026video,
  author = {Mingde Xu and Zhen Yang and Yan Wang and Yu Wang and Xijun Liu and Zijun Dou and Wenyi Hong and Xiaotao Gu and Bin Xu and Jie Tang},
  title = {{Video2Code: Generating Interactive Webpages from UI Videos via Action-Aware Revisit}},
  year = {2026},
  eprint = {2606.20711},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.20711},
}
Figure