{"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/temporal-fusion-transformers-for","title":"Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting","arxiv_id":"1912.09363","date":"2019-12-19","proceeding":null,"authors":["Bryan Lim","Sercan O. Arik","Nicolas Loeff","Tomas Pfister"],"abstract":"Multi-horizon forecasting problems often contain a complex mix of inputs -- including static (i.e. time-invariant) covariates, known future inputs, and other exogenous time series that are only observed historically -- without any prior information on how they interact with the target. While several deep learning models have been proposed for multi-step prediction, they typically comprise black-box models which do not account for the full range of inputs present in common scenarios. In this paper, we introduce the Temporal Fusion Transformer (TFT) -- a novel attention-based architecture which combines high-performance multi-horizon forecasting with interpretable insights into temporal dynamics. To learn temporal relationships at different scales, the TFT utilizes recurrent layers for local processing and interpretable self-attention layers for learning long-term dependencies. The TFT also uses specialized components for the judicious selection of relevant features and a series of gating layers to suppress unnecessary components, enabling high performance in a wide range of regimes. On a variety of real-world datasets, we demonstrate significant performance improvements over existing benchmarks, and showcase three practical interpretability use-cases of TFT.","url_abs":"https://arxiv.org/abs/1912.09363v3","url_pdf":"https://arxiv.org/pdf/1912.09363v3.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":"temporal-fusion-transformers-for","repo_url":"https://github.com/AWarno/CancerOptimization","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/IKKIM00/multi-horizon-forecasting-comparison-between-TFT-and-DL-methods","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/IKKIM00/stock_and_pm2.5_prediction_using_TFT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/JonathanRayner/Kaggle-Predict-Sales","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/KalleBylin/temporal-fusion-transformers","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/KalleBylin/tft_webapp","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/LeeSH825/TemporalFusionTransformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/LiamMaclean216/Any-Coin-TFN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/LiamMaclean216/Temporal-Fusion-Transformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/MarigoldJ/TFT_application","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/PlaytikaResearch/tft-torch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/Scallions/tft_paddle","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"paddle","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/Yoontae6719/Energy_project","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/aqua1907/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/aryan-jadon/regression-loss-functions-in-time-series-forecasting-tensorflow","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/ashi-k/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/ashishKAgg/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/bobbercheng/ventilator-pressure-prediction","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"unanswered"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/damu4/tft-forecast","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/dehoyosb/temporal_fusion_transformer_pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/eeci/annex_37","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/ggaggu/Diprunning_study","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/google-research/google-research/tree/master/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/greatwhiz/tft_tf2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/henghamao/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/jdb78/pytorch-forecasting","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/mattsherar/Temporal_Fusion_Transform","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/mavarick/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/mlverse/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/ntubiolin/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/stevinc/Transformer_Timeseries","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/unit8co/darts","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/MindSpore-scientific/code-13/tree/main/temporal-normalizing-flows","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Forecasting/TFT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/awslabs/gluon-ts/tree/master/src/gluonts/model/tft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mxnet","reach":null},{"paper_slug":"temporal-fusion-transformers-for","repo_url":"https://github.com/etna-team/etna","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"interpretable-machine-learning","task_name":"Interpretable Machine Learning"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"},{"task_slug":"time-series-forecasting","task_name":"Time Series Forecasting"}],"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":"interpretability","method_name":"Interpretability"},{"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":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1912.09363","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1912.09363"}},"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/mavarick/tft","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Forecasting/TFT","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/KalleBylin/tft_webapp","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MarigoldJ/TFT_application","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/henghamao/tft","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/etna-team/etna","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/bobbercheng/ventilator-pressure-prediction","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/IKKIM00/multi-horizon-forecasting-comparison-between-TFT-and-DL-methods","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/LiamMaclean216/Temporal-Fusion-Transformer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ntubiolin/tft","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ashishKAgg/tft","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-13/tree/main/temporal-normalizing-flows","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mlverse/tft","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/awslabs/gluon-ts/tree/master/src/gluonts/model/tft","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/damu4/tft-forecast","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/AWarno/CancerOptimization","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/greatwhiz/tft_tf2","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Scallions/tft_paddle","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ashi-k/tft","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/LiamMaclean216/Any-Coin-TFN","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mattsherar/Temporal_Fusion_Transform","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ggaggu/Diprunning_study","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/aqua1907/tft","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/aryan-jadon/regression-loss-functions-in-time-series-forecasting-tensorflow","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JonathanRayner/Kaggle-Predict-Sales","reach":{"status":"ok"}}],"summary":{"ran_fixture":3,"ran_honours":1,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"listed":{"samples":10,"ran":5,"repositories":4}},"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":5,"samples":[{"code_sha256_prefix":"7c95cb374bdd7ed4","entry":"a_norm","repo":"LiamMaclean216/Any-Coin-TFN","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/LiamMaclean216/Any-Coin-TFN/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c95cb374bdd7ed4"}},{"code_sha256_prefix":"72ce5bea9e3abec1","entry":"attention","repo":"LiamMaclean216/Any-Coin-TFN","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/LiamMaclean216/Any-Coin-TFN/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"72ce5bea9e3abec1"}},{"code_sha256_prefix":"608920c78f1ae5e9","entry":"get_n_params","repo":"LiamMaclean216/Any-Coin-TFN","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/LiamMaclean216/Any-Coin-TFN/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"608920c78f1ae5e9"}},{"code_sha256_prefix":"c3f734aa50290d68","entry":"load_data","repo":"LiamMaclean216/Temporal-Fusion-Transformer","repo_kind":"listed","path":"data.py","file_url":"https://github.com/LiamMaclean216/Temporal-Fusion-Transformer/blob/HEAD/data.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c3f734aa50290d68"}},{"code_sha256_prefix":"7e9f6b9b785a1b6a","entry":"one_hot","repo":"LiamMaclean216/Temporal-Fusion-Transformer","repo_kind":"listed","path":"data.py","file_url":"https://github.com/LiamMaclean216/Temporal-Fusion-Transformer/blob/HEAD/data.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7e9f6b9b785a1b6a"}},{"code_sha256_prefix":"b1e5983bdd5cf42a","entry":"aggregate_weights","repo":"PlaytikaResearch/tft-torch","repo_kind":"listed","path":"tft_torch/visualize.py","file_url":"https://github.com/PlaytikaResearch/tft-torch/blob/HEAD/tft_torch/visualize.py","link_basis":"harvester_set","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":"b1e5983bdd5cf42a"}},{"code_sha256_prefix":"8cd61d6b957edb62","entry":"compute_quantile_loss_instance_wise","repo":"PlaytikaResearch/tft-torch","repo_kind":"listed","path":"tft_torch/loss.py","file_url":"https://github.com/PlaytikaResearch/tft-torch/blob/HEAD/tft_torch/loss.py","link_basis":"harvester_set","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":"8cd61d6b957edb62"}},{"code_sha256_prefix":"3af6ae65fe631626","entry":"display_sample_wise_selection_stats","repo":"PlaytikaResearch/tft-torch","repo_kind":"listed","path":"tft_torch/visualize.py","file_url":"https://github.com/PlaytikaResearch/tft-torch/blob/HEAD/tft_torch/visualize.py","link_basis":"harvester_set","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":"3af6ae65fe631626"}},{"code_sha256_prefix":"4c5a235eedb8d13a","entry":"get_quantiles_loss_and_q_risk","repo":"PlaytikaResearch/tft-torch","repo_kind":"listed","path":"tft_torch/loss.py","file_url":"https://github.com/PlaytikaResearch/tft-torch/blob/HEAD/tft_torch/loss.py","link_basis":"harvester_set","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":"4c5a235eedb8d13a"}},{"code_sha256_prefix":"afd2b57d5293817f","entry":"preprocess_row","repo":"AWarno/CancerOptimization","repo_kind":"listed","path":"preprocess_data.py","file_url":"https://github.com/AWarno/CancerOptimization/blob/HEAD/preprocess_data.py","link_basis":"harvester_set","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":"afd2b57d5293817f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}