Search

Search papers and lessons

Learning Interactive Real-World Simulators (UniSim)

Sherry Yang, Yilun Du, Kamyar Ghasemipour et al. · 2023

UniSim is a video diffusion model that predicts the next video frames from past frames and an action given as text, robot controls or camera motion, so it can act as a simulator.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Architectures
  • Generative models
  • Neural network basics
  • Inference
  • Sign in to see your progress

TL;DR

UniSim is a video generation model that works as a simulator of the real world. It takes a few recent frames and an action, written as a sentence, a robot motor command or a camera motion, and generates the video that the action would produce. Trained on many datasets that each cover a different part of the world, it reaches 5.6B parameters and can be rolled out step by step for long interactions.

Where you'll see it: training robot and vision-language policies on simulated experience, and generating synthetic video to train captioning models when real footage is scarce.

The problem

A simulator that can show the visual result of any action would let people interact with scenes, let robots practice without risk, and produce training data cheaply. The obstacle is data. Each kind of dataset covers one part of the world and leaves the rest out. Paired text-image data has rich scenes but little motion. Video captioning and question-answering data has high-level descriptions but little motion detail. Human activity data has rich human action but little mechanical motion. Robot data has rich robot action but is small. Because these datasets come from different communities with different purposes, their information does not line up, and a single model cannot learn all of it from any one of them.

Key idea

UniSim puts all of these data sources into one interface: action in, video out. Every action is converted to a common continuous representation, and every clip is converted to video of varying length. A video diffusion model is then trained to predict the next observation from past frames and the action. The paper frames this as an observation prediction model. Because the output is a video segment that feeds back into the input, the model can be rolled out repeatedly, which lets it simulate long interactions.

Picture a film editor who has watched footage from many different sets. Given the last few shots and an instruction such as "open the drawer," the editor can cut the next shot, using what each source taught about how the world looks and moves.

The method

Unifying the action space

The paper converts each data source into the same action format.

  • Simulated renderings (Habitat navigation, Language Table) use text descriptions as actions when available. Continuous control values are encoded with language embeddings and concatenated with discretized controls.
  • Real robot data (Bridge, RT-1 and RT-2 data) uses task descriptions as high-level actions, plus discretized controls when present.
  • Human activity videos (Ego4D, EPIC-KITCHENS, Something-Something V2) have their labels turned into text actions, and the videos are subsampled to a frame rate that captures meaningful action.
  • Panorama scans (Matterport3D) have no actions, so the paper builds actions such as "turn left" from camera poses between frames.
  • Text-image data (LAION) treats each image as a one-frame video and its caption as the action, so a caption such as "a person walking" carries the motion.

Text actions are processed with T5 language embeddings and concatenated with low-level controls, which gives the final unified action space.

Observation prediction

The simulator is defined as a model of p(ot∣ht−1,at−1)p(o_t \mid h_{t-1}, a_{t-1}), the distribution of the next observations oto_t given history ht−1h_{t-1} and action at−1a_{t-1}. An ideal model would condition on the whole past. The paper finds that conditioning on a finite set of recent frames is enough and much simpler, so the history is just the most recent frames.

Diffusion parametrization

The conditional distribution is modeled with a diffusion model. The denoiser ϵθ(ot(k),k∣ht−1,at−1)\epsilon_\theta(o_t^{(k)}, k \mid h_{t-1}, a_{t-1}) predicts the noise in a noisy observation at step kk, and it is trained with the usual noise-prediction loss:

LMSE=∥ϵ−ϵθ(1−β(k) ot+β(k) ϵ,  k ∣ ht−1,at−1)∥2\mathcal{L}_{\text{MSE}}=\left\|\epsilon-\epsilon_{\theta}\Big(\sqrt{1-\beta^{(k)}}\,o_t+\sqrt{\beta^{(k)}}\,\epsilon,\;k\,\Big|\,h_{t-1},a_{t-1}\Big)\right\|^{2}

Here ϵ\epsilon is standard Gaussian noise and β(k)\beta^{(k)} is the noise level at step kk. Sampling starts from pure noise and applies KK denoising steps. The history frames are concatenated channel-wise with the noise, which conditions the model on the past.

The action is applied with classifier-free guidance. The paper writes the guided prediction as

ϵθguided=(1+η) ϵθ(ot(k),k∣ht−1,at−1)−η ϵθ(ot(k),k∣ht−1)\epsilon_\theta^{\text{guided}}=(1+\eta)\,\epsilon_\theta(o_t^{(k)}, k \mid h_{t-1}, a_{t-1}) - \eta\,\epsilon_\theta(o_t^{(k)}, k \mid h_{t-1})

where η\eta sets how strongly the action steers the output. The second term is the prediction without the action. The paper's notation omits the action from it, and this lesson reads it that way. Guidance pushes the output further from the action-free prediction and toward the action.

Architecture and training

The denoiser is a video U-Net with interleaved temporal and spatial attention and convolution layers. History frames are copied to every future frame index, so that each generated frame can attend to them. The full model has 5.6B parameters, trained on 512 TPU-v3 chips for 20 days. The paper's training hyperparameters include learning rate 10−410^{-4}, batch size 256, 1M training steps, and 256 sampling timesteps. The base model is followed by two spatial super-resolution models.

Worked examples

Example 1: guidance arithmetic (illustrative numbers). Let η=2\eta = 2, and take a scalar stand-in for the two predictions: the action-conditioned prediction is 0.50.5 and the action-free prediction is 0.20.2.

  1. Weight the conditioned prediction: (1+2)×0.5=1.5(1+2)\times 0.5 = 1.5.
  2. Subtract the weighted unconditional prediction: 2×0.2=0.42 \times 0.2 = 0.4.
  3. Combine: 1.5−0.4=1.11.5 - 0.4 = 1.1.

Interpretation: the guided output lies beyond the conditioned prediction, so the action effect is amplified. Larger η\eta makes the action matter more at the cost of possible artifacts, and the paper calls η\eta the control of action conditioning strength.

Example 2: how much the history helps (from the paper's Table 1). Compare one conditioning frame with four recent frames, measured on a validation split of Ego4D.

  1. FID: 59.47→34.6359.47 \to 34.63, a drop of 24.8424.84, which is 24.84/59.47≈41.8%24.84 / 59.47 \approx 41.8\%.
  2. FVD: 315.69→211.3315.69 \to 211.3, a drop of 104.39104.39, which is 104.39/315.69≈33.1%104.39 / 315.69 \approx 33.1\%.
  3. The paper's "4 distant" setting, with frames at exponentially increasing distances, reaches FVD 237237, which is worse than "4 recent" at 211.3211.3.

Interpretation: a few recent frames carry most of the information the next frames need. Frames far in the past can hurt, because they are not what the next observation depends on.

Example 3: the distance-reduction metric (illustrative). The paper's RDG metric is RDG=(∥s0−sgoal∥−∥sT−sgoal∥)/∥s0−sgoal∥\text{RDG} = (\|s_0 - s_{\text{goal}}\| - \|s_T - s_{\text{goal}}\|)/\|s_0 - s_{\text{goal}}\|. Suppose the blocks start 0.300.30 from their goal and end 0.120.12 from it.

  1. Initial distance: 0.300.30.
  2. Final distance: 0.120.12.
  3. RDG: (0.30−0.12)/0.30=0.6(0.30 - 0.12)/0.30 = 0.6.

Interpretation: 60% of the initial distance was closed. An RDG of 0 means no progress, and 1 means the goal was reached exactly.

Results

Every number below comes from the paper's text or tables.

Frame conditioning (Table 1). On a validation split of Ego4D, conditioning on one frame gives FID 59.47 and FVD 315.69. Four recent frames give FID 34.63 and FVD 211.3, with the best Inception Score (3.52) and CLIP score (22.63). Four distant frames give FID 34.89 and FVD 237. The paper finds that more than four frames did not help on Ego4D, though it notes that longer memory might matter for navigation.

Mixed data. Naively combining datasets of very different sizes lowers quality on the small ones. Attaching a dataset identifier to the action improves in-distribution quality on those datasets, but the paper found the identifier hurts generalization to other domains. The identifier should only be used when the test domain is in the training distribution.

Long-horizon and stochastic simulation (Figures 4 and 5). The paper shows eight autoregressive interactions in which the simulator keeps track of objects, such as a can and an orange that are moved into drawers and remain there. The model also produces varied outcomes from the same action, such as different objects revealed under a towel or different cup and pen colors, because the diffusion sampling is stochastic.

Hindsight-relabeled vision-language policies (Section 4.1 table). A PaLI-style VLM policy was trained on data from the simulator. The authors generated 10k long-horizon trajectories with 3 to 5 scripted rollouts per trajectory and used each final frame as a goal. On simulated long-horizon Language Table tasks, the reduction in distance to goal is 0.34 for simulator-hindsight data, against 0.07 for the original data on all blocks and 0.11 on moved blocks. The paper says the simulator-trained policy performs three to four times better, and that it transfers to a real robot in zero-shot.

Reinforcement learning in the simulator. A PaLI 3B policy was first trained by behavioral cloning, then improved by REINFORCE on rollouts from UniSim, with a learned reward. The paper compares the RL policy with the behavioral-cloning policy by qualitatively assessing simulated rollouts, and reports that RL training significantly improves the policy across a wide set of tasks, especially "point to blue block". It also reports that the RL policy runs on the real robot in zero-shot and completes tasks such as moving the blue cube to the green circle. The paper gives no numbers for this comparison.

Video captioning from generated data (Table 4). PaLI-X, a 55B vision-language model, was finetuned only on videos generated by UniSim, with captions from ActivityNet. Its CIDEr score on ActivityNet rises from 15.2 with no finetuning to 46.23, which the paper says is 84% of the score from finetuning on real videos. On MSR-VTT, VATEX and SMIT, the model finetuned on generated videos transfers better than the one finetuned on real ActivityNet data, which the paper says overfits to ActivityNet.

Why it mattered

The paper shows that one video diffusion model, trained on heterogeneous data with a single action interface, can simulate visually realistic interactions. It shows that policies trained purely in simulation can transfer to real robots in the paper's settings, and that generated video can improve a vision-language model's captioning.

The paper also lists what it does not solve. The simulator hallucinates when given an action that is impossible in the scene, such as "wash hands" for a tabletop robot. It has limited memory, so an object can vanish when it leaves the conditioning frames. It generalizes poorly to robots and domains absent from training, since it was trained mostly on four robot morphologies. It simulates only visual change, so it is not suited to settings where actions do not change what is seen, such as different grasping forces on a static cup.

Reading guide

Read the paper in this order and use these lessons for the sections that need them.

  1. Introduction and contributions (Section 1): World Model for the simulator idea, and Model-Based Reinforcement Learning for why a simulator helps policy learning.
  2. Orchestrating datasets (Section 2.1): Vision-Language Model for the text-action format used for images and captions. Behavior Cloning explains the robot data that supplies low-level actions.
  3. Observation prediction (Section 2.2): Autoregressive Model for conditioning on past outputs, Diffusion Model for the denoising process, and Denoising Diffusion Probabilistic Models (DDPM) for the noise-prediction loss. Classifier-Free Guidance explains the action guidance, and U-Net for the video architecture.
  4. Ablations (Section 3.2): no new prerequisites. Table 1 reads directly from the history definition above.
  5. Applications (Section 4): Hindsight Experience Replay for relabeling goals in the policy experiment, and Reinforcement Learning with Policy Gradient for the REINFORCE training in Section 4.2.
  6. Limitations (Section 6): no new prerequisites.

Check yourself

QuestionUniSim conditions on the most recent frames instead of the full history. Why does the paper say this helps, and what does it cost?Show answer
Conditioning on a finite set of recent frames simplifies the model: it avoids a recurrent state over the whole past, and the paper finds that four recent frames work better than one frame and better than four distant frames on Ego4D. The cost is memory. Anything outside the recent frames can be forgotten, as the paper's limited-memory example shows, where an apple in a drawer disappears from the simulation.
QuestionUsing the paper's guidance formula with η=3\eta = 3, a conditioned prediction of 0.40.4 and an action-free prediction of 0.10.1, what is the guided value?Show answer
Compute (1+3)×0.4−3×0.1=1.6−0.3=1.3(1+3)\times 0.4 - 3\times 0.1 = 1.6 - 0.3 = 1.3. The guided value lies beyond the conditioned prediction, so the action's effect is amplified relative to the conditioned output.
QuestionThe paper's ablation reports FVD 315.69 with one frame and 211.3 with four recent frames. Why is a percentage reduction a better summary here than the raw difference?Show answer
The percentage makes the two metrics comparable across scales. The FVD drop is 104.39104.39, about 33.1%33.1\% of the one-frame value. A raw difference of 104 would mean little without knowing the starting value, and the same raw difference could be a large or small change depending on the metric. The percentage tells the reader how large the improvement is relative to the baseline.
QuestionA team wants to use a UniSim-style simulator to train a robot that must avoid a kind of obstacle absent from the training data. Based on the paper's limitations, what should they expect and check?Show answer
The paper reports limited out-of-domain generalization, since it was mostly trained on four robot morphologies and generalizes poorly to unseen robots and domains. The team should expect the simulator to be unreliable for the new obstacle, and should check its predictions against real footage before using it for policy learning. They should also check for hallucination when an action is impossible in the scene, which the paper reports as a known failure.

Sources

Read the full paper

Sherry Yang, Yilun Du, Kamyar Ghasemipour et al., 2023. arXiv:2310.06114