Taming Teacher Forcing for Masked Autoregressive Video Generation

Deyu Zhou, Quan Sun, Yuang Peng, Kun Yan, Runpei Dong, Duomin Wang, Zheng Ge, Nan Duan, Xiangyu Zhang

Abstract

We introduce MAGI, a hybrid video generation framework that combines masked modeling for intra-frame generation with causal modeling for next-frame generation. Our key innovation, Complete Teacher Forcing (CTF), conditions masked frames on complete observation frames rather than masked ones (namely Masked Teacher Forcing, MTF), enabling a smooth transition from token-level (patch-level) to frame-level autoregressive generation. CTF significantly outperforms MTF, achieving a 23% improvement in FVD scores on first-frame conditioned video prediction. To address issues like exposure bias, we employ targeted training strategies, setting a new benchmark in autoregressive video generation. Experiments show that MAGI can generate long, coherent video sequences exceeding 100 frames, even when trained on as few as 16 frames, highlighting its potential for scalable, high-quality video generation.

Introduction

Autoregressive (AR) video generation typically faces a trade-off between computational efficiency and temporal consistency. Patch-level AR models capture temporal causality well but are slow, while frame-level masked modeling allows for parallel generation but often suffers from a significant training-inference gap. We present MAGI (Masked Autoregressive video GeneratIon), a framework that bridges these approaches to enable high-quality, long-term video synthesis.

The Training-Inference Gap

A primary challenge in masked video modeling is "exposure bias." Traditional models use Masked Teacher Forcing (MTF) during training, where the model predicts the next frame based on partially masked history. However, at inference, the model must predict based on its own fully generated (unmasked) frames. This discrepancy causes errors to accumulate, leading to drift and incoherence in long sequences.

Comparison of Masked Teacher Forcing (MTF) and Complete Teacher Forcing (CTF) during training and inference.

Methods: Complete Teacher Forcing and Hybrid Modeling

MAGI introduces Complete Teacher Forcing (CTF) to align training with inference. In CTF, the model predicts masked patches in frame $t$ by conditioning on the complete, unmasked ground truth of frames $1$ through $t-1$. This ensures the model learns to generate from the same "complete frame" distribution it will encounter during real-world generation.

Spatial-Temporal Transformer

The architecture utilizes a Spatial-Temporal Transformer with interleaved 2D spatial attention and 1D causal temporal attention. By enforcing temporal causality, MAGI becomes compatible with KV Caching, allowing inference time to scale linearly rather than quadratically with video length.

Robustness Strategies

To further combat exposure bias, we employ two key strategies:

  1. Dynamic Interval Training: Randomly sampling frames at different frame rates to help the model generalize across different motion speeds.
  2. Dynamic Noise Injection: Adding Gaussian noise to the teacher frames during training, which prepares the model to handle the imperfect, slightly noisy frames it generates during inference.

Experimental Results

MAGI was evaluated on the Kinetics-600 and UCF-101 benchmarks. On Kinetics-600, MAGI achieved a state-of-the-art FVD score of 11.5, significantly outperforming other AR models like Omni (32.9) and Phenaki (36.4).

Ablation study showing the visual impact of CTF, noise injection, and interval training on video coherence.

As shown in the qualitative analysis, the combination of CTF and robustness strategies eliminates the artifacts and blurriness common in standard teacher forcing methods. MAGI maintains motion and structural integrity for sequences exceeding 100 frames, even when the training window is limited to 16 frames.

Conclusion

By taming teacher forcing through the CTF mechanism and leveraging causal temporal modeling, MAGI provides a scalable and high-quality solution for autoregressive video generation. The framework effectively eliminates the training-inference gap, setting a new standard for long-term video coherence in generative models.

Summary updated

BibTeX
@inproceedings{zhou2025taming,
  author = {Deyu Zhou and Quan Sun and Yuang Peng and Kun Yan and Runpei Dong and Duomin Wang and Zheng Ge and Nan Duan and Xiangyu Zhang},
  title = {{Taming Teacher Forcing for Masked Autoregressive Video Generation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  url = {https://openreview.net/forum?id=YVWIOSFExI},
}
Figure