OTformer: Non-Stationarity-Aware Adaptive Optimal Transport Attention for Time Series Forecasting

Zhaowei Liu, KaixiangWang, Sheng Liu, ZengyangZhang, HaitaoYang, Rufei Gao, Zongxing Zhao, Yao Shan, Yongchao Song, Yanwei Yu, Anzuo JiangNeurIPS 2026

TL;DR

When forecasting multivariate time series with Transformers, standard Softmax attention suffers from a quiet bias: some variables hog all the attention while others are largely ignored, and the attention sharpness stays rigid even when the underlying data turns volatile. OTformer swaps Softmax for an Optimal Transport (OT) routing mechanism that dynamically smooths or sharpens attention based on how chaotic (non-stationary) each input sample is. The result is fairer information sharing across variables, stronger forecasting accuracy, and zero need to manually tune routing hyperparameters for every new dataset.

What Problem Does This Paper Address?

Recent time series Transformers (like iTransformer) flipped the classic script: instead of turning time steps into tokens, they treat each variable (e.g., an individual weather sensor or power client) as a single token containing its entire look-back history. Self-attention then figures out how variables influence one another.

However, relying on standard Softmax dot-product attention here creates two subtle headaches:

  1. Column-sum imbalance: Softmax forces every row of an attention matrix to sum to 1 (every query distributes 100% of its attention), but leaves the columns completely unconstrained. In practice, a few dominant variables become attention "hubs" while quieter, complementary channels get starved of routing mass.
  2. Rigid sharpness: Real-world time series experience regime shifts and volatility spikes—known as non-stationarity. Stable inputs benefit from sharp, selective matching between variables, whereas volatile inputs need smoother, hedged routing so the model doesn't over-commit to noisy correlations. Softmax uses a fixed sharpness for everything.

Methods

OTformer builds on the standard variate-tokenization backbone (along with optional Reversible Instance Normalization, or RevIN) and introduces three key upgrades:

Figure 1: Overall architecture of OTformer. The model processes multivariate inputs through three stages: (i) variate tokenization with a shared phase embedding (⊕); (ii) Sinkhorn-based optimal transport attention with sample-adaptive entropy regularization εb driven by a non-stationarity score; and (iii) a residual MLP projection head. Since attention is applied along the variate dimension and the encoder/projection weights are shared across variates, the number of learnable parameters in the encoder does not scale with the number of variates N.
  • Adaptive Sinkhorn Attention (New): Instead of dot-product Softmax, OTformer frames attention as an Optimal Transport problem. It measures the squared Euclidean distance between queries and keys as a transport "cost," then runs $K=3$ fast Sinkhorn iterations to find an optimal transport plan. Because Sinkhorn balances both rows and columns toward 1, no variable gets ignored.
  • NonStationarityScorer (New): Because standard instance normalization erases clues about distribution shifts, OTformer inspects the raw, pre-normalized input first. It chops the window into four segments, calculates three lightweight statistics (mean drift, variance drift, and lag-1 autocorrelation decay), and passes them through a tiny MLP to output a sample-wise non-stationarity score $s_b \in (0, 1)$. This score dynamically adjusts the Sinkhorn entropy regularization $\varepsilon_b$: chaotic samples get a larger $\varepsilon_b$ (smoother, safer routing), while stable samples get a smaller $\varepsilon_b$ (sharper routing).
  • Shared Phase Embedding & MLP Head (Refinement): Before entering the encoder, tokens receive a shared embedding indicating where the sample sits in a recurring cycle (like hour-of-day), followed by a 3-layer residual MLP projection head for final predictions.

Datasets

No new datasets are introduced. The authors evaluate OTformer across eight standard multivariate benchmarks:

  • ETT (ETTh1, ETTh2, ETTm1, ETTm2): Electricity transformer temperatures at hourly and 15-minute intervals.
  • Weather: 21 meteorological indicators logged every 10 minutes.
  • ECL (Electricity): Power consumption across 321 clients.
  • Traffic: Road occupancy rates from 862 San Francisco sensors.
  • Solar-Energy: Solar power output from 137 plants in Alabama.

All experiments use a look-back window of 96 steps to predict four horizons: 96, 192, 336, and 720 steps.

Key Insights and Ideas

  • Near-balance beats perfection: Through strictly matched control experiments, the authors show that simply forcing column normalization on standard Softmax already captures most of the accuracy gains! The magic isn't in achieving mathematically exact "double stochasticity" via Optimal Transport—it's simply about curing column-sum starvation so all variables participate.
Table 3: Matched routing controls on ECL (three seeds, mean ± std). All variants share the same backbone and training protocol. Column residual is the mean ℓ1 deviation of the per-head routing matrix column sums from 1. Bold marks the lowest MSE.
  • Adaptation is a tuning-killer, not a ceiling-raiser: Surprisingly, sample-wise adaptive $\varepsilon$ performs almost identically (within 0.08% MSE on ECL) to a fixed $\varepsilon$ carefully tuned on validation data. The "aha" here is practical: adaptive scoring saves engineers from running expensive per-dataset hyperparameter searches while automatically landing on the sweet spot. (And the score truly matters—deliberately flipping the score-to-$\varepsilon$ mapping spikes ECL error by 10.4%.)
  • Topology dictates utility: When transplanted onto another popular backbone (PatchTST), adaptive OT routing slashes MSE by 8.79% on 321-variable ECL, but does nothing on 7-variable ETTh1. Similarly, gains narrow on Traffic, where sparse physical road topology matters more than dense, balanced variable mixing.

Key Results

Across 32 forecasting settings (8 datasets $\times$ 4 horizons), OTformer outperforms its direct iTransformer backbone on the vast majority of metrics and ranks first on 11 out of 16 dataset-metric pairs against recent baselines like DUET, Leddam, and SOFTS.

Table 1: Average multivariate long-term forecasting results across four prediction horizons T ∈ {96, 192, 336, 720}. For each dataset and metric, the best and second-best results are shown in bold and underlined, respectively. The full comparison against an extended set of baselines is provided in Appendix Table A2.
  • Big wins on volatile data: OTformer reduces average MSE over iTransformer by 4.4% on ECL (0.178 $\rightarrow$ 0.171) and 12.5% on Solar-Energy (0.236 $\rightarrow$ 0.207).
  • Noise resilience: Under synthetic Gaussian input noise on ETTh1, OTformer's error degrades noticeably slower than iTransformer's, suggesting balanced routing prevents brittle over-reliance on a few noisy channels.
  • Computational trade-offs: Training time per batch (15.99 ms vs. 15.69 ms) and GPU memory (145.4 MB vs. 151.4 MB) match iTransformer, though the Sinkhorn loop roughly doubles inference latency (3.17 ms vs. 1.47 ms on ETTh1).

Limitations and Future Work

  • Hand-crafted statistics: The NonStationarityScorer relies on three simple, manually chosen metrics; learning richer end-to-end distributional descriptors could capture subtler regime shifts.
  • Inference latency: Sinkhorn iterations add moderate inference overhead, which may matter in ultra-low-latency deployments.
  • Not a universal silver bullet: Transport routing helps most when cross-variate competition is high (like ECL), offering diminishing returns on low-dimensional data or sparse sensor networks (like Traffic).
  • Scope of testing: Evaluations used a fixed look-back length ($L=96$), and noise robustness was only tested on a single dataset under Gaussian noise, leaving longer contexts and wilder distribution shifts for future exploration.

Summary updated

Abstract

Time series forecasting is important in applications such as energy management, climate modeling, traffic control, and industrial monitoring. Recent variate-tokenization Transformers model cross-variate dependencies effectively, but Softmax attention still suffers from uneven cross-variate routing and fixed attention sharpness under varying non-stationarity. To address these limitations, OTformer is introduced as a non-stationarity-aware Optimal Transport framework for time series forecasting. A lightweight scorer estimates sample-wise non-stationarity from raw pre-normalization statistics and uses this signal to adapt the Sinkhorn entropy regularization coefficient ε, yielding smoother transport plans for more non-stationary inputs and sharper routing for more stationary ones. A shared phase embedding further injects cycle-aware context into variate tokens. Experiments on eight standard benchmarks and 32 forecasting settings show that OTformer consistently improves upon the iTransformer backbone, with average MSE reductions of 4.4% on ECL and 12.5% on Solar across four forecasting horizons.
BibTeX
@inproceedings{liu2026otformer,
  author = {Zhaowei Liu and KaixiangWang and Sheng Liu and ZengyangZhang and HaitaoYang and Rufei Gao and Zongxing Zhao and Yao Shan and Yongchao Song and Yanwei Yu and Anzuo Jiang},
  title = {{OTformer: Non-Stationarity-Aware Adaptive Optimal Transport Attention for Time Series Forecasting}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=vNR0rYjfuq},
}
Figure