arXiv:2608.28134cs.LGAug 2026

Manuscript Offprint

arXiv:2608.28134

Learning to Difference: Adaptive Reversible Differencing (AdaRDiff) for Time Series Forecasting

Morad Laglil, Younes Hlal, Marouane El Hadari, Emilie Devijver, Eric Gaussier

Abstract

Reliable long-horizon time series forecasting is an important yet difficult problem. Trends and seasonality introduce complex temporal structure that challenges learning-based forecasting models. Differencing, which subtracts nearby past values to remove such structure, is the classical remedy, but its reliance on hand-picked orders and periods has kept it largely absent from recent deep architectures. We propose Adaptive Reversible Differencing (AdaRDiff), a generalized differencing approach that uses learnable weights to simplify the series through weighted differencing with previous time instants. This yields stabilized residuals on which forecasting is performed, after which the removed components are restored autoregressively to reconstruct the forecast, capturing trend and seasonality jointly through a single operator. This reconstruction admits a closed-form convolutional expression, which parallelizes on GPU and yields up to 33.7×33.7 \times speedup over the naive recurrence. We furthermore rely on a two-phase training schedule that separates temporal structure discovery from reconstruction learning, as suggested by a theoretical analysis of the gradient when using a linear forecasting model. AdaRDiff attains state-of-the-art forecast accuracy across eight benchmarks spanning electricity, weather, traffic, and energy, at negligible parameter cost. Furthermore, it is designed as a plug-and-play module: integrating AdaRDiff improves eight diverse backbones, from linear models to Transformers, in the large majority of cases, by up to 25.9% with a linear backbone and 18.3% with iTransformer.

1 Introduction

Time series forecasting is fundamental to many real-world applications, such as traffic flow prediction, product sales forecasting, and energy consumption management, where accurate predictions support proactive decision-making. Forecasting over long horizons, commonly referred to as Long-term Time Series Forecasting (LTSF) (Zhou et al. 2021), is particularly valuable and has accordingly drawn sustained attention. In all these settings, forecasting quality depends on how well a model extracts and exploits the temporal patterns present in the historical window (Lin et al. 2024b).

Among these patterns, trend and seasonality dominate: real-world series combine long-term drifts and recurring periodic cycles into most of their structured variation (Cleveland, Cleveland, and Terpenning 1990), and these components are precisely what makes forecasting difficult for learning-based models. Zhang and Qi (Zhang and Qi 2005) showed empirically that feedforward networks struggle to capture trend and seasonal patterns from raw series, whereas detrending and deseasonalizing the data beforehand substantially reduces forecasting error. The classical tool for this is differencing: replacing each observation by its difference with a previous value removes low-order trends ( 1st1^{st}-order differencing) or periodic components (seasonal differencing), leaving a simpler, more regular residual for the model to predict (Hyndman and Athanasopoulos 2021). Isolating such a residual is a powerful lever, and one that architectural sophistication alone may not supply.

Such preprocessing is fundamental to classical statistical models, including ARIMA and SARIMA (Box and Jenkins 1976), which have guided time series analysis for decades. Despite its proven effectiveness in traditional time series analysis, this principle has been largely overlooked in modern deep learning-based forecasting models. We believe this is due to a key limitation of classical differencing: the scheme is rigid and must be specified by hand, including the orders, seasonal periods, and their coefficients, which demands data exploration and domain expertise and does not fit end-to-end training. AdaRDiff instead learns the scheme directly from data, discovering the relevant lags and their weights rather than requiring them to be fixed in advance. Recent deep architectures have begun to reintroduce related preprocessing through time series decomposition, as in DLinear (Zeng et al. 2023) and CycleNet (Lin et al. 2024a), but these methods target a fixed form of structure and do not adaptively capture the range of trends and periodicities encountered across datasets.

This motivates an adaptive, data-driven form of differencing that captures multiple seasonalities and trends jointly, and can be paired with any forecasting model. We propose here such a framework, Adaptive Reversible Differencing (AdaRDiff). AdaRDiff is model-agnostic: rather than a standalone forecaster, it is a differencing module that wraps around a forecasting backbone, simplifying the series before the backbone predicts and reconstructing the forecast afterward. It generalizes classical differencing by replacing the hand-set coefficients with learnable, channel-wise differencing weights: for each time step, it forms a weighted combination of past observations within a fixed window and subtracts it from the current value, so that the model learns a differencing scheme tailored to the data. The backbone then operates on the resulting simplified residual. As AdaRDiff is reversible, the forecast is then reconstructed autoregressively, applying the learned weights step by step to the backbone's output so that each predicted value builds on the previously reconstructed ones, recovering the forecast in the original space and restoring the trend and seasonal structure that differencing had removed. The learned differencing weights are moreover interpretable, as their magnitudes at each lag reveal the dominant periods and dependencies the model has identified. AdaRDiff lets even a lightweight Linear or MLP backbone reach state-of-the-art accuracy across benchmarks spanning multiple domains. Our main contributions are as follows:

• We introduce AdaRDiff, a plug-and-play differencing module whose learnable weights capture trend and seasonality jointly and reversibly, recovering predictions in the original space while training end-to-end with any forecasting backbone.

• We theoretically analyze the training dynamics of AdaRDiff with a linear backbone through the gradient with respect to its parameters, revealing a tension between the differencing and reconstruction pathways that motivates a two-phase training schedule separating temporal structure discovery from reconstruction learning.

• We evaluate AdaRDiff through extensive experiments on eight benchmark datasets and eight forecasting backbones, demonstrating its effectiveness.

References (40)