arXiv:2611.02928cs.MMNov 2026

Manuscript Offprint

arXiv:2611.02928

Lab2Sim: Turning Real-World Experiment Videos into Interactive Virtual Experiments

Xusen Hei, Jiali Chen, Jinyu Yang, Yi Cai

Abstract

Science experiment videos demonstrate how experiments are performed, but offer no direct interaction for learners. Turning them into virtual experiments requires not only reproducing the observed apparatus and state changes, but also enforcing the preconditions governing each operation. We introduce Lab2Sim, a benchmark of 218 science experiment videos with evidence-grounded specifications and 11,881 rubric items. To address this task, we propose EduVideo2Code, which extracts experimental procedures hierarchically, encodes them as explicit state machines to guide code generation, and refines the resulting pages through execution-based verification. Experiments show that existing multimodal models readily generate runnable pages but struggle to faithfully reconstruct experimental apparatus. EduVideo2Code consistently improves all four evaluation dimensions across two backbone models, with apparatus fidelity gains of 24.15 points¹.

1 Introduction

Scientific experiment videos provide an accessible way to learn how experiments are performed, but learners can only observe rather than conduct them. Automatically converting these videos into browser-based virtual experiments could bridge this gap and make hands-on scientific learning more accessible. However, such conversion requires two capabilities: fidelity and operability. Fidelity requires reproducing the apparatus, experimental procedure, and observable state transitions shown in the video, while operability requires enabling learners to perform each step under the correct preconditions and observe the expected results.

Existing work addresses these requirements only partially. Front-end code generation methods reconstruct webpages from visual references, including screenshots, design specifications, and screen

recordings, with recent benchmarks evaluating their functional correctness and interactive behavior (Si et al., 2025; Yun et al., 2024; Li et al., 2025; Lu et al., 2026b,a; Zhu et al., 2025; Chen et al., 2026a; Xu et al., 2026b; Chen et al., 2026b; Ji et al., 2026; Dai et al., 2026). However, reconstructing interface transitions does not require inferring the physical states of experimental materials or the procedural constraints governing laboratory operations. Scientific video understanding methods recognize experimental events and reason about scientific phenomena (Song et al., 2025; Zhao et al., 2025; Hu et al., 2026; Xu et al., 2026c; Zou et al., 2025; Hasson et al., 2025; Chen et al., 2025), but primarily produce textual answers or explanations rather than interactive environments. Thus, a key challenge remains: how can a system translate what happens in an experiment video into a virtual experiment that is both faithful to the demonstration and operable by learners?

We address this question with Lab2Sim, a benchmark of 218 chemistry, physics, and biology experiment videos, each paired with a video-grounded specification of its apparatus, ordered steps, preconditions, and state transitions. From these specifications, we derive 11,881 rubric items to evaluate both fidelity and operability by executing the generated pages in a browser. Building on this benchmark, we propose EduVideo2Code, a compile-verify-repair framework that bridges video understanding and interactive implementation. The framework first extracts experimental procedures through coarse-to-fine video analysis, then compiles them into an explicit state machine that guides code generation, and finally verifies and repairs the generated page through browser execution. By making experimental logic explicit and grounding refinement in observed behavior, EduVideo2Code aims to move beyond generating pages that merely run toward virtual experiments that faithfully reproduce real procedures.

¹Our dataset and code will be released at the project page: https://black1948.github.io/lab2sim

Figure

Figure 1: Motivating example of experiment video-to-simulation generation.

Experiments with six multimodal models reveal a substantial gap between executability and fidelity: although more than 93% of directly generated pages are runnable, no model achieves 60% apparatus fidelity. EduVideo2Code improves all four evaluation dimensions on both tested backbone models, with gains of up to 24.15 points in apparatus fidelity. Ablations further show that all three stages contribute to performance. These findings demonstrate that converting experiment videos into usable learning environments requires not only code generation, but also explicit procedural modeling and execution-based verification.

Our contributions are as follows: (i) We introduce Lab2Sim, a benchmark of 218 real-world experiment videos with evidence-grounded specifications and 11,881 executable rubric items for evaluating the fidelity and operability of generated virtual experiments. (ii) We propose EduVideo2Code, a framework that combines hierarchical procedure extraction, state-machine-driven code generation, and execution-based verification and repair. (iii) We establish the gap between page executability and experimental fidelity through evaluations of six multimodal models, and demonstrate consistent improvements from EduVideo2Code across four evaluation dimensions.