TL;DR
Informer is a Transformer built for long-horizon forecasting: given many past readings of a time series, it predicts a long stretch of future readings in one shot. It keeps the Transformer's ability to link any two time steps directly, and it removes the three costs that make the vanilla model impractical at that length: quadratic attention, memory that grows with every stacked layer, and slow step-by-step output. On several real datasets its error rises slowly as the forecast gets longer, while the baselines' error climbs much faster.
Builds on: Transformer, Time Series Forecasting, Encoder-Decoder Architecture · Leads to: Autoformer: Decomposition Transformers with Auto-Correlation, A Time Series is Worth 64 Words: Long-term Forecasting with Transformers, Are Transformers Effective for Time Series Forecasting?
Why it mattered
Long-horizon forecasting feeds planning decisions. The paper's motivating case is a power utility that must know the temperature of an electrical transformer station, and the load on the grid, days or weeks ahead. Informer was one of the earliest Transformer models designed for that task rather than for language. It released a new dataset of transformer-station temperatures (the ETT data) and its code, so later papers could compare against it. Autoformer, which is an Informer successor, and PatchTST both report results on the same kind of benchmark. DLinear later used these benchmarks to question whether attention helps at all, which is why the Informer results are still read carefully.
The problem
Before this work, most forecasters were tested on short horizons, typically 48 points or fewer. The paper's Figure 1 shows an LSTM forecasting the hourly temperature of a transformer station. As the forecast grows from 12 points (half a day) to 480 points (20 days), the error stays manageable up to about 48 points and then rises sharply, and the inference speed drops.
The Transformer is the natural tool here, because self-attention links any two time steps through a path of length one, where a recurrent network needs a path as long as the gap. But the vanilla model has three limits on long inputs and outputs. Each limit is stated in terms of the input length and the number of stacked layers :
- Quadratic attention. Each layer compares every query with every key, so time and memory per layer are .
- Memory across layers. Stacking layers multiplies that cost, giving total memory. Long inputs stop fitting on one GPU.
- Slow long outputs. A standard decoder predicts one value at a time and feeds each prediction back in, so predicting values takes sequential passes, which is as slow as an RNN.
Earlier work tackled the first limit with sparse patterns such as the Sparse Attention of Sparse Transformer and Longformer, or with hashing (Reformer) and low-rank projections (Linformer). The paper argues these efforts left limits 2 and 3 untouched, and that the goal for forecasting is improvement beyond efficiency: a bigger prediction capacity, meaning the ability to link the far future to the far past, at a cost the hardware can carry.
Earlier attempts and history
Forecasting was dominated by classical models such as ARIMA and by recurrent networks such as the LSTM, which read a series one step at a time and struggled as sequences grew longer. The Transformer, introduced in 2017, replaced recurrence with attention, and its cost is quadratic in sequence length. From 2019 to 2020, several groups proposed sparse or approximate attention to cut that cost, including the Sparse Transformer, LogSparse, Longformer, Reformer and Linformer. Informer was posted to arXiv in December 2020 and aimed those efforts at the forecasting problem, adding distilling and the one-pass decoder so that both memory and output speed were addressed. The paper's data and code were released publicly, which made it a common reference point for the Transformer-based forecasters that followed.
How it works
Informer has an encoder that reads the past, and a decoder that writes the future. The diagram shows the path of one input.
flowchart LR A[Past values with time stamps] --> B[Input embedding: value plus position plus calendar] B --> C[ProbSparse attention with distilling, repeated] C --> D[Encoder output] D --> E[Decoder: start token plus zero placeholders] E --> F[All future values in one pass]
Take a tiny instance: 8 past hourly readings, and a forecast of the next 4 readings. Every number is kept small so each step can be checked by hand.
-
Embed each time step. Each of the 8 readings becomes one vector. The vector is the reading's value, plus a fixed position code that says which slot it occupies, plus learned embeddings of calendar stamps such as hour of day and day of week. Check: 8 readings give 8 vectors; the vector length is the model width.
-
Score how informative each query is. Attention lets each time step (a query) compare itself with every other step (its keys). For each query the model measures how far its attention spread is from uniform. A query whose attention is almost uniform adds little: its output is close to the average of the values. The model keeps the top queries, where is a constant times , and gives the rest the average of the values. This is the ProbSparse attention (defined in the math below), and the name comes from the sparse set of queries that receive the full computation. Check: with 8 queries and the constant set to 5, , which is more than 8, so this toy keeps every query. The saving only appears at lengths where is much smaller than .
-
Distil: halve the sequence between layers. The attention output goes through a 1-D convolution, an exponential linear unit (ELU, a smooth activation that is negative for negative inputs), and a max-pool with stride 2. The pool keeps the strongest response in each pair of time steps. Check: 8 time steps become 4.
-
Run a second, shorter stack in parallel. The encoder also builds replicas of the stack on halved inputs and drops one distilling layer at a time, like a pyramid. The experiments pair the full-length stack with a quarter-length one, so the model sees both the full history and a more compressed version. The encoder output concatenates the stacks. Check: each stack's output has the same width, so they can be joined.
-
Decode in one pass. The decoder input is a start token (the last known values, here 2 readings) followed by 4 placeholder zeros, one per future step. Masked attention stops each placeholder from looking at later placeholders. A linear layer turns every position into a forecast. Check: 2 + 4 = 6 decoder positions; 4 forecasts come out after a single forward pass.
-
Train on the error. The 4 forecasts are compared with the 4 true readings using mean squared error, and the gradient flows back through the decoder, the encoder and the attention layers. Check: a forecast 1 degree too high and one 2 degrees too high contribute 1 and 4 to the sum before averaging.
The uniform input in step 1 matters more than it looks. The paper argues that long-range forecasting needs global context such as the week, the month or a holiday, and that plain Transformer position codes carry only the local order.
The math
For a query and keys , with scaled scores , the measurement is
It is the log-sum-exp of the scores minus their mean. A query whose scores are all equal has the smallest value; a query with one dominant score has a large one.
Step 2 in symbols: ProbSparse attention
The paper writes the gap between the attention distribution and the uniform distribution as a KL divergence. Dropping the constant that does not depend on the query gives the measurement above.
Computing exactly needs every dot product, which is the quadratic cost we wanted to avoid. The paper replaces the log-sum-exp with the max, giving
and bounds the error with a lemma:
The max-mean value is therefore a usable proxy for the true measure. In practice the paper samples only random dot products to estimate it.
Then ProbSparse attention keeps the top queries under this measure and fills the rest with the mean of the values:
where holds only the top queries and is the sampling factor. With , the time and memory of a layer are .
Step 3 in symbols: distilling
where is the attention block at layer , the convolution has kernel width 3 along time, and the max-pool has stride 2. Each layer halves the time length, so the total memory over the stack is for a small .
Step 5 in symbols: the decoder input
where is the known start segment and is a block of zeros. Future positions are masked so each one attends only to earlier positions, and one forward pass produces all outputs.
Step 6 in symbols: the loss
averaged over the forecast window. The paper also reports MAE, the same average with absolute values in place of squares.
Worked examples
Four keys, so . Query 1 has scaled scores .
- Exponentiate each score: , and three times.
- Add them: .
- Take the log: . This is the log-sum-exp term.
- Take the mean of the scores: .
- Subtract: .
- Compute the max-mean proxy: .
- Check the lemma: . The bound holds.
Query 2 has scores .
- Log-sum-exp: . Mean: . So .
- Max-mean proxy: .
Interpretation: query 1 has a clear favourite key, so its attention is far from uniform and it ranks above query 2 (1.841 against 1.386). Query 2 attends uniformly, so it gets the average of the values, and it is dropped from the top .
Feed 336 hourly readings (14 days) through three distilling layers, and count the entries in the full attention matrices, one matrix per layer, one head.
- Without distilling, each of the 3 layers holds a matrix: entries. Three layers total .
- With distilling, the length halves after each layer: .
- Layer 1 holds entries.
- Layer 2 holds entries.
- Layer 3 holds entries.
- Total with distilling: .
- Ratio: , so the distilled stack needs less than half the memory.
Interpretation: distilling lets deeper encoders see long inputs without the memory growing with depth. The savings compound with ProbSparse, which shrinks each layer further.
Input length , which is 7 days of hourly readings.
- Full attention needs every query against every key: dot products per head.
- ProbSparse first samples dot products to estimate the measure.
- It keeps the top , rounded to 26, queries.
- Those 26 queries each take all 168 keys: dot products.
- Total for ProbSparse: .
- Ratio: , so about 19% of the work.
Interpretation: at this length the saving is large, and it grows as grows, because the full cost is quadratic and the ProbSparse cost is close to .
Try it: a step-by-step decoder must predict 720 hourly values (the longest ETTh1 horizon, 30 days). How many decoder forward passes does it need, and how many does Informer need? Answer: the step-by-step decoder needs 720 passes, one per predicted value, while Informer needs 1, since all 720 placeholder positions are filled in a single pass.
Results
The paper evaluates univariate forecasting on the ETT data (ETTh1, ETTh2 and ETTm1), ECL and Weather, at five horizons each. For ETTh1 at a 168-hour horizon, Informer reaches MSE 0.183 and MAE 0.346. The baselines are LSTMa at 0.236 and 0.392, DeepAR at 0.239 and 0.422, ARIMA at 0.396 and 0.504, and Prophet at 1.224 and 0.763. At the 720-hour horizon, Informer reaches MSE 0.269 and MAE 0.435, against 0.683 for LSTMa, 0.658 for DeepAR and 2.735 for Prophet.
The count row of the univariate table records how often each method wins a metric cell. Informer wins 32 cells, its canonical-attention variant wins 12, and DeepAR wins 6. In the multivariate table Informer wins 33 cells, the canonical variant 14, and LSTnet 2. At ETTh1 with a 168-hour horizon, Informer's multivariate MSE is 0.931, against 1.997 for LSTnet.
The limits are stated by the authors. On ECL, DeepAR is better at short horizons: at 168 hours its MSE is 0.315 against 0.447 for Informer, and at 336 hours it is 0.414 against 0.489. Informer is better from 720 hours on (0.540 against 0.563). The canonical-attention variant is close to Informer on these counts, which the authors read as support for the query sparsity assumption: full attention and the sparse version produce comparable attention maps. These are benchmark results on one GPU with a fixed training recipe (Adam, learning rate starting at 0.0001 and halving each epoch, batch size 32, eight epochs), not a general claim about all forecasting problems.
Limits and tradeoffs
It is tempting to think ProbSparse simply throws away attention; in fact the lazy queries still receive an output, the average of the values, and the top- queries get full attention. The paper's argument is that the lazy queries' full attention would be close to that average anyway, which is why dropping them costs little.
It is tempting to think halving the sequence loses too much; in fact the paper runs a shorter stack on a quarter of the input next to the full-length one, so the encoder keeps a view of the full input and a compressed view. The paper's memory test shows the cost of the alternative: the full-attention LogTrans runs out of memory in its extreme cases, while ProbSparse does not.
It is tempting to think the one-pass decoder is always more accurate; in fact it is chosen for speed and for avoiding accumulated error, and the paper's evidence is mostly on long horizons. On short horizons the gain is small, and a simpler model can be enough.
It is tempting to think a Transformer forecaster always beats classical baselines; in fact the paper's own ECL results show DeepAR ahead at horizons up to 336 hours, and DLinear later showed that a simple one-layer linear model can match or beat several Transformer forecasters on long-horizon benchmarks.
| Method | Training time | Memory | Testing steps |
|---|---|---|---|
| Informer | 1 | ||
| Vanilla Transformer | |||
| LogTrans | 1 | ||
| Reformer | |||
| LSTM |
Use an Informer-style model when the horizon is long, the input history is long, and you have enough data and a GPU to train it. Avoid it for short horizons or small datasets, and always compare it against a simple linear baseline before trusting its gains.
Reading guide
- Abstract and Section 1 (Introduction): needs Transformer and Long Short-Term Memory. Figure 1 is the motivating experiment.
- Section 2 (Preliminary): the forecasting setup and the encoder-decoder pattern. Needs Encoder-Decoder Architecture and Time Series Forecasting. "Dynamic decoding" in the paper means step-by-step output; compare Teacher Forcing and Exposure Bias.
- Section 3.1 (ProbSparse attention): needs Softmax, Multi-Head Attention and Kullback–Leibler Divergence. Read the lemma as a bound on the measure.
- Section 3.2 (Encoder and distilling): needs Convolution and Max Pooling.
- Section 3.3 (Decoder): needs Sequence to Sequence Learning with Neural Networks for the contrast between one-pass and step-by-step output.
- Section 4 (Experiments): needs Mean Squared Error and Adam Optimizer. The results tables are where to check every claim.
- Appendix B (Input representation): needs Positional Encoding.
- Appendix D (Proof of Lemma 1): needs the calculus of convex functions and the gradient of the log-sum-exp (the log of a sum of exponentials), which is a smooth stand-in for the max.
Check yourself
QuestionName the three limitations of the vanilla Transformer that Informer targets.Show answer
(1) Each layer's attention costs time and memory quadratic in the sequence length, . (2) Stacking layers multiplies the memory, giving , which limits how long an input can be. (3) Step-by-step decoding makes the prediction of a long output as slow as an RNN, since each value needs its own pass.
QuestionA query has scaled scores over 8 keys. What is its sparsity measurement , and what is the max-mean proxy?Show answer
The log-sum-exp is , and the mean of the scores is 0, so . The max-mean proxy is . The value is the smallest possible for 8 keys, so this query has perfectly uniform attention and is a candidate to be dropped from the top .
QuestionWhy does the decoder use zero placeholders rather than feeding its own earlier predictions back in?Show answer
Because the paper's decoder produces all outputs in one forward pass, there are no earlier predictions to feed back. This avoids the accumulated error that step-by-step decoding builds up over a long horizon, and it cuts inference to a single pass. The decoder has to learn the future from the start token and the calendar stamps alone.
QuestionYou need 48 hourly forecasts of grid load from 500 days of data, and a simple linear model already gives low error. Should Informer be your first choice?Show answer
Probably not as the first try. Informer's advantages are reported for long horizons, while the paper's own ECL results show DeepAR ahead at short ones and the authors' motivation starts from horizons above about 48 points. Start with the linear baseline, then test Informer on your data at your horizon, and compare it against the classical baselines before deciding.
Sources
- Zhou, H., Zhang, S., Peng, J., Zhang, S., Li, J., Xiong, H., Zhang, W. Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting. arXiv:2012.07436. https://arxiv.org/abs/2012.07436
- Official source code: https://github.com/zhouhaoyi/Informer2020