Do-Undo: Generating and Reversing Physical Actions in Vision-Language Models

Shweta Mahajan, Shreya Kadambi, Hoang Le, Munawar Hayat, Fatih PorikliarXiv 2025 · DOI

Abstract

Modern Vision-Language Models (VLMs) excel at image generation but often lack a fundamental understanding of physical cause-and-effect. We introduce the Do-Undo task and benchmark, which requires models to simulate a physical transformation and then accurately reverse it to restore the original scene state. By enforcing physical reversibility, we encourage models to develop physics-aware scene dynamics rather than surface-level pixel edits. Our framework utilizes a consistency loss and a prompt expansion strategy on a curated dataset of 24,000 reversible actions from real-world egocentric videos. Experimental results demonstrate that our approach significantly reduces hallucinations and improves object identity persistence compared to state-of-the-art baselines.

Introduction

While modern VLMs like Qwen or Flux generate impressive imagery, they frequently fail to maintain "physical common sense" across sequential edits. For instance, asking a model to "open a refrigerator" followed by "close the refrigerator" often results in a final image where objects have disappeared or the environment has fundamentally shifted. This highlights a gap where models treat editing as pixel manipulation rather than physical simulation. They struggle with physical reversibility—the principle that many real-world actions have a corresponding inverse that should restore the environment's previous state. The Do-Undo framework addresses this by treating physical reversibility as a core learning objective, essential for applications in Embodied AI and robotics.

Methods

The authors propose the Do-Undo framework, which focuses on three primary components to bridge the gap between image editing and physical simulation:

  1. Reversible Action Learning: The model is trained on pairs of images representing a "Forward" action ($I_{initial} \to I_{final}$) and a "Reverse" action ($I_{final} \to I_{initial}$).
  2. Consistency Loss: To ensure the model doesn't just "hallucinate" a new version of the starting scene, a specific loss function is introduced: $L_c = \|I_o - \hat{I}_R\|_1$. This explicitly penalizes the model if the "undone" image ($\hat{I}_R$) differs from the original input image ($I_o$).
  3. Prompt Expansion Strategy: Recognizing that simple labels like "open drawer" are ambiguous, they use a VLM (Qwen-VL) to generate detailed, context-rich prompts. These include details about hand posture, spatial relationships, and the specific mechanics of the action (e.g., "pulling it backward until it is fully opened").
The Do-Undo data generation pipeline, involving frame quality filtering, reversible action selection, and prompt expansion.

The baseline architecture is built on BAGEL, a unified VLM that uses a transformer backbone with rectified flow matching for image generation.

Datasets

The Do-Undo Dataset is derived from the EpicKitchens dataset, consisting of real-world egocentric videos of kitchen tasks. It contains 24,000 training samples and a balanced test set of 662 samples. The dataset features 20 common reversible actions such as pick-up/put-down, open/close, turn-on/turn-off, and remove/place. Unlike existing datasets that focus on object addition/removal or style changes, Do-Undo focuses strictly on physical manipulations where the background and non-target objects must remain consistent.

Results and Insights

The researchers compared their approach against heavyweights like Qwen-Image, BAGEL, and FluxKontext. Quantitatively, the Do-Undo trained model achieved higher DINO-R scores (measuring similarity between the "undone" image and the original) and better Instruction Fidelity (IF) as judged by Gemini 2.5.

Qualitatively, the "Undo" task acts as a powerful regularizer. Baseline models frequently hallucinated new objects when performing actions—for example, opening a freezer might cause the model to "invent" new frozen goods that weren't there before. In side-by-side comparisons, baseline models often failed to reverse actions or changed the identity of objects (e.g., a wooden bowl becoming a ceramic one). The Do-Undo model maintained object identity and background stability much more effectively.

Qualitative comparison showing baseline models (Qwen, Bagel) failing to accurately reverse actions or maintain object identity, while the proposed method succeeds.

Conclusion

The Do-Undo task demonstrates that reversibility is a critical litmus test for physical grounding in VLMs. By enforcing consistency, models learn to associate specific verbs with pixel-level transformations while maintaining global scene coherence. Future work will address limitations such as camera motion in egocentric data and extending the benchmark to complex dynamics like fluid manipulation or deformable objects.

Summary updated

BibTeX
@misc{mahajan2025do,
  author = {Shweta Mahajan and Shreya Kadambi and Hoang Le and Munawar Hayat and Fatih Porikli},
  title = {{Do-Undo: Generating and Reversing Physical Actions in Vision-Language Models}},
  year = {2025},
  eprint = {2512.13609},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.13609},
}
Figure