Sparse Spatiotemporal Attention for Video Transformers

39 concepts34 papers1 proposal

Standard Vision Transformers treat video as a flat sequence of spatiotemporal tokens. If a video contains 100 frames sliced into $64 \times 64$ patches, the model must process 409,600 tokens. Because the computational complexity of standard self-attention scales quadratically ($O(N^2)$), computing a dense attention matrix for this sequence requires evaluating over 160 billion pairwise relationships per layer.

This global approach is fundamentally redundant. In any given video sequence, large swaths of the background remain static, and human visual interest is highly concentrated. Early foundational insights by Rudoy et al. demonstrated that human gaze transitions between a very sparse set of candidate regions, meaning dense pixel-wise computation wastes significant compute on irrelevant or unchanging data.

To bridge this gap, researchers have developed sparse spatiotemporal attention. Instead of performing an exhaustive global search across every pixel and frame, these architectures use data-driven priors to sample a tiny fraction of highly informative keys and values.


Deformable Attention: Turning Search into Regression

In standard attention, a query token must compute a dot product with every single key token to discover where the high-attention weights lie. Spatiotemporal deformable attention replaces this expensive search problem with a regression problem.

Instead of looking everywhere, a query token uses a small, computationally cheap linear layer to directly predict a sparse set of 3D sampling coordinates (offsets across space and time) relative to a reference point. The model then uses interpolation to extract features only from those specific coordinates.

Standard Attention:
[Query] ───► Computes dot-product with EVERY token in the video volume ───► O(N²)

Deformable Attention:
[Query] ───► Predicts 3D offsets (Δx, Δy, Δt) ───► Samples K points ───► O(N)

As demonstrated by Wang et al. and Wu et al., this shifts the computational complexity from quadratic to linear relative to the number of tokens, because each query only interacts with a fixed number of sampled keys ($K \ll N$).

This mechanism provides the flexibility of global attention without its prohibitive overhead, making it highly effective across diverse video tasks:

  • Temporal Action Detection: Liu et al. utilize temporal deformable attention to sample a sparse set of key points around learned reference locations, preventing feature over-smoothing across long sequences.
  • 3D Localization: Sun et al. apply this to filter out background noise and isolate long-range action patterns.
  • Pixel-Level Reconstruction: For video super-resolution, Fuoli et al. employ a deformable attention pyramid to dynamically predict sampling offsets, achieving precise frame alignment without global comparisons.

Trajectory and Flow Guidance: Following Physical Motion

While deformable attention forces the network to learn sampling offsets from scratch, videos possess an inherent physical property that can be exploited: temporal continuity. Objects do not teleport across frames; they move along continuous paths.

Instead of guessing where to look, models can use motion priors like optical flow or point tracking to hardwire spatiotemporal sparsity.

Frame t-1                 Frame t                 Frame t+1
┌───────────┐           ┌───────────┐           ┌───────────┐
│   Object  │◄──────────┤  [Query]  ├──────────►│   Object  │
└───────────┘           └───────────┘           └───────────┘
      ▲                       │                       ▲
      └───────────────────────┴───────────────────────┘
                     Motion Trajectory / Flow Vector

Lin et al. introduced flow-guided sparse attention, where pre-computed optical flow vectors dictate exactly which patches in neighboring frames a query should attend to. This allows video restoration models to track and aggregate sharp features across highly blurred frames without wasting compute on static regions.

Taking this concept to its logical conclusion, Andrea Vedaldi developed Tracktention (Paper), an architectural layer that leverages off-the-shelf point trackers to route attention directly along motion trajectories. By constraining the receptive field to physical paths, the model ensures perfect temporal consistency while using a fraction of the parameters required by dense spatiotemporal models.

Similarly, in action quality assessment, Yang et al. combined visual object tracking with sparse self-attention to isolate the athlete, entirely eliminating the computational waste of processing irrelevant background pixels.


Structural Factorization and Content-Driven Masks

Another prominent strategy for breaking the quadratic bottleneck relies on structural factorization and content-aware masking.

Axis Factorization

Instead of computing attention across the entire 3D spatiotemporal volume at once, the attention operator can be factorized into orthogonal, lower-dimensional axes. Duke et al. demonstrated that restricting a pixel's receptive field to its own spatial and temporal axes reduces computational overhead by over 98%. Because these axis-aligned layers are stacked sequentially, information still propagates globally across the entire video volume over time. Thawakar et al. extended this concept by splitting attention into intra-scale and inter-scale components, allowing models to capture complex object deformations across multi-scale feature maps efficiently.

Content-Driven Masking

Alternatively, the content of the video itself can dictate where attention is permitted to look. In generative video diffusion models, attention maps exhibit massive inherent sparsity because only a subset of tokens significantly influences the generation process.

Shen et al. introduced DraftAttention, which first runs a low-resolution "draft" pass to map out critical spatiotemporal interactions. This draft map acts as a cheap proxy, guiding a hardware-optimized sparse attention mechanism at the native high resolution and skipping redundant computations entirely.

For video editing and inpainting, the optimization is even more direct. Since large portions of a video frame remain intact during editing, Zhou et al. designed a mask-guided sparse Transformer that restricts attention queries exclusively to the regions requiring synthesis, preventing the quadratic scaling issues common to standard spatiotemporal architectures.

Key Foundational Work

Learning Video Saliency from Human Gaze Using Candidate Selection (2013) — contributed 2 concept elements to this direction.
Recurrent Attention Models for Depth-Based Person Identification (2016) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_sparse_spatio_temporal_attention_d0c2d2aa,
  title = {sparse spatio-temporal attention},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/sparse-spatio-temporal-attention/rdr_d0c2d2aa3e3e45ec8a3c8d0444f78ab3},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-26},
}

This exact version (version 1, frozen text):

@misc{lacuna_sparse_spatio_temporal_attention_d0c2d2aa_v1,
  title = {sparse spatio-temporal attention},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/sparse-spatio-temporal-attention/rdr_d0c2d2aa3e3e45ec8a3c8d0444f78ab3/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake