DLinear: Decomposition Linear Model for Time Series Forecasting

Machine Learning
Introduced by
Ailing Zeng et al.
Year
2023
Type
Decomposition-based linear forecasting model
Family
Time-series forecasting

What does it do?

DLinear is a lightweight time series forecasting model introduced by Zeng et al. at AAAI 2023.

It tests the assumption that Transformer-based architectures are needed for accurate long-horizon forecasting. The model splits the input sequence into trend and seasonal components with a moving average filter, applies a separate single-layer linear map to each component, and sums the two outputs to form the forecast.

The intuition behind the method

DLinear relies on a simple decomposition rather than attention. Many time series can be separated into a smooth trend and a residual seasonal pattern, and the model gives each part its own linear map. Because each map is a weighted sum over the lookback window, the model has few parameters and does not need attention or positional encodings. The original paper argues that this simpler structure can match Transformer variants on several long-horizon benchmarks.

History

Ailing Zeng and co-authors (Muxi Chen, Lei Zhang and Q. Xu) presented DLinear in 'Are Transformers Effective for Time Series Forecasting?' at AAAI 2023. The paper is an empirical challenge to Transformer-based forecasting, reporting that decomposition followed by linear layers can match or exceed several attention-based models. Its conclusions are based on the benchmarks the paper evaluates.

When to use it

Choose DLinear for long-horizon forecasting of univariate series, or of multivariate series modelled channel by channel, when the series has a clear trend and periodic structure and when training cost or interpretability matters. It is also a useful linear baseline before trying larger models. Avoid it when forecasts depend on interactions between variables, when the series has no separable trend and seasonal structure, or when probabilistic forecasts are required. For richer temporal representations or explicit channel mixing, the related models PatchTST and TSMixer are the more natural alternatives.

Limitations and considerations

  • Each component is passed through one linear layer, so the model cannot capture non-linear temporal dependencies or interactions between variates
  • A single linear map may underfit highly irregular series, where the trend and seasonal split does not describe the signal well
  • The moving average uses a fixed window, so it assumes a seasonal pattern that stays roughly constant; it may not follow seasonality that changes over time
  • The model gives point forecasts only and does not produce uncertainty estimates

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Few parameters: each linear map is a weight matrix from the lookback window to the forecast horizon, so the model is much smaller than Transformer-based forecasters, which keeps training and inference light
  • The decomposition gives an explicit split into a trend forecast and a seasonal forecast, so each part of the prediction can be inspected
  • The original paper reports long-horizon accuracy competitive with or better than several Transformer variants on the benchmarks it evaluates
  • Channel-independent use treats each variate as its own univariate series, which keeps the model simple when many variates are forecast

Applications

  • Electricity consumption and energy load forecasting, where trend and daily or weekly cycles are typical
  • Weather variable forecasting, such as temperature series with seasonal cycles
  • Economic indicators with clear trend and seasonal components, forecast over multiple steps

How it works

How it works

1

The input series X is smoothed by average pooling with padding, which is a moving average, to estimate the trend component. Padding is applied so that the smoothed trend has the same length as the input, which keeps the seasonal residual defined at every time step. The seasonal component is the residual X minus this trend. The window (kernel) size of the moving average is a hyperparameter: a larger window gives a smoother trend and leaves more variation in the seasonal part, so it should be set for the target data.

Formula
\hat{X}_{\text{trend}} = \text{AvgPool}(\text{Padding}(X)), \quad \hat{X}_{\text{seasonal}} = X - \hat{X}_{\text{trend}}
2

A linear layer with weight matrix W_trend and bias b_trend maps the trend component from the lookback window to the forecast horizon. Each forecast step is a weighted sum of trend values in the window plus a bias. The layer can represent smooth directional movement, but it cannot model interactions between time steps beyond these weighted sums.

Formula
\hat{Y}_{\text{trend}} = W_{\text{trend}} \cdot \hat{X}_{\text{trend}} + b_{\text{trend}}
3

A second, independent linear layer with its own parameters W_seasonal and b_seasonal maps the seasonal residual onto the same forecast horizon. Because the two layers have separate weights, they can learn different weightings over the lookback window for the trend and for the residual pattern.

Formula
\hat{Y}_{\text{seasonal}} = W_{\text{seasonal}} \cdot \hat{X}_{\text{seasonal}} + b_{\text{seasonal}}
4

The two horizon forecasts are added element-wise to give the final prediction. This mirrors the additive split used on the input, so the output is the sum of a predicted trend and a predicted seasonal part.

Formula
\hat{Y} = \hat{Y}_{\text{trend}} + \hat{Y}_{\text{seasonal}}

Common pitfalls

  • The moving average window controls the trend-seasonal split; a poor choice gives a trend that absorbs seasonal variation, or a seasonal part that contains slow drift, and both reduce forecast quality
  • Applying DLinear in a channel-mixing setting, where variates are combined in the input, goes beyond the channel-independent use described on this page; the model does not capture cross-variate dependencies, so such a setup should be validated empirically
  • Because each weight matrix maps the full lookback window to the horizon, results are only comparable across studies when the lookback length and normalization match
  • DLinear's advantage over Transformer models depends on the task and dataset, so it should be checked empirically rather than assumed

Frequently asked questions

How does DLinear differ from a plain linear regression model?

A plain linear regression is applied to the raw series. DLinear first splits the input into a trend and a seasonal component with a moving average, then applies two separate linear layers, one to each component. Each layer can specialise on a different part of the signal, which the original paper reports can improve accuracy on its benchmarks, while the model stays simple.

Is DLinear suitable for multivariate forecasting?

DLinear can be applied to multivariate data in a channel-independent manner, treating each variate as an independent univariate series. This avoids spurious cross-variate correlations, but it does not model relationships between variables. Tasks where cross-variate dynamics matter may be better served by a model such as TSMixer.

What lookback window length should be used with DLinear?

The original paper examines several lookback lengths, and performance varies by dataset, so the length should be chosen by cross-validation on the target data. The lookback length sets the number of input weights in each linear layer, so longer windows give larger layers and can help the trend estimate, at the cost of more parameters.

Related methods

Sources

  1. Zeng, A., Chen, M., Zhang, L., & Xu, Q. (2023). Are transformers effective for time series forecasting? AAAI.

    Open publication reference