{"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/basisformer-attention-based-time-series-1","title":"BasisFormer: Attention-based Time Series Forecasting with Learnable and Interpretable Basis","arxiv_id":"2310.20496","date":"2023-10-31","proceeding":"NeurIPS 2023 11","authors":["Zelin Ni","Hang Yu","Shizhan Liu","Jianguo Li","Weiyao Lin"],"abstract":"Bases have become an integral part of modern deep learning-based models for time series forecasting due to their ability to act as feature extractors or future references. To be effective, a basis must be tailored to the specific set of time series data and exhibit distinct correlation with each time series within the set. However, current state-of-the-art methods are limited in their ability to satisfy both of these requirements simultaneously. To address this challenge, we propose BasisFormer, an end-to-end time series forecasting architecture that leverages learnable and interpretable bases. This architecture comprises three components: First, we acquire bases through adaptive self-supervised learning, which treats the historical and future sections of the time series as two distinct views and employs contrastive learning. Next, we design a Coef module that calculates the similarity coefficients between the time series and bases in the historical view via bidirectional cross-attention. Finally, we present a Forecast module that selects and consolidates the bases in the future view based on the similarity coefficients, resulting in accurate future predictions. Through extensive experiments on six datasets, we demonstrate that BasisFormer outperforms previous state-of-the-art methods by 11.04\\% and 15.78\\% respectively for univariate and multivariate forecasting tasks. Code is available at: \\url{https://github.com/nzl5116190/Basisformer}","url_abs":"https://arxiv.org/abs/2310.20496v2","url_pdf":"https://arxiv.org/pdf/2310.20496v2.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":"basisformer-attention-based-time-series-1","repo_url":"https://github.com/nzl5116190/basisformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series-forecasting","task_name":"Time Series Forecasting"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/time-series-forecasting-on-etth1-336-1","task":"Time Series Forecasting","dataset":"ETTh1 (336) Multivariate","model":"Basisformer","rank_in_archive_order":52,"of":72,"metrics":{"MAE":"0.451","MSE":"0.473"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2310.20496","atlas_url":"https://app.syntology.ai/?focus=2310.20496","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.20496"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"deterministic:regex_extraction","url":"https://github.com/nzl5116190/Basisformer","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nzl5116190/basisformer","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":6},"by_repo_kind":{"official":{"samples":12,"ran":6,"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":12,"samples":[{"code_sha256_prefix":"d763cca3c7f80812","entry":"BCAB","repo":"nzl5116190/basisformer","repo_kind":"official","path":"model.py","file_url":"https://github.com/nzl5116190/basisformer/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d763cca3c7f80812"}},{"code_sha256_prefix":"03d63d172032b256","entry":"CORR","repo":"nzl5116190/Basisformer","repo_kind":"official","path":"evaluate_tool.py","file_url":"https://github.com/nzl5116190/Basisformer/blob/HEAD/evaluate_tool.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"03d63d172032b256"}},{"code_sha256_prefix":"a5c9297bf66c897e","entry":"MLP_bottle","repo":"nzl5116190/basisformer","repo_kind":"official","path":"model.py","file_url":"https://github.com/nzl5116190/basisformer/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a5c9297bf66c897e"}},{"code_sha256_prefix":"6d41fccc23b87628","entry":"channel_AutoCorrelationLayer","repo":"nzl5116190/basisformer","repo_kind":"official","path":"model.py","file_url":"https://github.com/nzl5116190/basisformer/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6d41fccc23b87628"}},{"code_sha256_prefix":"77e2ce6a639b631b","entry":"last_layer","repo":"nzl5116190/basisformer","repo_kind":"official","path":"model.py","file_url":"https://github.com/nzl5116190/basisformer/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"77e2ce6a639b631b"}},{"code_sha256_prefix":"806f37ee31a4de89","entry":"plot_seq_feature","repo":"nzl5116190/Basisformer","repo_kind":"official","path":"pyplot.py","file_url":"https://github.com/nzl5116190/Basisformer/blob/HEAD/pyplot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"806f37ee31a4de89"}},{"code_sha256_prefix":"e26529d5f5ebdc84","entry":"Basisformer","repo":"nzl5116190/basisformer","repo_kind":"official","path":"model.py","file_url":"https://github.com/nzl5116190/basisformer/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e26529d5f5ebdc84"}},{"code_sha256_prefix":"4ed48971298f7621","entry":"Coefnet","repo":"nzl5116190/basisformer","repo_kind":"official","path":"model.py","file_url":"https://github.com/nzl5116190/basisformer/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4ed48971298f7621"}},{"code_sha256_prefix":"75f44993b096bf76","entry":"MAE","repo":"nzl5116190/Basisformer","repo_kind":"official","path":"evaluate_tool.py","file_url":"https://github.com/nzl5116190/Basisformer/blob/HEAD/evaluate_tool.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"75f44993b096bf76"}},{"code_sha256_prefix":"b40a11875ebd0cd2","entry":"RSE","repo":"nzl5116190/Basisformer","repo_kind":"official","path":"evaluate_tool.py","file_url":"https://github.com/nzl5116190/Basisformer/blob/HEAD/evaluate_tool.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b40a11875ebd0cd2"}},{"code_sha256_prefix":"9a5fcd4ebfc55d03","entry":"time_features","repo":"nzl5116190/Basisformer","repo_kind":"official","path":"data_provider/timefeatures.py","file_url":"https://github.com/nzl5116190/Basisformer/blob/HEAD/data_provider/timefeatures.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9a5fcd4ebfc55d03"}},{"code_sha256_prefix":"f8544563682146e5","entry":"time_features_from_frequency_str","repo":"nzl5116190/Basisformer","repo_kind":"official","path":"data_provider/timefeatures.py","file_url":"https://github.com/nzl5116190/Basisformer/blob/HEAD/data_provider/timefeatures.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f8544563682146e5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}