{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/prune-spatio-temporal-tokens-by-semantic","title":"Prune Spatio-temporal Tokens by Semantic-aware Temporal Accumulation","arxiv_id":"2308.04549","date":"2023-08-08","proceeding":"ICCV 2023 1","authors":["Shuangrui Ding","Peisen Zhao","Xiaopeng Zhang","Rui Qian","Hongkai Xiong","Qi Tian"],"abstract":"Transformers have become the primary backbone of the computer vision community due to their impressive performance. However, the unfriendly computation cost impedes their potential in the video recognition domain. To optimize the speed-accuracy trade-off, we propose Semantic-aware Temporal Accumulation score (STA) to prune spatio-temporal tokens integrally. STA score considers two critical factors: temporal redundancy and semantic importance. The former depicts a specific region based on whether it is a new occurrence or a seen entity by aggregating token-to-token similarity in consecutive frames while the latter evaluates each token based on its contribution to the overall prediction. As a result, tokens with higher scores of STA carry more temporal redundancy as well as lower semantics thus being pruned. Based on the STA score, we are able to progressively prune the tokens without introducing any additional parameters or requiring further re-training. We directly apply the STA module to off-the-shelf ViT and VideoSwin backbones, and the empirical results on Kinetics-400 and Something-Something V2 achieve over 30% computation reduction with a negligible ~0.2% accuracy drop. The code is released at https://github.com/Mark12Ding/STA.","url_abs":"https://arxiv.org/abs/2308.04549v1","url_pdf":"https://arxiv.org/pdf/2308.04549v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"prune-spatio-temporal-tokens-by-semantic","repo_url":"https://github.com/mark12ding/sta","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-2-Clause"}}],"tasks":[{"task_slug":"video-recognition","task_name":"Video Recognition"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.04549","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.04549"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mark12ding/sta","reach":{"status":"ok","spdx":"BSD-2-Clause"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Mark12Ding/STA","reach":{"status":"ok","spdx":"BSD-2-Clause"}}],"summary":{"ran":10,"ran_honours":1,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"official":{"samples":17,"ran":12,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"a40d0b88efe57389","entry":"Attention","repo":"Mark12Ding/STA","repo_kind":"official","path":"model_vit.py","file_url":"https://github.com/Mark12Ding/STA/blob/HEAD/model_vit.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a40d0b88efe57389"}},{"code_sha256_prefix":"bc39b8ed5fefa7eb","entry":"crop_clip","repo":"mark12ding/sta","repo_kind":"official","path":"functional.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/functional.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"bc39b8ed5fefa7eb"}},{"code_sha256_prefix":"2b53e457d5632b4e","entry":"get_resize_sizes","repo":"mark12ding/sta","repo_kind":"official","path":"functional.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/functional.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"2b53e457d5632b4e"}},{"code_sha256_prefix":"9b2250a3d13ed688","entry":"get_sinusoid_encoding_table","repo":"mark12ding/sta","repo_kind":"official","path":"model_vit.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/model_vit.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"9b2250a3d13ed688"}},{"code_sha256_prefix":"8733e0d87f232d11","entry":"mixup_target","repo":"mark12ding/sta","repo_kind":"official","path":"mixup.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/mixup.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"8733e0d87f232d11"}},{"code_sha256_prefix":"024894a396cde124","entry":"multiple_samples_collate","repo":"mark12ding/sta","repo_kind":"official","path":"utils.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"024894a396cde124"}},{"code_sha256_prefix":"4728dc2025227bba","entry":"one_hot","repo":"mark12ding/sta","repo_kind":"official","path":"mixup.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/mixup.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"4728dc2025227bba"}},{"code_sha256_prefix":"3913c620f6926f42","entry":"rand_bbox","repo":"mark12ding/sta","repo_kind":"official","path":"mixup.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/mixup.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"3913c620f6926f42"}},{"code_sha256_prefix":"981936c73d3cdd12","entry":"resize_clip","repo":"mark12ding/sta","repo_kind":"official","path":"functional.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/functional.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"981936c73d3cdd12"}},{"code_sha256_prefix":"e866e1196986f728","entry":"shear_x","repo":"mark12ding/sta","repo_kind":"official","path":"rand_augment.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"e866e1196986f728"}},{"code_sha256_prefix":"7b2503c99c9447fb","entry":"shear_y","repo":"mark12ding/sta","repo_kind":"official","path":"rand_augment.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"7b2503c99c9447fb"}},{"code_sha256_prefix":"323759f906fbb394","entry":"translate_x_rel","repo":"mark12ding/sta","repo_kind":"official","path":"rand_augment.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"323759f906fbb394"}},{"code_sha256_prefix":"981e00fd80e33c21","entry":"Block","repo":"Mark12Ding/STA","repo_kind":"official","path":"model_vit.py","file_url":"https://github.com/Mark12Ding/STA/blob/HEAD/model_vit.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"981e00fd80e33c21"}},{"code_sha256_prefix":"ae539267a5c6d2d3","entry":"VisionTransformer","repo":"Mark12Ding/STA","repo_kind":"official","path":"model_vit.py","file_url":"https://github.com/Mark12Ding/STA/blob/HEAD/model_vit.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"ae539267a5c6d2d3"}},{"code_sha256_prefix":"b700fb0a3496b255","entry":"cosine_scheduler","repo":"mark12ding/sta","repo_kind":"official","path":"utils.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"b700fb0a3496b255"}},{"code_sha256_prefix":"2c569f5fd03e74b4","entry":"merge","repo":"mark12ding/sta","repo_kind":"official","path":"engine.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/engine.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"2c569f5fd03e74b4"}},{"code_sha256_prefix":"14b3b13b2e7ee844","entry":"tensor_normalize","repo":"mark12ding/sta","repo_kind":"official","path":"kinetics.py","file_url":"https://github.com/mark12ding/sta/blob/HEAD/kinetics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-2-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"14b3b13b2e7ee844"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}