VidCompress: Memory-Enhanced Temporal Compression for Video Understanding in Large Language Models

Xiaohan Lan, Yitian Yuan, Zequn Jie, Lin MaarXiv 2024 · DOI

TL;DR

This paper introduces VidCompress, a novel Video-LLM that tackles the challenge of processing long videos by employing a "dual-compressor" architecture. This approach effectively compresses visual information while preserving crucial temporal relationships, leading to significant improvements in video understanding tasks.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown remarkable capabilities in understanding and generating human language. Extending these models to understand videos (Video-LLMs) opens up exciting possibilities. However, current Video-LLMs often treat videos as a simple sequence of individual frames. This approach struggles with capturing the intricate temporal dynamics within videos, leading to difficulties in understanding fine-grained details and processing longer video sequences due to the limited capacity of visual tokens that LLMs can handle. Essentially, the models are overwhelmed by the sheer amount of information and miss the nuanced connections between different parts of a video.

Methods

VidCompress introduces a novel "dual-compressor" architecture to address these limitations. This architecture consists of two main components:

  1. Memory-Enhanced Compressor: This component is designed to capture both short-term (inter-frame) and long-term (across clips) temporal relationships. It utilizes a multiscale transformer with a memory-cache mechanism. This mechanism allows the model to retain contextual information from previous video segments, enabling it to understand how events unfold over extended periods.
  2. Text-Perceived Compressor: This component focuses on generating condensed visual tokens that are relevant to the text or question being asked. It leverages a Q-Former (similar to those used in other vision-language models) to compress frame-wise visual features and then integrates temporal contexts using cross-attention, guided by the memory-enhanced compressor's output.

These two compressors work in tandem to produce two distinct types of visual tokens. These tokens are then adapted to the LLM's semantic space and fed into the LLM along with textual instructions to generate a response. The training process involves two stages: modality alignment and instruction tuning, with specific modules being frozen or unfrozen to optimize learning.

Datasets

The paper mentions using several datasets for training and evaluation:

  • Training:
    • LLaMA-VID dataset (790K image-text and video-text pairs) for modality alignment.
  • VideoChat2 dataset (230K video QA pairs) for instruction tuning, specifically to test temporal reasoning.
  • Evaluation:
    • VideoQA Datasets: MSVD-QA, MSRVTT-QA, and ActivityNet-QA.
  • Comprehensive Benchmarks: MVBench, Video-MME, LVBench, and MMBench-Video.

Key Insights and Ideas

  • Dual-Compressor Approach is Key: The paper strongly suggests that a single compression strategy isn't enough. Combining a memory-enhanced compressor for broad temporal understanding with a text-perceived compressor for task-specific relevance is crucial for effective video comprehension.
  • Memory Cache for Long-Term Dependencies: The memory-cache mechanism in the enhanced compressor is vital for bridging temporal gaps and understanding events that span significant durations, a common challenge in long videos.
  • Efficiency Matters: By compressing visual tokens before they reach the LLM, VidCompress significantly reduces the computational burden, making it more feasible to process longer videos without sacrificing performance.
  • Clip Size Optimization: The study highlights that an optimal clip size (specifically 8 frames in their experiments) is critical for balancing performance and efficiency, with both smaller and larger sizes leading to suboptimal results on certain benchmarks.

Key Results

VidCompress demonstrates strong performance across various benchmarks:

  • VideoQA Datasets: The model achieves competitive results on MSVD-QA, MSRVTT-QA, and ActivityNet-QA, with particular strength on ActivityNet-QA, which features longer videos and diverse activities.
  • Comprehensive Benchmarks: VidCompress outperforms comparable open-source Video-LLMs on benchmarks like Video-MME, MMBench-Video, and LVBench, especially those involving longer videos. For instance, it achieves around 3% higher performance on Video-MME compared to VideoChat2 and Video-LLaVA.
  • Qualitative Examples: The paper showcases qualitative results where VidCompress accurately answers questions about text on a keychain, identifies object colors, and correctly reorders steps in a cooking video, demonstrating its fine-grained visual recognition and temporal reasoning capabilities.

Limitations and Future Work

  • Limitations:
    • The memory-enhanced compressor is trained from scratch, which might limit its performance compared to pretrained components in some scenarios.
  • Performance on shorter videos is comparable but not significantly superior, suggesting the benefits of the compression strategy are more pronounced for longer sequences.
  • The optimal memory cache size varied across benchmarks, indicating potential for further refinement in memory management.
  • Future Work: The paper suggests that VidCompress offers valuable insights for future research in enhancing temporal interactions in Video-LLMs. The success of the dual-compressor architecture and memory-enhanced temporal modeling points towards continued exploration in these areas for more robust and efficient video understanding models.

Summary updated

BibTeX
@misc{lan2024vidcompress,
  author = {Xiaohan Lan and Yitian Yuan and Zequn Jie and Lin Ma},
  title = {{VidCompress: Memory-Enhanced Temporal Compression for Video Understanding in Large Language Models}},
  year = {2024},
  eprint = {2410.11417},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.11417},
}
Figure