TL;DR
TempMe (Temporal Token Merging) is a novel framework that drastically speeds up text-video retrieval by identifying and merging redundant information across consecutive video frames. By progressively condensing video tokens through a multi-granularity approach, it achieves state-of-the-art performance with 51% fewer GFLOPs, a 95% reduction in output tokens, and a 1.8x inference speedup compared to existing efficient fine-tuning methods.
What Problem Does This Paper Address?
Most modern text-video retrieval systems rely on CLIP (Contrastive Language-Image Pre-training) as their backbone. While CLIP is a powerhouse for understanding images, adapting it to video is computationally expensive. Standard approaches treat a video as a sequence of independent frames, passing each one through a heavy image encoder.
This creates two major bottlenecks:
- Temporal Redundancy: Consecutive frames in a video are often nearly identical. Processing every patch in every frame independently wastes a massive amount of computation on redundant data.
- The Efficiency Paradox: Current "parameter-efficient" fine-tuning methods (like LoRA or Adapters) reduce the number of trainable parameters, but they don't actually reduce the inference cost. The model still has to process the same massive number of tokens, making real-world deployment slow and costly.
Methods
The authors propose TempMe, which introduces a Progressive Multi-Granularity (PMG) framework. Instead of just fine-tuning CLIP, TempMe changes how the model handles data as it flows through the transformer layers.
Key Components:
- ImgMe Block (Spatial Merging): In the early layers, the model merges similar tokens within a single frame. This handles spatial redundancy (e.g., merging multiple patches of a clear blue sky).
- ClipMe Block (Temporal Merging): This is the core innovation. It merges tokens across adjacent frames. If a subject appears in Frame 1 and Frame 2 in roughly the same spot, the ClipMe block merges those tokens into one, effectively "summarizing" the action over time.
- Progressive Merging: The architecture doesn't merge everything at once. It follows a hierarchy: it might start with 8 clips of 1 frame each, merge them into 4 clips of 2 frames, and eventually result in a single holistic video representation.
- Bipartite Soft Matching: To decide which tokens to merge, the model uses a similarity-based matching algorithm. It finds the most similar pairs of tokens and averages their features, ensuring that essential information isn't just deleted (as in pruning) but preserved.
By combining this with LoRA (Low-Rank Adaptation), the model remains extremely lightweight in terms of trainable parameters while becoming significantly faster during inference.
Key Insights and Ideas
- Merging > Pruning: Unlike "token pruning," which simply discards "unimportant" tokens, TempMe merges them. This prevents the loss of subtle information that might be useful for retrieval.
- The "Pyramid" Effect: By merging tokens progressively, the model naturally transitions from learning low-level spatial details (in early layers) to high-level temporal concepts (in later layers).
- Inference Efficiency is the Goal: The authors highlight that while many papers brag about low parameter counts, the true bottleneck for deployment is GFLOPs and token count. TempMe addresses the latter directly.
Qualitatively, visualizations show that TempMe successfully groups tokens belonging to the same moving object across multiple frames, effectively "tracking" the subject through the transformer layers.
Key Results
TempMe demonstrates that you can have your cake and eat it too—better performance with less compute. Evaluated on standard video-language benchmarks (MSRVTT, ActivityNet, DiDeMo, and LSMDC), the framework achieved impressive results:
- Efficiency Gains: Compared to standard LoRA fine-tuning, TempMe reduces GFLOPs by 51% and output tokens by 95%.
- Speed: It achieves a 1.8x speedup in inference and a 1.57x speedup in training time.
- Accuracy: On the MSRVTT dataset, it improved the R-Sum (a standard retrieval metric) by 4.4% over previous parameter-efficient methods while using only 0.50M trainable parameters. With full fine-tuning, it achieved a 7.9% R-Sum improvement.
- Memory: During full fine-tuning, it utilized only 75.2% of the GPU memory required by baseline methods like CLIP4Clip.
Limitations and Future Work
While TempMe is a significant step forward, the authors note a few areas for improvement:
- Text Encoder Optimization: The current work focuses almost entirely on the video (image) encoder. The text encoder remains largely standard, presenting a potential area for further efficiency gains.
- Architecture Specificity: The merging logic is currently optimized for CLIP-style architectures. Extending this to more specialized video foundation models is more complex and remains an open challenge.
- Dataset Scope: The evaluation is limited to non-commercial, publicly available datasets. Testing on more diverse, "in-the-wild" video data would further validate its robustness.
Summary updated