Papers
Topics
Authors
Recent
Search
2000 character limit reached

PatchTST Architecture

Updated 10 March 2026
  • PatchTST is a transformer-based model that segments time series into patches, processing each channel independently to enhance forecasting efficiency.
  • The architecture incorporates learnable positional encodings and modular Transformer layers to capture temporal structure while mitigating noise through targeted augmentations.
  • Variants like CT-PatchTST extend the framework with cross-channel attention, improving inter-variable dependency learning for superior long-term predictions and activity recognition.

PatchTST is a transformer-based deep time series model designed for efficient and accurate multivariate forecasting and robust sequence classification. It is distinguished by its patch-level tokenization of time series, strict channel independence (in the original form), and architectural adaptations tailored to both forecasting and real-world sensor data perturbations. PatchTST variants have established state-of-the-art performance for long-term horizon prediction and demonstrate high robustness in noisy human activity recognition tasks.

1. Patch Segmentation and Embedding

PatchTST processes time series windows by segmenting them along the temporal axis into fixed-length non-overlapping or overlapping patches. Given an input X∈RC×LX \in \mathbb{R}^{C \times L} (with CC channels and LL time steps), the signal is split into PP contiguous patches of length τ=L/P\tau = L/P per channel. Each patch a(p)∈RC×τa^{(p)} \in \mathbb{R}^{C \times \tau} is vectorized via channel-wise stacking, resulting in vec(a(p))∈RC⋅τ\mathrm{vec}(a^{(p)}) \in \mathbb{R}^{C \cdot \tau}. A shared learnable linear projection E∈R(C⋅τ)×dE \in \mathbb{R}^{(C \cdot \tau) \times d} together with bias b∈Rdb \in \mathbb{R}^d maps each patch to a dd-dimensional embedding:

xp=ET vec(a(p))+b ,p=1,…,P .x_p = E^T\,\mathrm{vec}(a^{(p)}) + b\,, \qquad p=1,\ldots,P\,.

This yields the patch token sequence X0=[x1;…;xP]∈RP×dX^0 = [x_1; \ldots; x_P] \in \mathbb{R}^{P \times d}. Positional encoding, usually sinusoidal or learnable, is added to each patch token to encode temporal order:

Z0=X0+PE ,Z^0 = X^0 + PE\,,

where PE∈RP×dPE \in \mathbb{R}^{P \times d}. Fixed sinusoidal encoding is used in noise-aware HAR applications, while learnable positional encoding is adopted for forecasting tasks (Nie et al., 2022, Chandankar et al., 24 Oct 2025, Huo et al., 15 Jan 2025).

2. Channel Independence and Channel–Time Extensions

The canonical PatchTST model applies a strictly channel-independent processing paradigm. For multivariate time series X∈RM×LX \in \mathbb{R}^{M \times L}, each channel is patched and embedded independently using shared weights, but no cross-channel mixing occurs within the Transformer backbone. Formally, for channel ii, the embedded tokens Z(i)Z^{(i)} are fed through identical Transformer modules, and final forecasts are concatenated:

[ x^(1),…,x^(M) ] ,x^(i)∈RT.\left[\,\widehat{\mathbf{x}}^{(1)},\ldots, \widehat{\mathbf{x}}^{(M)}\,\right]\,, \qquad \widehat{\mathbf{x}}^{(i)}\in\mathbb{R}^T.

This channel-independence yields benefits in sample efficiency and regularization, but ignores inter-channel dependencies (Nie et al., 2022). The CT-PatchTST variant (Huo et al., 15 Jan 2025) introduces a dual-stage encoder which first applies single-head attention across channels for each patch and then applies multi-head time attention per channel. Explicit learnable channel embeddings can also be added. This extension enables the model to learn cross-channel dependencies prior to modeling temporal structure.

Variant Cross-Channel Attention Position Encoding
PatchTST None (channel-independent) Sinusoidal or Learnable
CT-PatchTST Yes (per patch, hc=1h_c=1) Learnable (time, channel)

3. Transformer Encoder Architecture

The core encoder consists of a stack of BB identical layers (typically B=3B=3 or B=4B=4), each comprising:

  • Pre-norm multi-head self-attention (MSA), where input is first layer-normalized, then transformed via MSA with hh heads, each of dk=d/hd_k = d/h dimensions.
  • Residual addition after both MSA and subsequent feed-forward network (FFN) blocks.
  • FFN as a two-layer MLP expanding the embedding dimension by a factor (typically $2d$), with activation (GELU or ReLU).
  • Normalization in each sub-layer (LayerNorm in classification and CT-PatchTST, BatchNorm in forecasting).

All PatchTST variants use mean-pooling over the patch dimension after the final encoder layer. The result is projected via a linear classification or regression head, depending on the downstream task (Chandankar et al., 24 Oct 2025, Nie et al., 2022, Huo et al., 15 Jan 2025).

4. Augmentation and Noise Robustness Strategies

In robust sequence classification applications—e.g., human activity recognition (HAR) from wearable inertial sensors—the PatchTST framework incorporates noise-aware, test-matched augmentations. For each normalized 1 s1\,\mathrm{s} (50 sample) window, stochastic augmentation transforms are applied during training:

  • Gaussian jitter (σ∼Uniform(0.01 g, 0.05 g)\sigma \sim \mathrm{Uniform}(0.01\,g,\,0.05\,g))
  • Amplitude scaling (s∼Uniform(0.8,1.2)s \sim \mathrm{Uniform}(0.8,1.2))
  • Small-angle rotation (θ∼Uniform(−15∘,15∘)\theta \sim \mathrm{Uniform}(-15^\circ,15^\circ) with batch-consistent rotation matrices R(θ)R(\theta))
  • Channel dropout (independent axis dropout with p=0.2p=0.2)

In each training batch, exactly one augmentation is sampled and held fixed across the batch, stabilizing normalization statistics. This approach mirrors test-time noise modalities, enabling the model to generalize across real-world sensor perturbations (Chandankar et al., 24 Oct 2025).

5. Ensemble and Probability Fusion Mechanisms

PatchTST demonstrates further robustness in sensor-based classification by training model ensembles per sensor placement (e.g., left/right arms and legs). For each sensor, both a "clean" (unaugmented) and a "robust" (noise-augmented) model is trained. At inference, both models generate probability vectors for each window. These are averaged per sensor, and the aggregated probabilities across all sensors are uniformly weighted:

p~s(c∣w)=12[ pclean,s(c∣w)+probust,s(c∣w) ],p(c∣w)=14∑sp~s(c∣w).\tilde{p}_s(c|w) = \tfrac{1}{2} \big[\,p_{\text{clean},s}(c|w) + p_{\text{robust},s}(c|w)\,\big], \quad p(c|w) = \tfrac{1}{4} \sum_s \tilde{p}_s(c|w).

Label prediction is by maximum probability. This sensor-specific, probability-level ensemble mitigates single-sensor failures and leverages specialization per kinematic context (Chandankar et al., 24 Oct 2025).

6. Application Domains and Performance

PatchTST has demonstrated leading accuracy for long-horizon multivariate forecasting (energy, traffic, epidemiology) and high robustness on noisy wearable HAR benchmarks. Notably, in the 2nd WEAR Dataset Challenge, the sensor-specific dual-stream PatchTST ensemble scored a macro-F1 of 51.72 %51.72\,\% under substantial test perturbations (Chandankar et al., 24 Oct 2025). For multivariate forecasting, PatchTST's patching reduces attention complexity from quadratic in sequence length to quadratic in number of patches, enabling use of longer look-back windows with state-of-the-art accuracy. Ablation studies indicate that grouping time steps into patches (e.g., patch size P=16P=16 with stride S=8S=8) yields improved performance versus tokenizing each time step individually (Nie et al., 2022).

PatchTST's signature channel-wise patching and independence stand in contrast to channel-mixing Transformers, which process the full MM-dimensional input at each time. Channel independence improves regularization and allows learning separate attention patterns per channel, but can fail to capture inter-channel dependencies critical in domains where variable interactions are strong. CT-PatchTST addresses this by interleaving channel and time attention, exploiting cross-channel structure (Huo et al., 15 Jan 2025).

A plausible implication is that while PatchTST scales efficiently to high-dimensional long sequences, its plain variant may be suboptimal where joint representation learning across variables is required. Empirical results show that PatchTST is robust across patch lengths and gains further as look-back windows grow, in contrast to other Transformer variants that can overfit or saturate (Nie et al., 2022).


References:

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to PatchTST Architecture.