{"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/long-short-term-transformer-for-online-action","title":"Long Short-Term Transformer for Online Action Detection","arxiv_id":"2107.03377","date":"2021-07-07","proceeding":"NeurIPS 2021 12","authors":["Mingze Xu","Yuanjun Xiong","Hao Chen","Xinyu Li","Wei Xia","Zhuowen Tu","Stefano Soatto"],"abstract":"We present Long Short-term TRansformer (LSTR), a temporal modeling algorithm for online action detection, which employs a long- and short-term memory mechanism to model prolonged sequence data. It consists of an LSTR encoder that dynamically leverages coarse-scale historical information from an extended temporal window (e.g., 2048 frames spanning of up to 8 minutes), together with an LSTR decoder that focuses on a short time window (e.g., 32 frames spanning 8 seconds) to model the fine-scale characteristics of the data. Compared to prior work, LSTR provides an effective and efficient method to model long videos with fewer heuristics, which is validated by extensive empirical analysis. LSTR achieves state-of-the-art performance on three standard online action detection benchmarks, THUMOS'14, TVSeries, and HACS Segment. Code has been made available at: https://xumingze0308.github.io/projects/lstr","url_abs":"https://arxiv.org/abs/2107.03377v3","url_pdf":"https://arxiv.org/pdf/2107.03377v3.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":"long-short-term-transformer-for-online-action","repo_url":"https://github.com/amazon-research/long-short-term-transformer","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"long-short-term-transformer-for-online-action","repo_url":"https://github.com/amazon-science/long-short-term-transformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"action-detection","task_name":"Action Detection"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"online-action-detection","task_name":"Online Action Detection"},{"task_slug":"2048","task_name":"Playing the Game of 2048"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/online-action-detection-on-thumos-14","task":"Online Action Detection","dataset":"THUMOS'14","model":"LSTR","rank_in_archive_order":4,"of":15,"metrics":{"mAP":"69.5"},"uses_additional_data":false},{"leaderboard":"/sota/online-action-detection-on-tvseries","task":"Online Action Detection","dataset":"TVSeries","model":"LSTR","rank_in_archive_order":3,"of":13,"metrics":{"mCAP":"89.1"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2107.03377","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2107.03377"}},"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/amazon-science/long-short-term-transformer","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/amazon-research/long-short-term-transformer","reach":null}],"summary":{"ran":1,"unverified":9},"by_repo_kind":{"official":{"samples":4,"ran":1,"repositories":1},"listed":{"samples":6,"ran":0,"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":"5b79db82f7d82ff6","entry":"Registry","repo":"amazon-research/long-short-term-transformer","repo_kind":"official","path":"src/rekognition_online_action_detection/models/lstr.py","file_url":"https://github.com/amazon-research/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/models/lstr.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b79db82f7d82ff6"}},{"code_sha256_prefix":"db30394d4d9c124a","entry":"LSTR","repo":"amazon-research/long-short-term-transformer","repo_kind":"official","path":"src/rekognition_online_action_detection/models/lstr.py","file_url":"https://github.com/amazon-research/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/models/lstr.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"db30394d4d9c124a"}},{"code_sha256_prefix":"9b77a01bbd0a3540","entry":"_register_generic","repo":"amazon-research/long-short-term-transformer","repo_kind":"official","path":"src/rekognition_online_action_detection/models/lstr.py","file_url":"https://github.com/amazon-research/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/models/lstr.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9b77a01bbd0a3540"}},{"code_sha256_prefix":"3ad8b1617b1ca798","entry":"build_feature_head","repo":"amazon-research/long-short-term-transformer","repo_kind":"official","path":"src/rekognition_online_action_detection/models/lstr.py","file_url":"https://github.com/amazon-research/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/models/lstr.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3ad8b1617b1ca798"}},{"code_sha256_prefix":"4b0c45865a8c0eee","entry":"calibrated_average_precision_score","repo":"amazon-science/long-short-term-transformer","repo_kind":"listed","path":"src/rekognition_online_action_detection/evaluation/metrics.py","file_url":"https://github.com/amazon-science/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/evaluation/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4b0c45865a8c0eee"}},{"code_sha256_prefix":"823c049021ac6854","entry":"generate_square_subsequent_mask","repo":"amazon-science/long-short-term-transformer","repo_kind":"listed","path":"src/rekognition_online_action_detection/models/transformer/utils.py","file_url":"https://github.com/amazon-science/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/models/transformer/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"823c049021ac6854"}},{"code_sha256_prefix":"2b4cae7268c1b0f8","entry":"get_stage_pred_scores","repo":"amazon-science/long-short-term-transformer","repo_kind":"listed","path":"src/rekognition_online_action_detection/evaluation/metrics.py","file_url":"https://github.com/amazon-science/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/evaluation/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2b4cae7268c1b0f8"}},{"code_sha256_prefix":"38e465d98db284f6","entry":"layer_norm","repo":"amazon-science/long-short-term-transformer","repo_kind":"listed","path":"src/rekognition_online_action_detection/models/transformer/utils.py","file_url":"https://github.com/amazon-science/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/models/transformer/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"38e465d98db284f6"}},{"code_sha256_prefix":"d8d010da99929e02","entry":"perframe_average_precision","repo":"amazon-science/long-short-term-transformer","repo_kind":"listed","path":"src/rekognition_online_action_detection/evaluation/metrics.py","file_url":"https://github.com/amazon-science/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/evaluation/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d8d010da99929e02"}},{"code_sha256_prefix":"a1406d77c11f45ee","entry":"postprocessing","repo":"amazon-science/long-short-term-transformer","repo_kind":"listed","path":"src/rekognition_online_action_detection/evaluation/postprocessing.py","file_url":"https://github.com/amazon-science/long-short-term-transformer/blob/HEAD/src/rekognition_online_action_detection/evaluation/postprocessing.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a1406d77c11f45ee"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}