Introduction
Video-language models, essential for tasks like action recognition and semantic search, are traditionally computationally expensive. Their cost scales quadratically with both the number of video frames and the internal embedding dimensions. This creates a significant deployment hurdle: a model optimized for a high-end GPU server cannot run on a mobile device, and a model designed for efficiency often lacks the depth required for complex long-form video understanding.
AdaVid addresses this by introducing a flexible transformer-based framework that allows a single model to dynamically adjust its computational footprint at inference time. By adapting hidden embedding dimensions, AdaVid scales from high-performance execution to ultra-efficient edge deployment without the need for retraining multiple models.
Methodology
The core innovation of AdaVid is the Adaptive Transformer Layer. Unlike standard transformers with fixed embedding dimensions ($D$), AdaVid is trained to handle varying dimensions ($d \le D$) on the fly. This is achieved through two primary mechanisms:
1. Matryoshka-style Slicing
For Feed-Forward Networks (FFN), the model employs a technique inspired by Matryoshka Representation Learning. It utilizes the upper-left $d \times d$ submatrix of the weights. This ensures that the most critical "coarse" information is prioritized in the lower dimensions, while higher dimensions provide the "fine" details necessary for high-accuracy tasks.
2. Adaptive Attention
Rather than reducing the size of individual attention heads, which can be computationally awkward, AdaVid reduces the number of active heads. For instance, a model with 12 heads at full capacity might drop down to 3 heads in a low-compute mode, significantly reducing the FLOPs required for self-attention.
Key Insights and Ideas
- The "Dropout" Regularization Effect: Training a model to be adaptive often improves its performance even at full capacity. The authors suggest that forcing the model to remain accurate at low dimensions acts as a form of regularization, preventing over-reliance on specific parameters.
- Strategic Dimension Ordering: Research indicated that gradually decreasing the embedding dimension in deeper layers (
d-dec) is more effective than increasing it. This aligns with the intuition that early layers should capture broad features, while deeper layers can compress high-level concepts into a smaller subspace. - Frames vs. Dimensions Trade-off: AdaVid allows for a flexible compute budget. On benchmarks like Diving48, the model can process more frames at a lower dimension, outperforming heavier models by capturing more temporal context for the same computational cost.
Experimental Results
AdaVid was evaluated on massive datasets including Ego4D and Diving48, as well as long-form benchmarks like EgoSchema.
- Efficiency: AdaVid-EgoVLP matches state-of-the-art performance on short video benchmarks while utilizing 50% less compute.
- Long-Form Performance: On the LongVideoRetrieval task, the AdaVid-Aggregator achieved a Recall@1 of 16.6, more than doubling the 7.1 achieved by the standard EgoVLP baseline.
- Action Recognition: On Diving48, AdaVid achieved 82.2% accuracy using 128 frames, outperforming a standard TimeSformer-L (81.0%) while requiring 2.5x fewer FLOPs.
Conclusion and Future Work
AdaVid demonstrates that a single, elastic model can effectively replace a suite of specialized models for different hardware targets. While highly effective, future work remains in optimizing "adaptive retrieval"—using low-dimensional embeddings for fast initial searches followed by high-dimensional reranking—and exploring more sophisticated sampling strategies for layer-wise dimension reduction.
Summary updated