Chemistry · Physics · Biology — real-world experiments

Lab2Sim

Turning Real-World Experiment Videos into Interactive Virtual Experiments

>
Xusen Hei* Jiali Chen* Jinyu Yang Yi Cai†
South China University of Technology  ·  The Hong Kong Polytechnic University *Equal contribution   †Corresponding author
0experiment videos
0rubric items
0apparatus fidelity gain
0runnable rate
Motivating example: converting an experiment video into an interactive virtual experiment

From watching to doing: a real experiment video is compiled into a browser-based virtual experiment that reproduces the apparatus, enforces step preconditions, and re-plays the observed state transitions.

Abstract

Runnable pages are easy. Faithful experiments are not.

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. Existing multimodal models readily generate runnable pages — yet no model reaches 60% apparatus fidelity. EduVideo2Code consistently improves all four evaluation dimensions across two backbone models, with apparatus fidelity gains of up to 24.15 points.

Demo

One video in — a working experiment out.

Left: the original “molecular motion” demonstration video from the benchmark. Right: the virtual experiment EduVideo2Code generates from it — every operation is performed live in the browser: drawing phenolphthalein with the pipette, dripping, stirring, pouring, and the solution finally turning red above the concentrated-ammonia bottle, exactly as in the video.

source video Real-world demonstration · molecular motion of ammonia
EduVideo2Code output Generated interactive experiment · browser screen capture
These pages are real, runnable outputs — try them yourself: 🧪 Molecular Motion 🕯️ Candle Combustion 🔥 Sulfur Combustion open in a new tab · start by collecting apparatus from the Stockroom
How it was made
eduvideo2code · compile–verify–repair

          
ready
Benchmark

Lab2Sim: 218 videos, grounded in evidence.

From 500+ public chemistry, physics, and biology videos on Bilibili and YouTube, 218 survived manual screening. A GLM-5.3-series assistant drafts a gold specification for each — apparatus, ordered steps, preconditions, state transitions — and human reviewers verify every draft against the source video (~13 min per video). Fixed templates turn each specification into executable rubric items, plus violation probes that skip, reorder, or misuse steps.

Lab2Sim benchmark construction pipeline Click to enlarge
0instances (videos)chemistry 89 · physics 87 · biology 42
0total rubric items54.5 per instance
0steps / instanceeach with preconditions
0state transitions / instancee.g. flask.solution.color
0mean video durationBilibili + YouTube, ≥720p
0evidence labelsvideo_visible / apparatus_inferred / domain
fidelity

Apparatus Fidelity AF

Is every annotated piece of apparatus present and correctly identified? Spatial layout is not scored — content over pixels.

operability

Procedure Execution PE

Can each demonstrated step be performed on the correct object and complete as specified, checked by replaying the procedure?

operability

Procedural Constraint Compliance PCC

Does the page block a step whose precondition does not hold — and explain why? Violation probes skip, reorder, or misuse steps.

fidelity

State-Transition Fidelity STF

Do initial states and the states after each step match the video, e.g. a solution turning from colorless to pink?

Method

EduVideo2Code: a compile–verify–repair loop.

Video understanding on one side, interactive implementation on the other — bridged by an explicit experiment state machine M = (S, A, Φ) where states assign values to tracked object attributes, operations implement steps, and Φ guards each operation with its precondition.

EduVideo2Code architecture Click to enlarge
01

Hierarchical Procedure Extraction

A coarse pass finds phases, apparatus, and step order; a fine pass re-inspects marked segments with dense, high-resolution sampling for instrument readings, liquid levels, and connections. Every step must cite supporting frames — unverifiable steps are dropped.

02

State-Machine-Driven Generation

The procedure compiles into M = (S, A, Φ). Each operation becomes a direct-manipulation gesture — dragging, pouring, lighting — and each state a visual appearance. Learners perform the experiment instead of replaying an animation. Three design documents (science, layout, asset list) record evidence and asset provenance.

03

Execution-Based Verification

A separate verifier runs the page in a browser: it compares apparatus with the video, attempts invalid operations, and replays the procedure, comparing screenshots and state summaries against video evidence. Below the threshold θ = 0.8, diagnostic feedback triggers targeted repair — up to Tmax = 10 rounds (5.3 on average).

Results

93%+ runnable — but that says little.

All 218 instances, six baselines with direct video-to-code generation vs. EduVideo2Code on two backbones. AF/PE/PCC/STF in %, higher is better except OFR.

Model Rubric dimensions Diagnostics
AF ↑PE ↑PCC ↑STF ↑OFR ↓RR ↑
Direct generation
Seed-2.1-Pro20.6220.1125.1424.6531.0993.12
GLM-5.3-Flash40.4422.5816.3334.4812.9094.95
GPT-6-Astra41.8124.0644.8337.8822.2896.79
GPT-5.6-Sol36.6132.7932.5641.6828.5296.79
DeepSeek-V4.1-Flash59.0936.4836.6741.833.14100.00
Kimi-K354.2328.5722.2244.868.04100.00
EduVideo2Code (ours)
+ GLM-5.3-Flash61.32+20.8837.17+14.5938.33+22.0049.63+15.157.10−5.80100.00+5.05
+ GPT-5.6-Sol60.76+24.1541.40+8.6133.75+1.1945.45+3.7712.38−16.14100.00+3.21
F1

A high Runnable Rate says little about fidelity

All eight systems exceed 93% RR, yet AF spans 20.62 → 61.32 and PE 20.11 → 41.40. A page that loads and responds to clicks is not a page that reproduces the experiment.

F2

Drawing the apparatus is easier than making steps work

For every system AF > PE. Executing steps is also different from guarding them: Kimi-K3 executes well (OFR 8.04) but enforces few constraints (PCC 22.22), while GPT-6-Astra leads PCC at 44.83.

F3

EduVideo2Code lifts both backbones on all dimensions

AF +20.88 (GLM-5.3-Flash) and +24.15 (GPT-5.6-Sol), RR to 100%. Gains vary by dimension: PCC improves by 22.00 for one backbone but only 1.19 for the other.

Ablation — GLM-5.3-Flash backbone, 218 instances (%)
VariantAF ↑PE ↑PCC ↑STF ↑OFR ↓
Direct generation40.4422.5816.3334.4812.90
EduVideo2Code (full)61.3237.1738.3349.637.10
w/o HPE48.24−13.0823.53−13.6422.03−16.3038.10−11.5311.61+4.51
w/o SMG60.03−1.2930.52−6.6532.20−6.1337.50−12.1310.32+3.22
w/o EBV59.77−1.5525.81−11.3622.41−15.9240.05−9.5814.84+7.74

Removing any stage worsens every metric; the three stages depend on one another rather than contributing independently. HPE matters most for AF / PE / PCC, SMG mainly secures correct state transitions, and without EBV the extra interactions specified by the state machine go unrepaired — OFR even rises above direct generation.

Case Study

Four ways a page can fail an experiment.

Candle combustion and molecular motion, evaluated by replaying the demonstrated operations on pages from six baselines and EduVideo2Code.

Qualitative comparison of generated virtual experiments Click to enlarge
BP

Blank Rendering

A candle-combustion page loads without errors — then renders only “[object Object]”. Technical executability does not guarantee a meaningful scene.

WE

Experiment Substitution

For molecular motion, baselines generate a potassium-permanganate or fuchsine diffusion setup instead of the demonstrated ammonia + phenolphthalein — coherent pages of the wrong experiment.

WA

Apparatus Mismatch

A balance-like stand and a bent tube appear where the video shows a candle, a knife, and crucible tongs — undermining every later interaction.

NO

Non-Executable Operations

Visually plausible scenes where lighting the candle or covering the beaker triggers nothing. EduVideo2Code instead reproduces the demonstrated operations and their states — e.g. the solution turning red after ammonia is added.

Citation

BibTeX

bibtex
@article{hei2026lab2sim,
  title   = {Lab2Sim: Turning Real-World Experiment Videos into
             Interactive Virtual Experiments},
  author  = {Hei, Xusen and Chen, Jiali and Yang, Jinyu and Cai, Yi},
  journal = {arXiv preprint arXiv:2611.02928},
  year    = {2026}
}

Lab2Sim sources its videos from public instructional content on Bilibili and YouTube; all apparatus assets in generated pages record their source and license. The benchmark is released for research purposes.