# Learning-to-Memorize: Dynamic Context Management for Long-Horizon Autoregressive Video Generation

*Haowei Zhu, Qijie Wang, Jia Li, XING WANG, Tianyu Zhao, Jiexi Wang, Xurui Peng, Xinglong Wu, Jun-Hai Yong, Bin Wang*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/154562) · [Open on the map](../papers.html#p154562)

Category: [Video Understanding & Generation](../pcat/3.md) › [Video Diffusion Memory and Control](../pgroup/262.md) · Type: new method · Keywords: video generation, autoregressive models, context memory management, importance prediction, dynamic memory, teacher-student distillation

Areas: [Memory](../areas/memory.md) › Long-horizon memory › Video generation memory; [Long Context](../areas/longcontext.md) › Video Sequence Modeling › Long video memory

## Summary
Learning-to-Memorize (L2M) introduces a learned context memory management framework that dynamically retains, evicts, and evolves historical frames based on predicted importance, improving long-horizon autoregressive video generation.

## Explained to a 5-year-old
Making long videos one frame at a time is hard because mistakes can build up. The paper creates a smart way to remember which past frames are important. It decides which old frames to keep and which to forget based on how useful they are. It also updates the memory so that the remembered parts stay fresh as the scene changes. This helps the video stay clear, moving, and varied for a long time.

## Explained to a 5-year-old, longer
When we make a video by guessing each picture one after another, it works well for short clips. But if we try to make a very long video, small mistakes can get bigger and bigger. The old ways of remembering past pictures either forget everything old or keep the very first pictures forever. This can make the video look blurry, the motion stop, or the scenes repeat. The new idea is to teach a computer to decide which past pictures are most useful. It looks at each old frame and predicts how important it might be for the rest of the video. Based on that prediction, it keeps the good frames and discards the ones that are not needed. It also updates the memory so that if a scene changes, the remembered frames can be refreshed. The system uses a special training trick that helps it work even when some past frames are noisy. It also uses a teacher-student method to make the memory management stable and efficient. All of this is done while using a limited amount of memory, like a small notebook. As a result, the generated long videos stay clear, have natural motion, and show diverse scenes.

## For a technical reader
The paper introduces Learning-to-Memorize (L2M), a framework that dynamically manages context during autoregressive video generation. It predicts the importance of each previously generated frame using a router, then decides which frames to keep in a limited memory buffer. A degradation-aware training scheme and an exponential moving average update keep the memory fresh and robust. Teacher-student distillation and sparsity regularization ensure efficient use of a fixed KV-cache budget. Experiments show L2M improves stability and visual fidelity over existing baselines.

## Problem
Generating long videos autoregressively is difficult because errors accumulate over time, and static context management strategies either discard important long-range information or keep outdated frames, leading to degraded fidelity, motion stagnation, and reduced diversity.

## Method
The approach uses an importance prediction router to estimate relevance of historical frames, a degradation-aware training scheme to handle noisy context, and a dynamic memory initialization and evolution mechanism that updates long-term memory with exponential moving average scores, combined with teacher-student distillation and sparsity regularization to efficiently use a fixed KV-cache budget.

## Contributions
The paper introduces a learned context memory management framework that dynamically retains, evicts, and evolves historical frames based on predicted importance, includes degradation-aware training and an EMA-based memory update, and demonstrates improved stability and fidelity in long-horizon video generation.

## Research questions this paper is counted under

- [How can long-horizon video generation maintain temporal and spatial consistency?](../q/6.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/154562)
