Paper · 2024-05-23 · cs.LG, cs.AI
TimeMixer: Decomposable Multiscale Mixing for Time Series Forecasting
TimeMixer is an MLP-only forecaster. It average-pools the input into several scales, splits each scale into seasonal and trend parts, mixes seasonal parts bottom-up and trend parts top-down, then sums one linear predictor per scale. Author-reported: lowest MSE on all 8 long-term benchmarks (input 96) and best scores on PEMS and M4.
Time series forecastingMulti-layer perceptron (MLP)Multi-scale feature fusiontime-seriesforecastingmultiscalemlpseries-decompositionlong-term-forecastingshort-term-forecasting
arXivPDFCodeMarkdown19 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 a time series is hard when the signal mixes several kinds of change at once: a slow drift over months, a repeating daily or weekly rhythm, and short bursts. A series looks different depending on how far you zoom out. Fine detail shows the short rhythms, while a coarse view shows the drift.
TimeMixer uses this idea. It makes a stack of copies of the past input, each one smaller than the last, so the model sees the same history at several zoom levels. For each zoom level it separates the signal into a repeating part and a slow-moving part. The repeating detail from fine levels is blended upward into coarser levels, and the slow trend from coarse levels is blended downward into finer ones. Last, a simple linear predictor at each zoom level makes its own guess at the future, and the guesses are added together.
The network uses only linear layers and GELU activations, with no attention. The authors report that this makes it efficient to run, and that it forecasts more accurately than the models they compare it against.
TL;DR
- TimeMixer forecasts from the past at several downsampled scales, using only MLP blocks §3.
- Each scale is split into seasonal and trend parts §3.2 eq. 3. Seasonal parts are mixed bottom-up and trend parts top-down eq. 4 eq. 5.
- The final forecast is the sum of one predictor per scale §3.3 eq. 6.
- Author-reported: best MSE and MAE on all eight long-term benchmarks at input length 96 tab. 2, and best error on the PEMS and M4 short-term tables tab. 3 tab. 4.
- Use it when you want a small MLP forecaster with explicit multiscale structure. Check the code-vs-paper differences before you reimplement it.
Problem
Real series combine many kinds of variation, such as increasing, decreasing and fluctuating patterns, and these are hard to separate §1. Earlier deep forecasters handled this with series decomposition (seasonal plus trend) or multiperiodicity analysis, and used CNN, RNN, Transformer or MLP backbones §1 §2. The authors argue that the signal at different sampling scales should be used directly: fine scales show detailed patterns and coarse scales show macro variation, and the future depends on both §1. Prior multiscale models (Pyraformer, SCINet) do not use past information from all scales together when they predict the future §2.
Method
The paper has three parts: a multiscale input, a past-mixing stack (PDM) and a future-prediction block (FMM) §3.
3.1 Multiscale mixing architecture §3.1. The past series x of length P and C variates is average-pooled M times. Scale m has length floor(P/2^m), and scale 0 is the input itself §3.1. Each scale is embedded into d_model channels §3.1. Stacked PDM blocks (L of them) then mix the past across scales eq. 1.
3.2 Past-Decomposable-Mixing (PDM) §3.2 eq. 3. For block l, each scale is split into a seasonal part and a trend part by a moving-average decomposition (from Autoformer) §3.2. Then:
- Seasonal parts are mixed bottom-up: scale m gets a residual term from scale m-1 eq. 4. The mixer is two linear layers over time with a GELU between them, from length P/2^{m-1} to P/2^m §3.2. The width between the two layers is not stated, and the code uses P/2^m (see Pitfalls).
- Trend parts are mixed top-down: scale m gets a residual term from scale m+1, computed the same way as step 1 but in the opposite direction eq. 5 §3.2.
- The mixed seasonal and trend parts are added, passed through a feed-forward block (two linear layers with GELU, over channels), and added back to the block input as a residual eq. 3 §3.2.
The authors argue that seasonal detail is most useful when it flows from fine to coarse, and trend is most useful when it flows from coarse to fine §3.2. They also test the opposite directions and removing either mixing or decomposition, and report that these variants are worse tab. 5 §4.2.
3.3 Future-Multipredictor-Mixing (FMM) §3.3 eq. 2 eq. 6. After the last PDM block, each scale m has its own predictor. Each predictor is one linear layer over time from floor(P/2^m) to F, and then a projection to C variates §3.3. The final forecast is the sum over scales eq. 6. The authors state that the predictors use different information and so are complementary §3.3 fig. 4.
Overall pipeline, in the paper's notation:
- Multiscale input: X = {x_0, ..., x_M}, scale m of length floor(P/2^m) §3.1.
- Past mixing: X^l = PDM(X^{l-1}) for l = 1..L eq. 1.
- Future: x_hat = FMM(X^L) eq. 2.
Pseudocode for one forward pass. The paper does not describe normalization, so the per-scale normalization step is taken from the code and marked as such:
# TimeMixer forward pass, channel-independent setting (code default)
# Input: past (B, P, C) Output: forecast (B, F, C)
# M = down-sampling steps, L = PDM blocks [§3.1] [app. A, tab. 7]
def timemixer(past):
# 1. Build M+1 scales by average pooling; each step halves the
# length [§3.1]
scales = [past]
for m in 1 to M:
scales.append(avg_pool(scales[m - 1], window=2)) # (B, P/2^m, C)
# 2. Per-scale instance normalisation. Code only, not in the paper
# [code: models/TimeMixer.py#L213-L218]
stats = [normalise_stats(s) for s in scales]
# 3. Channel independence: each variate becomes its own univariate
# series [code: models/TimeMixer.py#L349-L350]
series = [reshape_per_variate(s) for s in normed] # (B*C, P/2^m, 1)
# 4. Embed every scale into d_model channels [§3.1]
# [code: layers/Embed.py#L176-L194]
hidden = [embed(s) for s in series] # (B*C, P/2^m, d_model)
# 5. L PDM blocks mix seasonal and trend parts across scales
# [eq. 1] [eq. 3]
for block in pdm_blocks:
hidden = pdm_block(hidden)
# 6. Per-scale linear predictor over time, then a projection to one
# channel [§3.3]
preds = []
for m in 0 to M:
y = predict_layers[m](hidden[m]) # (B*C, d_model, F)
preds.append(projection(y)) # (B*C, F, 1)
# 7. Sum the scale predictions [eq. 6]
out = sum(preds)
# 8. Undo normalisation with scale-0 statistics
# [code: models/TimeMixer.py#L382]
return reshape_back(denormalise(out, stats[0])) # (B, F, C)# One Past-Decomposable-Mixing block [§3.2] [eq. 3]
# Input: list of M+1 scales, each (B*C, T_m, d_model)
def pdm_block(hidden):
# 1. Split each scale into seasonal and trend parts with a moving
# average, kernel 25 by default [eq. 3]
# [code: layers/Autoformer_EncDec.py#L21-L53]
seasonal = []
trend = []
for h in hidden:
s, t = moving_average_decomp(h)
seasonal.append(s)
trend.append(t)
# 2. Bottom-up seasonal mixing: fine to coarse, residual [eq. 4]
# The code uses the already-updated finer scale
# [code: models/TimeMixer.py#L61-L67]
for m in 1 to M:
seasonal[m] = seasonal[m] + bottom_up(seasonal[m - 1])
# 3. Top-down trend mixing: coarse to fine, residual [eq. 5]
# The code uses the already-updated coarser scale
# [code: models/TimeMixer.py#L105-L111]
for m in M - 1 down to 0:
trend[m] = trend[m] + top_down(trend[m + 1])
# 4. Recombine each scale, add the feed-forward block (d_model to
# d_ff and back), keep the residual [eq. 3]
out = []
for m in 0 to M:
mixed = seasonal[m] + trend[m]
out.append(hidden[m] + feed_forward(mixed)) # (B*C, T_m, d_model)
return outKey equations, as printed in the paper:
\mathcal{X}^{l} = \operatorname{PDM}(\mathcal{X}^{l-1}) \qquad [\text{eq. 1}]
\widehat{\mathbf{x}} = \operatorname{FMM}(\mathcal{X}^{L}) \qquad [\text{eq. 2}]
\mathcal{X}^{l} = \mathcal{X}^{l-1} + \operatorname{FeedForward}\!\big(\operatorname{S\text{-}Mix}(\{\mathbf{s}_m^l\}) + \operatorname{T\text{-}Mix}(\{\mathbf{t}_m^l\})\big) \qquad [\text{eq. 3}]
\mathbf{s}_m^l \leftarrow \mathbf{s}_m^l + \operatorname{Bottom\text{-}Up\text{-}Mixing}(\mathbf{s}_{m-1}^l), \quad m = 1..M \qquad [\text{eq. 4}]
\mathbf{t}_m^l \leftarrow \mathbf{t}_m^l + \operatorname{Top\text{-}Down\text{-}Mixing}(\mathbf{t}_{m+1}^l), \quad m = M-1..0 \qquad [\text{eq. 5}]
\widehat{\mathbf{x}} = \sum_{m=0}^{M} \widehat{\mathbf{x}}_m, \qquad \widehat{\mathbf{x}}_m = \operatorname{Predictor}_m(\mathbf{x}_m^L) \qquad [\text{eq. 6}]
Hyperparameters
Paper configuration, from the appendix table app. A, tab. 7. "M" is the number
of down-sampling steps, which the code calls down_sampling_layers. "Layers" is
the number of PDM blocks, which the code calls e_layers. LR is the initial
learning rate, which the code passes as max_lr to OneCycleLR. The scripts in
the repository do not always match this table (see Paper vs code).
| Dataset | M | Layers | d_model | LR | Loss | Batch size | Epochs | Source |
|---|---|---|---|---|---|---|---|---|
| ETTh1 | 3 | 2 | 16 | 1e-2 | MSE | 128 | 10 | app. A, tab. 7 |
| ETTh2 | 3 | 2 | 16 | 1e-2 | MSE | 128 | 10 | app. A, tab. 7 |
| ETTm1 | 3 | 2 | 16 | 1e-2 | MSE | 128 | 10 | app. A, tab. 7 |
| ETTm2 | 3 | 2 | 32 | 1e-2 | MSE | 128 | 10 | app. A, tab. 7 |
| Weather | 3 | 2 | 16 | 1e-2 | MSE | 128 | 20 | app. A, tab. 7 |
| Electricity | 3 | 2 | 16 | 1e-2 | MSE | 32 | 20 | app. A, tab. 7 |
| Solar-Energy | 3 | 2 | 128 | 1e-2 | MSE | 32 | 20 | app. A, tab. 7 |
| Traffic | 3 | 2 | 32 | 1e-2 | MSE | 8 | 20 | app. A, tab. 7 |
| PEMS | 1 | 5 | 128 | 1e-3 | MSE | 32 | 10 | app. A, tab. 7 |
| M4 | 1 | 4 | 32 | 1e-2 | SMAPE | 128 | 50 | app. A, tab. 7 |
Settings the paper does not state. Values are the code defaults, or what the run scripts pass. Each is cited to the code.
| Name | Value | Where | Notes |
|---|---|---|---|
| Input length P | 96 | §4 tab. 2 | All main-table runs. Hyperparameter search covers 96, 192, 336, 512 app. E |
| Prediction length F (long-term) | 96, 192, 336, 720 | tab. 2 | Results averaged over the four lengths |
| Prediction length F (PEMS) | 12 | tab. 3 | |
| Prediction length F (M4) | 6 to 48 | tab. 4 | Per frequency |
| Feed-forward width d_ff | 32 (ETT), 64 (Traffic), 256 (PEMS), 2048 (Solar) | TimeMixer_ETTh1_unify.sh TimeMixer_unify.sh TimeMixer.sh | Not in the paper. Set per script; run.py default is 32 run.py |
| Down-sampling window | 2 | TimeMixer_ETTh1_unify.sh | Not stated in the paper. Average pooling: §3.1 |
| Down-sampling method | avg | run.py | Matches the paper |
| Moving-average kernel (decomposition) | 25 | run.py | Not stated in the paper |
| Dropout | 0.1 | run.py | Not stated in the paper |
| Optimizer | Adam, default betas | exp_long_term_forecasting.py app. A, tab. 7 | Paper states Adam with (0.9, 0.999) |
| LR schedule | OneCycleLR, pct_start 0.2 | exp_long_term_forecasting.py run.py | Not stated in the paper |
| Early-stopping patience | 15 (run.py default); 10 (ETTh1 script), 3 (Solar script), 20 (M4 script) | run.py | Not stated in the paper |
| Loss (long-term, PEMS) | MSE | exp_long_term_forecasting.py | Paper: "L2 loss" §4 |
| Loss (M4) | SMAPE | TimeMixer.sh | Paper: SMAPE app. A, tab. 7 |
| Normalisation | per-scale instance norm with learnable affine, on by default | run.py StandardNorm.py | Not in the paper. The Solar script sets use_norm 0 |
| Channel independence | 1 (default) | run.py | Solar script sets 0 |
| Embedding | value conv (kernel 3, circular, no bias) plus time features | Embed.py Embed.py | Paper: "embedding layer" §3.1, not specified |
| Batch size (default) | 16 | run.py | Scripts override it |
| Epochs (default) | 100 | run.py | The Traffic script sets no epochs flag, so this default applies |
| Metrics | MAE, MSE, RMSE, MAPE for PEMS; SMAPE, MASE, OWA for M4 | app. A, metric details | See Paper vs code |
Benchmark data sizes and forecastability, from app. A, tab. 6. "Series Length" in that table is the prediction horizon for M4, not the input length.
| Dataset | Dim | Series length | (Train, Val, Test) | Frequency | Forecastability |
|---|---|---|---|---|---|
| ETTm1 | 7 | {96, 192, 336, 720} | (34465, 11521, 11521) | 15 min | 0.46 |
| ETTm2 | 7 | {96, 192, 336, 720} | (34465, 11521, 11521) | 15 min | 0.55 |
| ETTh1 | 7 | {96, 192, 336, 720} | (8545, 2881, 2881) | 15 min | 0.38 |
| ETTh2 | 7 | {96, 192, 336, 720} | (8545, 2881, 2881) | 15 min | 0.45 |
| Electricity | 321 | {96, 192, 336, 720} | (18317, 2633, 5261) | Hourly | 0.77 |
| Traffic | 862 | {96, 192, 336, 720} | (12185, 1757, 3509) | Hourly | 0.68 |
| Weather | 21 | {96, 192, 336, 720} | (36792, 5271, 10540) | 10 min | 0.75 |
| Solar-Energy | 137 | {96, 192, 336, 720} | (36601, 5161, 10417) | 10 min | 0.33 |
| PEMS03 | 358 | 12 | (15617, 5135, 5135) | 5 min | 0.65 |
| PEMS04 | 307 | 12 | (10172, 3375, 3375) | 5 min | 0.45 |
| PEMS07 | 883 | 12 | (16911, 5622, 5622) | 5 min | 0.58 |
| PEMS08 | 170 | 12 | (10690, 3548, 265) | 5 min | 0.52 |
| M4-Yearly | 1 | 6 | (23000, 0, 23000) | Yearly | 0.43 |
| M4-Quarterly | 1 | 8 | (24000, 0, 24000) | Quarterly | 0.47 |
| M4-Monthly | 1 | 18 | (48000, 0, 48000) | Monthly | 0.44 |
| M4-Weekly | 1 | 13 | (359, 0, 359) | Weekly | 0.43 |
| M4-Daily | 1 | 14 | (4227, 0, 4227) | Daily | 0.44 |
| M4-Hourly | 1 | 48 | (414, 0, 414) | Hourly | 0.46 |
Results
Author-reported. Setup: input length 96 for every model, results averaged over the 4 prediction lengths, averaged over 3 runs, one NVIDIA A100 80GB §4 tab. 2 app. A. Baselines are re-run with a unified setting, not copied from their papers §4. The hyperparameter-searched upper bounds are in app. E and are not reproduced here.
Long-term forecasting (MSE / MAE, averaged over four horizons) tab. 2.
| Model | Weather | Solar-Energy | Electricity | Traffic | ETTh1 | ETTh2 | ETTm1 | ETTm2 |
|---|---|---|---|---|---|---|---|---|
| TimeMixer | 0.240 / 0.271 | 0.216 / 0.280 | 0.182 / 0.272 | 0.484 / 0.297 | 0.447 / 0.440 | 0.364 / 0.395 | 0.381 / 0.395 | 0.275 / 0.323 |
| PatchTST | 0.265 / 0.285 | 0.287 / 0.333 | 0.216 / 0.318 | 0.529 / 0.341 | 0.516 / 0.484 | 0.391 / 0.411 | 0.406 / 0.407 | 0.290 / 0.334 |
| TimesNet | 0.251 / 0.294 | 0.403 / 0.374 | 0.193 / 0.304 | 0.620 / 0.336 | 0.495 / 0.450 | 0.414 / 0.427 | 0.400 / 0.406 | 0.291 / 0.333 |
| Crossformer | 0.264 / 0.320 | 0.406 / 0.442 | 0.244 / 0.334 | 0.667 / 0.426 | 0.529 / 0.522 | 0.942 / 0.684 | 0.513 / 0.495 | 0.757 / 0.610 |
| MICN | 0.268 / 0.321 | 0.283 / 0.358 | 0.196 / 0.309 | 0.593 / 0.356 | 0.475 / 0.480 | 0.574 / 0.531 | 0.423 / 0.422 | 0.353 / 0.402 |
| FiLM | 0.271 / 0.291 | 0.380 / 0.371 | 0.223 / 0.302 | 0.637 / 0.384 | 0.516 / 0.483 | 0.402 / 0.420 | 0.411 / 0.402 | 0.287 / 0.329 |
| DLinear | 0.265 / 0.315 | 0.330 / 0.401 | 0.225 / 0.319 | 0.625 / 0.383 | 0.461 / 0.457 | 0.563 / 0.519 | 0.404 / 0.408 | 0.354 / 0.402 |
| FEDformer | 0.309 / 0.360 | 0.328 / 0.383 | 0.214 / 0.327 | 0.610 / 0.376 | 0.498 / 0.484 | 0.437 / 0.449 | 0.448 / 0.452 | 0.305 / 0.349 |
| Stationary | 0.288 / 0.314 | 0.350 / 0.390 | 0.193 / 0.296 | 0.624 / 0.340 | 0.570 / 0.537 | 0.526 / 0.516 | 0.481 / 0.456 | 0.306 / 0.347 |
| Autoformer | 0.338 / 0.382 | 0.586 / 0.557 | 0.227 / 0.338 | 0.628 / 0.379 | 0.496 / 0.487 | 0.450 / 0.459 | 0.588 / 0.517 | 0.327 / 0.371 |
| Informer | 0.634 / 0.548 | 0.331 / 0.381 | 0.311 / 0.397 | 0.764 / 0.416 | 1.040 / 0.795 | 4.431 / 1.729 | 0.961 / 0.734 | 1.410 / 0.810 |
Headline numbers from the text §4.1: the Weather MSE is 9.4% lower than PatchTST's, and the Solar-Energy MSE is 24.7% lower. The authors also note good performance on low-forecastability datasets such as Solar-Energy and ETT §4.1.
Short-term forecasting, PEMS (input 96, horizon 12) tab. 3. Bold is TimeMixer's row.
| Dataset | Metric | TimeMixer | SCINet | Crossformer | PatchTST | TimesNet | MICN | FiLM | DLinear | FEDformer | Stationary | Autoformer | Informer |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PEMS03 | MAE | 14.63 | 15.97 | 15.64 | 18.95 | 16.41 | 15.71 | 21.36 | 19.70 | 19.00 | 17.64 | 18.08 | 19.19 |
| PEMS03 | MAPE | 14.54 | 15.89 | 15.74 | 17.29 | 15.17 | 15.67 | 18.35 | 18.35 | 18.57 | 17.56 | 18.75 | 19.58 |
| PEMS03 | RMSE | 23.28 | 25.20 | 25.56 | 30.15 | 26.72 | 24.55 | 35.07 | 32.35 | 30.05 | 28.37 | 27.82 | 32.70 |
| PEMS04 | MAE | 19.21 | 20.35 | 20.38 | 24.86 | 21.63 | 21.62 | 26.74 | 24.62 | 26.51 | 22.34 | 25.00 | 22.05 |
| PEMS04 | MAPE | 12.53 | 12.84 | 12.84 | 16.65 | 13.15 | 13.53 | 16.46 | 16.12 | 16.76 | 14.85 | 16.70 | 14.88 |
| PEMS04 | RMSE | 30.92 | 32.31 | 32.41 | 40.46 | 34.90 | 34.39 | 42.86 | 39.51 | 41.81 | 35.47 | 38.02 | 36.20 |
| PEMS07 | MAE | 20.57 | 22.79 | 22.54 | 27.87 | 25.12 | 22.28 | 28.76 | 28.65 | 27.92 | 26.02 | 26.92 | 27.26 |
| PEMS07 | MAPE | 8.62 | 9.41 | 9.38 | 12.69 | 10.60 | 9.57 | 11.21 | 12.15 | 12.29 | 11.75 | 11.83 | 11.63 |
| PEMS07 | RMSE | 33.59 | 35.61 | 35.49 | 42.56 | 40.71 | 35.40 | 45.85 | 45.02 | 42.29 | 42.34 | 40.60 | 45.81 |
| PEMS08 | MAE | 15.22 | 17.38 | 17.56 | 20.35 | 19.01 | 17.76 | 22.11 | 20.26 | 20.56 | 19.29 | 20.47 | 20.96 |
| PEMS08 | MAPE | 9.67 | 10.80 | 10.92 | 13.15 | 11.83 | 10.76 | 12.81 | 12.09 | 12.41 | 12.21 | 12.27 | 13.20 |
| PEMS08 | RMSE | 24.26 | 27.34 | 27.21 | 31.04 | 30.65 | 27.26 | 35.13 | 32.38 | 32.97 | 38.62 | 31.52 | 30.61 |
Short-term forecasting, M4 (univariate, single variate per series) tab. 4. Bold is TimeMixer's column. The table's header abbreviations are kept: FED. is FEDformer, Auto. is Autoformer, Pyra. is Pyraformer, In. is Informer. N-BEATS was run without its ensemble tab. 4 caption.
| Group | Metric | TimeMixer | TimesNet | N-HiTS | N-BEATS | SCINet | PatchTST | MICN | FiLM | LightTS | DLinear | FED. | Stationary | Auto. | Pyra. | In. |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Yearly | SMAPE | 13.206 | 13.387 | 13.418 | 13.436 | 18.605 | 16.463 | 25.022 | 17.431 | 14.247 | 16.965 | 13.728 | 13.717 | 13.974 | 15.530 | 14.727 |
| Yearly | MASE | 2.916 | 2.996 | 3.045 | 3.043 | 4.471 | 3.967 | 7.162 | 4.043 | 3.109 | 4.283 | 3.048 | 3.078 | 3.134 | 3.711 | 3.418 |
| Yearly | OWA | 0.776 | 0.786 | 0.793 | 0.794 | 1.132 | 1.003 | 1.667 | 1.042 | 0.827 | 1.058 | 0.803 | 0.807 | 0.822 | 0.942 | 0.881 |
| Quarterly | SMAPE | 9.996 | 10.100 | 10.202 | 10.124 | 14.871 | 10.644 | 15.214 | 12.925 | 11.364 | 12.145 | 10.792 | 10.958 | 11.338 | 15.449 | 11.360 |
| Quarterly | MASE | 1.166 | 1.182 | 1.194 | 1.169 | 2.054 | 1.278 | 1.963 | 1.664 | 1.328 | 1.520 | 1.283 | 1.325 | 1.365 | 2.350 | 1.401 |
| Quarterly | OWA | 0.825 | 0.890 | 0.899 | 0.886 | 1.424 | 0.949 | 1.407 | 1.193 | 1.000 | 1.106 | 0.958 | 0.981 | 1.012 | 1.558 | 1.027 |
| Monthly | SMAPE | 12.605 | 12.670 | 12.791 | 12.677 | 14.925 | 13.399 | 16.943 | 15.407 | 14.014 | 13.514 | 14.260 | 13.917 | 13.958 | 17.642 | 14.062 |
| Monthly | MASE | 0.919 | 0.933 | 0.969 | 0.937 | 1.131 | 1.031 | 1.442 | 1.298 | 1.053 | 1.037 | 1.102 | 1.097 | 1.103 | 1.913 | 1.141 |
| Monthly | OWA | 0.869 | 0.878 | 0.899 | 0.880 | 1.027 | 0.949 | 1.265 | 1.144 | 0.981 | 0.956 | 1.012 | 0.998 | 1.002 | 1.511 | 1.024 |
| Others | SMAPE | 4.564 | 4.891 | 5.061 | 4.925 | 16.655 | 6.558 | 41.985 | 7.134 | 15.880 | 6.709 | 4.954 | 6.302 | 5.485 | 24.786 | 24.460 |
| Others | MASE | 3.115 | 3.302 | 3.216 | 3.391 | 15.034 | 4.511 | 62.734 | 5.09 | 11.434 | 4.953 | 3.264 | 4.064 | 3.865 | 18.581 | 20.960 |
| Others | OWA | 0.982 | 1.035 | 1.040 | 1.053 | 4.123 | 1.401 | 14.313 | 1.553 | 3.474 | 1.487 | 1.036 | 1.304 | 1.187 | 5.538 | 5.879 |
| Weighted average | SMAPE | 11.723 | 11.829 | 11.927 | 11.851 | 15.542 | 13.152 | 19.638 | 14.863 | 13.525 | 13.639 | 12.840 | 12.780 | 12.909 | 16.987 | 14.086 |
| Weighted average | MASE | 1.559 | 1.585 | 1.613 | 1.559 | 2.816 | 1.945 | 5.947 | 2.207 | 2.111 | 2.095 | 1.701 | 1.756 | 1.771 | 3.265 | 2.718 |
| Weighted average | OWA | 0.840 | 0.851 | 0.861 | 0.855 | 1.309 | 0.998 | 2.279 | 1.125 | 1.051 | 1.051 | 0.918 | 0.930 | 0.939 | 1.480 | 1.230 |
Ablations tab. 5. Run on M4, PEMS04 and the ETTm1 predict-336 setting. The official design is case 172. ↗ is bottom-up mixing and ↙ is top-down. A check mark means the component is present and × means absent.
| Case | Decompose | Seasonal mixing | Trend mixing | Multipredictor | M4 SMAPE | M4 MASE | M4 OWA | PEMS04 MAE | PEMS04 MAPE | PEMS04 RMSE | ETTm1 MSE | ETTm1 MAE |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 172 (official) | ✓ | ↗ | ↙ | ✓ | 11.723 | 1.559 | 0.840 | 19.21 | 12.53 | 30.92 | 0.390 | 0.404 |
| 173 | ✓ | ↗ | ↙ | × | 12.503 | 1.634 | 0.925 | 21.67 | 13.45 | 34.89 | 0.402 | 0.415 |
| 174 | ✓ | × | ↙ | ✓ | 13.051 | 1.676 | 0.962 | 24.49 | 16.28 | 38.79 | 0.411 | 0.427 |
| 175 | ✓ | ↗ | × | ✓ | 12.911 | 1.655 | 0.941 | 22.91 | 15.02 | 37.04 | 0.405 | 0.414 |
| 176 | ✓ | ↙ | ↙ | ✓ | 12.008 | 1.628 | 0.871 | 20.78 | 13.02 | 32.47 | 0.392 | 0.413 |
| 177 | ✓ | ↗ | ↗ | ✓ | 11.978 | 1.626 | 0.859 | 21.09 | 13.78 | 33.11 | 0.396 | 0.415 |
| 178 | ✓ | ↙ | ↗ | ✓ | 13.012 | 1.657 | 0.954 | 22.27 | 15.14 | 34.67 | 0.412 | 0.429 |
| 179 | × | ↗ (both parts) | ✓ | 11.975 | 1.617 | 0.851 | 21.51 | 13.47 | 34.81 | 0.395 | 0.408 | |
| 180 | × | ↙ (both parts) | ✓ | 11.973 | 1.622 | 0.850 | 21.79 | 14.03 | 35.23 | 0.393 | 0.406 | |
| 181 | × | × (no past mixing) | ✓ | 12.468 | 1.671 | 0.916 | 24.87 | 16.66 | 39.48 | 0.405 | 0.412 |
Other §4.2 claims, reported in text and figures only: the seasonal mixing weights are periodic and the trend mixing weights are local fig. 3. The predictions from fine scales track detail and those from coarse scales track trend fig. 4. The number of scales M is set to 3 for long-term and 1 for short-term forecasting, to trade off accuracy and cost §4.2 app. D.
Efficiency, training memory and time app. B, tab. 8. Batch size is not given in the table; fig. 5 says batch size 16 on ETTh1, averaged over 100 iterations.
| Model | Mem 192 (MiB) | s/iter 192 | Mem 384 | s/iter 384 | Mem 768 | s/iter 768 | Mem 1536 | s/iter 1536 | Mem 3072 | s/iter 3072 |
|---|---|---|---|---|---|---|---|---|---|---|
| TimeMixer | 1003 | 0.007 | 1043 | 0.007 | 1075 | 0.008 | 1151 | 0.009 | 1411 | 0.016 |
| PatchTST | 1919 | 0.018 | 2097 | 0.019 | 2749 | 0.021 | 5465 | 0.032 | 16119 | 0.094 |
| TimesNet | 1148 | 0.028 | 1245 | 0.024 | 1585 | 0.042 | 2491 | 0.045 | 2353 | 0.073 |
| Crossformer | 1737 | 0.027 | 1799 | 0.027 | 1895 | 0.028 | 2303 | 0.033 | 3759 | 0.035 |
| MICN | 1771 | 0.014 | 1801 | 0.016 | 1873 | 0.017 | 1991 | 0.018 | 2239 | 0.020 |
| DLinear | 1001 | 0.002 | 1021 | 0.003 | 1041 | 0.003 | 1081 | 0.0.004 | 1239 | 0.015 |
| FEDformer | 2567 | 0.132 | 5977 | 0.141 | 7111 | 0.143 | 9173 | 0.178 | 12485 | 0.288 |
| Autoformer | 1761 | 0.028 | 2101 | 0.070 | 3209 | 0.071 | 5395 | 0.129 | 10043 | 0.255 |
The authors attribute the speed gap to the fully MLP design app. B.
Paper vs code
Official code: https://github.com/kwuking/TimeMixer, Apache-2.0, cloned at
commit e24610583b36fdd8c76cc17a8df4e65759a5f460. The paper links it §7. The
code is the reference for every item below; the paper is silent on most of them.
- Normalisation is missing from the paper. The paper never mentions it.
The code wraps every scale in an instance normalisation with learnable affine
parameters, and undoes it on the output with scale-0 statistics
TimeMixer.py TimeMixer.py
TimeMixer.py StandardNorm.py.
Turned off by
use_norm 0, which the Solar script sets TimeMixer_unify.sh. - Residual and feed-forward differ for channel-mixing. Eq. 3 adds a residual
and a feed-forward block to every PDM block eq. 3. The code adds that residual
only when
channel_independenceis 1 TimeMixer.py. For channel-mixing it applies a feed-forward (cross_layer) to the seasonal and trend parts before decomposition, and returns their sum with no residual TimeMixer.py TimeMixer.py. - Extra prediction path for channel-mixing. The paper's FMM is only a sum of per-scale predictors eq. 6. For channel-mixing the code adds a second regression path with its own per-scale linear layers, applied to the moving-average component of the input TimeMixer.py TimeMixer.py TimeMixer.py.
- Projection layer shared across scales. The paper describes one predictor per scale that also projects to C variates §3.3. The code uses one projection module for all scales; only the time-axis linear layer is per scale TimeMixer.py.
- Unused layer norm.
PastDecomposableMixingdefines a LayerNorm, butforwardnever calls it TimeMixer.py. - Mixer intermediate width is not stated. The paper gives the input and output lengths of each mixer, but not the width between its two linear layers. The code uses the output length P/2^m there, in both mixers TimeMixer.py TimeMixer.py.
- Hyperparameters in the scripts differ from Table 7. Checked against
app. A, tab. 7:
- Solar: script d_model 512, d_ff 2048, LR 1e-3, 3 layers, 10 epochs, M=2, channel_independence 0 TimeMixer_unify.sh TimeMixer_unify.sh. Table: d_model 128, LR 1e-2, 2 layers, 20 epochs, M=3.
- Weather and Electricity: script 3 layers TimeMixer_unify.sh TimeMixer_unify.sh. Table: 2 layers.
- Traffic: script 3 layers and no epochs flag TimeMixer_unify.sh. Table: 2 layers, 20 epochs.
- PEMS: script LR 3e-3 TimeMixer.sh. Table: 1e-3.
- ETTh1, M4, PEMS (layers, d_model, batch) and Weather/ECL/Traffic batch sizes match the table.
- The text says "By default, TimeMixer contains 2 PDM blocks" app. A. Table 7 and the scripts use 4 to 5 for M4 and PEMS.
- Metric formulas. The appendix writes MAE and RMSE as sums over the
horizon app. A, metric details. The code uses means: MAE and MSE are
np.mean, and RMSE is the square root of MSE metrics.py. - Stated M is down-sampling steps. Table 7 "M" equals the code's
down_sampling_layersrun.py. The number of scales is M+1.
Pitfalls
- Normalisation is the first thing to add. Without the per-scale instance normalisation the model will not match reported numbers, and the paper gives no hint of it. Decide which statistics to use for the output (scale 0, as in the code).
- Channel independence changes the architecture. With the default
channel_independence 1, each variate is an independent univariate series and the model is shared across variates TimeMixer.py. The paper's Eq. 3 with its residual and feed-forward matches this default TimeMixer.py. For channel-mixing (channel_independence 0, used by the Solar script) the code's block differs from Eq. 3 (see Paper vs code). - Mixer intermediate width is underspecified. The paper gives the mixer's input and output lengths only. The code's intermediate width is the output length P/2^m, and the second linear layer maps it to itself TimeMixer.py TimeMixer.py.
- Mixing order matters and is sequential. Bottom-up mixing uses the already updated finer scale, and top-down mixing uses the already updated coarser scale TimeMixer.py TimeMixer.py. A parallel implementation will differ.
- Ablation text and table disagree on cases 176 to 178. The appendix says cases 176 to 178 reverse the directions app. F. Table 5 shows 176 uses top-down on both parts and 177 bottom-up on both. Only 178 swaps the two directions. Implement the official design (172) and use the table as the reference.
- Forecastability values disagree. Table 1 gives ETT 0.46 and Solar 0.33 tab. 1. The appendix gives ETTh1 0.38, ETTh2 0.45, ETTm1 0.46, ETTm2 0.55 app. A, tab. 6. The PEMS08 test size of 265 looks like a typo next to validation 3548 app. A, tab. 6. The M4 "Series Length" column is the horizon.
- Hyperparameter search changes the picture. Under per-model search the gap to PatchTST shrinks, which the authors state app. E. Use the unified numbers for comparisons, and do not compare them with searched numbers from other papers.
- Appendix efficiency table has a typo. One DLinear entry reads "0.0.004" app. B, tab. 8. Read it as 0.004 only if you can check it another way.
- Error bars and full searched tables are not in this card. The standard deviations and significance tests app. C and the full searched long-term results app. E are in the paper. The full ablation grids app. F are in the paper's LaTeX and not reproduced here.
- Costs the abstract hides. Efficiency depends on series length. At length 3072, TimeMixer takes 0.016 s per iteration and 1411 MiB, against 0.094 s and 16119 MiB for PatchTST app. B, tab. 8. The batch size of that table is not stated. The mixing layers are linear in input length, and the authors name the resulting parameter growth as a limitation for mobile use app. J.
- Only the temporal dimension is mixed. The authors name variate mixing as future work app. J.
- Scale choice is a dataset decision. M=3 suits long series and M=1 suits short ones §4.2 app. A. Test M on your own data.
Lineage
- Builds on: series decomposition from Autoformer, used for the seasonal and trend split §3.2.
- Related decomposition model: DLinear, which uses decomposition before linear regression §2.
- Related multiscale designs: Pyraformer (pyramidal attention) and SCINet (bifurcate downsampling tree), which the authors say do not use past information at all scales together for the future prediction §2.
- Mixing ideas: MLP-Mixer (channel and patch mixing) and FNet (Fourier token mixing) §2.
- Compared against: PatchTST, TimesNet, SCINet, Crossformer, MICN, FiLM, DLinear, LightTS, FEDformer, Stationary, Pyraformer, Autoformer, Informer, N-HiTS, N-BEATS §4 tab. 2 tab. 3 tab. 4. Two concurrent MLP models (MTSMixer and TSMixer) and Scaleformer are in app. G, not in the main tables app. G.
- Superseded by: not stated in this paper.
Source and license
Adapted from “TimeMixer: Decomposable Multiscale Mixing for Time Series Forecasting” by Shiyu Wang, Haixu Wu, Xiaoming Shi, Tengge Hu, Huakun Luo, Lintao Ma, James Y. Zhang, Jun Zhou (arXiv:2405.14616), 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/kwuking/TimeMixer at commit e24610583b36 (Apache-2.0). Any quoted code is shown under that license.