Abstract
Multimodal Large Language Models (MLLMs) have significantly improved performance across various image-language applications. Recently, there has been a growing interest in adapting image pre-trained MLLMs for video-related tasks. However, most efforts concentrate on enhancing the vision encoder and projector components, while the core part, Large Language Models (LLMs), remains comparatively under-explored. In this paper, we propose two strategies to enhance the model's capability in video understanding tasks by improving inter-layer attention computation in LLMs. Specifically, the first approach focuses on the enhancement of Rotary Position Embedding (RoPE) with Temporal-Aware Dual RoPE, which introduces temporal position information to strengthen the MLLM's temporal modeling capabilities while preserving the relative position relationships of both visual and text tokens. The second approach involves enhancing the Attention Mask with the Frame-wise Block Causal Attention Mask, a simple yet effective method that broadens visual token interactions within and across video frames while maintaining the causal inference mechanism. Based on these proposed methods, we adapt LLaVA for video understanding tasks, naming it Temporal-Considered LLaVA (TC-LLaVA). Our TC-LLaVA achieves new state-of-the-art performance across various video understanding benchmarks with only supervised fine-tuning (SFT) on video-related datasets.
Introduction
Most current Multimodal Large Language Models (MLLMs) were originally designed for static images. When adapted for video, these models typically treat a video as a long sequence of concatenated image frames. However, this "video-as-images" approach suffers from two major flaws: Temporal Neglect and Uniform Attention.
Standard LLMs use position embeddings that track token order but lack an explicit understanding of "time" or "frames," making it difficult to track complex motions. Furthermore, standard causal attention masks restrict visual tokens from interacting bidirectionally within a frame, which is unnecessarily restrictive for visual understanding. These issues often lead to "hallucinations," where the model identifies objects correctly but fails to grasp the sequence or nature of actions.
Methodology
To address these limitations, we introduce TC-Attention, which modifies the LLM's attention layer through two primary innovations: Temporal-Aware Dual RoPE and the Frame-wise Block Causal Attention Mask.
Temporal-Aware Dual RoPE (TAD-RoPE)
Standard models use Rotary Position Embeddings (RoPE) to provide token order. TC-LLaVA augments this with a second layer of temporal information. It assigns a global position ID to maintain the overall sequence while also assigning a specific "frame ID." All visual tokens within the same frame share the same temporal ID, allowing the model to distinguish between spatial relationships within a frame and temporal dynamics across frames.
Frame-wise Block Causal Attention Mask (FwBC)
In standard LLMs, the attention mask is strictly causal (triangular), preventing a token from attending to subsequent tokens. TC-LLaVA introduces a mask that allows visual tokens within the same frame to have bidirectional interaction. While visual tokens can "see" each other regardless of sequence order within a frame, the model maintains the causal constraint for text generation and across different time steps to prevent the model from looking into the future of the video during reasoning.
Experiments and Results
TC-LLaVA was trained using a massive collection of 783k video instruction samples aggregated from sources like VideoChat, NextQA, and Kinetics. The model was evaluated on standard open-ended benchmarks (MSVD-QA, MSRVTT-QA, ActivityNet-QA, TGIF-QA) and the rigorous MVBench.
Key Findings
- State-of-the-Art Performance: TC-LLaVA (based on a 7B parameter Vicuna model) set new records on MSVD-QA (78.8% accuracy) and TGIF-QA (78.2% accuracy).
- Superior Temporal Reasoning: On the MVBench average score, TC-LLaVA (56.6%) significantly outperformed GPT-4V (43.5%), particularly in tasks requiring temporal ordering and action sequences.
- Architectural Generalization: The TC-Attention mechanism provided consistent performance boosts of 1-2% when tested on different base models like Llama-3 and Mistral.
- Hyperparameter Sensitivity: The ratio between global and temporal positioning (the $\gamma$ factor) was found to peak at 1.0. Excessive temporal weighting can distort the spatial understanding learned during image pre-training.
Conclusion
TC-LLaVA demonstrates that the internal attention mechanism of the LLM, rather than just the vision encoder, is a critical bottleneck for video understanding. By rethinking how visual tokens interact spatially and temporally, TC-LLaVA achieves superior performance without requiring massive architectural changes. Future work will explore scaling these mechanisms for longer video sequences and further refining the vision-language projector.
Summary updated