MemFlow: Flowing Adaptive Memory for Consistent and Efficient Long Video Narratives

Sihui Ji, Xi Chen, Shuai Yang, Xin Tao, Pengfei Wan +1 more
12/16/2025
cs.CV

No official code found. Best implementation: KlingAIResearch/MemFlow (211 stars, Apache-2.0, last commit 2025-12-29).

Abstract

The core challenge for streaming video generation is maintaining the content consistency in long context, which poses high requirement for the memory design. Most existing solutions maintain the memory by compressing historical frames with predefined strategies. However, different to-generate video chunks should refer to different historical cues, which is hard to satisfy with fixed strategies. In this work, we propose MemFlow to address this problem. Specifically, before generating the coming chunk, we dynamically update the memory bank by retrieving the most relevant historical frames with the text prompt of this chunk. This design enables narrative coherence even if new event happens or scenario switches in future frames. In addition, during generation, we only activate the most relevant tokens in the memory bank for each query in the attention layers, which effectively guarantees the generation efficiency. In this way, MemFlow achieves outstanding long-context consistency with negligible computation burden (7.9% speed reduction compared with the memory-free baseline) and keeps the compatibility with any streaming video generation model with KV cache.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Official Implementation of "MemFlow: Flowing Adaptive Memory for Consistent and Efficient Long Video Narratives"

2119Shell, PythonDec 14, 20259 months agoApache-2.0

Similar Papers

Cite this paper

@article{ji2025memflow,
  title  = {MemFlow: Flowing Adaptive Memory for Consistent and Efficient Long Video Narratives},
  author = {Sihui Ji and Xi Chen and Shuai Yang and Xin Tao and Pengfei Wan and Hengshuang Zhao},
  year   = {2025},
  eprint = {2512.14699},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.14699v1}
}

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/2512.14699.svg)](https://codeofpaper.com/paper/2512.14699)

Discussion