TL;DR
This paper introduces AdaCodec, a novel "predictive visual code" for video Multimodal Large Language Models (MLLMs). By intelligently encoding only the changes between frames (motion and residuals) instead of full frames, AdaCodec significantly reduces the number of visual tokens processed, leading to faster inference and improved performance across various video understanding tasks.
What Problem Does This Paper Address?
Existing video MLLMs typically process videos by encoding each sampled frame as an independent image. This approach is highly inefficient due to the temporal redundancy inherent in videos – adjacent frames often share a lot of the same visual information (objects, background, layout). This redundancy leads to a "coverage-detail dilemma": to capture fine-grained temporal information, models need to process many frames, which quickly exhausts their limited context windows and increases latency. Conversely, sampling fewer frames to save tokens can lead to missing important short-term events or transitions. AdaCodec aims to solve this by creating a more efficient visual interface that leverages temporal redundancy.
Methods
AdaCodec re-imagines the video input for MLLMs as a "predictive visual code." Instead of sending full RGB frames, it adopts a strategy inspired by video compression codecs:
- Adaptive Group of Pictures (GOP): Videos are segmented into Groups of Pictures (GOPs). Each GOP starts with an "I-frame" (intra-coded, fully encoded) and is followed by "P-frames" (predictive frames).
- Predictive Cost (pcost): AdaCodec adaptively decides when to insert an I-frame. It calculates a "predictive cost" for each frame, estimating how difficult it would be to predict from the previous frame. If this cost exceeds a threshold, a new I-frame is inserted to capture significant scene changes or novel content.
- Compact P-tokens: For frames that are predictable (low pcost), AdaCodec doesn't encode them as full RGB images. Instead, it generates compact "P-tokens" that represent the inter-frame changes. These P-tokens are derived from motion vectors (describing pixel movement) and residual signals (the difference between the predicted and actual pixel values).
- Dual-Branch Architecture: A specialized dual-branch architecture is used. One branch encodes the I-frames using a standard ViT, while a "P-tokenizer" encodes the P-frames into compact tokens.
- Two-Stage Training: The model is trained in two stages: first, to learn the P-tokenizer's ability to reconstruct features from motion and residuals, and second, to align these visual codes with the language model for multimodal tasks.
Datasets
The paper evaluates AdaCodec on eleven public video benchmarks across three categories:
- Long-video: MLVU, LongVideoBench, LVBench
- Temporal: TempCompass, MotionBench, TOMATO
- General video-understanding: Video-MME, MVBench, NEXT-QA, PerceptionTest, EgoSchema
The paper does not introduce new benchmarks but focuses on adapting existing ones to its efficient visual code.
Key Insights and Ideas
- Predictive Coding for MLLMs: The core idea of applying predictive coding principles (transmitting errors/changes rather than the full signal) to the visual interface of MLLMs is a significant departure from standard frame-by-frame encoding.
- Adaptive GOPs are Crucial: The adaptive nature of GOP construction, driven by a "pcost" threshold, is key. It allows the model to dynamically adjust the number of full frames based on video content, avoiding unnecessary token generation for static scenes and capturing important changes.
- Motion and Residuals are Rich Enough: The paper demonstrates that motion vectors and residuals, when encoded as compact tokens, retain sufficient information for complex video understanding tasks, even outperforming full RGB frames at a fraction of the token budget.
- Efficiency Doesn't Necessarily Mean Accuracy Loss: AdaCodec shows that significant efficiency gains (fewer tokens, faster inference) can be achieved without sacrificing, and often by improving, accuracy.
Key Results
- Token Efficiency: AdaCodec reduces visual token usage by up to 84.6% compared to per-frame RGB baselines. Even at 1/7th of the token budget (32k tokens), AdaCodec surpasses the 224k token baseline on long-video benchmarks.
- Speed Improvements: Time-to-first-token (TTFT) is cut from 9.26s to 1.62s, and total end-to-end latency (E2EL) is reduced from 11.18s to 3.20s on general video benchmarks.
- Accuracy Gains: AdaCodec improves accuracy across all eleven benchmarks. On long-video tasks, it achieves the best open-source results. On general video benchmarks, it raises the average score while significantly cutting latency.
- Adaptive GOP Behavior: The adaptive GOP mechanism leads to longer GOPs for stable videos (e.g., anomaly recognition, tutorials) and shorter ones for dynamic content (e.g., egocentric videos), demonstrating content-dependent efficiency.
Limitations and Future Work
- Fixed Input Resolution: The current implementation uses a fixed input resolution. The authors suggest future work could explore dynamic resolution inputs.
- Uniform P-frame Token Budget: AdaCodec uses a uniform token budget for all P-frames. Adapting this budget based on per-frame motion or residual complexity could further improve efficiency.
- Streaming Video: While AdaCodec's structure is amenable to streaming, it was not explicitly evaluated in this context. The authors believe it has the potential to support streaming with high frame rates and reduced latency.
Summary updated