{"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/autoformer-decomposition-transformers-with","title":"Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting","arxiv_id":"2106.13008","date":"2021-06-24","proceeding":"NeurIPS 2021 12","authors":["Haixu Wu","Jiehui Xu","Jianmin Wang","Mingsheng Long"],"abstract":"Extending the forecasting time is a critical demand for real applications, such as extreme weather early warning and long-term energy consumption planning. This paper studies the long-term forecasting problem of time series. Prior Transformer-based models adopt various self-attention mechanisms to discover the long-range dependencies. However, intricate temporal patterns of the long-term future prohibit the model from finding reliable dependencies. Also, Transformers have to adopt the sparse versions of point-wise self-attentions for long series efficiency, resulting in the information utilization bottleneck. Going beyond Transformers, we design Autoformer as a novel decomposition architecture with an Auto-Correlation mechanism. We break with the pre-processing convention of series decomposition and renovate it as a basic inner block of deep models. This design empowers Autoformer with progressive decomposition capacities for complex time series. Further, inspired by the stochastic process theory, we design the Auto-Correlation mechanism based on the series periodicity, which conducts the dependencies discovery and representation aggregation at the sub-series level. Auto-Correlation outperforms self-attention in both efficiency and accuracy. In long-term forecasting, Autoformer yields state-of-the-art accuracy, with a 38% relative improvement on six benchmarks, covering five practical applications: energy, traffic, economics, weather and disease. Code is available at this repository: \\url{https://github.com/thuml/Autoformer}.","url_abs":"https://arxiv.org/abs/2106.13008v5","url_pdf":"https://arxiv.org/pdf/2106.13008v5.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":"autoformer-decomposition-transformers-with","repo_url":"https://github.com/thuml/autoformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"autoformer-decomposition-transformers-with","repo_url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/autoformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"autoformer-decomposition-transformers-with","repo_url":"https://github.com/WenjieDu/PyPOTS","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"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":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/time-series-forecasting-on-etth1-336-1","task":"Time Series Forecasting","dataset":"ETTh1 (336) Multivariate","model":"Autoformer","rank_in_archive_order":62,"of":72,"metrics":{"MAE":"0.484","MSE":"0.505"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2106.13008","atlas_url":"https://app.syntology.ai/?focus=2106.13008","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.13008"}},"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/thuml/Autoformer","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/autoformer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/WenjieDu/PyPOTS","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thuml/autoformer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":12,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":11,"ran":10,"repositories":1},"listed":{"samples":5,"ran":3,"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":"d0d7e1a62ce9a487","entry":"AutoCorrelation","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d0d7e1a62ce9a487"}},{"code_sha256_prefix":"86002073aa37c338","entry":"AutoCorrelationLayer","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"86002073aa37c338"}},{"code_sha256_prefix":"b67927730a8e4c56","entry":"DataEmbedding_wo_pos","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b67927730a8e4c56"}},{"code_sha256_prefix":"fec719ccc1a83273","entry":"Decoder","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fec719ccc1a83273"}},{"code_sha256_prefix":"b4cbe9d6ab095cdf","entry":"DecoderLayer","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b4cbe9d6ab095cdf"}},{"code_sha256_prefix":"09148e200d49d64c","entry":"Encoder","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"09148e200d49d64c"}},{"code_sha256_prefix":"d73afac4def3cad2","entry":"EncoderLayer","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d73afac4def3cad2"}},{"code_sha256_prefix":"c9a3cbac02773ea2","entry":"MovingAvgBlock","repo":"WenjieDu/PyPOTS","repo_kind":"listed","path":"pypots/nn/modules/autoformer/layers.py","file_url":"https://github.com/WenjieDu/PyPOTS/blob/HEAD/pypots/nn/modules/autoformer/layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"c9a3cbac02773ea2"}},{"code_sha256_prefix":"f42a7fe1ccedb9dd","entry":"MultiHeadAttention","repo":"WenjieDu/PyPOTS","repo_kind":"listed","path":"pypots/nn/modules/autoformer/layers.py","file_url":"https://github.com/WenjieDu/PyPOTS/blob/HEAD/pypots/nn/modules/autoformer/layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"f42a7fe1ccedb9dd"}},{"code_sha256_prefix":"d63bc21c9187631a","entry":"SeriesDecompositionBlock","repo":"WenjieDu/PyPOTS","repo_kind":"listed","path":"pypots/nn/modules/autoformer/layers.py","file_url":"https://github.com/WenjieDu/PyPOTS/blob/HEAD/pypots/nn/modules/autoformer/layers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"d63bc21c9187631a"}},{"code_sha256_prefix":"7c956e353b5b9e7c","entry":"TokenEmbedding","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7c956e353b5b9e7c"}},{"code_sha256_prefix":"027c93847484d85a","entry":"compared_version","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"027c93847484d85a"}},{"code_sha256_prefix":"e19320a7ff1b54a1","entry":"my_Layernorm","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e19320a7ff1b54a1"}},{"code_sha256_prefix":"7eeecf9ed43a551d","entry":"AttentionOperator","repo":"WenjieDu/PyPOTS","repo_kind":"listed","path":"pypots/nn/modules/autoformer/layers.py","file_url":"https://github.com/WenjieDu/PyPOTS/blob/HEAD/pypots/nn/modules/autoformer/layers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"7eeecf9ed43a551d"}},{"code_sha256_prefix":"a9330eefe8b2c5c7","entry":"AutoformerEncoderLayer","repo":"WenjieDu/PyPOTS","repo_kind":"listed","path":"pypots/nn/modules/autoformer/layers.py","file_url":"https://github.com/WenjieDu/PyPOTS/blob/HEAD/pypots/nn/modules/autoformer/layers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a9330eefe8b2c5c7"}},{"code_sha256_prefix":"16dec41e5dbdd719","entry":"Model","repo":"thuml/autoformer","repo_kind":"official","path":"models/Autoformer.py","file_url":"https://github.com/thuml/autoformer/blob/HEAD/models/Autoformer.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":"16dec41e5dbdd719"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}