Abstract
Standard Mean Squared Error (MSE) is the dominant loss function in time series forecasting, yet it often fails to capture the underlying structural components of temporal data. We present DBLoss, a novel "plug-and-play" loss function that explicitly decomposes predictions into seasonal and trend components. By calculating and weighting these losses separately, DBLoss overcomes the gradient coupling limitations of MSE, leading to state-of-the-art performance and improved generalization across diverse benchmarks and model architectures.
Introduction
In time series forecasting, models aim to predict future values by learning historical patterns. Despite the development of sophisticated architectures like DLinear or PatchTST that incorporate decomposition, most are still trained using point-wise objectives like Mean Squared Error (MSE).
The authors identify a critical flaw: MSE is "structurally blind." It treats each data point independently, failing to distinguish between the long-term trend (the trajectory) and repeating seasonal patterns. Mathematically, the authors prove that MSE creates a "coupling" effect in gradients where errors in trend prediction interfere with the optimization of seasonal patterns, and vice versa. This interference prevents models from fully exploiting the inductive biases necessary for accurate long-term forecasting.
Methodology: The DBLoss Framework
DBLoss (Decomposition-Based Loss) shifts the optimization objective from point-wise accuracy to structural fidelity. The framework operates in three primary stages:
- EMA Decomposition: The forecasting horizon for both the prediction ($\hat{Y}$) and ground truth ($Y$) is decomposed into seasonal ($\hat{Y}_S, Y_S$) and trend ($\hat{Y}_T, Y_T$) components using Exponential Moving Averages (EMA). EMA is utilized for its computational efficiency and robustness in capturing complex temporal dynamics.
- Component-wise Loss Calculation: DBLoss computes separate errors for each component:
- Seasonal Loss ($L_S$): Employs an $L_2$ (squared) norm to capture periodic fluctuations.
- Trend Loss ($L_T$): Employs an $L_1$ (absolute) norm to focus on the overall trajectory.
- Scale Alignment and Weighting: To account for differing scales between trend and seasonality, a Scale Alignment mechanism adaptively adjusts the trend loss based on the magnitude of the seasonal loss. A
stopgradoperation is used to ensure that this alignment does not introduce unwanted gradient interference between the two paths.
The final objective is a weighted sum controlled by a hyperparameter $\beta$, allowing practitioners to prioritize either trend or seasonality depending on the dataset.
Experimental Evaluation
The efficacy of DBLoss was evaluated across eight real-world benchmarks, including the Electricity Transformer Temperature (ETT) datasets, Weather, Electricity, Solar, and Traffic data. These datasets encompass a wide range of sampling frequencies and temporal characteristics. The loss function was tested as a drop-in replacement for MSE across various backbones, including standard models (iTransformer, DLinear) and large-scale foundation models (GPT4TS, UniTS).
Key Results and Discussion
DBLoss consistently achieved state-of-the-art (SOTA) performance, reducing MSE significantly across all datasets. For instance, using the iTransformer backbone on the ETTh1 dataset, DBLoss reduced the average MSE from 0.439 to 0.423.
Regularization and Stability
A notable observation is that models trained with DBLoss often exhibit higher training MSE but significantly lower testing MSE compared to those trained with standard MSE. This indicates that DBLoss acts as a powerful regularizer, forcing the model to learn meaningful structural patterns rather than overfitting to point-wise noise. Furthermore, DBLoss provides greater stability during training, avoiding the "jitter" and fluctuations often seen in MSE-trained models.
Generalization
In zero-shot and few-shot transfer learning scenarios, DBLoss-trained models demonstrated superior generalization. This suggests that learning the underlying structure of time series is a more transferable skill than learning specific data points, making DBLoss particularly valuable for foundation models.
Conclusion and Future Work
DBLoss offers a simple yet effective way to improve time series forecasting by addressing the fundamental limitations of MSE. By decoupling the gradients of trend and seasonality, it enables models to learn more robust representations.
Currently, the main limitation is the manual tuning required for the EMA smoothing factor ($\alpha$) and the loss weighting hyperparameter ($\beta$). Future research directions include developing adaptive mechanisms to automatically determine these parameters during the training process, potentially using meta-learning techniques.
Summary updated