19 — Deep Learning

Transformers for Time Series#

Deep Learning✓ Mathematical
◆ The PatternAttention-based forecasting at scale

Time-series transformers adapt the attention mechanism from NLP for temporal data. Informer uses ProbSparse attention for long sequences. Autoformer integrates decomposition into the architecture. PatchTST treats time windows as patches, achieving state-of-the-art results with channel-independent processing.

// Interactive — patched attention for time series
ModelKey InnovationBest For
InformerProbSparse attentionLong sequence forecasting
AutoformerBuilt-in decompositionSeasonal data
PatchTSTChannel-independent patchesMultivariate benchmarks
TimesFMPre-trained foundation modelZero-shot forecasting
# Python — PatchTST with HuggingFace
from transformers import PatchTSTForPrediction

model = PatchTSTForPrediction.from_pretrained(
    "ibm/patchtst-etth1-forecasting"
)
# Or with Darts library
from darts.models import TFTModel
model = TFTModel(input_chunk_length=96, output_chunk_length=24)
Pattern bridge: Time-series transformers borrow directly from the self-attention and positional encoding in LLMs. The patching strategy in PatchTST is analogous to tokenization — chunking continuous signals into digestible pieces.
← Previous
Temporal CNN (TCN)
Open in the full reader, with the topic sidebar →