Papers › A Time Series is Worth 64 Words: Long-term Forecasting with Transformers

A Time Series is Worth 64 Words: Long-term Forecasting with Transformers

27 Nov 2022arXiv:2211.14730archive 2025-07-28

Yuqi Nie, Nam H. Nguyen, Phanwadee Sinthong, Jayant Kalagnanam

We propose an efficient design of Transformer-based models for multivariate time series forecasting and self-supervised representation learning. It is based on two key components: (i) segmentation of time series into subseries-level patches which are served as input tokens to Transformer; (ii) channel-independence where each channel contains a single univariate time series that shares the same embedding and Transformer weights across all the series. Patching design naturally has three-fold benefit: local semantic information is retained in the embedding; computation and memory usage of the attention maps are quadratically reduced given the same look-back window; and the model can attend longer history. Our channel-independent patch time series Transformer (PatchTST) can improve the long-term forecasting accuracy significantly when compared with that of SOTA Transformer-based models. We also apply our model to self-supervised pre-training tasks and attain excellent fine-tuning performance, which outperforms supervised training on large datasets. Transferring of masked pre-trained representation on one dataset to others also produces SOTA forecasting accuracy. Code is available at: https://github.com/yuqinie98/PatchTST.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2211.14730")

Code

Syntology Ran 7 of 30 code samples harvested from 6 repositories linked to this paper; 23 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 6 ran with no contract checked.

By repository: official repository: 8 samples from 1 repository, 2 ran; community (archive-listed): 22 samples from 5 repositories, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

yuqinie98/patchtst officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
arclab-mit/sw-driver-forecaster mentioned on GitHubpytorchApache-2.0 report
romilbert/samformer mentioned on GitHubtf report
thuml/iTransformer mentioned on GitHubpytorch report
timeseriesAI/tsai mentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

30 samples harvested; 7 ran; 0 honoured the contract we drafted; 23 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
6ran
23unverified

Licence: 0 of the 30 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 6 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Flatten_Head yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 924854bdeb316b83 · report
RevIN yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · a7b56d4ba3fc4e05 · report
PatchTST_backbone yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository unverified Apache-2.0 (permissive) · 23dc6db25b8074c9 · report
TSTEncoder yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository unverified Apache-2.0 (permissive) · 935deedae3555ede · report
TSTEncoderLayer yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository unverified Apache-2.0 (permissive) · ce09df21971e2a59 · report
TSTiEncoder yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository unverified Apache-2.0 (permissive) · 583948f80990e843 · report
_MultiheadAttention yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository unverified Apache-2.0 (permissive) · db1784f091843709 · report
_ScaledDotProductAttention yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py official repository unverified Apache-2.0 (permissive) · 0caa47b3b62aada4 · report
PatchEmbedding WenjieDu/PyPOTS/pypots/nn/modules/patchtst/layers.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted BSD-3-Clause (permissive) · 9bb8f29c7ede97fa · report
PositionalEncoding WenjieDu/PyPOTS/pypots/nn/modules/patchtst/layers.py community (archive-listed) ran fingerprinted BSD-3-Clause (permissive) · 492dd85148f4f725 · report
RevIN romilbert/samformer/samformer_pytorch/samformer/samformer.py community (archive-listed) ran · metamorphic tier: invariant Apache-2.0 (permissive) · 299bb76dee459375 · report
SAMFormerArchitecture romilbert/samformer/samformer_pytorch/samformer/samformer.py community (archive-listed) ran Apache-2.0 (permissive) · d4cfb7ce9eee3e29 · report
scaled_dot_product_attention romilbert/samformer/samformer_pytorch/samformer/samformer.py community (archive-listed) ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 21d036b82013b9f5 · report
Model thuml/iTransformer/model/iTransformer.py community (archive-listed) unverified MIT (permissive) · d1fa32a7b86667ec · report
bold_best arclab-mit/sw-driver-forecaster/swdf/plots.py community (archive-listed) unverified Apache-2.0 (permissive) · 19fa411f0e0b205f · report
custom_doc_links timeseriesAI/tsai/tsai/_nbdev.py community (archive-listed) unverified Apache-2.0 (permissive) · c00f1d9594b0678a · report
euclidean_distance_dict arclab-mit/sw-driver-forecaster/swdf/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · d0e642167565d536 · report
forecast_error arclab-mit/sw-driver-forecaster/swdf/benchmark.py community (archive-listed) unverified Apache-2.0 (permissive) · 5b63e338d455f44a · report
get_classified_columns arclab-mit/sw-driver-forecaster/swdf/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 0c4835b27ac129bc · report
get_idxs_per_solar_activity_level arclab-mit/sw-driver-forecaster/swdf/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 82677ec6b39c1fda · report
get_lds_kernel_window timeseriesAI/tsai/tsai/callback/core.py community (archive-listed) unverified Apache-2.0 (permissive) · 2bbd4bfccd060fed · report
inverse_scale_values_below_threshold arclab-mit/sw-driver-forecaster/swdf/metrics.py community (archive-listed) unverified Apache-2.0 (permissive) · b28a75229f1ab34d · report
is_installed timeseriesAI/tsai/tsai/imports.py community (archive-listed) unverified Apache-2.0 (permissive) · 9b5013e73b919955 · report
nb_name_to_py timeseriesAI/tsai/tsai/export.py community (archive-listed) unverified Apache-2.0 (permissive) · bc18aebf89319382 · report
percent_forecast_error arclab-mit/sw-driver-forecaster/swdf/benchmark.py community (archive-listed) unverified Apache-2.0 (permissive) · 984b7d634fd80a20 · report
plot_predictions_performance arclab-mit/sw-driver-forecaster/swdf/plots.py community (archive-listed) unverified Apache-2.0 (permissive) · b462a292e7a87197 · report
prepare_LDS_weights timeseriesAI/tsai/tsai/callback/core.py community (archive-listed) unverified Apache-2.0 (permissive) · c2f4fa1e770585ff · report
prepare_tensor_to_forecast_histogram arclab-mit/sw-driver-forecaster/swdf/plots.py community (archive-listed) unverified Apache-2.0 (permissive) · 5ca0c802e78ccded · report
py_last_saved timeseriesAI/tsai/tsai/imports.py community (archive-listed) unverified Apache-2.0 (permissive) · eafe0504957d2813 · report
to_local_time timeseriesAI/tsai/tsai/imports.py community (archive-listed) unverified Apache-2.0 (permissive) · aa4127e924213cb3 · report

Tasks

Multivariate Time Series ForecastingRepresentation LearningTime SeriesTime Series AnalysisTime Series Forecasting

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Time Series Forecasting ETTh1 (192) Multivariate PatchTST/64 MAE 0.429 #14 of 17 Archive leaderboard report
Time Series Forecasting ETTh1 (192) Multivariate PatchTST/64 MSE 0.413 #14 of 17 Archive leaderboard report
Time Series Forecasting ETTh1 (192) Univariate PatchTST/64 MAE 0.215 #5 of 5 Archive leaderboard report
Time Series Forecasting ETTh1 (192) Univariate PatchTST/64 MSE 0.074 #5 of 5 Archive leaderboard report
Time Series Forecasting ETTh1 (336) Multivariate PatchTST/64 MAE 0.44 #18 of 72 Archive leaderboard report
Time Series Forecasting ETTh1 (336) Multivariate PatchTST/64 MSE 0.422 #18 of 72 Archive leaderboard report
Time Series Forecasting ETTh1 (336) Univariate PatchTST/64 MAE 0.22 #2 of 10 Archive leaderboard report
Time Series Forecasting ETTh1 (336) Univariate PatchTST/64 MSE 0.076 #2 of 10 Archive leaderboard report
Time Series Forecasting ETTh1 (720) Multivariate PatchTST/64 MAE 0.468 #10 of 22 Archive leaderboard report
Time Series Forecasting ETTh1 (720) Multivariate PatchTST/64 MSE 0.447 #10 of 22 Archive leaderboard report
Time Series Forecasting ETTh1 (720) Univariate PatchTST/64 MAE 0.236 #4 of 12 Archive leaderboard report
Time Series Forecasting ETTh1 (720) Univariate PatchTST/64 MSE 0.087 #4 of 12 Archive leaderboard report
Time Series Forecasting ETTh1 (96) Multivariate PatchTST/64 MAE 0.4 #10 of 15 Archive leaderboard report
Time Series Forecasting ETTh1 (96) Multivariate PatchTST/64 MSE 0.37 #10 of 15 Archive leaderboard report
Time Series Forecasting ETTh1 (96) Univariate PatchTST/64 MAE 0.189 #6 of 6 Archive leaderboard report
Time Series Forecasting ETTh1 (96) Univariate PatchTST/64 MSE 0.059 #6 of 6 Archive leaderboard report
Time Series Forecasting ETTh2 (192) Multivariate PatchTST/64 MAE 0.382 #11 of 16 Archive leaderboard report
Time Series Forecasting ETTh2 (192) Multivariate PatchTST/64 MSE 0.341 #11 of 16 Archive leaderboard report
Time Series Forecasting ETTh2 (192) Univariate PatchTST/64 MAE 0.329 #4 of 6 Archive leaderboard report
Time Series Forecasting ETTh2 (192) Univariate PatchTST/64 MSE 0.171 #4 of 6 Archive leaderboard report
Time Series Forecasting ETTh2 (336) Multivariate PatchTST/64 MAE 0.384 #5 of 20 Archive leaderboard report
Time Series Forecasting ETTh2 (336) Multivariate PatchTST/64 MSE 0.329 #5 of 20 Archive leaderboard report
Time Series Forecasting ETTh2 (336) Univariate PatchTST/64 MAE 0.336 #4 of 10 Archive leaderboard report
Time Series Forecasting ETTh2 (336) Univariate PatchTST/64 MSE 0.171 #4 of 10 Archive leaderboard report
Time Series Forecasting ETTh2 (720) Multivariate PatchTST/64 MAE 0.422 #3 of 20 Archive leaderboard report
Time Series Forecasting ETTh2 (720) Multivariate PatchTST/64 MSE 0.379 #3 of 20 Archive leaderboard report
Time Series Forecasting ETTh2 (720) Univariate PatchTST/64 MAE 0.38 #5 of 11 Archive leaderboard report
Time Series Forecasting ETTh2 (720) Univariate PatchTST/64 MSE 0.223 #5 of 11 Archive leaderboard report
Time Series Forecasting ETTh2 (96) Multivariate PatchTST/64 MAE 0.337 #9 of 16 Archive leaderboard report
Time Series Forecasting ETTh2 (96) Multivariate PatchTST/64 MSE 0.274 #9 of 16 Archive leaderboard report
Time Series Forecasting ETTh2 (96) Univariate PatchTST/64 MAE 0.284 #5 of 6 Archive leaderboard report
Time Series Forecasting ETTh2 (96) Univariate PatchTST/64 MSE 0.131 #5 of 6 Archive leaderboard report
Time Series Forecasting Electricity (192) PatchTST/64 MSE 0.147 #4 of 8 Archive leaderboard report
Time Series Forecasting Electricity (336) PatchTST/64 MSE 0.163 #6 of 9 Archive leaderboard report
Time Series Forecasting Electricity (720) PatchTST/64 MSE 0.197 #5 of 8 Archive leaderboard report
Time Series Forecasting Electricity (96) PatchTST/64 MSE 0.129 #5 of 11 Archive leaderboard report
Time Series Forecasting Weather (192) PatchTST/64 MSE 0.194 #9 of 13 Archive leaderboard report
Time Series Forecasting Weather (336) PatchTST/64 MSE 0.245 #8 of 11 Archive leaderboard report
Time Series Forecasting Weather (720) PatchTST/64 MSE 0.314 #6 of 11 Archive leaderboard report
Time Series Forecasting Weather (96) PatchTST/64 MSE 0.149 #9 of 12 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections