Progressive Memory Transformer: Memory-Aware Attention for Time-Series

Tord Sture Stangeland, Andreas Köhler, Steffen Maeland, Adín Ramírez RiveraNeurIPS 2026

TL;DR

Time-series signals tell stories at three simultaneous resolutions: millisecond jitter, recurring intermediate rhythms, and overarching trends. Standard self-supervised models typically squash these rich intermediate rhythms into a single global summary, losing crucial mid-range structure along the way. By equipping a Transformer with writable, sliding-window "notepads" and supervising all three scales directly, the Progressive Memory Transformer (PMT) learns representations that excel simultaneously at local forecasting, mid-range motif detection, and global classification.

What Problem Does This Paper Address?

Think about listening to a piece of music: you hear individual notes (local), recurring melodic phrases or motifs (mid-range), and the overall genre or mood (global). Real-world time-series—from heartbeats to seismic waves—have this exact multi-scale hierarchy, and different downstream tasks care about different scales.

In self-supervised learning (SSL), where models learn representations from unlabeled data, conventional transformers already give you fine-grained tokens and a global [CLS] summary token. However, the intermediate scale—where recurring motifs actually live—is usually treated as a throwaway internal variable or destructively compressed via pooling. Even memory-augmented transformers either treat past segments as read-only caches (like Transformer-XL) or store them in global banks detached from specific time windows. Consequently, you cannot directly teach the model what a good mid-range representation looks like.

Figure 1: An illustration of the three levels of representation and how they capture distinct structural patterns. Shaded regions indicate expanding receptive fields. Exposing the intermediate representations (gray background) enables direct supervision at multiple scales, unlike standard global readouts.

Methods

To make the mid-range scale a "first-class citizen," the authors pair a novel architecture with a three-tiered contrastive learning framework (training the model by comparing two differently augmented views of the same signal):

  • Progressive Memory Attention (PMA): After slicing the waveform into overlapping patch tokens and grouping them into sliding windows, PMA equips each window with a small set of writable, sample-specific memory slots. As processing moves forward, memory flows horizontally from the previous window and vertically from the previous layer. Adaptive gates (similar to RNN forget gates) mix incoming memory with a learned reset state so the model can overwrite stale context when the signal's regime shifts.
  • Three-Scale Contrastive Supervision: Because PMT explicitly exposes tokens, window-aligned memory slots, and a global [CLS] vector, each gets its own tailored contrastive loss:
  • Local — Hierarchical Gaussian Contrastive Loss (HGCL): Aligns individual tokens across views. Instead of treating neighboring tokens in the same series as harsh negatives (since nearby points are naturally correlated), it softly weights them using a Gaussian curve derived purely from window geometry—no expensive Dynamic Time Warping (DTW) required.
  • Mid-Range — PMA Contrastive Loss (PCL): Forces each window's writable memory slots to agree across augmented views, turning slots into robust motif detectors rather than raw token caches.
  • Global — Instance Contrastive Loss (ICL): Standard sequence-level agreement on the [CLS] token.
Figure 2: PMA information flow (1).

Datasets

  • Global Classification: Eight standard UCR, UEA, and UCI benchmarks covering human activity, medical signals, sensors, and astronomy: HAR, Epilepsy, Wafer, FordA, FordB, PhalangesOutlinesCorrect (POC), ElectricDevices, and StarLightCurves.
  • Local Forecasting: ETTh1 (electricity transformer temperature) and Electricity consumption across horizons from 24 to 720 steps.
  • Mid-Range Cue Retention (New Probe): The authors introduce a synthetic benchmark built on FordA. They inject a brief Hann-tapered burst at varying distances from the end of a sequence into a frozen, pretrained model that has never seen such bursts. A linear probe then tries to detect whether the burst occurred by looking only at the final end-of-sequence state—testing whether mid-range surprises are genuinely carried forward.

Key Insights and Ideas

  • Exposing memory isn't enough; supervising it is the magic: In the cue-retention test, state-propagating backbones (xLSTM, Transformer-XL) naturally beat pooling-based models like TS2Vec. Yet when PMT's mid-range loss (PCL) is turned off, it performs just like Transformer-XL. Turning PCL on vaults detection accuracy upward—proving that explicitly supervising the memory interface forces it to preserve salient intermediate events.
  • Tokenizer stride makes or breaks high-frequency signals: While patch size is forgiving, moving from heavily overlapping patches (10% stride) to non-overlapping patches (100% stride) craters accuracy by 23 percentage points on engine-vibration data (FordA). Short-lived phase events easily slip through the cracks of coarse strides.
  • Zero-fuss loss balancing: Simply setting all three loss weights to 1 lands within 0.4 percentage points of exhaustively tuned weights, meaning the three scales complement rather than fight each other.

Key Results

  • Low-Label Classification: With a frozen backbone and only 1% or 5% labeled data, PMT achieves the highest average Top-1 accuracy across the eight benchmarks (85.0% vs. 83.5% for TS-TCC+SoftCLT), shining brightest on the longest sequences (StarLightCurves, gaining +6.6 percentage points at 1% labels).
  • Mid-Range Retention & Motifs: On the cue-retention probe, PMT hits 0.995 AUC (96.6% Top-1), outperforming TS2Vec (0.639 AUC), Transformer-XL (0.967), and xLSTM (0.986). Qualitatively, when fed a spliced human-activity signal (walking upstairs $\rightarrow$ downstairs $\rightarrow$ upstairs), PMT's memory states produce crisp block-diagonal similarity matrices that cleanly separate activities far better than raw tokens.
  • Forecasting: PMT beats SoftCLT on 31 out of 40 horizon evaluations across ETTh1 and Electricity, winning every horizon on Electricity.
Figure 3: Cosine similarity matrices for the representations and states between pair-wise signals from HAR. Higher similarity shows that the signals correlate as evidenced by the learned embeddings. The vertical bars denote the different sections of the hybrid wave. The wave number corresponds to the sample index in the validation dataset.

Limitations and Future Work

On engine-vibration datasets (FordA/B), PMT leads at 1% labels, but its accuracy stagnates when given 5% labels—whereas autoregressive baselines surge ahead by 11–20 percentage points. The authors note two culprits: high sensitivity to tokenizer stride for transient frequency events, and the fact that purely agreement-based contrastive losses lack the phase-relative positioning naturally captured by predictive (future-guessing) objectives. Bridging this gap by integrating a predictive pretraining component—alongside addressing tokenizer sensitivity and contrastive batch-size requirements—is a clear next step.

Summary updated

Abstract

Time-series carry structure simultaneously at multiple scales (fine-grained variation, mid-range motifs, and global properties) and downstream tasks operate at correspondingly different scales. Most existing self-supervised learning approaches supervise representations globally via instance-level contrastive losses and limited temporal neighborhood supervision, but do not explicitly exploit the structural hierarchy. We propose a learning framework that explicitly enforces a structural hierarchy across three scales independently: a local objective for token alignment, a mid-range objective for window-level motifs, and a global objective for sequence-level agreement. Realizing this framework requires the backbone to expose a representation at each scale; we introduce Progressive Memory Transformer (PMT), which augments a transformer with writable, window-aligned memory that exposes the mid-range scale alongside the token and sequence-level representations conventional transformers already provide. Across eight UCR/UEA/UCI classification benchmarks, a cue-retention probe, and forecasting benchmarks, PMT learns representations that probe well at the global, mid-range, and local scales—strong low-label classification (1–5% labels), competitive forecasting performance across multiple horizons, and quantitative and qualitative evidence that memory states capture mid-range motifs.
BibTeX
@inproceedings{stangeland2026progressive,
  author = {Tord Sture Stangeland and Andreas Köhler and Steffen Maeland and Adín Ramírez Rivera},
  title = {{Progressive Memory Transformer: Memory-Aware Attention for Time-Series}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=jyIfuVt2UU},
}
Figure