Papers › Is Space-Time Attention All You Need for Video Understanding?

Is Space-Time Attention All You Need for Video Understanding?

9 Feb 2021arXiv:2102.05095archive 2025-07-28

Gedas Bertasius, Heng Wang, Lorenzo Torresani

We present a convolution-free approach to video classification built exclusively on self-attention over space and time. Our method, named "TimeSformer," adapts the standard Transformer architecture to video by enabling spatiotemporal feature learning directly from a sequence of frame-level patches. Our experimental study compares different self-attention schemes and suggests that "divided attention," where temporal attention and spatial attention are separately applied within each block, leads to the best video classification accuracy among the design choices considered. Despite the radically new design, TimeSformer achieves state-of-the-art results on several action recognition benchmarks, including the best reported accuracy on Kinetics-400 and Kinetics-600. Finally, compared to 3D convolutional networks, our model is faster to train, it can achieve dramatically higher test efficiency (at a small drop in accuracy), and it can also be applied to much longer video clips (over one minute long). Code and models are available at: https://github.com/facebookresearch/TimeSformer.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2102.05095")

Code

Syntology Ran 35 of 43 code samples harvested from 6 repositories linked to this paper; 8 have no recorded run. Of those that ran: 1 ran · violated contract; 5 ran · our draft was wrong; 9 ran · fixture could not drive it; 20 ran with no contract checked.

By repository: community (archive-listed): 42 samples from 6 repositories, 34 ran; 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

16 repositories listed; official and paper-mentioned ones first.

facebookresearch/TimeSformer officialmentioned in papermentioned on GitHubpytorch report
jerrywn121/TianChi_AIEarth mentioned on GitHubpytorch report
lucidrains/TimeSformer-pytorch mentioned on GitHubpytorch report
m-bain/video-transformers mentioned on GitHubpytorch report
md-mohaiminul/objectstatechange mentioned on GitHubpytorchNOASSERTION report
mx-mark/videotransformer-pytorch mentioned on GitHubpytorch report
yiyixuxu/TimeSformer-rolled-attention mentioned on GitHubpytorch report
pwc-1/Paper-9 mindspore report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

43 samples harvested; 35 ran; 0 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran · violated contract
5ran · our draft was wrong
9ran · fixture could not drive it
20ran
8unverified

Licence: 14 of the 43 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 6 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Attention halixness/generative_timesformer_pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran MIT (permissive) · 9e6eb12055d4b5db · report
AxialRotaryEmbedding lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran MIT (permissive) · 2125f85e76f4efc7 · report
Decoder jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 3c436600aed6654a · report
DecoderLayer jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 1879ef86738392c0 · report
Encoder jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · metamorphic tier: deterministic fingerprinted no licence file found · pointer only · 070741108b175c8f · report
EncoderLayer jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 38ab040cbcf984b8 · report
FeedForward lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 0183b5f0d306482f · report
GEGLU lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran fingerprinted MIT (permissive) · 384419959d31762c · report
Mlp m-bain/video-transformers/video-transformers/timesformer.py community (archive-listed) ran Apache-2.0 (permissive) · 409ab4896697a02f · report
MultiHeadedAttention jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · bb5aa1cbee56c9d7 · report
PreNorm lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 8bb9d8688ba435cf · report
PreTokenShift lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · metamorphic tier: deterministic fingerprinted MIT (permissive) · 42b61b5b4f622a76 · report
RotaryEmbedding lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · metamorphic tier: well formed MIT (permissive) · 4e0216fcf6abef9d · report
SpaceAttention jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · cf33bd73aa85bae0 · report
SpacetimeMHSA The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 6ed6a97e76e9e405 · report
SublayerConnection jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 2c2573860f1078bc · report
TimeAttention jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 0f190b82b567601a · report
TimeSformer halixness/generative_timesformer_pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran MIT (permissive) · 1e12db9a2b6a6d61 · report
TimeSformerBlock The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · b5fc28091e91cbe9 · report
VarAttention m-bain/video-transformers/video-transformers/timesformer.py community (archive-listed) ran Apache-2.0 (permissive) · 90617d5175fc43de · report
VideoPatchEmbed m-bain/video-transformers/video-transformers/timesformer.py community (archive-listed) ran Apache-2.0 (permissive) · 02e3cffeb7724448 · report
apply_rot_emb lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · b47a2562da71bf81 · report
attn lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 5d2b139fbe3e2fe5 · report
attn halixness/generative_timesformer_pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · c9b2023a8e7f543b · report
fold_tensor jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 382b7426a720dd16 · report
input_embedding jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · d1d6c81b2e101027 · report
merge_timespace The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · d153fd18d2c78fd5 · report
project_vk_linformer The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 3b4883ee8560ec7c · report
rotate_every_two lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 07e3c5417d5f77fc · report
shift lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · f6e07e75149898e3 · report
space_att_rearrange The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 214635d3580c503e · report
split_cls The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 43ee896c0cb92a0e · report
time_att_rearrange The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 2349364a5be28b97 · report
unfold_StackOverChannel jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 5eee191e9a7fe18e · report
Attention lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) unverified MIT (permissive) · f7e0694aefe90304 · report
SpaceTimeBlock m-bain/video-transformers/video-transformers/timesformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 2af0e5fbba35a2f7 · report
SpaceTimeTransformer jerrywn121/TianChi_AIEarth/STTransformer/transformer.py community (archive-listed) unverified no licence file found · pointer only · 9323660c90d8a3a4 · report
TimeSformer lucidrains/TimeSformer-pytorch/timesformer_pytorch/timesformer_pytorch.py community (archive-listed) unverified MIT (permissive) · 1c93e555127bcf25 · report
Timesformer The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) unverified MIT (permissive) · cc63279ce5b42414 · report
Timesformer m-bain/video-transformers/video-transformers/timesformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 9ad394810b771a6b · report
compute_mhsa The-AI-Summer/self-attention-cv/self_attention_cv/timesformer/timesformer.py community (archive-listed) unverified MIT (permissive) · e29cd379b8279b38 · report
get_frames yiyixuxu/TimeSformer-rolled-attention/visualize_attn_util.py community (archive-listed) unverified no licence file found · pointer only · 7c6f43d2449917c6 · report
exists identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · aa5486a3650902d8 · report

Tasks

Action ClassificationAction RecognitionAllAnomaly DetectionGeneral ClassificationVideo ClassificationVideo Question AnsweringVideo Understanding

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Action Classification Kinetics-400 TimeSformer-L Acc@1 80.7 #93 of 207 Archive leaderboard report
Action Classification Kinetics-400 TimeSformer-L Acc@5 94.7 #93 of 207 Archive leaderboard report
Action Classification Kinetics-400 TimeSformer-L FLOPs (G) x views 7140x3 #93 of 207 Archive leaderboard report
Action Classification Kinetics-400 TimeSformer-L Parameters (M) 121.4 #93 of 207 Archive leaderboard report
Action Classification Kinetics-400 TimeSformer-HR Acc@1 79.7 #108 of 207 Archive leaderboard report
Action Classification Kinetics-400 TimeSformer-HR Acc@5 94.4 #108 of 207 Archive leaderboard report
Action Classification Kinetics-400 TimeSformer Acc@1 78 #130 of 207 Archive leaderboard report
Action Classification Kinetics-400 TimeSformer Acc@5 93.7 #130 of 207 Archive leaderboard report
Action Recognition Diving-48 TimeSformer-L Accuracy 81 #15 of 18 Archive leaderboard report
Action Recognition Diving-48 TimeSformer-HR Accuracy 78 #16 of 18 Archive leaderboard report
Action Recognition Diving-48 TimeSformer Accuracy 75 #18 of 18 Archive leaderboard report
Action Recognition Something-Something V2 TimeSformer-HR Top-1 Accuracy 62.5 #103 of 123 Archive leaderboard report
Action Recognition Something-Something V2 TimeSformer-L Top-1 Accuracy 62.3 #104 of 123 Archive leaderboard report
Action Recognition Something-Something V2 TimeSformer Top-1 Accuracy 59.5 #113 of 123 Archive leaderboard report
Anomaly Detection UBnormal TimeSformer AUC 68.5% #5 of 14 Archive leaderboard report
Anomaly Detection UBnormal TimeSformer RBDC 0.04 #5 of 14 Archive leaderboard report
Anomaly Detection UBnormal TimeSformer TBDC 0.05 #5 of 14 Archive leaderboard report
Video Question Answering Howto100M-QA TimeSformer Accuracy 62.1 #1 of 1 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: TimeSformer

TimeSformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections