Mixture of Contexts for Long Video Generation

Shengqu Cai, Ceyuan Yang, Lvmin Zhang, Yuwei Guo, Junfei Xiao +8 more
8/28/2025
cs.GRcs.AIcs.CV

No confident code implementation found for this paper.

Abstract

Long video generation is fundamentally a long context memory problem: models must retain and retrieve salient events across a long range without collapsing or drifting. However, scaling diffusion transformers to generate long-context videos is fundamentally limited by the quadratic cost of self-attention, which makes memory and computation intractable and difficult to optimize for long sequences. We recast long-context video generation as an internal information retrieval task and propose a simple, learnable sparse attention routing module, Mixture of Contexts (MoC), as an effective long-term memory retrieval engine. In MoC, each query dynamically selects a few informative chunks plus mandatory anchors (caption, local windows) to attend to, with causal routing that prevents loop closures. As we scale the data and gradually sparsify the routing, the model allocates compute to salient history, preserving identities, actions, and scenes over minutes of content. Efficiency follows as a byproduct of retrieval (near-linear scaling), which enables practical training and synthesis, and the emergence of memory and consistency at the scale of minutes.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{cai2025mixture,
  title  = {Mixture of Contexts for Long Video Generation},
  author = {Shengqu Cai and Ceyuan Yang and Lvmin Zhang and Yuwei Guo and Junfei Xiao and Ziyan Yang and Yinghao Xu and Zhenheng Yang and Alan Yuille and Leonidas Guibas and Maneesh Agrawala and Lu Jiang and Gordon Wetzstein},
  year   = {2025},
  eprint = {2508.21058},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.21058v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2508.21058.svg)](https://codeofpaper.com/paper/2508.21058)

Discussion