MemFlow: Memoria Adaptativa Fluida para Narrativas Largas Consistentes y Eficientes
MemFlow: Flowing Adaptive Memory for Consistent and Efficient Long Video Narratives
December 16, 2025
Autores: Sihui Ji, Xi Chen, Shuai Yang, Xin Tao, Pengfei Wan, Hengshuang Zhao
cs.AI
Resumen
El principal desafío para la generación de video en streaming es mantener la coherencia del contenido en contextos largos, lo que impone altos requisitos en el diseño de la memoria. La mayoría de las soluciones existentes mantienen la memoria comprimiendo los fotogramas históricos mediante estrategias predefinidas. Sin embargo, los diferentes fragmentos de video a generar deberían hacer referencia a distintas claves históricas, algo difícil de satisfacer con estrategias fijas. En este trabajo, proponemos MemFlow para abordar este problema. Específicamente, antes de generar el siguiente fragmento, actualizamos dinámicamente el banco de memoria recuperando los fotogramas históricos más relevantes utilizando la indicación textual de dicho fragmento. Este diseño permite una coherencia narrativa incluso si ocurren nuevos eventos o hay cambios de escenario en fotogramas futuros. Además, durante la generación, solo activamos los tokens más relevantes en el banco de memoria para cada consulta en las capas de atención, lo que garantiza eficazmente la eficiencia de generación. De esta manera, MemFlow logra una coherencia excepcional en contextos largos con una carga computacional insignificante (una reducción de velocidad del 7.9% en comparación con el baseline sin memoria) y mantiene la compatibilidad con cualquier modelo de generación de video en streaming que utilice KV cache.
English
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.