Introduction
In the field of video-language understanding, the "token explosion" remains a primary bottleneck. While a typical sentence consists of a few dozen tokens, a high-resolution video can generate upwards of 19,000 visual tokens. This volume makes processing long-form videos (exceeding 30 seconds) prohibitively expensive for standard Transformer architectures due to their quadratic computational cost relative to sequence length.
Existing strategies often resort to sparse sampling—which loses narrative continuity—or offline encoding, which prevents end-to-end learning. TESTA (TEmporal-Spatial Token Aggregation) is a novel framework designed to maintain dense sampling and end-to-end learning while slashing computational overhead by up to 75%.
The TESTA Framework
TESTA adopts a "divide and conquer" strategy for video tokens. Inspired by Token Merging (ToMe) used in image processing, TESTA decouples the aggregation process into two distinct, sequential steps within each Transformer block:
- Temporal Aggregation (TAM): Merges similar frames, such as those within a continuous camera shot.
- Spatial Aggregation (SAM): Merges redundant patches within a single frame, such as multiple tokens representing a static background.
By decoupling these dimensions, the computational complexity is reduced from $O((T \cdot L)^2)$ to $O(T^2 + L^2)$, where $T$ is the number of frames and $L$ is the number of spatial patches. This efficiency allows the model to process 128+ frames within the same budget that would cause standard models to fail.
Aggregation Mechanism
To perform merging efficiently, TESTA utilizes a bipartite matching algorithm. Tokens are partitioned into two sets (Set A and Set B). The model identifies the most similar pairs between these sets using the cosine similarity of their attention "keys." These pairs are then merged via mean pooling.
The authors found that a geometry-based partitioning strategy—simply assigning adjacent tokens to different sets—outperformed more complex importance-scoring methods. This approach naturally encourages the merging of neighboring, and likely redundant, information.
Key Results and Scalability
TESTA demonstrates superior scalability compared to existing models. While many video-language models see performance plateau or decline when frame counts increase from 32 to 96, TESTA’s performance improves linearly.
- Efficiency: The model achieves a 1.7x speedup and a 75% reduction in visual tokens compared to vanilla baselines.
- Retrieval: On the QuerYD long-form video dataset, TESTA achieved a 77.0 R@1, outperforming previous state-of-the-art (SOTA) by 7.3 points. When scaled to 96 frames, it reached 83.4 R@1.
- VideoQA: On ActivityNet-QA, it reached 45.0% accuracy, a 3.2% improvement over previous benchmarks.
Conclusion
TESTA proves that redundancy in video data is a feature that can be leveraged for efficiency rather than a bug to be ignored. By adaptively merging tokens rather than pruning them, the model retains critical semantic information while significantly reducing costs. Future work may involve incorporating text-guided merging to further refine task-specific efficiency and scaling pre-training to larger datasets.
Summary updated