NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Context as Memory: Scene-Consistent Interactive Long Video Generation with Memory Retrieval

Jiwen Yu, Jianhong Bai, Yiran Qin, Quande Liu, Xintao Wang, Pengfei Wan, Di Zhang, Xihui Liu · DOI

Introduction

Modern video generation models, such as Sora and Kling, have achieved remarkable success in producing short, fluid video clips. However, these models often struggle with "long-term drift"—a phenomenon where the model "forgets" the initial state of a scene after the camera moves away. In interactive applications like virtual walkthroughs, this leads to a lack of spatial consistency; returning to a previously visited location often results in a completely different environment. To address this, researchers have introduced Context-as-Memory, a framework that treats historical frames as a retrievable memory bank to ensure pixel-perfect scene consistency over long durations.

The Challenge of Long-Term Memory

Existing solutions for video consistency typically rely on sliding windows or lossy compression. Sliding windows only consider the most recent frames, leading to gradual divergence from the original scene. Compression methods attempt to summarize the past into latent vectors, but this often discards the fine-grained details necessary for maintaining architectural or environmental consistency. The primary challenge is providing the model with access to the entire historical context without incurring prohibitive computational costs.

The Context-as-Memory Framework

The proposed framework solves the memory problem through two key innovations:

  1. Direct Frame Conditioning: Instead of using complex 3D reconstructions or feature embeddings, the system stores previous frames in their raw pixel format. When generating a new frame, relevant historical frames are concatenated with current noise latents. This allows the Diffusion Transformer (DiT) to attend directly to past pixels, ensuring "lossless" memory retrieval.
  2. Camera-Aware Memory Retrieval: To maintain efficiency, the model uses a rule-based retrieval module. By leveraging the camera's 6-DoF trajectory, the system calculates the Field of View (FOV) overlap between the current frame and all historical frames. It only retrieves frames that share a visible region with the current view.
Visualization of a camera trajectory used for FOV-based memory retrieval.

Dataset and Benchmarking

To evaluate the framework, the authors developed the UE5 Scene-Consistent Dataset. Using Unreal Engine 5, they rendered 100 high-quality videos, each spanning 7,601 frames, across 12 distinct environments (e.g., cities, forests, industrial sites). Each frame is annotated with precise camera poses and automated captions. The model was also tested on "unseen" open-domain images, such as screenshots from Black Myth: Wukong, to demonstrate its generalization capabilities.

Key Results and Performance

Context-as-Memory significantly outperforms state-of-the-art methods like Diffusion Forcing (DFoT) and FramePack in maintaining long-term consistency. In quantitative tests measuring "History Context Comparison" (the ability to reconstruct a scene upon return), the model achieved a PSNR of 18.11, compared to 15.70 for DFoT.

Qualitative results showing consistent frame generation across diverse scenes and complex trajectories.

Qualitatively, the model maintains the exact placement of windows, trees, and architectural details even after 1,000+ frames of navigation. Furthermore, by retrieving only approximately 20 relevant frames at a time, the system maintains a generation speed of nearly 1 FPS, making it viable for interactive use.

Conclusion and Future Work

Context-as-Memory demonstrates that raw pixel retrieval guided by geometric heuristics is a powerful strategy for long-term video consistency. While the current model assumes static scenes and can be challenged by complex occlusions, it provides a robust foundation for future "world models." Future work will focus on handling dynamic objects and scaling the architecture to larger parameter counts to further reduce error accumulation in complex open-domain environments.

Summary updated

BibTeX
@inproceedings{yu2025context,
  author = {Jiwen Yu and Jianhong Bai and Yiran Qin and Quande Liu and Xintao Wang and Pengfei Wan and Di Zhang and Xihui Liu},
  title = {{Context as Memory: Scene-Consistent Interactive Long Video Generation with Memory Retrieval}},
  booktitle = {SIGGRAPH Asia},
  year = {2025},
  doi = {10.1145/3757377.3763833},
}
Figure