SandHouse
Pages and contents

VideoSEMA

0\. Metadata

Field
Value
⋮⋮
Authors
Tran, Zhang, Xue
⋮⋮
Year
2026
⋮⋮
Link / arXiv
https://arxiv.org/pdf/2607.14711
⋮⋮
Code
⋮⋮
My relevance (1-5)
5
⋮⋮
Tags
#ssm #transformer #video #mamba #sema

1\. Main Idea

An implementation of the SEMA algorithm for video, which splits video into spatial attention and temporal attention for input frames. SEMA is a prerequisite.

2\. Method

Processing

VideoSEMA uses a 3D Conv to project the input video into X∈ℝC×T×H×Wof non-overlapping patches where W=w/4and H=h/4. Spatial and temporal positional embeddings are then added.

X = \text{3DConv}(x) \\ X = [X,X_{\mathrm{cls}}] + E_{\mathrm{pos}} + E_{\mathrm{temp}}

Rather than flattening the entire video into one sequence and applying joint space-time attention, VideoSEMA runs a Spatial SEMA operation over the H×Wdimension and a temporal softmax attention independently along the Tdimension. The main block is

y = \operatorname{SpatialSEMA}(X) \\ y' = \operatorname{LayerNorm}(y) \\ z' = \operatorname{TemporalAttention}(y') \\ z = X + z'

The resulting features are passed through the remaining normalization, MLP, and residual components of the Mamba-like macro-architecture.

Spatial SEMA

For a query at frame t and spatial location (h,w), spatial SEMA is.

SpatialSEMA⁡(qt,h,w)=1HW∑i=1H∑j=1Wvt,i,j+∑(l,p)∈I(h,w)exp⁡(qt,h,wkt,l,p⊤)∑(i,j)∈I(h,w)exp⁡(qt,h,wkt,i,j⊤)vt,l,p

The first term is a global average over all spatial tokens in the frame. It supplies cheap global context. The second term is local window attention over the spatial neighborhood I(h,w). It preserves local details such as object shape, texture, and boundaries. Therefore

SpatialSEMA⁡=GlobalAverage⁡+LocalWindowAttention

Temporal attention

After spatial processing, VideoSEMA applies ordinary softmax attention through time at every fixed spatial location

TemporalAttention⁡(qt,h,w)=∑i=1Texp⁡(qt,h,wki,h,w⊤)∑j=1Texp⁡(qt,h,wkj,h,w⊤)vi,h,w

This allows the patch at location (h,w) in one frame to directly compare itself with the corresponding spatial location in every other frame. Unlike a forward recurrent scan, temporal attention is bidirectional: it can use both earlier and later frames simultaneously.

Computational Complexity

Splitting spatial and temporal embedding has computational advantages. Joint space-time attention treats all video patches as one sequence of length N=THW . Its computational complexity is O((THW)2C). This becomes very expensive because every patch in every frame attends to every other patch. Standard split space-time attention reduces the cost to O([T2HW+T(HW)2]C). The first term is temporal attention and the second is full spatial attention inside every frame. VideoSEMA replaces quadratic spatial attention with fixed-window SEMA. Its total complexity is

O([T2HW+THWk]C)

where k is the number of spatial tokens in each local window. For fixed T and fixed window size k, VideoSEMA is linear in the number of spatial tokens HW: O(HW) . Temporal attention remains quadratic in the number of frames, O(T2HWC), but the experiments use relatively short clips of at most 32 frames. For substantially longer videos, the authors suggest replacing full temporal attention with sparse or dilated temporal attention.

[image: Screenshot_2026-07-24_at_1.30.17 PM.png]