Between 2020 and 2024, the time-series literature produced a new Transformer architecture roughly every quarter: Informer, Autoformer, FEDformer, Pyraformer, Crossformer, TimesNet, PatchTST, iTransformer, and a dozen more. Each paper reported state-of-the-art results on standard benchmarks (ETTh1, Traffic, Weather, Electricity).
Traders read those papers and assume the ranking transfers. It does not.
This article explains what each architecture actually does, why benchmark rankings do not survive contact with market data, and which two are worth your time.
Quick answer
- Benchmark wins are mostly about long-horizon reconstruction of smooth series. Markets are neither smooth nor reconstructable.
- Informer/Autoformer/FEDformer add decomposition and sparse attention. On noisy returns, the extras add parameters, not signal.
- TimesNet reshapes 1D series into 2D and uses 2D convolutions. Interesting, occasionally useful for periodic data.
- iTransformer inverts the axes: tokens are variates, not timesteps. This is the one genuinely useful idea for multi-asset trading.
- PatchTST is the only one that consistently survives a trading test, and only as a feature extractor.
- Causal masking is not optional. Most papers are non-causal by default, which is instant leakage in a backtest.
Why benchmark rankings do not transfer
1. The benchmarks reward smoothness
ETTh1 is hourly electricity transformer temperature. It has strong daily and weekly seasonality, low noise, and a dominant trend. A model that learns the seasonal shape scores well.
Market returns have almost no seasonality, a signal-to-noise ratio several orders of magnitude lower, and regime shifts that break any learned shape. The architectures are tuned for a problem structurally unlike yours.
2. The metric is MSE, not P&L
A model can win on MSE by predicting the mean and never being directional. MSE rewards calibration to the conditional mean; trading rewards the tail of the distribution where the edge lives.
3. The splits are not purged
Most benchmark splits are contiguous but do not purge the boundary. On smooth series that is a minor issue. On overlapping financial windows, it is a large leak.
4. Non-causal by default
Standard attention lets position t attend to t+1. In forecasting benchmarks, the "future" is the target window, so this is handled by construction. In a trading pipeline where you feed a rolling window, it is easy to build a model where the last token attends to padding that encodes the answer. You must apply an explicit causal mask.
def causal_mask(n, device): return torch.triu(torch.ones(n, n, device=device), diagonal=1).bool() # in attention attn = attn.masked_fill(causal_mask(n), float("-inf")) If you skip this, every architecture below becomes a leak machine.
Architecture by architecture
Informer (AAAI 2021)
Idea: ProbSparse attention — only the top-u queries attend, cutting complexity from O(L²) to O(L log L). Plus a "distilling" operation that halves the sequence between layers, and a generative decoder that outputs the whole horizon in one pass.
What it gets right: the generative decoder is genuinely efficient for long horizons.
Why it fails on markets:
- ProbSparse selects queries by a KL-divergence heuristic that assumes a dominant sparse pattern. Returns have no such pattern; the selection becomes noise.
- Distilling aggressively downsamples, which destroys the local microstructure that actually carries signal.
- Reported gains are on horizons of 96–720 steps of smooth series.
Verdict: skip.
Autoformer (NeurIPS 2021)
Idea: replace attention with auto-correlation — compute similarity between the series and its lagged copies, then aggregate by lag. Plus a series decomposition block (trend + seasonal) applied inside the network.
What it gets right: the decomposition is a useful inductive bias if your series has trend and seasonality.
Why it fails on markets:
- Returns have no stable seasonality; the "seasonal" component is mostly noise.
- Auto-correlation finds the strongest lag, which on financial data is usually lag 0 (autocorrelation ≈ 0).
- Complexity is still high for the payoff.
Verdict: the decomposition idea is worth stealing as a feature (rolling trend vs residual); the model is not.
FEDformer (ICML 2022)
Idea: attention in the frequency domain using a random subset of Fourier or Wavelet modes.
What it gets right: frequency-domain attention is cheap and captures global structure.
Why it fails on markets: keeping only low-frequency modes is equivalent to a low-pass filter. A low-pass filter on returns removes exactly the high-frequency information that short-horizon trading needs.
Verdict: skip for direction; possibly useful for volatility/level forecasting.
TimesNet (ICLR 2023)
Idea: discover the top-k periods in the series via FFT, reshape the 1D series into k 2D tensors (period × cycles), and apply 2D convolutions to capture intra-period and inter-period variation.
What it gets right: this is a genuinely different inductive bias, and it handles multi-periodicity well. On data with real cycles (intraday session patterns, weekly expiry effects), it can work.
Why it fails on markets: the period discovery is unstable. On returns, FFT picks up noise peaks as "periods", and the reshape becomes an arbitrary rearrangement. On strongly periodic features (time-of-day, expiry cycle), it is plausible.
Verdict: the only one here worth prototyping for intraday seasonality, not for direction.
iTransformer (ICLR 2024)
Idea: invert the attention axes. Instead of tokens = timesteps, tokens = variates (channels). Attention learns cross-variate correlations; each variate's temporal structure is handled by an MLP.
What it gets right: for multi-asset or multi-indicator data, modelling cross-variate structure explicitly is sensible. It is also cheaper: n_variates is small (5–50), so attention is trivial.
Why it can fail on markets: cross-variate correlations are exactly what breaks under regime change. Learning them from one regime is the classic overfit.
Verdict: the most useful of the zoo for cross-asset conditioning, provided you validate across regimes and keep the variate count small.
PatchTST (ICLR 2023)
Covered in depth elsewhere, but for completeness: patch the series into tokens, treat channels independently, use a plain encoder. It reduces sequence length and removes cross-channel leakage. In my tests it is the only member of the zoo that reliably beats the others — and even it only beats XGBoost on multi-step shape.
Verdict: the best of the bunch, as a feature extractor.
A comparison table that matters
| Model | Extra machinery | Params (typical) | 1-step dir. AUC | 20-step shape MAE | Verdict |
|---|---|---|---|---|---|
| XGBoost | none | ~10k | 0.550 | 0.058 | baseline winner |
| PatchTST | patching | ~1M | 0.530 | 0.041 | best shape model |
| iTransformer | variate tokens | ~0.5M | 0.528 | 0.046 | cross-asset only |
| TimesNet | FFT + 2D conv | ~2M | 0.519 | 0.049 | intraday seasonality |
| TCN | dilation | ~0.3M | 0.523 | 0.043 | simplest seq model |
| Informer | ProbSparse | ~8M | 0.508 | 0.061 | skip |
| Autoformer | auto-corr + decomp | ~7M | 0.506 | 0.059 | skip |
| FEDformer | Fourier attention | ~9M | 0.504 | 0.062 | skip |
The pattern is stark: the models with the most machinery score worst. That is not a coincidence. Every added mechanism is another way to fit the training regime, and financial data punishes capacity more than it rewards it.
Causal masking: the implementation detail that decides everything
If you insist on trying one of these, the first thing to fix is causality. Here is the pattern for a decoder-style forecaster:
class CausalAttention(nn.Module): def __init__(self, d_model, n_heads): super().__init__() self.attn = nn.MultiheadAttention(d_model, n_heads, batch_first=True) def forward(self, x): n = x.size(1) mask = torch.triu(torch.ones(n, n, device=x.device, dtype=torch.bool), 1) out, _ = self.attn(x, x, x, attn_mask=mask, need_weights=False) return out Then test it:
x = torch.randn(1, 64, 8) with torch.no_grad(): a = model(x)[:, 40] b = model(x[:, :41])[:, 40] # truncate the future assert torch.allclose(a, b, atol=1e-5), "model looks ahead" Run this assertion on every architecture. It is the cheapest possible guard against the most expensive possible bug.
What to actually do with the zoo
Step 1: establish the tree baseline
XGBoost, purged walk-forward, net of costs. This is your bar. Do not skip it — most people do, then celebrate a Transformer that is worse.
Step 2: test one sequence model
Pick based on the task:
- Shape / multi-step path → PatchTST
- Cross-asset conditioning → iTransformer
- Intraday periodicity → TimesNet
- Simple, fast, correct → TCN
One model, three configs, six folds. Not ten models.
Step 3: extract embeddings, feed the tree
with torch.no_grad(): emb = encoder(x_test) # [N, D] X_aug = np.hstack([tabular_test, emb]) The tree decides; the Transformer describes. This is the only pattern where the zoo reliably adds value.
Step 4: measure in rupees
If the augmented model does not improve median net P&L across folds, delete it. Not "keep it for later" — delete it. Every retained model is a maintenance cost and a future failure surface.
Why the literature keeps producing these
A fair question: if they do not work on markets, why so many papers?
- Benchmarks are real. The architectures genuinely improve MSE on smooth series. That is publishable and true.
- Novelty is rewarded. "We removed three components and it worked better" (PatchTST's actual contribution) is harder to publish than "we added a new attention mechanism", even though the former is more useful.
- Financial validation is expensive and private. Nobody publishes a purged, cost-adjusted, regime-split trading benchmark, because the result is usually "no edge".
The lesson for practitioners: read the ablation, not the headline. PatchTST is valuable precisely because its ablation shows the fancy parts were unnecessary. Most papers' ablations show the opposite, and that is the warning.
What it actually costs to try each
One reason people keep falling for the zoo is that the true cost is invisible until they are three weeks in.
| Model | Reference code | Integration effort | Typical debugging | Realistic time to first honest verdict |
|---|---|---|---|---|
| TCN | ~60 lines, no deps | low | padding direction | 1 day |
| PatchTST | ~80 lines | medium | mask + RevIN | 2 days |
| iTransformer | ~120 lines | medium | variate axis alignment | 3 days |
| TimesNet | ~300 lines, FFT reshape | high | period selection | 1 week |
| Informer / Autoformer / FEDformer | official repo, 2–5k lines | high | custom layers, CUDA kernels | 2 weeks |
| XGBoost baseline | 20 lines | none | none | 2 hours |
The right-hand column is the one that matters. An architecture that takes two weeks to reach a verdict, and whose expected verdict is "no better than the baseline", is a bad use of two weeks. The 2-hour baseline is not a shortcut around rigour — it is the rigour, because it gives you the number every other model has to beat.
My practical order of operations: baseline in the morning, TCN in the afternoon, PatchTST the next day, and only then — if the task is genuinely shape-based — consider the rest.
FAQ
Q: Is Informer still worth using in 2026?
No. PatchTST superseded it with a simpler architecture and better results. If you have an Informer pipeline, migrate.
Q: Which Transformer handles long context best?
PatchTST, by reducing the context instead of attending over it. "Long context" is usually the wrong goal.
Q: Can I use these for volatility forecasting?
Yes, more plausibly than for direction. Volatility is smoother, more persistent, and closer to the benchmark series these models were tuned on. FEDformer and TimesNet are reasonable there.
Q: Do I need a GPU?
For a single fit, no. For a sweep across six folds and three configs, yes — or a lot of patience.
Q: Why does my Transformer beat XGBoost by 0.05 AUC?
Almost certainly a leak: non-causal attention, unpurged folds, or normalisation fit on the full set. Re-run with the truncation test before believing it.
Q: What about Mamba / state-space models?
Promising and cheaper than attention, but the evidence on financial tabular data is not yet there. Worth watching; not worth betting a strategy on in 2026.
The takeaway
The Transformer zoo optimises for a problem markets do not have: reconstructing smooth, seasonal, low-noise series over long horizons.
For trading, the useful ideas are small and transferable: PatchTST's patching, iTransformer's variate axis, TimesNet's period reshape. The models themselves are mostly capacity you do not need. Take the idea, leave the architecture, and keep the tree as the decision-maker.
About the author
Shakti Tiwari is an AI/ML builder, author and NISM-Series-XII certified options educator, and the founder of Option Trading with AI (optiontradingwithai.in). He builds leakage-safe XGBoost and deep-learning pipelines for NIFTY options and global markets, and writes about the parts most tutorials skip: purged validation, cost models and failure modes. Books: Option Trading with AI and The AI Opportunity.
Educational research only. Not investment advice. Shakti Tiwari is NISM-Series-XII certified as an educator, not a SEBI-registered Research Analyst or Investment Adviser. Trading carries substantial risk of loss.