Patch-wise Structural Loss for Time Series Forecasting

Dilfira Kudrat, Zongxia Xie, Yanru Sun, Tianyu Jia, Qinghua Hu

Introduction

In the field of time-series forecasting, the standard objective for training models has long been the minimization of Mean Squared Error (MSE). While MSE is mathematically convenient and computationally efficient, it is fundamentally a "point-wise" loss. It treats every time step as an independent data point, effectively ignoring the temporal dependencies and structural patterns—such as trends, cycles, and volatility—that define a signal. This "structural blindness" often results in forecasts that achieve low MSE but fail to capture the true dynamics of the data, appearing out of phase or lacking the correct amplitude.

This paper introduces Patch-wise Structural (PS) loss, a plug-and-play enhancement designed to ensure forecasts align with the underlying "shape" of the ground truth. By moving from global or point-wise comparisons to adaptive local patches, PS loss provides a robust framework for capturing the nuances of non-stationary time-series data.

The Problem: The Limitations of MSE

The core issue with MSE is that it "misses the forest for the trees." A model can achieve a mathematically low error while producing a forecast that is vertically shifted, lacks the necessary volatility, or is completely out of phase with the actual signal. Previous attempts to address this by using global structural losses often fail when dealing with non-stationary data, where statistical properties change over time. To solve this, a method is needed that can respect local dependencies while adapting to the signal's changing rhythm.

Methodology: The PS Loss Framework

The authors propose a three-pronged approach to structural alignment:

1. Fourier-based Adaptive Patching (FAP)

Rather than using a fixed window size, which might be too small to capture a cycle or too large to handle non-stationarity, the model employs a Fast Fourier Transform (FFT) on the ground truth. By identifying the dominant frequency, the system adaptively sets the "patch" size to match the natural rhythm of the data. This ensures that the loss function evaluates meaningful chunks of the signal.

2. The PS Loss Triplets

Within each adaptive patch, the model calculates three distinct statistical metrics to ensure structural fidelity:

  • Correlation Loss: Utilizes the Pearson Correlation Coefficient to ensure the direction and pattern of the forecast match the ground truth.
  • Variance Loss: Uses a Softmax-normalized KL-Divergence to align the relative dispersion (the "swing") of the signal, preventing dampened or overly volatile predictions.
  • Mean Loss: Ensures the average level of the patch is accurate, preventing constant vertical offsets.

3. Gradient-based Dynamic Weighting (GDW)

Balancing multiple loss terms (MSE plus the three structural components) typically requires extensive manual hyperparameter tuning. PS loss simplifies this via GDW, which automatically adjusts the weights of the correlation, variance, and mean losses during training based on their gradient magnitudes. This ensures that no single term dominates the learning process and that the model converges effectively.

The final objective function is defined as: $L = L_{MSE} + \lambda L_{PS}$.

Experimental Evaluation

The researchers evaluated PS loss across seven widely recognized multivariate time-series benchmarks, including the Electricity Transformer Temperature (ETT) subsets, Weather data, and Electricity Consuming Load (ECL).

Crucially, the method was tested as a "plug-and-play" component across a diverse range of model architectures:

  • Linear Models: DLinear
  • CNNs: TimesNet
  • Transformers: iTransformer
  • LLM-based Models: OFA and Autotimes

Key Insights and Results

  • Universal Improvement: PS loss improved forecasting performance in 134 out of 140 tested cases. For the DLinear model, it achieved an average reduction of 5.22% in MSE and 4.39% in MAE.
  • Structural Regularization: The authors demonstrate that PS loss acts as a powerful regularizer. While MSE-only models may overfit to point-wise noise, PS loss forces the model to learn the underlying "physics" of the series, leading to superior generalization on unseen data.
  • Zero-Shot Prowess: The structural focus significantly boosts "zero-shot" performance. When trained on one dataset (e.g., ETTh1) and tested on another (e.g., ETTh2), PS-enhanced models consistently outperformed their MSE-only counterparts.
  • Visual Fidelity: Qualitative results indicate that PS-loss forecasts follow the actual peaks and troughs of the ground truth much more closely, avoiding the dampened or shifted results common in standard models.

Conclusion and Future Work

Patch-wise Structural loss represents a significant step forward in making time-series models more aware of the data's inherent structure. By combining Fourier-based patching with a triplet of statistical losses, it provides a universal way to improve forecasting accuracy and physical realism. While the method introduces a modest computational overhead (20-30% increase in training time), the gains in reliability and generalization make it a compelling choice for production-ready forecasting systems. Future research may explore even more complex structural metrics or the integration of these dynamics directly into model architectures.

Summary updated

BibTeX
@inproceedings{kudrat2025patch,
  author = {Dilfira Kudrat and Zongxia Xie and Yanru Sun and Tianyu Jia and Qinghua Hu},
  title = {{Patch-wise Structural Loss for Time Series Forecasting}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=p1KkW2kgDp},
}
Figure