All models

nlinear

A one-layer linear forecaster that subtracts the last input value before the layer and adds it back.

Time series · 7 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (9 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
32.4K
Operations
7
Framework
PyTorch
Recurrent
No
Published
AAAI 2023
Cited by
4,997 (as of 22 October 2026)
Authors
Ailing Zeng, Muxi Chen, Lei Zhang, Qiang Xu
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m7739
Graph hash
41fa5c096a6eaadb6fff03c061093ac7aa84ad2b3907feb5306fd8966e4832ef
Skeleton hash
42768b761a85e950272683273dfcd9acd94a228bc1620c10296cad75dcba8c4c
Architecture hash
af139280dc88692afe79dc4580f13bcc55ed781db731e5190680fd27e090661c
Diagram SHA-256
22a8fde94e27990385f955840ece6fa326a808a714df950f4427b93acdef2fb3
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

NLinear belongs to LTSF-Linear, a set of one-layer linear models for the long-term time series forecasting (LTSF) task. The paper that introduced them questions the validity of Transformer-based solutions for this task. Its argument is that the permutation-invariant self-attention mechanism inevitably loses temporal information, and the linear models serve as a simple baseline for comparison.

The whole model is a subtraction, one linear layer and an addition. NLinear first subtracts the last value of the sequence from the input, passes the result through a linear layer, and adds the subtracted part back before making the final prediction. The linear layer forecasts the future time series directly from the historical one. The paper describes the subtraction and addition as a simple normalization of the input sequence, added to help when there is a distribution shift in the dataset. Their purpose is to shift the model prediction toward the distribution of the true value.

On nine real-life datasets, the paper reports that LTSF-Linear outperforms existing Transformer-based LTSF models in all cases, and often by a large margin. The authors also state a limit: LTSF-Linear has a limited model capacity and serves as a simple yet competitive baseline for future research.

Key idea. The paper introduces LTSF-Linear, a set of one-layer linear models, and reports that they outperform Transformer-based models for long-term time series forecasting on nine real-life datasets.

  • nlinear
  • ltsf-linear
  • normalized linear
  • long-term time series forecasting
  • time series forecasting
  • linear model
  • distribution shift

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{zeng2022transformerseffectivetimeseries,
      title={Are Transformers Effective for Time Series Forecasting?}, 
      author={Ailing Zeng and Muxi Chen and Lei Zhang and Qiang Xu},
      year={2022},
      eprint={2205.13504},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2205.13504}, 
}