NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Efficient Video Transformers with Spatial-Temporal Token Selection

Junke Wang, Xitong Yang, Hengduo Li, Li Liu, Zuxuan Wu, Yu-Gang Jiang

Introduction

Vision Transformers (ViTs) have achieved state-of-the-art performance in video recognition, but their computational demands are a significant barrier to real-world deployment. The self-attention mechanism scales quadratically with the number of input tokens; in video, where tokens are extracted across multiple frames, this sequence length explodes.

STTS (Spatial-Temporal Token Selection) is a lightweight, plug-and-play framework designed to mitigate this "compute-heavy" nature. By dynamically selecting only the most informative tokens in both time and space, STTS reduces computational costs (GFLOPs) by 20-33% with negligible impact on accuracy.

The STTS Framework

The core innovation of STTS is treating token selection as a ranking problem rather than a random pruning task. Previous methods that dropped random 3D patches often destroyed the structural information—such as motion flow—that hierarchical video models (e.g., MViT) rely on for spatial downsampling.

Architecture of the STTS framework integrated into a hierarchical Vision Transformer. Selection modules are inserted between transformer blocks to prune redundant tokens.

1. Scorer Network

STTS utilizes a tiny, two-layer Multi-Layer Perceptron (MLP) as a scorer. This network predicts an importance score for every token by analyzing both local features and a global average-pooled representation of the video clip.

2. Decoupled Selection Process

The authors found that decoupling the selection into separate temporal and spatial stages is more effective than solving a unified 3D selection problem.

  • Temporal Selection: The model ranks frames based on their relevance to the action. It retains the top $K$ frames and discards the rest, effectively pruning "filler" frames that do not contribute to classification.
  • Spatial Selection (Anchor-based): To preserve spatial structure, STTS avoids dropping individual pixels. Instead, it defines "anchors" (overlapping regions). The scorer identifies the most discriminative anchor, preserving a contiguous block of tokens that later layers can still process effectively.
The STTS framework decouples selection into temporal and spatial stages. Temporal selection identifies key frames, while spatial selection uses anchors to preserve local structure.

3. Differentiable Top-K

Standard Top-K selection is a discrete operation that breaks backpropagation. STTS overcomes this using a perturbed-maximum method. By adding random noise during training, the model creates a smoothed, differentiable version of the Top-K operator, allowing for end-to-end training.

Key Results and Insights

The framework was rigorously evaluated on the Kinetics-400 (K400) and Something-Something-v2 (SSV2) benchmarks, yielding several key insights:

  • Efficiency vs. Accuracy: On the MViT backbone, STTS achieved similar accuracy to the full model while saving 20% of the computation. With more aggressive pruning (keeping only 50% of tokens), it reduced GFLOPs by 33% with a minor accuracy drop of less than 0.7%.
  • Structure Preservation: Moving from token-level dropping to anchor-based selection was critical. Randomly dropping tokens makes it impossible for later layers to perform standard pooling or convolutions, whereas anchors maintain the necessary spatial integrity.
  • Single-Step Selection: Surprisingly, performing selection at a single layer worked better than progressive pruning across multiple layers. Frequent changes to the spatio-temporal structure appear to make the model harder to train.

Limitations and Future Work

While highly effective, STTS faces challenges with certain architectures. For instance, the "window shifting" mechanism in Swin Transformers is highly sensitive to spatial changes, making spatial selection difficult to implement there. Additionally, the current method uses a fixed $K$ (number of tokens to keep). Future iterations may involve dynamic budgets that decide how many tokens to retain based on the complexity of the specific video clip. Finally, the differentiable Top-K requires careful tuning of a noise parameter ($\sigma$) to ensure consistent behavior between training and inference.

Summary updated

BibTeX
@inproceedings{wang2022efficient,
  author = {Junke Wang and Xitong Yang and Hengduo Li and Li Liu and Zuxuan Wu and Yu-Gang Jiang},
  title = {{Efficient Video Transformers with Spatial-Temporal Token Selection}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19833-5\_5},
}
Figure