← Latest papers
🤖 AI

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

Video2Code is an action-aware framework that enhances UI video-to-code generation by identifying and revisiting critical action regions at higher temporal resolution to accurately recover executable state transitions, thereby significantly improving functional correctness in complex interactive webpages.

Original authors: Mingde Xu, Zhen Yang, Yan Wang, Yu Wang, Xijun Liu, Zijun Dou, Wenyi Hong, Xiaotao Gu, Bin Xu, Jie Tang

Published 2026-06-23
📖 5 min read🧠 Deep dive

Original authors: Mingde Xu, Zhen Yang, Yan Wang, Yu Wang, Xijun Liu, Zijun Dou, Wenyi Hong, Xiaotao Gu, Bin Xu, Jie Tang

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you want to teach a robot how to build a specific, interactive website. You could show the robot a single, static photograph of the site. The robot would do a great job copying the colors, the layout, and the buttons. But here's the problem: a photo can't tell the robot what happens when you click a button, type in a box, or scroll down the page. The photo is frozen in time; it misses the "magic" of how the site actually works.

Alternatively, you could show the robot a video of someone using the site. This is much better because it captures the movement. However, current AI models watching these videos are like people with very short attention spans. They might glance at the video, see a few frames, and miss the tiny, split-second moment where a user clicks a button and a menu pops up. If the AI misses that split-second transition, it can't write the code to make the menu pop up. It builds a beautiful shell, but the inside is broken.

Enter "Video2Code."

The researchers behind this paper created a new method called Video2Code. Think of it as a smart, two-step detective process for teaching an AI to build websites from videos.

The Problem: The "Blurry Snapshot"

Most AI models try to understand a whole video by taking a few "snapshots" (frames) spaced far apart.

  • The Analogy: Imagine trying to understand a magic trick by looking at a photo taken before the magician pulls a rabbit out of a hat, and another photo taken after the rabbit is gone. You see the hat and the rabbit, but you have no idea how the rabbit got there. You might guess the rabbit was there the whole time, or you might think the hat is just a picture of a rabbit.
  • The Result: The AI misses the "action boundaries"—the precise moment a user interacts with the screen. Without seeing that moment clearly, the AI can't write the code to make the interaction happen.

The Solution: The "Action-Aware Revisit"

Video2Code changes the game by acting like a detective who knows exactly where to look closely. It doesn't waste time staring at the boring parts of the video; it zooms in on the exciting parts.

Step 1: The Coarse Scan (The Wide-Angle Lens)
First, the AI watches the whole video quickly, just like you might flip through a book to find the interesting chapters. It doesn't try to understand every detail yet. Instead, it asks: "Where did the user click? Where did they type? Where did something change?" It marks these spots as "Action-Critical Regions."

Step 2: The Revisit (The Magnifying Glass)
Once it knows where the important stuff happened, the AI uses a special tool to "revisit" those specific moments. It pauses the video and watches those few seconds in high definition and slow motion.

  • The Analogy: It's like a film editor who sees a scene where a character opens a door. Instead of just watching the whole movie once, the editor cuts out just the 3 seconds of the door opening, slows it down, and studies the handle turning, the latch clicking, and the door swinging.
  • The Result: Now the AI sees the entire sequence: the state before the click, the click itself, and the state after the click.

The Training: Learning from a Timeline

To teach the AI to do this, the researchers didn't just show it random videos. They created a special dataset called WebVidCoding.

  • They recorded videos of people using real websites.
  • They added a tiny, invisible "marker" (like a color-changing bar at the bottom of the screen) that flashed exactly when a user clicked or typed.
  • This gave the AI a perfect "timeline" to learn from: "When the bar turns red, that's the click. Watch what happens right before and right after."

The Results: Does it Work?

The researchers tested Video2Code against other top AI models.

  • Visuals: All models were good at making the website look right.
  • Functionality: This is where Video2Code shined. While other models built websites that looked good but didn't work (the buttons didn't do anything), Video2Code built websites that actually behaved like the video.
  • The "Dense" Test: The improvement was most obvious in videos with lots of steps (clicking, scrolling, typing in a row). Other models got confused by the complexity, but Video2Code, by revisiting the critical moments, figured out the logic.

In a Nutshell

Video2Code is a system that stops AI from just "glancing" at a video. Instead, it teaches the AI to spot the important moments, zoom in, and study them closely before writing the code. This ensures that the final website doesn't just look like the video; it actually acts like the video, capturing the full "state-action-state" dance of a real user interaction.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →