Video Multimodal Large Language Models (MLLMs) have demonstrated remarkable capabilities in understanding video semantics across various downstream tasks. However, these models are fundamentally constrained by the "context window" of their underlying Large Language Model (LLM)—the maximum number of tokens they can process simultaneously.
When representing a video, researchers face a difficult trade-off: should they sample many frames with very few details (tokens) per frame, or fewer frames with high spatial detail? Despite advancements in model architectures and training data, the systematic design space of how to optimally represent video context has remained largely unexplored. This paper introduces a mathematical framework to find the optimal balance that maximizes video understanding within a fixed context window.
Methodology: A Constrained Optimization Problem
The authors treat visual context representation as a constrained optimization problem. Using a standard LLaVA-like architecture (incorporating a SigLIP visual encoder and a Qwen2-7B LLM) as their base, they evaluate different strategies for selecting frames and tokens.
The study compares two primary selection strategies:
- Sampling-based methods: Simply picking specific frames uniformly or selecting specific tokens.
- Compression-based methods: Using techniques like MeanPooling to aggregate information across frames or spatial regions.
To formalize this, the authors draw inspiration from text-based scaling laws (like Chinchilla). They model the language modeling loss $\mathcal{L}$ as a function of the number of frames ($T$) and embeddings per frame ($M$):
$$\mathcal{L}(M, T) = C_M \cdot M^{-\alpha} + C_T \cdot T^{-\beta} + L_0$$
By applying Lagrange multipliers, they use this formula to solve for the optimal $T$ and $M$ given a total token limit $L$ (where $T \times M < L$).
Key Insights and Scaling Laws
Through extensive empirical experiments on a massive mix of ~2.5 million image and video instruction samples, several critical insights emerged:
- Compression Trumps Sampling: At both the frame and embedding levels, compression-based methods consistently outperform simple sampling. Pooling preserves essential spatial and temporal cues that are otherwise discarded when frames or tokens are simply dropped.
- Frames are Often More Valuable than Pixels: For many long-video reasoning tasks, increasing the temporal resolution (more frames) is significantly more beneficial than increasing spatial resolution (more tokens per frame).
- Performance Compensation: The authors discovered that the performance drop caused by reducing the number of tokens per frame can be fully compensated for—and even exceeded—by increasing the total number of frames.
- Predictable Sweet Spots: Model performance follows a predictable surface when plotted against frames and tokens. The theoretical "minimum loss" point derived from their mathematical formula closely matched the best-performing configurations in their empirical tests.
Results and Impact
The derived scaling laws provide a predictable, mathematically grounded approach to configuring video MLLMs. For a standard 6K context window, the derived optimal setting was approximately 120 frames with 49 tokens per frame.
Using this optimized representation, the authors' model achieved state-of-the-art results among open-source models on rigorous long-video benchmarks, including VNBench (67.3%) and LongVideoBench (58.4%), even outperforming GPT-4V on certain tasks. Furthermore, the authors demonstrated that their optimal ratio formula generalizes well across different LLM backbones (such as Llama-3) and varying context window sizes ranging from 4K to 126K.
Future Work
While this study provides a robust foundation for LLaVA-like architectures, future work will explore how these scaling behaviors adapt to different architectures, such as those using Mamba or specialized long-context Transformers. Additionally, researchers aim to explore dynamic selection strategies—where the model actively learns which frames or regions are most important to retain—moving beyond uniform pooling or sampling.
Summary updated