{"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/transformer-networks-for-trajectory","title":"Transformer Networks for Trajectory Forecasting","arxiv_id":"2003.08111","date":"2020-03-18","proceeding":null,"authors":["Francesco Giuliari","Irtiza Hasan","Marco Cristani","Fabio Galasso"],"abstract":"Most recent successes on forecasting the people motion are based on LSTM models and all most recent progress has been achieved by modelling the social interaction among people and the people interaction with the scene. We question the use of the LSTM models and propose the novel use of Transformer Networks for trajectory forecasting. This is a fundamental switch from the sequential step-by-step processing of LSTMs to the only-attention-based memory mechanisms of Transformers. In particular, we consider both the original Transformer Network (TF) and the larger Bidirectional Transformer (BERT), state-of-the-art on all natural language processing tasks. Our proposed Transformers predict the trajectories of the individual people in the scene. These are \"simple\" model because each person is modelled separately without any complex human-human nor scene interaction terms. In particular, the TF model without bells and whistles yields the best score on the largest and most challenging trajectory forecasting benchmark of TrajNet. Additionally, its extension which predicts multiple plausible future trajectories performs on par with more engineered techniques on the 5 datasets of ETH + UCY. Finally, we show that Transformers may deal with missing observations, as it may be the case with real sensor data. Code is available at https://github.com/FGiuliari/Trajectory-Transformer.","url_abs":"https://arxiv.org/abs/2003.08111v3","url_pdf":"https://arxiv.org/pdf/2003.08111v3.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":"transformer-networks-for-trajectory","repo_url":"https://github.com/FGiuliari/Trajectory-Transformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"trajectory-forecasting","task_name":"Trajectory Forecasting"},{"task_slug":"trajectory-prediction","task_name":"Trajectory Prediction"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"lstm","method_name":"LSTM"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"tanh-activation","method_name":"Tanh Activation"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/trajectory-prediction-on-ethucy","task":"Trajectory Prediction","dataset":"ETH/UCY","model":"Transformer TF","rank_in_archive_order":12,"of":20,"metrics":{"ADE-8/12":"0.31","FDE-8/12":"0.65"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2003.08111","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2003.08111"}},"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/FGiuliari/Trajectory-Transformer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"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":"4398df6341c69e22","entry":"attention","repo":"FGiuliari/Trajectory-Transformer","repo_kind":"official","path":"transformer/functional.py","file_url":"https://github.com/FGiuliari/Trajectory-Transformer/blob/HEAD/transformer/functional.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4398df6341c69e22"}},{"code_sha256_prefix":"cf10304f2074eff0","entry":"batch_size_fn","repo":"FGiuliari/Trajectory-Transformer","repo_kind":"official","path":"transformer/flow.py","file_url":"https://github.com/FGiuliari/Trajectory-Transformer/blob/HEAD/transformer/flow.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cf10304f2074eff0"}},{"code_sha256_prefix":"3a8e240203d9f9a3","entry":"clones","repo":"FGiuliari/Trajectory-Transformer","repo_kind":"official","path":"transformer/functional.py","file_url":"https://github.com/FGiuliari/Trajectory-Transformer/blob/HEAD/transformer/functional.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3a8e240203d9f9a3"}},{"code_sha256_prefix":"a4172fe393c320f7","entry":"make_model","repo":"FGiuliari/Trajectory-Transformer","repo_kind":"official","path":"transformer/flow.py","file_url":"https://github.com/FGiuliari/Trajectory-Transformer/blob/HEAD/transformer/flow.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a4172fe393c320f7"}},{"code_sha256_prefix":"7ef6f0f168ab5fba","entry":"run_epoch","repo":"FGiuliari/Trajectory-Transformer","repo_kind":"official","path":"transformer/flow.py","file_url":"https://github.com/FGiuliari/Trajectory-Transformer/blob/HEAD/transformer/flow.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7ef6f0f168ab5fba"}},{"code_sha256_prefix":"df240a27a072f288","entry":"subsequent_mask","repo":"FGiuliari/Trajectory-Transformer","repo_kind":"official","path":"transformer/functional.py","file_url":"https://github.com/FGiuliari/Trajectory-Transformer/blob/HEAD/transformer/functional.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"df240a27a072f288"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}