TL;DR
N-BEATS is a forecasting model for a single numeric series, such as daily sales or monthly tourist counts. It is a deep stack of plain fully connected layers with no time-series-specific parts: no seasonal adjustment, no input scaling tricks, no hand-built features. Each block in the stack looks at what is left of the input, predicts a piece of the future, and removes the part of the past it could explain before passing the rest on. On the M4, M3 and tourism benchmarks it reported better scores than the best published entries, and a variant with trend and seasonality built into its basis gave forecasts that split into readable parts.
Builds on: Residual Connection, Basis Expansion, Time Series Forecasting · Leads to: Time Series Forecasting (the benchmark case it reset)
Why it mattered
Forecasting is a large business problem, and inventory control and planning depend on it. Before this work, deep learning had a poor record here. In the M4 competition, pure machine-learning entries ranked poorly against statistical methods. The M4 winner by Smyl (2020) was a hybrid of a dilated LSTM stack and a Holt-Winters statistical model.
N-BEATS showed that a pure deep network, built only from generic parts, could beat that winner on the same benchmark. The same architecture, with the same settings, worked across M3, M4 and tourism. The interpretable variant showed a second thing: a deep model can be told to split its forecast into a trend part and a seasonal part, the way analysts already do with classical decomposition.
The history is short. Spyros Makridakis has run forecasting competitions since 1982, and M4 is the latest with 100,000 series. Through M3 and M4, pure machine-learning forecasters ranked poorly against statistical methods. The paper was posted to arXiv in 2019 by Oreshkin, Carpov, Chapados and Bengio.
The problem
The task is univariate point forecasting. You are given a history of T numbers, y₁ to y_T, and you must predict the next H numbers. H is the forecast horizon: 6 for six months ahead, 48 for hourly data over two days, and so on. The model does not see the future. It sees a lookback window, the last t values before the forecast point, and it must produce all H future values at once.
Accuracy is scored with error measures that do not depend on the scale of the series. The paper uses sMAPE, MAPE and MASE. The symmetric mean absolute percentage error is
where is the true value and is the forecast. Before this work, the best entries in M4 were a mix of statistical models and ensembles, and the question was whether deep learning could compete without help from those methods.
How it works
The model is a stack of blocks. Here is one tiny instance traced from start to finish, with H = 2 (predict two steps) and a lookback of 4 values.
- The input to the first block is the lookback window x₁ = [4, 6, 8, 10]. The block is a small fully connected network. It reads x₁ and outputs two sets of numbers, the forward and backward coefficients. Check: 4 numbers in, 2 forward and 2 backward numbers out.
- The forward coefficients are mixed into a forecast of length H = 2. Say the block outputs a forecast ŷ₁ = [11, 12]. Check: the forecast has the same length as the horizon.
- The backward coefficients are turned into a backcast x̂₁, the block's best guess of what its input looked like. Say x̂₁ = [4, 6, 7, 9]. The block subtracts it from its input and passes the rest on: x₂ = x₁ − x̂₁ = [0, 0, 1, 1]. Check: the part the block could explain is gone, and the second block sees only what is left.
- The second block gets x₂ = [0, 0, 1, 1] and, in this made-up instance, produces the forecast ŷ₂ = [1, 1] and a backcast equal to its input. Its residual is then x₃ = [0, 0, 0, 0]. Check: nothing is left over.
- The final forecast is the sum of all partial forecasts: ŷ = ŷ₁ + ŷ₂ = [11 + 1, 12 + 1] = [12, 13]. Each block contributed one piece, and the pieces can be inspected separately.
The numbers in steps 2 to 4 are invented to show the mechanism. In the real model, the blocks learn these outputs from data. The point is the bookkeeping: each block subtracts its explanation from the signal and adds its explanation to the forecast.
The generic model stacks many such blocks. Each block has four fully connected layers with ReLU bends, then two linear layers, one for the forward coefficients and one for the backward coefficients. The coefficients then pass through a basis layer that turns them into a forecast of length H.
flowchart LR X["input x_l"] --> B["block l: FC layers"] B --> TF["forward coefficients"] B --> TB["backward coefficients"] TF --> YF["partial forecast y_l"] TB --> XB["backcast x_hat_l"] X --> S["x_l+1 = x_l minus x_hat_l"] XB --> S S --> NEXT["next block"] YF --> SUM["final forecast = sum of all y_l"]
The interpretable variant uses the same blocks but changes the basis layer. The first stack has a polynomial basis, so its partial forecasts are smooth, slowly moving curves. The second stack has a Fourier basis, so its partial forecasts are repeating waves. The trend stack runs first, so the seasonal stack only sees what the trend did not explain.
Training, briefly: each batch draws 1024 series at random, picks a forecast point in each, and updates the network with the Adam optimizer. One model is trained per forecast horizon. The architecture is the same across datasets, and only the training settings change.
The math
The block equations follow the walkthrough step by step.
Step 1 in symbols: the block network
For a block ℓ, with input x_ℓ, four fully connected layers produce a hidden vector h_{ℓ,4}, and two linear maps produce the coefficient vectors:
Here ReLU is the bend that sets every negative value to zero. θᶠ is the forward coefficient vector and θᵇ the backward one.
Step 2 in symbols: the forecast from a basis
A basis is a list of waveforms v₁, v₂, … of length H. The forecast is a weighted sum of them, with the coefficients as weights:
In the walkthrough, ŷ₁ = [11, 12] is such a sum. The generic model learns the vectors v directly. The interpretable model fixes them in advance.
Step 3 in symbols: doubly residual stacking
The backcast is subtracted from the block's input, and the partial forecasts are added up:
Check with the walkthrough: x₂ = [4, 6, 8, 10] − [4, 6, 7, 9] = [0, 0, 1, 1].
Step 4 in symbols: trend and seasonality bases
A trend is a low-degree polynomial over the forecast window. With the time vector t = [0, 1, …, H−1]ᵀ / H and a degree p, the basis matrix is T = [1, t, …, tᵖ], and the trend forecast is T θ. The paper's settings use p = 2.
A seasonal pattern is a periodic function. The Fourier basis uses sines and cosines, with S = [1, cos(2πt), …, sin(2πt), …], and the seasonal forecast is S θ.
Worked example 1: one block, H = 2
Take the lookback x = [4, 6, 8, 10] and one block whose backcast is x̂ = [4, 6, 7, 9].
- Subtract the backcast from the input, element by element: 4 − 4 = 0, 6 − 6 = 0, 8 − 7 = 1, 10 − 9 = 1.
- The residual passed on is [0, 0, 1, 1].
- Suppose this block's forecast is ŷ = [11, 12]. That is the whole contribution of the block to the final answer.
- Interpretation: the block explained the first two lookback values exactly and left a bump of 1 in each of the last two, which the next block must handle.
Worked example 2: scoring a forecast with sMAPE
Actual values are y = [100, 110]. The forecast is ŷ = [90, 115]. So H = 2.
- Error on step 1: |100 − 90| = 10. Scale: |100| + |90| = 190. Ratio: 10 / 190 ≈ 0.05263.
- Error on step 2: |110 − 115| = 5. Scale: |110| + |115| = 225. Ratio: 5 / 225 ≈ 0.02222.
- Sum of ratios: 0.05263 + 0.02222 = 0.07485.
- Multiply by 200 / H = 200 / 2 = 100: sMAPE ≈ 7.49.
- Interpretation: on average the forecast is about 7.5 percent off, measured symmetrically against the actual and the forecast.
Worked example 3: reading the M4 results
The paper's Table 1 reports average sMAPE on the 100,000-series M4 dataset: 11.374 for the M4 winner (DL/TS hybrid) and 11.135 for N-BEATS with its generic and interpretable models combined (N-BEATS-I+G). The overall weighted average (OWA) score is 0.821 for the winner and 0.795 for N-BEATS-I+G.
- Compute the sMAPE gap: 11.374 − 11.135 = 0.239 points in favour of N-BEATS.
- Compute the OWA gap: 0.821 − 0.795 = 0.026.
- Turn the OWA gap into a relative size: 0.026 / 0.821 ≈ 0.032, so about 3.2 percent.
- Interpretation: the gain over the hybrid winner is real but modest. The paper notes that this gap is larger than the gap between the winner and the second-place entry, which is 0.838 − 0.821 = 0.017.
Try it: using the same table, what is the sMAPE gap between N-BEATS-I+G and the M4 winner? Answer: 11.374 − 11.135 = 0.239 points.
Results
Table 1 gives the aggregate results. Lower is better for each metric.
| Dataset | Metric | Best published entries | N-BEATS result |
|---|---|---|---|
| M4 (100,000 series) | sMAPE / OWA | M4 winner (DL/TS hybrid): 11.374 / 0.821 | N-BEATS-I+G: 11.135 / 0.795 |
| M3 (3,003 series) | sMAPE | EXP: 12.71 | N-BEATS-I+G: 12.37 |
| Tourism (1,311 series) | MAPE | LeeCBaker: 19.35 | N-BEATS-G: 18.47 |
On M4, the generic model N-BEATS-G scored 11.168 and the interpretable N-BEATS-I scored 11.174 in sMAPE. The authors say that the generic model uses no feature engineering, no scaling and no time-series components, and that it outperforms all the other approaches they studied on every subset of M4.
What the results mean: the gain is consistent across three datasets from different domains, which is the claim the paper most cares about. What they do not show: the paper evaluates only univariate point forecasts, so it says nothing about probabilistic forecasts or series with many inputs. The reported results come from a large ensemble, so they cost far more compute than a single model. The paper's discussion also connects the model to meta-learning.
Common mistakes and tradeoffs
It is tempting to think that deep learning cannot beat statistical forecasting on series like these. Earlier machine-learning entries in M4 did rank low, but the generic N-BEATS model, with no seasonal filter and no hand-set scaling, beats the M4 winner on the reported metrics. Its design is a deep stack that refines its own residual.
It is tempting to think that an interpretable model must lose accuracy. Table 1 shows N-BEATS-I at sMAPE 11.174 and N-BEATS-G at 11.168 on M4, a difference of 0.006 points. The constraint on the basis costs almost nothing here, although it may cost more on other data.
It is tempting to think that an ensemble is just averaging the same model many times. In fact the diversity is the point. The paper's ensemble uses three loss functions, six lookback lengths from 2H to 7H, and different random starts, and it takes the median. The authors report that dropout and L2 penalties improved single models but hurt the ensemble.
When to use it: many related series, a fixed forecast horizon, and enough compute. When not to use it: a single short series, where a simple statistical model is cheaper and easier to check, or a task with many input variables, since the model is univariate. Alternatives include exponential smoothing and ARIMA, which need less data and no GPU.
Reading guide
Read the paper in this order. Each section depends on the lessons named beside it.
- Section 1, Introduction, and Section 2, Problem Statement: Time Series Forecasting and the error measures above.
- Section 3.1, Basic Block: Feedforward Neural Network for the fully connected layers, and Backpropagation for training them.
- Section 3.2, Doubly Residual Stacking: Residual Connection, then Basis Expansion for the forward and backward basis layers.
- Section 3.3, Interpretability: Polynomial for the trend basis and Fourier Transform for the seasonal basis.
- Section 3.4, Ensembling: Ensemble Learning.
- Section 5, Experimental Results: Adam Optimizer for the training setup. Appendix B has the ablations on stacking and ensemble size.
- Section 6, Discussion: meta-learning, optional on a first read.
Recap: forecasting one series means predicting H future values from a lookback window. A block predicts forward and backward coefficients, which become a partial forecast and a backcast through a basis. Doubly residual stacking subtracts each backcast from the input, so later blocks see only what is left, and adds up the partial forecasts. The interpretable variant fixes a polynomial basis for trend and a Fourier basis for seasonality, so the forecast splits into two readable parts.
Check yourself
QuestionWhy does each block subtract its backcast from its input?Show answer
So the next block only sees the part of the signal the earlier blocks could not explain. Each block removes what it can model, which makes the later blocks' job easier and gives the gradients a direct path through the stack.
QuestionA forecast of length H = 3 has sMAPE terms that sum to 0.10. What is the sMAPE?Show answer
sMAPE = (200 / H) times the sum = (200 / 3) times 0.10 = 6.67, to two decimal places.
QuestionWhy does the interpretable model use a polynomial basis for one stack and a Fourier basis for the other?Show answer
A trend is slowly varying and monotonic, which a low-degree polynomial matches. A seasonal pattern repeats, which sines and cosines match. Fixing the bases this way forces each stack to output one kind of pattern, so its output can be read as trend or as seasonality.
QuestionApplied scenario: a retailer has 50 monthly sales series, each with a clear yearly season, and wants a forecast 12 months ahead. Why might N-BEATS-I be a sensible first choice, and what should be checked?Show answer
It fits many related series, the horizon is fixed, and the trend and seasonal parts can be inspected for each product. Check that the seasonal period is right for monthly data, that the trend stack does not absorb the seasonality, and that the forecast is compared against a simple baseline on held-out months.