MovieChat: From Dense Token to Sparse Memory for Long Video Understanding

Enxin Song, Wenhao Chai, Guanhong Wang, Yucheng Zhang, Haoyang Zhou, Feiyang Wu, Haozhe Chi, Xun Guo, Tian Ye, Yanting Zhang, Yan Lu, Jenq-Neng Hwang, Gaoang Wang

TL;DR

MovieChat introduces a sparse memory mechanism that allows Large Language Models (LLMs) to understand ultra-long videos (over 10,000 frames) on consumer-grade hardware. By mimicking human memory to consolidate dense visual tokens into a compact long-term representation, it achieves a 10,000× improvement in VRAM efficiency per frame compared to existing methods.

What Problem Does This Paper Address?

Current Multi-modal Large Language Models (MLLMs) excel at describing images or short video clips, but they hit a "memory wall" when faced with long-form content like movies or TV episodes.

The challenge is three-fold:

  1. Computational Complexity: Standard Transformer architectures have a quadratic relationship between sequence length and computation.
  2. Memory Cost: Storing dense visual tokens for thousands of frames quickly exceeds the VRAM of even high-end GPUs.
  3. Temporal Connections: Maintaining a coherent understanding of an event that happened 10 minutes ago while processing the current frame is difficult without a specialized storage structure.

Existing systems typically handle only a few dozen frames, making them unsuitable for true "long video" understanding.

Methods

The authors propose MovieChat, a framework inspired by the Atkinson-Shiffrin human memory model, which distinguishes between short-term and long-term memory.

Figure 2. Illustration of MovieChat. MovieChat extracts video features with a sliding window and represents them in token form, which are then sequentially fed into the short-term memory frame by frame. When the fixed-length short-term memory reaches its preset limit, the earliest tokens are popped and consolidated into the long-term memory. MovieChat incorporates two distinct inference modes: the global mode, which exclusively utilizes the long-term memory, and the breakpoint mode, which additionally incorporates the current short-term memory as part of the video representation. The breakpoint mode allows for understanding the video at a specific moment in time. After passing through a projection layer, the video representation is inputted into a large language model for interaction with the user.
  • Visual Feature Extraction: It uses a pre-trained ViT-G/14 and a Q-former to extract tokens from video frames.
  • Short-term Memory (S): A First-In-First-Out (FIFO) buffer stores dense tokens from a sliding window of frames.
  • Memory Consolidation: This is the "secret sauce." When the short-term buffer is full, the system calculates the cosine similarity between adjacent frames. It greedily merges the most similar pairs using weighted averaging, transforming dense tokens into a sparse representation.
  • Long-term Memory (L): These consolidated sparse tokens are stored here, allowing the model to retain a "summary" of the entire video without the memory overhead of every single frame.
  • Dual Inference Modes:
    • Global Mode: Uses only long-term memory to answer questions about the whole video.
  • Breakpoint Mode: Concatenates long-term memory, short-term memory, and the current frame to answer questions about a specific moment.

Datasets

The researchers evaluated MovieChat on standard short-video benchmarks (MSVD-QA, MSRVTT-QA, and ActivityNet-QA) but recognized a lack of long-video benchmarks. To fill this gap, they introduced:

  • MovieChat-1K: A new benchmark consisting of 1,000 high-quality long video clips (mostly 10,000–12,000 frames) sourced from movies and TV series. It includes 14,000 manual annotations, featuring dense captions, global QA pairs, and timestamped breakpoint QA pairs.
Statistics of the MovieChat-1K dataset across categories, video lengths, and question types.

Key Insights and Ideas

  • Sparse is Better than Sampled: Traditional methods often just sample every $N$-th frame, which can miss critical, brief actions. MovieChat’s consolidation preserves information by merging redundant frames rather than deleting them.
  • Extreme VRAM Efficiency: By moving from dense to sparse tokens, the average VRAM cost per frame drops from ~200MB to just 21.3KB.
  • Human-Centric Design: The "Breakpoint Mode" acknowledges that video understanding isn't just about the whole; it's about the context of the now relative to the past.
Figure 1. VRAM cost under gigabyte (GB) (y-axis) v.s. frame number (x-axis) comparison. We test the visual-only inference of all methods at a resolution of 224 × 224 without frame sampling. While the previous method can only support around 100 frames of inference, MovieChat can handle videos with >10K frames on a 24GB graphics card. MovieChat has a 10000× advantage over other methods in terms of the average increase in VRAM cost per frame (21.3KB to ∼200MB per frame).

Key Results

  • Scaling: MovieChat can process videos with >10,000 frames on a single 24GB GPU. Previous state-of-the-art models typically crashed or ran out of memory after ~100 frames.
  • Accuracy: On the MovieChat-1K test set (Global Mode), MovieChat achieved an accuracy of 62.3%, significantly outperforming baselines like VideoChat (57.8%) and Video-LLaMA (51.7%), despite those models being given sampled versions of the same videos.
  • Short Video Performance: Surprisingly, even though it's optimized for long videos, MovieChat achieved a new SOTA on the MSVD-QA benchmark with 75.2% accuracy.

Limitations and Future Work

  • Perception Bottlenecks: The model's ultimate performance is still limited by the pre-trained visual encoders it relies on. If the encoder misses a small detail in a single frame, the memory consolidation might not be able to recover it.
  • Temporal Precision: While MovieChat understands what happened, it still struggles with precise temporal localization (e.g., "Exactly how many seconds did the man hold the door?").
  • Memory Aggregation: The current method uses simple concatenation for breakpoint mode; the authors suggest that more sophisticated aggregation techniques could further improve performance.

Summary updated

BibTeX
@inproceedings{song2023moviechat,
  author = {Enxin Song and Wenhao Chai and Guanhong Wang and Yucheng Zhang and Haoyang Zhou and Feiyang Wu and Haozhe Chi and Xun Guo and Tian Ye and Yanting Zhang and Yan Lu and Jenq-Neng Hwang and Gaoang Wang},
  title = {{MovieChat: From Dense Token to Sparse Memory for Long Video Understanding}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure