MA-LMM: Memory-Augmented Large Multimodal Model for Long-Term Video Understanding

Bo He, Hengduo Li, Young Kyun Jang, Menglin Jia, Xuefei Cao, Ashish Shah, Abhinav Shrivastava, Ser-Nam Lim

TL;DR

MA-LMM addresses the computational bottlenecks of long-term video understanding by processing video frames sequentially in an online manner and storing historical context in a compressed memory bank. This plug-and-play framework eliminates the context-length and GPU memory limitations of traditional Large Multimodal Models (LMMs), achieving state-of-the-art performance across multiple long-video benchmarks.

What Problem Does This Paper Address?

Large Multimodal Models (LMMs) excel at short video tasks but struggle significantly when scaled to long-form videos (such as movies or instructional cooking videos). Traditional models typically concatenate features from all video frames and feed them simultaneously into a Large Language Model (LLM).

This approach hits two major bottlenecks: it quickly exceeds the strict context length limits of LLMs (often 2048 tokens), and it causes GPU memory consumption to skyrocket. While some methods use naive average pooling to compress temporal data, they lose crucial temporal dynamics. MA-LMM aims to solve this by enabling efficient, long-term temporal modeling without blowing up hardware requirements.

Methods

The authors introduce MA-LMM (Memory-Augmented Large Multimodal Model), which shifts from offline batch processing to an online, auto-regressive framework. Instead of feeding all frames at once, MA-LMM processes frames sequentially and maintains a Long-Term Memory Bank consisting of two components:

  1. Visual Memory Bank: Caches raw static visual features from a frozen visual encoder (EVA-CLIP ViT-G/14).
  2. Query Memory Bank: Caches dynamic, evolving queries from a trainable Querying Transformer (Q-Former).

To prevent the memory bank from growing indefinitely, they propose a novel Memory Bank Compression (MBC) technique. Instead of a standard First-In-First-Out (FIFO) queue that discards old information entirely, MBC computes the cosine similarity between temporally adjacent tokens and averages the most similar ones. This retains early historical context while removing temporal redundancies. The final aggregated memory is fed into a frozen LLM (Vicuna-7B) for text generation.

Figure 2. (a) Framework overview. MA-LMM auto-regressively processes video frames in an online manner. Two long-term memory banks are designed to store the raw visual features and learned queries at each timestep, which are used for future reference. The Q-Former is composed of several cascaded blocks, indexed by l. LLM outputs text for various video understanding downstream tasks. The snowflake icon indicates components with fixed parameters, while the flame icon denotes parts of the model that are fine-tuned. (b) Illustration of the memory bank compression technique, which is applied to maintain the length of the memory bank constant.

Datasets

The model is evaluated across several diverse benchmarks:

  • Long-term Video Understanding: LVU (movie clips, 1-3 mins), Breakfast (cooking activities, ~2.7 mins), and COIN (instructional videos, ~2.36 mins).
  • Video Question Answering: MSRVTT-QA, MSVD-QA (short videos), and ActivityNet-QA (long videos, ~2 mins).
  • Video Captioning: MSRVTT, MSVD, and YouCook2.
  • Online Action Prediction: EpicKitchens-100.

Key Insights and Ideas

  • Constant GPU Memory Footprint: By processing frames sequentially, MA-LMM maintains a nearly flat GPU memory usage (~17 GB) regardless of whether the video has 10 frames or 1,000 frames. This contrasts sharply with standard concatenation methods that crash due to out-of-memory errors beyond 100 frames.
  • Token-Level vs. Frame-Level Compression: Compressing features at the token level (spatial patches across time) significantly outperforms frame-level compression (averaging entire frames). Token-level compression preserves fine-grained spatial details necessary for identifying specific objects or actions.
  • Off-the-Shelf Viability: The long-term memory bank can be integrated into existing image-based LMMs (like InstructBLIP) as a plug-and-play module without retraining, providing an immediate boost in long-video tasks.
  • Information Saturation: Ablation studies show that model accuracy saturates when the memory bank length reaches 10 to 20 tokens, confirming massive temporal redundancy in long videos and proving that compact memory banks are highly effective.
Impact of different memory bank lengths on accuracy

Key Results

  • Long-Video Benchmarks: MA-LMM achieves state-of-the-art results on long-video classification, outperforming the previous best method (S5) on LVU (63.0% vs 59.2% average accuracy), Breakfast (93.0% vs 90.7%), and COIN (93.2% vs 90.8%).
  • Video QA & Captioning: Despite being designed for long videos, it beats or matches competitive baselines on short-video QA (MSRVTT-QA: 48.5%, MSVD-QA: 60.6%) and captioning tasks, outperforming Video-LLaMA across the board.
  • Efficiency: While baseline models scale quadratically or exponentially in memory usage, MA-LMM scales linearly in inference time while keeping memory flat.
GPU Memory consumption vs. Number of Frames

Limitations and Future Work

  • Inference Time Trade-off: Processing frames sequentially reduces GPU memory usage but increases total video processing time, making it slower for extremely long videos compared to parallel processing methods.
  • Future Directions: The authors suggest a hierarchical approach—dividing massive videos into smaller segments, processing segments sequentially, and modeling inter-segment relationships to balance memory efficiency and speed. They also propose replacing the image-based visual encoder with a video- or clip-based encoder to better capture short-term dynamics.

Summary updated

BibTeX
@misc{he2024ma,
  author = {Bo He and Hengduo Li and Young Kyun Jang and Menglin Jia and Xuefei Cao and Ashish Shah and Abhinav Shrivastava and Ser-Nam Lim},
  title = {{MA-LMM: Memory-Augmented Large Multimodal Model for Long-Term Video Understanding}},
  year = {2024},
  eprint = {2404.05726},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.05726},
}
Figure