Paper · 2023-11-10 · cs.LG, cs.AI
Frequency-domain MLPs are More Effective Learners in Time Series Forecasting
Forecasts with two MLPs that run on a discrete Fourier transform of the input: one mixes channels, one mixes time steps. A feed-forward head then predicts the horizon. Author-reported: MAE 0.120 on Solar and 0.011 on Traffic at 12-step horizons, and the best MAE on most long-term benchmarks; PatchTST wins on Traffic at two horizons and on one Electricity horizon.
Time series forecastingMulti-layer perceptron (MLP)Frequency-domain learningtime-series-forecastingmulti-layer-perceptronfrequency-domaindiscrete-fourier-transform
arXivPDFCodeMarkdown20 min read
AI-compiled by claude-haiku-5-5 on 2026-10-19, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Forecasting means predicting the next stretch of a series, such as power use, traffic counts or exchange rates, from its recent past. Small multi-layer perceptrons (MLPs) are a cheap way to do this, but they look at the series one point at a time, and they can get lost in the noise between neighbouring points.
FreTS takes the input series and rewrites it as a spectrum, the same kind of view you get from a music equaliser. In that view, each component describes the whole series at once, and the important patterns (the repeating daily or weekly rhythms) sit in a few large components. The model runs small MLPs on those components: one pass mixes information across the series, and another mixes it across time. The result is turned back into a time series and passed to a simple head that outputs the forecast in a single step.
The authors report that this beats several recent forecasting models on most of the benchmarks they ran, while staying simple. The numbers are their own.
TL;DR
- Learns forecasts with two frequency-domain MLPs. One mixes channels and one mixes time steps, applied after a discrete Fourier transform §3.1 eq. 1 eq. 3 eq. 4.
- Each frequency-domain MLP is a complex-valued linear layer, written as real and imaginary parts §3.2 eq. 6 eq. 7.
- Author-reported: MAE 0.120 on Solar and 0.011 on Traffic at horizon 12 tab. 1. On long-term forecasting it is best on most rows of tab. 2.
- The released code is official, Apache-2.0, and covers the long-term experiments only. Several details differ from the paper, notably the frequency MLP (diagonal weights only) and the channel learner, which the code never runs. See Paper vs code.
Problem
Multivariate forecasting asks for the next τ values of N series given a lookback window of length L §3. The authors argue that point-wise MLPs capture the temporal mapping poorly, cannot model global dependencies, and suffer an information bottleneck on volatile local patterns §1. Transformer and graph models capture more structure but cost more §1 §4.3.
The assumptions behind the method are that the series is regularly sampled, the DFT is a good basis for its periodic and trend structure §3.1, and that most of the signal energy sits in a few frequency components §3.2. Baselines and data are described in §4 and app. B.1–app. B.2.
Method
Overview. The model has three stages §3.1 fig. 2:
- Dimension extension. Each input value is multiplied by a learnable vector, so each series element becomes a d-dimensional vector. The authors compare this to word embeddings §3.1.
- Frequency learning. A frequency channel learner runs over the N axis for every timestamp, and a frequency temporal learner runs over the L axis for every channel. Both use a discrete Fourier transform, a frequency-domain MLP, and an inverse transform §3.1 eq. 1 eq. 2 eq. 3 eq. 4.
- Projection. A two-layer feed-forward network maps the flattened learned representation to τ outputs in one step, avoiding autoregressive error accumulation §3.1 eq. 5.
Domain conversion. The DFT of a signal H is written as the integral of H(v) times e^(−j2πfv) eq. 1. In the discrete setting, the code uses a real FFT, which gives L//2+1 bins for a length-L signal FreTS.py FreTS.py. The paper writes L/2 complex components §3.1. The inverse transform is given by eq. 2. Real and imaginary parts of each component are kept separately §3.1.
Frequency channel learner. For each timestamp l, the learner takes the N-by-d matrix H(:,l) and computes a DFT along the channel axis. It applies one frequency-domain MLP with weights W_chan and biases B_chan, then inverts the transform §3.1 eq. 3. Weights are shared across the L timestamps §3.1.
Frequency temporal learner. For each channel n, the learner computes a DFT along the time axis, applies a frequency-domain MLP with weights W_temp and biases B_temp, then inverts the transform §3.1 eq. 4. Weights are shared across the N channels §3.1.
Frequency-domain MLP. For a complex input H of shape m-by-d and a complex weight matrix W of shape d-by-d with bias B, one layer is σ(HW + B) with σ an activation §3.2 eq. 6. Expanding the complex product gives the real and imaginary outputs eq. 7. The activation σ is not named in the paper. The authors implement the real and imaginary parts as separate real-valued computations and stack them back into a complex tensor §3.2. Each learner uses one such layer by default app. B.3.
Projection. The output is σ(S_t φ1 + b1) φ2 + b2, where S_t is the temporal learner output, φ1 has shape (L·d)-by-d_h, φ2 has shape d_h-by-τ, and d_h is the hidden width §3.1 eq. 5. The activation σ is not named.
Theoretical claims. The paper states two results. (i) Parseval-type energy equality: the energy of a series in time equals its energy in frequency §3.2 eq. 8. The authors use it to argue that energy concentrates in few components §3.2 fig. 1. (ii) A frequency-domain MLP with complex weights equals a global circular convolution in the time domain §3.2 eq. 9. Both proofs are in app. D.1 and app. D.2.
Pseudocode for the whole model (the [code: …] tags show where the released
implementation lives, see Paper vs code):
# FreTS forward pass [§3.1] [fig. 2] [eq. 5]
# [code: models/FreTS.py#L88-L101]
# Input: series (B, L, N); output: forecast (B, tau, N)
def frets(series):
# Dimension extension: lift each value to d dimensions [§3.1]
# [code: models/FreTS.py#L34-L40]
lifted = series_to_hidden(series) # (B, N, L, d)
# Frequency channel learner, runs along the N axis [§3.1] [eq. 3]
hidden = frequency_channel_learner(lifted) # (B, N, L, d)
# Frequency temporal learner, runs along the L axis [§3.1] [eq. 4]
hidden = frequency_temporal_learner(hidden) # (B, N, L, d)
# The released code adds the lifted input back here; eq. 5 has no
# such term [code: models/FreTS.py#L93] [code: models/FreTS.py#L99]
hidden = hidden + lifted # (B, N, L, d)
# Two-layer feed-forward head maps the flattened window to tau steps
# [eq. 5]
forecast = feed_forward(flatten(hidden)) # (B, N, tau)
return transpose(forecast) # (B, tau, N)# Frequency channel learner [§3.1] [eq. 3]
# [code: models/FreTS.py#L51-L60]
# Input and output: hidden (B, N, L, d)
def frequency_channel_learner(hidden):
# Real DFT along the channel axis, one signal per timestamp [eq. 1]
spectrum = rfft(move_axis(hidden, to=channel)) # (B, L, N//2+1, d)
# One frequency-domain MLP, weights shared over the L timestamps [§3.2]
spectrum = frequency_mlp(spectrum, channel_weights, channel_biases)
# Inverse DFT back to N channels, then restore the axis order [eq. 2]
return move_axis(irfft(spectrum, n=N), to=time) # (B, N, L, d)# Frequency temporal learner [§3.1] [eq. 4]
# [code: models/FreTS.py#L43-L48]
# Input and output: hidden (B, N, L, d)
def frequency_temporal_learner(hidden):
# Real DFT along the time axis, one signal per channel [eq. 1]
spectrum = rfft(hidden, axis=time) # (B, N, L//2+1, d)
# One frequency-domain MLP, weights shared over the N channels [§3.1]
spectrum = frequency_mlp(spectrum, temporal_weights, temporal_biases)
# Inverse DFT back to L steps [eq. 2]
return irfft(spectrum, n=L, axis=time) # (B, N, L, d)# One frequency-domain MLP layer [§3.2] [eq. 6] [eq. 7]
# [code: models/FreTS.py#L65-L86]
# Input: complex spectrum (B, M, F, d); weights and biases are complex
def frequency_mlp(spectrum, weights, biases):
# Split the complex input into real and imaginary parts [eq. 7]
x_real = real(spectrum)
x_imag = imag(spectrum)
# Real part of the complex product plus bias [eq. 7]
out_real = x_real @ real(weights) - x_imag @ imag(weights)
out_real = out_real + real(biases)
# Imaginary part of the complex product plus bias [eq. 7]
out_imag = x_real @ imag(weights) + x_imag @ real(weights)
out_imag = out_imag + imag(biases)
# Activation sigma is not named in the paper; the code uses ReLU
# on each part, then a soft-shrink [code: models/FreTS.py#L71-L84]
out_real = activation(out_real)
out_imag = activation(out_imag)
# Stack the two parts back into one complex tensor [§3.2]
return complex(out_real, out_imag) # (B, M, F, d)Hyperparameters
Values in quotes are as written in the paper. "Not stated" means the paper does not give the value. Code defaults are listed where the code provides them, with the caveat that the released code covers the long-term experiments only.
| Name | Value | Where | Notes |
|---|---|---|---|
| embedding size d | 128 | app. B.3 FreTS.py | Hard-coded in the code, not a command-line flag |
| hidden size d_h | 256 | app. B.3 FreTS.py | Hidden width of the feed-forward head eq. 5 |
| frequency MLP layers per learner | 1 | app. B.3 | "one layer" by default |
| channel learner, long-term | off for τ = 336 and 720 | app. B.3 | Channel-independent mode, temporal learner only |
| short-term batch size | 32 (Solar, METR-LA, ECG, COVID-19, Electricity); 4 (Wiki, Traffic) | app. B.3 | |
| batch size search | {4, 8, 16, 32} | app. B.3 | Tuned on the validation set for some datasets |
| loss | MSE | §4 exp_main.py | |
| metrics | MAE, RMSE | §4 | |
| normalisation | min-max, fit on training split | §4 data_loader.py | |
| split, most datasets | 7:2:1 | §4 | ETT is not 7:2:1 in the code, see Paper vs code |
| split, COVID-19 | 6:2:2 | §4 | |
| short-term lookback and horizon | 12 and 12 | §4.1 tab. 1 | Multi-step: horizons 3, 6, 9, 12 app. F.1 |
| long-term lookback | 96 (Traffic: 48 per text) | §4.1 app. B.3 | The caption of tab. 2 says 96 for all except Traffic; see Pitfalls |
| long-term horizons | {96, 192, 336, 720}; Traffic {48, 96, 192, 336} | §4.1 tab. 2 | |
| optimizer | Not stated in paper; code uses Adam | exp_main.py | |
| learning rate | Not stated in paper; code default 0.0001 | run_longExp.py | |
| epochs | Not stated in paper; code default 10 | run_longExp.py | |
| early-stopping patience | Not stated in paper; code default 3 | run_longExp.py | |
| learning-rate schedule | Not stated in paper; code halves the rate each epoch | tools.py exp_main.py | |
| weight initialisation scale | Not stated in paper; code uses 0.02 times a standard normal | FreTS.py | |
| embedding initialisation | Not stated in paper; code uses a standard normal, no scale | FreTS.py | |
| soft-shrink threshold | Not stated in paper; code uses 0.01 | FreTS.py FreTS.py | |
| activation σ (frequency MLP) | Not stated in paper; code uses ReLU | FreTS.py | |
| activation (head) | Not stated in paper; code uses LeakyReLU | FreTS.py | |
| random seed | Not stated in paper; code fixes 2021 | run_longExp.py | |
| hardware and framework | 1 × NVIDIA RTX 3080 10 GB, PyTorch 1.8 | §4 |
Results
Author-reported. Setup: thirteen benchmarks, as described in §4 and app. B.1. Table 1 covers six short-term datasets with horizon 12 and thirteen baselines. Table 2 covers six long-term datasets. The paper does not state random seeds and reports no variance. The text says the paper uses seven short-term benchmarks (the seventh is METR-LA, in app. F.1).
Short-term, horizon 12 tab. 1. Columns are MAE and RMSE per dataset.
| Model | Solar MAE | Solar RMSE | Wiki MAE | Wiki RMSE | Traffic MAE | Traffic RMSE | ECG MAE | ECG RMSE | Electricity MAE | Electricity RMSE | COVID-19 MAE | COVID-19 RMSE |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| VAR | 0.184 | 0.234 | 0.052 | 0.094 | 0.535 | 1.133 | 0.120 | 0.170 | 0.101 | 0.163 | 0.226 | 0.326 |
| SFM | 0.161 | 0.283 | 0.081 | 0.156 | 0.029 | 0.044 | 0.095 | 0.135 | 0.086 | 0.129 | 0.205 | 0.308 |
| LSTNet | 0.148 | 0.200 | 0.054 | 0.090 | 0.026 | 0.057 | 0.079 | 0.115 | 0.075 | 0.138 | 0.248 | 0.305 |
| TCN | 0.176 | 0.222 | 0.094 | 0.142 | 0.052 | 0.067 | 0.078 | 0.107 | 0.057 | 0.083 | 0.317 | 0.354 |
| DeepGLO | 0.178 | 0.400 | 0.110 | 0.113 | 0.025 | 0.037 | 0.110 | 0.163 | 0.090 | 0.131 | 0.169 | 0.253 |
| Reformer | 0.234 | 0.292 | 0.047 | 0.083 | 0.029 | 0.042 | 0.062 | 0.090 | 0.078 | 0.129 | 0.152 | 0.209 |
| Informer | 0.151 | 0.199 | 0.051 | 0.086 | 0.020 | 0.033 | 0.056 | 0.085 | 0.074 | 0.123 | 0.200 | 0.259 |
| Autoformer | 0.150 | 0.193 | 0.069 | 0.103 | 0.029 | 0.043 | 0.055 | 0.081 | 0.056 | 0.083 | 0.159 | 0.211 |
| FEDformer | 0.139 | 0.182 | 0.068 | 0.098 | 0.025 | 0.038 | 0.055 | 0.080 | 0.055 | 0.081 | 0.160 | 0.219 |
| GraphWaveNet | 0.183 | 0.238 | 0.061 | 0.105 | 0.013 | 0.034 | 0.093 | 0.142 | 0.094 | 0.140 | 0.201 | 0.255 |
| StemGNN | 0.176 | 0.222 | 0.190 | 0.255 | 0.080 | 0.135 | 0.100 | 0.130 | 0.070 | 0.101 | 0.421 | 0.508 |
| MTGNN | 0.151 | 0.207 | 0.101 | 0.140 | 0.013 | 0.030 | 0.090 | 0.139 | 0.077 | 0.113 | 0.394 | 0.488 |
| AGCRN | 0.123 | 0.214 | 0.044 | 0.079 | 0.084 | 0.166 | 0.055 | 0.080 | 0.074 | 0.116 | 0.254 | 0.309 |
| FreTS (this model) | 0.120 | 0.162 | 0.041 | 0.074 | 0.011 | 0.023 | 0.053 | 0.078 | 0.050 | 0.076 | 0.123 | 0.167 |
Source: tab. 1. The paper reports an average gain of 9.4% in MAE and 11.6% in RMSE over the baselines §4.1. This average is not recomputed here.
Long-term tab. 2. Cells are MAE / RMSE.
| Dataset | Horizon | FreTS | PatchTST | LTSF-Linear | FEDformer | Autoformer | Informer | Reformer |
|---|---|---|---|---|---|---|---|---|
| Weather | 96 | 0.032 / 0.071 | 0.034 / 0.074 | 0.040 / 0.081 | 0.050 / 0.088 | 0.064 / 0.104 | 0.101 / 0.139 | 0.108 / 0.152 |
| Weather | 192 | 0.040 / 0.081 | 0.042 / 0.084 | 0.048 / 0.089 | 0.051 / 0.092 | 0.061 / 0.103 | 0.097 / 0.134 | 0.147 / 0.201 |
| Weather | 336 | 0.046 / 0.090 | 0.049 / 0.094 | 0.056 / 0.098 | 0.057 / 0.100 | 0.059 / 0.101 | 0.115 / 0.155 | 0.154 / 0.203 |
| Weather | 720 | 0.055 / 0.099 | 0.056 / 0.102 | 0.065 / 0.106 | 0.064 / 0.109 | 0.065 / 0.110 | 0.132 / 0.175 | 0.173 / 0.228 |
| Exchange | 96 | 0.037 / 0.051 | 0.039 / 0.052 | 0.038 / 0.052 | 0.050 / 0.067 | 0.050 / 0.066 | 0.066 / 0.084 | 0.126 / 0.146 |
| Exchange | 192 | 0.050 / 0.067 | 0.055 / 0.074 | 0.053 / 0.069 | 0.064 / 0.082 | 0.063 / 0.083 | 0.068 / 0.088 | 0.147 / 0.169 |
| Exchange | 336 | 0.062 / 0.082 | 0.071 / 0.093 | 0.064 / 0.085 | 0.080 / 0.105 | 0.075 / 0.101 | 0.093 / 0.127 | 0.157 / 0.189 |
| Exchange | 720 | 0.088 / 0.110 | 0.132 / 0.166 | 0.092 / 0.116 | 0.151 / 0.183 | 0.150 / 0.181 | 0.117 / 0.170 | 0.166 / 0.201 |
| Traffic | 48 | 0.018 / 0.036 | 0.016 / 0.032 | 0.020 / 0.039 | 0.022 / 0.036 | 0.026 / 0.042 | 0.023 / 0.039 | 0.035 / 0.053 |
| Traffic | 96 | 0.020 / 0.038 | 0.018 / 0.035 | 0.022 / 0.042 | 0.023 / 0.044 | 0.033 / 0.050 | 0.030 / 0.047 | 0.035 / 0.054 |
| Traffic | 192 | 0.019 / 0.038 | 0.020 / 0.039 | 0.020 / 0.040 | 0.022 / 0.042 | 0.035 / 0.053 | 0.034 / 0.053 | 0.035 / 0.054 |
| Traffic | 336 | 0.020 / 0.039 | 0.021 / 0.040 | 0.021 / 0.041 | 0.021 / 0.040 | 0.032 / 0.050 | 0.035 / 0.054 | 0.035 / 0.055 |
| Electricity | 96 | 0.039 / 0.065 | 0.041 / 0.067 | 0.045 / 0.075 | 0.049 / 0.072 | 0.051 / 0.075 | 0.094 / 0.124 | 0.095 / 0.125 |
| Electricity | 192 | 0.040 / 0.064 | 0.042 / 0.066 | 0.043 / 0.070 | 0.049 / 0.072 | 0.072 / 0.099 | 0.105 / 0.138 | 0.121 / 0.152 |
| Electricity | 336 | 0.046 / 0.072 | 0.043 / 0.067 | 0.044 / 0.071 | 0.051 / 0.075 | 0.084 / 0.115 | 0.112 / 0.144 | 0.122 / 0.152 |
| Electricity | 720 | 0.052 / 0.079 | 0.055 / 0.081 | 0.054 / 0.080 | 0.055 / 0.077 | 0.088 / 0.119 | 0.116 / 0.148 | 0.120 / 0.151 |
| ETTh1 | 96 | 0.061 / 0.087 | 0.065 / 0.091 | 0.063 / 0.089 | 0.072 / 0.096 | 0.079 / 0.105 | 0.093 / 0.121 | 0.113 / 0.143 |
| ETTh1 | 192 | 0.065 / 0.091 | 0.069 / 0.094 | 0.067 / 0.094 | 0.076 / 0.100 | 0.086 / 0.114 | 0.103 / 0.137 | 0.120 / 0.148 |
| ETTh1 | 336 | 0.070 / 0.096 | 0.073 / 0.099 | 0.070 / 0.097 | 0.080 / 0.105 | 0.088 / 0.119 | 0.112 / 0.145 | 0.124 / 0.155 |
| ETTh1 | 720 | 0.082 / 0.108 | 0.087 / 0.113 | 0.082 / 0.108 | 0.090 / 0.116 | 0.102 / 0.136 | 0.125 / 0.157 | 0.126 / 0.155 |
| ETTm1 | 96 | 0.052 / 0.077 | 0.055 / 0.082 | 0.055 / 0.080 | 0.063 / 0.087 | 0.081 / 0.109 | 0.070 / 0.096 | 0.065 / 0.089 |
| ETTm1 | 192 | 0.057 / 0.083 | 0.059 / 0.085 | 0.060 / 0.087 | 0.068 / 0.093 | 0.083 / 0.112 | 0.082 / 0.107 | 0.081 / 0.108 |
| ETTm1 | 336 | 0.062 / 0.089 | 0.064 / 0.091 | 0.065 / 0.093 | 0.075 / 0.102 | 0.091 / 0.125 | 0.090 / 0.119 | 0.100 / 0.128 |
| ETTm1 | 720 | 0.069 / 0.096 | 0.070 / 0.097 | 0.072 / 0.099 | 0.081 / 0.108 | 0.093 / 0.126 | 0.115 / 0.149 | 0.132 / 0.163 |
Source: tab. 2. Lookback 96 except Traffic (48 per §4.1). The paper says FreTS "outperforms all baselines on all datasets" §4.1. Table 2 does not support that wording for Traffic at horizons 48 and 96, or for Electricity at horizon 336 (see Pitfalls). The paper reports an average MAE and RMSE improvement of more than 20% over the best Transformer-based model §4.1.
Channel and temporal learner ablation tab. 3. Cells are MAE / RMSE. FreCL removes the temporal learner and FreTL removes the channel learner. Note that the released code cannot run the channel learner (see Paper vs code).
| Variant | Electricity 12/12 | METR-LA 12/12 | Exchange 96/336 | Weather 96/336 |
|---|---|---|---|---|
| FreCL | 0.054 / 0.080 | 0.086 / 0.168 | 0.067 / 0.086 | 0.051 / 0.094 |
| FreTL | 0.058 / 0.086 | 0.085 / 0.167 | 0.065 / 0.085 | 0.047 / 0.091 |
| FreTS | 0.050 / 0.076 | 0.080 / 0.166 | 0.062 / 0.082 | 0.046 / 0.090 |
Source: tab. 3 §4.2.
Frequency MLP as a drop-in for DLinear and NLinear tab. 4. The paper replaces the linear layers in DLinear and NLinear with the frequency-domain MLP. Lookback 96. Cells are MAE / RMSE.
| Model | Exchange 96 | Exchange 192 | Exchange 336 | Exchange 720 | Weather 96 | Weather 192 | Weather 336 | Weather 720 |
|---|---|---|---|---|---|---|---|---|
| DLinear | 0.037 / 0.051 | 0.054 / 0.072 | 0.071 / 0.095 | 0.095 / 0.119 | 0.041 / 0.081 | 0.047 / 0.089 | 0.056 / 0.098 | 0.065 / 0.106 |
| DLinear (FreMLP) | 0.036 / 0.049 | 0.053 / 0.071 | 0.063 / 0.071 | 0.086 / 0.101 | 0.038 / 0.078 | 0.045 / 0.086 | 0.055 / 0.097 | 0.061 / 0.100 |
| NLinear | 0.037 / 0.051 | 0.051 / 0.069 | 0.069 / 0.093 | 0.115 / 0.146 | 0.037 / 0.081 | 0.045 / 0.089 | 0.052 / 0.098 | 0.058 / 0.106 |
| NLinear (FreMLP) | 0.036 / 0.050 | 0.049 / 0.067 | 0.067 / 0.091 | 0.109 / 0.139 | 0.035 / 0.076 | 0.043 / 0.084 | 0.050 / 0.094 | 0.057 / 0.103 |
Source: tab. 4 §4.2.
Multi-step short-term on METR-LA tab. 8 app. F.1. Lookback 12, horizons 3, 6, 9 and 12. Cells are MAE / RMSE. Some baselines use pre-defined graphs (STGCN, DCRNN, TAMP-S2GCNets, not in this table).
| Model | h=3 | h=6 | h=9 | h=12 |
|---|---|---|---|---|
| Reformer | 0.086 / 0.154 | 0.097 / 0.176 | 0.107 / 0.193 | 0.118 / 0.206 |
| Informer | 0.082 / 0.156 | 0.094 / 0.176 | 0.108 / 0.193 | 0.125 / 0.214 |
| Autoformer | 0.087 / 0.149 | 0.091 / 0.162 | 0.106 / 0.178 | 0.099 / 0.184 |
| FEDformer | 0.064 / 0.127 | 0.073 / 0.145 | 0.079 / 0.160 | 0.086 / 0.175 |
| DCRNN | 0.160 / 0.204 | 0.191 / 0.243 | 0.216 / 0.269 | 0.241 / 0.291 |
| STGCN | 0.058 / 0.133 | 0.080 / 0.177 | 0.102 / 0.209 | 0.128 / 0.238 |
| GraphWaveNet | 0.180 / 0.366 | 0.184 / 0.375 | 0.196 / 0.382 | 0.202 / 0.386 |
| MTGNN | 0.135 / 0.294 | 0.144 / 0.307 | 0.149 / 0.328 | 0.153 / 0.316 |
| StemGNN | 0.052 / 0.115 | 0.069 / 0.141 | 0.080 / 0.162 | 0.093 / 0.175 |
| AGCRN | 0.062 / 0.131 | 0.086 / 0.165 | 0.099 / 0.188 | 0.109 / 0.204 |
| FreTS (this model) | 0.050 / 0.113 | 0.066 / 0.140 | 0.076 / 0.158 | 0.080 / 0.166 |
Source: tab. 8. The text says FreTS beats all baselines at all steps app. F.1. In tab. 8, FreTS has the lowest value in every cell; the closest baseline is StemGNN (MAE 0.052 at h=3 against 0.050 for FreTS).
Multi-step short-term on COVID-19 tab. 9 app. F.1. Lookback 12. Cells are MAE / RMSE.
| Model | h=3 | h=6 | h=9 | h=12 |
|---|---|---|---|---|
| Reformer | 0.212 / 0.282 | 0.139 / 0.186 | 0.148 / 0.197 | 0.152 / 0.209 |
| Informer | 0.234 / 0.312 | 0.190 / 0.245 | 0.184 / 0.242 | 0.200 / 0.259 |
| Autoformer | 0.212 / 0.280 | 0.144 / 0.191 | 0.152 / 0.201 | 0.159 / 0.211 |
| FEDformer | 0.246 / 0.328 | 0.169 / 0.242 | 0.175 / 0.247 | 0.160 / 0.219 |
| GraphWaveNet | 0.092 / 0.129 | 0.133 / 0.179 | 0.171 / 0.225 | 0.201 / 0.255 |
| StemGNN | 0.247 / 0.318 | 0.344 / 0.429 | 0.359 / 0.442 | 0.421 / 0.508 |
| AGCRN | 0.130 / 0.172 | 0.171 / 0.218 | 0.224 / 0.277 | 0.254 / 0.309 |
| MTGNN | 0.276 / 0.379 | 0.446 / 0.513 | 0.484 / 0.548 | 0.394 / 0.488 |
| TAMP-S2GCNets | 0.140 / 0.190 | 0.150 / 0.200 | 0.170 / 0.230 | 0.180 / 0.230 |
| FreTS (this model) | 0.071 / 0.103 | 0.093 / 0.131 | 0.109 / 0.148 | 0.124 / 0.164 |
Source: tab. 9. In tab. 9, FreTS has the lowest value in every cell; the closest baseline at h=3 is GraphWaveNet (MAE 0.092 against 0.071 for FreTS).
Efficiency §4.3 fig. 4. The paper states complexity O(N log N + L log L). On Wiki (N from 1000 to 5000, horizon 12), it reports the number of parameters does not depend on N, and against AGCRN, about 30% fewer parameters and about 20% less training time §4.3. On Exchange (horizon 96 to 480), it reports at least 3× fewer parameters than FEDformer, Autoformer and Informer, and training 3× faster than Informer, 5× faster than Autoformer and more than 10× faster than FEDformer §4.3. These are author-reported.
Parameter sensitivity app. E.3 fig. 6. On ECG with horizon 12, the paper sweeps input length over {6, 12, ..., 60} and embedding size over {32, 64, 128, 256, 512}. It reports that accuracy first rises and then falls with input length, and with embedding size app. E.3. The per-value numbers are only in the figure.
Learned weights §4.4 fig. 5 app. E.2 app. B.4. Visualisations of the real and imaginary weight matrices on Traffic show clear diagonal patterns §4.4 fig. 5. The paper claims the real part matters more than the imaginary part app. E.2. The ablation table for real and imaginary inputs is tab. 7. This table is not transcribed here.
Paper vs code
The official code is at code and code_commit (repository: aikunyi/FreTS).
Its LICENSE is Apache-2.0. Its header line reads "Copyright 2022 DLinear
Authors", so the code appears to be derived from the DLinear/LTSF-Linear
codebase. The repository only contains the long-term experiments
run_longExp.py. The short-term experiments, including Solar,
Wiki, METR-LA, ECG and COVID-19 in tab. 1, tab. 8 and tab. 9, have no
script in the repository.
Differences between the paper and the code at code_commit:
- Frequency MLP weights are used diagonally. The paper writes the layer as a
complex d-by-d matrix product §3.2 eq. 6 eq. 7. The code computes
einsum('bijd,dd->bijd', x, r), which multiplies each feature by the diagonal entry r[d, d] and drops the off-diagonal entries [code: models/FreTS.py#L71-L81]. The off-diagonal entries of r1, i1, r2 and i2 get no gradient and have no effect. - The channel learner is never executed. The code tests
self.channel_independence == '1'FreTS.py. The flag is parsed as an integer run_longExp.py, so the comparison is always false. The temporal learner is the only one that runs. This also means the channel-learner results in tab. 3 cannot be reproduced from the code as shipped. The paper says the channel learner is part of the default model app. B.3 §3.1. - Residual connection. The code adds the lifted input back before the head FreTS.py FreTS.py. Equation 5 has no such term eq. 5.
- Activation and soft-shrink. The paper leaves σ unnamed §3.2 eq. 6. The code applies ReLU to the real and imaginary parts, then a soft-shrink with threshold 0.01 FreTS.py. The soft-shrink is not in the paper.
- Head activation. The code's head is Linear, LeakyReLU, Linear [code: models/FreTS.py#L27-L31]. The paper leaves σ unnamed eq. 5.
- Rfft length. The code uses L//2+1 bins FreTS.py. The paper writes L/2 §3.1.
- Dataset split for ETT. The paper uses 7:2:1 §4. The ETT loader uses fixed borders of 12, 4 and 4 months (8640, 2880 and 2880 hours) [code: data_provider/data_loader.py#L47-L48].
- Training configuration. The paper leaves the optimizer, learning rate, epochs and patience unstated. The code uses Adam, learning rate 1e-4, batch size 8, 10 epochs, patience 3, and halves the rate each epoch [code: exp/exp_main.py#L43] run_longExp.py [code: utils/tools.py#L11-L12]. The code default batch size (8) lies in the paper's search set {4, 8, 16, 32} app. B.3, but the paper does not say which value it used for the long-term tables.
- Traffic lookback. §4.1 gives lookback 48 for Traffic. The caption of tab. 2 gives lookback 96 for all datasets except Traffic, whose horizons are 48 to 336. The code has no Traffic script, so this cannot be checked.
- No discrepancy found for embedding width 128, hidden width 256, MSE loss exp_main.py, min-max normalisation fitted on the training split data_loader.py, or lookback 96 and horizons for ETT and Weather run_longExp.py.
Pitfalls
- Diagonal versus full weight matrix. Implementations that follow eq. 6 and eq. 7 will have d² trainable weights per layer and will not match the released model. Implementations that follow the code will train only d diagonal entries per weight. Theorem 2 eq. 9 is stated for the full complex matrix, so it does not directly describe the released layer.
- The channel learner is off in the released code. Results for FreCL/FreTL tab. 3 and any short-term setup that depends on the channel learner cannot be checked with this repository.
- Activation and initialisation are unstated. The σ in the frequency MLP and the head, the initial scale of the frequency weights and the embedding, and the soft-shrink threshold are not in the paper. The code choices are in the Hyperparameters table and may change results.
- Residual term. The code's residual connection (lifted input added back before the head) is not in the paper's equations. Reproductions that follow the paper alone will differ from the code.
- Numerical sensitivity of the frequency representation. The frequency
representation uses an orthonormal FFT (
norm='ortho') in the code [code: models/FreTS.py#L45] FreTS.py, and the inverse uses the same normalisation FreTS.py. Changing the normalisation changes the scale of every frequency component, and the paper does not state it. - Claims in the text are stronger than the tables. §4.1 says FreTS "outperforms all baselines on all datasets" for long-term forecasting. In tab. 2, PatchTST has the lower MAE and RMSE on Traffic at horizons 48 and 96 (MAE 0.016 vs 0.018 and 0.018 vs 0.020), and on Electricity at horizon 336 (MAE 0.043 vs 0.046). LTSF-Linear ties FreTS on ETTh1 at horizon 720.
- Baseline count. §4 refers to thirteen baselines for short-term forecasting, which matches tab. 1. app. B.2 refers to eighteen baselines.
- Short-term data loading is not in the repository. Solar, Wiki, METR-LA,
ECG and COVID-19 short-term settings have no code. The ECG and COVID-19 CSVs
are in
dataset/, but the repository does not contain the short-term training loop. - Averages are not recomputed. The paper's averaged gains (9.4% MAE, 11.6% RMSE for short-term; more than 20% for long-term against Transformers) are given in the text and can be checked against tab. 1 and tab. 2 only by computing them yourself.
- No variance reported. The paper gives no repeated runs or significance tests. The code fixes seed 2021 run_longExp.py. Gaps of 0.001 in MAE, as in several rows of tab. 2, have no error bars to judge them by.
Lineage
- Builds on: Discrete Fourier transform eq. 1 eq. 2. The paper adopts the LTSF-Linear experimental protocol for long-term forecasting app. B.3 and reuses the DLinear and NLinear linear-model setups as ablation targets §4.2 tab. 4. The lookback of 96 follows FEDformer and Autoformer app. B.3.
- Compared against: VAR, SFM, LSTNet, TCN, DeepGLO, Reformer, Informer, Autoformer, FEDformer, GraphWaveNet, StemGNN, MTGNN, AGCRN (short-term); PatchTST, LTSF-Linear, FEDformer, Autoformer, Informer, Reformer (long-term) §4 tab. 1 tab. 2. The paper also names TAMP-S2GCNets, DCRNN and STGCN for graph-based short-term comparisons §4 tab. 9 tab. 8.
- Related frequency-domain forecasters named by the authors: SFM, StemGNN, Autoformer, FEDformer, CoST and FiLM §2. These are not cards in this wiki yet, so they are not linked.
- Superseded by: not known from content in this wiki.
Source and license
Adapted from “Frequency-domain MLPs are More Effective Learners in Time Series Forecasting” by Kun Yi, Qi Zhang, Wei Fan, Shoujin Wang, Pengyang Wang, Hui He, Defu Lian, Ning An, Longbing Cao, Zhendong Niu (arXiv:2311.06184), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/aikunyi/FreTS at commit 6de28ab19f83 (Apache-2.0). Any quoted code is shown under that license.