How Mistral AI’s Timestral turns one causal transformer into a forecaster for any horizon, any context length and any mix of covariates, explained component by component.
About 40 min read
Contents
1. Why forecasting needs foundation models
2. Timestral at a glance
3. Normalisation and patch embedding
4. The backbone
5. Decoupled Horizon Forecasting
6. Many variates, three roles
7. The quantile head and the loss
8. Training and inference recipes
9. Open questions and experiments I would run
10. What’s next
References
Summary
- Timestral [1] is a family of four time-series foundation models (5M to 209M parameters) from Mistral AI. One network forecasts series it has never seen (zero-shot), with no retraining. It outputs 21 quantiles for each future step, for one or many variates, with or without covariates. The report places Timestral-209M and -123M first and second on every metric of GIFT-Eval [21], TIME [22] and fev-bench [23], with all four sizes on the accuracy–size Pareto front [1, §4.2].
- Its central idea is Decoupled Horizon Forecasting (DHF). The observed past is encoded causally, once. Separate prediction tokens, all copies of one learned vector, read that past and forecast up to 32 patches (1,024 steps) ahead. During training, no observation has to be hidden to create long forecast distances.
- Covariates need no new parameters. A series’ role (target, past-only covariate or known-future covariate) is never embedded. It acts only through attention masks and the choice of normaliser. The masks admit known future values and keep future target values out.
- The rest of the network is a modern LLM-style stack: RMSNorm, sigmoid-gated attention, RoPE on half of each head, SwiGLU, and a quantile head whose quantiles cannot cross.
- The report treats forecasting as amortised Bayesian inference: the training data defines the prior. Pre-training uses synthetic data only.

1. Why forecasting needs foundation models
From one model per series to one model for all series. The classical way to forecast is local: fit an ARIMA or exponential-smoothing model to each series, with its own parameters. This works well when every series has a long, clean history, but it scales badly to a hundred thousand series, and it can do nothing for a series that started last week. Global models such as DeepAR [17] share one set of weights across many related series, so that information pools in the weights. A foundation model takes the next step. It is trained once on a very large and diverse corpus and then used zero-shot: you hand it a context it has never seen (electricity load, server latency, an exchange rate) and it returns a forecast, with no fine-tuning. Timestral, Chronos-2 [4], Toto 2.0 [3], TimesFM [16] and TiRex [5] all belong to this family.
Point forecasts are not enough. A grid operator schedules reserves for the bad hour, not the average one. A trader sizes a position by how wide the distribution is, not just where its middle is. A useful forecaster must therefore say how uncertain it is. Timestral outputs 21 quantiles for every future step, at levels
so the 0.05 and 0.95 quantiles bound a 90% interval, and the 0.01 and 0.99 levels describe the tails. The quantiles are marginal: one distribution per variate and per step, with no joint distribution across steps. Section 8 comes back to what that rules out.
Series become tokens by patching. Transformers read sequences of tokens. Following PatchTST [8], most modern forecasters cut a series into patches of consecutive values and turn each patch into one token. Timestral uses non-overlapping patches with throughout. A context of 8,192 steps therefore becomes 256 tokens, short enough for full attention.
What kind of model Timestral is. Benidis et al.’s survey [14] gives a useful checklist for placing a forecaster:
- Forecast type: probabilistic, represented by quantiles and trained with the pinball loss.
- Model type: global and multivariate, used zero-shot. One input is a whole task: every variate that shares a time axis, such as the load of a grid zone together with its temperature, or an exchange rate together with the two countries’ interest rates.
- Conditioning: each target’s forecast conditions on its own past, the past of the other targets, and on covariates. Past-only covariates are known up to now. Known-future covariates, such as calendars, holidays or scheduled events, are known over the horizon too.
- Horizon: up to 1,024 steps in a single forward pass. Longer horizons are forecast block by block.
The training data is the prior. The report’s framing [1, §2.1] is worth stating carefully, because it explains a design priority that architecture diagrams hide. Suppose every series is produced by some unknown process , drawn from a prior . Given a context , the forecast we actually want is the posterior predictive distribution of the continuation . It averages over every process that could have produced the context, weighted by how plausible each one is:
Prior-data fitted networks (PFNs) [6] learn this integral by example. Each training example draws a process from the prior, shows the network a context and asks it for the continuation. Trained with a likelihood loss, the network’s optimum is the posterior predictive itself. Trained with the pinball loss, as Timestral is, the optimum is that distribution’s quantiles [7]. The network amortises inference: instead of fitting a model to a new series, it reads the context and outputs, in one pass, what a Bayesian would have concluded under the training prior.
The consequence is practical. The training corpus is the prior, so it decides how wide the forecasts are. A corpus with too much unpredictable variety teaches the model to hedge even on regular series. A corpus with too little makes it overconfident on new data. The report says that “a significant part of our effort went into designing the generating processes” [1, §2.1], and Timestral is pre-trained on synthetic data only (Section 8). Choosing the generators is a modelling decision, not a data chore.
2. Timestral at a glance

The pipeline has eight stages (stage 1 is training only, stage 7 inference only):
- Sample a task and crop a window; assign roles and hide random gaps (training only).
- Normalise: targets and past-only rows are scaled causally, patch by patch; known-future rows use whole-window statistics.
- Patch and embed: every 32 values, together with 32 missing-value flags, become one token.
- Add prediction tokens: copies of one learned vector sit at the positions to be forecast.
- Backbone: a stack of pre-norm blocks. Each block has temporal attention within a row and a SwiGLU, and every fourth block adds variate attention across the rows of the task.
- Head: only the prediction tokens of target rows reach the quantile head.
- De-normalise each forecast patch with its own statistics. In training, the targets are scaled into the same frame instead, and the loss is computed there.
- Output: the pinball loss in training, or 21 quantiles per step at inference.
Notation. The equations follow the conventions of Prince’s Understanding Deep Learning [13]. Vectors are bold lowercase, matrices bold uppercase, functions take square brackets, and a token matrix holds one token per column.
| Symbol | Meaning |
|---|---|
| patch length: time steps per token | |
| , | steps and patches in a training window |
| row (one variate of one task), time step, patch index (from 0) | |
| , | value of row at step ; 1 if observed |
| context token of patch (target, past-only or known-future row) | |
| , | the learned prediction token, and its copy at patch |
| final representation at prediction token | |
| first patch of the forecast block that contains patch | |
| , | mean and std of row up to the end of patch |
| , | quantile at step , in scaled and in raw units |
| model sizes |
The report indexes the target by and covariates by . Because Timestral feeds covariates as ordinary rows, this article writes every row’s value as and lets the role of row say what it is.
3. Normalisation and patch embedding
Why scale at all. A zero-shot model meets series whose levels range from to . Before any learned layer, every row is mapped to a common scale, and the forecast is mapped back at the end. The interesting part is which statistics are used, and when.
3.1 A causal frame per patch
Each value of row in patch is standardised with the mean and standard deviation of all observed values of that row up to the end of patch , then passed through [1, §3.3]:
Here runs over the 32 steps of patch , and the released code adds small guards against empty or single-value histories. I call the pair the frame of patch : the zero point and unit length in which its values are written. Three choices are packed into this formula.
- Causal. In a causal model, the token at patch may depend only on data up to patch . Statistics computed over the whole window would leak the future level and spread of the series into every earlier token, and the model would learn to rely on information it will not have at test time. (The report follows Toto [15] here.)
- One frame per patch. All 32 values of a token share one frame, so the embedding sees a consistent shape. Including the patch’s own values is harmless: only later patches are hidden from it.
- . It is linear near zero and logarithmic in the tails, so a price jump or a demand spike is compressed without losing its sign, as in Chronos-2 [4].
Known-future rows are different. Their values are visible over the whole window anyway, so one frame over the whole window, horizon included, is both safe and more stable. Binary known-future rows, such as holiday flags, are left untouched [1, §3.3].

3.2 The frame of a forecast patch
A forecast must be written in some frame too, and here the details matter. The target of patch is expressed in the frame of everything up to the end of the preceding patch, [1, §3.3]. The truth in that frame, which is what the loss compares against, and the way back to raw units are
where is the head’s -th quantile in scaled units and is the frame of forecast patch . Ending the frame at patch rather than matters: a frame that included patch would leak the answer through its mean.
There is a subtlety inside a forecast block. The second patch of a block needs a frame that includes the first patch of the block, which at inference has not happened yet. Timestral replaces the earlier patches of the block by their predicted medians, so the frame advances through the horizon. It uses the same median-filled statistics in training too, “so that training and inference match” [1, §3.3]. For the first patch of a block, the frame is simply .
3.3 Patch embedding, with missing values made explicit
Real series have gaps. Timestral writes a missing value as 0 and also passes a missing-value flag, so an observed zero and a gap remain distinguishable [1, §3.3]. For patch of row , the 32 scaled values are stacked on top of the 32 flags , and a two-layer residual MLP maps the -vector to a -dimensional token:
For the 28M model this is . Nothing else is added to the token: there is no positional, timestamp, frequency or role embedding [1, §3.3]. The model has to infer the sampling frequency from the shape of the data. Contexts are left-padded to a multiple of 32, so that the last patch ends exactly at the forecast origin, and leading all-missing patches are never attended to.

The scaler is short enough to show in full. Cumulative sums give the frame at the end of every patch in one pass:
import torch
P = 32 # patch length
def causal_patch_stats(x: torch.Tensor, obs: torch.Tensor, eps: float = 1e-6):
"""Mean and std of each row's observed values up to the end of every patch.
x, obs: (rows, C) with C a multiple of P; x is 0 where obs is False.
Returns m, s of shape (rows, C // P): the frame of every patch.
"""
o = obs.double()
xo = x.double() * o
n = o.cumsum(-1)[:, P - 1 :: P] # observed count at each patch end
s1 = xo.cumsum(-1)[:, P - 1 :: P]
s2 = (xo * xo).cumsum(-1)[:, P - 1 :: P]
m = s1 / n.clamp(min=1)
var = (s2 - n * m * m) / (n - 1).clamp(min=1) # Bessel-corrected
return m.float(), var.clamp(min=0).sqrt().clamp(min=eps).float()
def scale(x: torch.Tensor, obs: torch.Tensor) -> torch.Tensor:
"""asinh-standardise every value in the frame of its own patch; gaps stay 0."""
m, s = causal_patch_stats(x, obs)
u = (x - m.repeat_interleave(P, -1)) / s.repeat_interleave(P, -1)
return torch.where(obs, torch.asinh(u), 0.0)
The released code accumulates the statistics in float64 with Welford’s algorithm, which is more stable for very long contexts. The cumulative-sum version above is the readable equivalent.
4. The backbone
Once every patch is a token, Timestral is a modern LLM-style transformer stack. This section covers what each component does and why it is there, then counts every parameter.
4.1 One block
Write for the tokens of row , one per column. One block applies up to three sub-layers, each pre-norm: normalise the input, transform it, and add the result back to the residual stream [1, §3.3].
Here collects slot of every row of the task. Temporal attention mixes information along time within a row, variate attention mixes it across rows at the same slot (Section 6), and the SwiGLU transforms each token on its own. There is no dropout and no stochastic depth [1, §3.3], and the released weights have no biases in attention or the SwiGLU.

RMSNorm [12] rescales one token by the root mean square of its own features, , with learned gains . It is easy to confuse this with the input scaler of Section 3, so the difference is worth stating. RMSNorm acts on learned features of one token and is never undone. The scaler acts on raw values over time and is inverted at the output.
Gated attention. Each attention sub-layer is ordinary multi-head self-attention with a head dimension of 64, plus an element-wise sigmoid output gate computed from the same normalised input [10]:
The gate lets each output channel switch itself off depending on the token. Qiu et al. report that this adds a useful non-linearity, makes attention sparser and removes “attention sinks” [10]. The mask ( where a query may not read a key) is where all of Timestral’s structure lives (Sections 5 and 6).
Partial RoPE. Self-attention is blind to order. Timestral gives position to temporal attention only, with rotary position embeddings (RoPE) [9] on half of each head’s dimensions [1, §3.3]. RoPE turns pairs of query and key coordinates by an angle proportional to the token’s position, so their dot product depends only on the distance between the two tokens, not on where the window was cropped. In the other half, scores ignore distance entirely. One half can ask “what happened one seasonal cycle ago?”, the other “find patches that look like this one, wherever they are”. Two details are specific to Timestral:
- Positions are patch indices, and a prediction token takes the position of the patch it forecasts (Section 5).
- Consecutive patches are always one apart, so weekends, holidays and the calendar are invisible to RoPE. If they matter, they must enter as known-future covariates.
SwiGLU [11] reads each token twice. One reading is the message, the other a smooth gate, and their product is projected back: . With it has the same parameter count as a classic MLP of width .
4.2 Four sizes
| 5M | 28M | 123M | 209M | |
|---|---|---|---|---|
| blocks | 8 | 12 | 20 | 24 |
| width | 192 | 384 | 640 | 768 |
| heads (each 64 dims) | 3 | 6 | 10 | 12 |
| SwiGLU width | 512 | 1,024 | 1,712 | 2,048 |
| variate-attention blocks | 4, 8 | 4, 8, 12 | 4, 8, …, 20 | 4, 8, …, 24 |
| parameters | 5.2M | 27.8M | 122.6M | 209.3M |
These are small models by LLM standards, and that is part of their appeal: the report times the 28M model at 31 ms per forecast on 8 CPU threads [1, Table 2]. For comparison, Toto 2.0’s 22m model is wide and shallow (6 blocks of width 512) [3], whereas Timestral-28M is narrow and deep (12 blocks of width 384).

5. Decoupled Horizon Forecasting
This is the central idea of Timestral, and the one I would most want a reader to leave with.
5.1 The problem: any horizon from any context
A foundation model must forecast any horizon from any context length. Each earlier design pays for that somewhere.

- Encoder-decoder with teacher forcing (a) sees the true previous values while training and its own outputs at test time. Errors compound, and training never sees them (exposure bias).
- Bidirectional encoders with prediction tokens (b), as in Chronos-2 [4], forecast the whole horizon in one pass. But every position can read later context, so each forecast origin must be encoded separately: one context length and one horizon per pass [1, §1, §2.2].
- Causal next-patch models (c), such as Toto [15] and Timer [19], make every position a forecast origin in one pass, but only one patch ahead. TimesFM [16] stretches this to one longer output patch (128 steps, from input patches of 32). Longer horizons require autoregressive roll-outs.
- Contiguous patch masking (d), introduced in TiRex [5] and used in Toto 2.0 [3], masks runs of input patches so that a causal model learns to forecast several patches ahead. The cost: a masked patch is also hidden from every later forecast in the same sequence, and it looks exactly like a missing patch [1, §2.2, §3.1]. Toto 2.0 masks spans of up to 16 patches, with a masking probability drawn up to 0.4 [3].
DHF (e) keeps (c)’s many origins per pass and (d)’s multi-patch horizons, without paying (d)’s price.
5.2 Two streams of tokens
DHF gives every patch except the first two tokens during training [1, §3.1]:
- a context token , which embeds the observed values of patch . Context tokens attend causally to earlier context tokens and never read a prediction token. Their representations are therefore computed once and shared by every forecast;
- a prediction token , a copy of one learned vector , placed at the RoPE position of patch . All copies are identical at the input. They differ only through their position, what the mask lets them read and, for multivariate tasks, variate attention.
The training window is tiled into consecutive forecast blocks: runs of patches , with between 1 and 32. Write for the first patch of the block that contains patch . The prediction token of patch may read:
- the context tokens before its block, ;
- the prediction tokens of its own block up to itself, .
Its output goes to the head and forecasts patch at a distance of patches. This is why the report calls Timestral a “causal encoder-only” model [1, §3]: the context is encoded causally, as in a decoder, but forecasts are read from dedicated tokens, as in an encoder-only model, not from the last hidden state.

Compare panel (e) with (d) in Figure 7. The third block’s forecasts depend on patch 2, which CPM would have had to mask [1, §3.1]. Under DHF, every observed value is both a forecast target and context for later forecasts.
Is a block autoregressive? No. reads the earlier prediction tokens of its block, but those carry no data: only what they gathered from the same context. Every patch in a block is a direct forecast from the context before the block, and no predicted value is fed back. My reading of the within-block attention is that it lets the forecasts of one block coordinate, for example to agree on a seasonal phase.
The mask is also compact in code. This version builds it for a single row of patches with a given tiling:
import torch
def dhf_time_mask(anc: torch.Tensor) -> torch.Tensor:
"""Boolean (query, key) mask over [x_0..x_{N_C-1}, psi_1..psi_{N_C-1}]; True = may attend.
anc: (N_C,) with anc[n] = first patch of the forecast block containing patch n (n >= 1).
"""
n_c = anc.shape[0]
i = torch.arange(n_c)
ctx_ctx = i[None, :] <= i[:, None] # x_n reads x_0..x_n
a, j = anc[1:], i[1:] # prediction tokens psi_1..psi_{N_C-1}
pred_ctx = i[None, :] < a[:, None] # psi_n reads x_0..x_{anc_n - 1}
pred_pred = (a[:, None] == a[None, :]) & (j[None, :] <= j[:, None]) # own block, causal
top = torch.cat([ctx_ctx, torch.zeros(n_c, n_c - 1, dtype=torch.bool)], 1) # x never reads psi
return torch.cat([top, torch.cat([pred_ctx, pred_pred], 1)], 0)
def tile_blocks(n_c: int, max_block: int = 32) -> torch.Tensor:
"""Random tiling of patches 1..n_c-1 into consecutive blocks; uniform lengths are an assumption."""
anc, n = torch.zeros(n_c, dtype=torch.long), 1
while n < n_c:
k = int(torch.randint(1, max_block + 1, (1,)))
anc[n : n + k] = n
n += k
return anc
Two tests pin a mask like this down: it should reproduce the paper’s Figure 5 cell for cell, and perturbing a target patch must leave the forecasts of every earlier block unchanged.
5.3 Training: one pass, every origin, every distance
Tile the whole window into blocks of 1 to 32 patches. Then every patch except the first is a forecast target, and one forward pass of tokens per row:
- computes the context representations once;
- produces forecasts from many origins and at distances 1 to 32;
- trains every context length at once, because causality makes the representation at patch exactly what a model with context would compute.
The price is roughly twice the tokens of a plain causal model [1, §3.1]. Two further benefits are easy to miss:
- The block-length distribution alone decides how often each horizon is trained, with no side effects on the context.
- Missing-data augmentation is independent of forecasting. Timestral hides variable-length gaps at arbitrary time steps, not whole patches. The hidden values are still scored, and because a gap is flagged on a context token, it never looks like a position to be forecast [1, §3.1].
5.4 Inference: one block after the context
At inference there is one forecast block. prediction tokens follow the context, all anchored at the first horizon patch, and one forward pass forecasts up to 1,024 steps [1, §3.1]. Longer horizons are forecast block by block, with the predicted medians of each block appended as if observed, as in Toto 2.0 [1, §3.1; 3].
6. Many variates, three roles
6.1 Rows, roles and variate attention
A task is every variate that shares a time axis: the load of a grid zone and its temperature, or an exchange rate and the two countries’ 2-year yields. Each variate is its own row of context and prediction tokens, with one of three roles [1, §3.2]:
| Role | Example (energy) | Example (FX trading) | Temporal attention | Normaliser |
|---|---|---|---|---|
| target | zonal electricity load | EUR/USD | causal | causal frame |
| past-only covariate | metered rooftop-solar output | the two 2-year yields | causal | causal frame |
| known-future covariate | holiday calendar; day-ahead temperature forecast | central-bank meeting dates | bidirectional over the whole window, horizon included | window frame |
Roles are not embedded in the tokens. They act only through the attention masks and the choice of normaliser [1, §3.2]. A new covariate therefore needs no new parameters, which matters later when we adapt the model to a new domain.
Variate attention runs in every fourth block. At each token slot it lets the rows of one task exchange information: context tokens with context tokens and prediction tokens with prediction tokens, at the same patch. It has no positional encoding, so the order of the rows does not matter [1, §3.2]. The full 2D grid of rows × patches is thus handled as factorised attention: along time within a row, then across rows within a slot. This costs per slot, and in total, instead of for attention over all tokens at once.
6.2 Who may read whom
| query row ↓ / key row → | target | past-only | known-future |
|---|---|---|---|
| target | yes | yes | yes |
| past-only | no | yes | yes |
| known-future | no | no | yes |
The two “no” rules have different justifications, and the report is careful to say which is which:
- Known-future rows must not read targets or past-only rows. That is a leak argument. A known-future row attends bidirectionally in time. If it could read a target or past-only row at patch , its temporal attention could carry that value back to earlier patches, and from there into the forecast of patch .
- Past-only rows not reading targets is a modelling choice: covariates are treated as exogenous, so their representations do not depend on target values [1, §3.2].

How does a known future value reach a forecast? A target’s prediction tokens only read context before their block, and variate attention only connects tokens at the same slot. The value therefore has to travel in hops. One route takes three:
- time, bidirectional: the known-future row’s context tokens read its horizon tokens;
- time: that row’s prediction token reads its own context tokens;
- variate: the target’s prediction token reads the known-future row’s prediction token at the same slot.
A second route swaps the last two hops: the target’s context token reads the known-future row’s context token at the same slot (variate), and the target’s prediction token then reads that context token (time). Either way, the value needs a temporal sub-layer followed, later in the stack, by a second temporal sub-layer and a variate sub-layer. The released code checks for this explicitly, and every released configuration passes: three time-only blocks come before the first block with variate attention.
Covariates from ordinary multivariate data. Real tasks with clean covariate labels are scarce. During training, Timestral reassigns some rows of a random subset of multivariate series as past-only or known-future covariates. Those rows are inputs only and are not scored [1, §3.2], so any multivariate corpus doubles as covariate training data.
A caution from practice, which is my addition rather than the report’s: a “known-future” value must really be known at the forecast origin. A calendar qualifies. A day-ahead weather forecast qualifies only if you use the forecast as issued, not the later observed temperature. Mixing the two in a backtest is one of the easiest ways to make a covariate model look better than it is.
7. The quantile head and the loss
7.1 A head whose quantiles cannot cross
After a final RMSNorm, each target prediction token passes through a bias-free residual MLP ( for the 28M model). The output is read as numbers : one per step of the patch and per quantile level .
Independent quantile outputs can cross: the 0.9 quantile can come out below the 0.8 quantile, which is meaningless. Toto 2.0 sorts its outputs at inference [3]. Timestral rules crossing out by construction [1, §3.3]. The median is predicted directly, and every other level is the median plus (or minus) a running sum of positive increments. Let be the median level, the gap from level to its inward neighbour (0.05, or 0.04 at the tails) and a step scale (the value in all released configurations; the weighting and are from the released code):
There is a nice reading of this: plays the role of the quantile density, the rate at which the quantile function rises at level . Since is increasing and , the order survives de-normalisation (Section 3.2).
import torch
import torch.nn.functional as F
TAUS = torch.tensor([0.01] + [round(0.05 * i, 2) for i in range(1, 20)] + [0.99]) # 21 levels
def monotone_quantiles(g: torch.Tensor, omega: float = 3.0) -> torch.Tensor:
"""Turn raw head outputs (..., 21) into non-decreasing quantiles (..., 21)."""
mid = len(TAUS) // 2 # index 10: the median
gaps = torch.cat([TAUS[1 : mid + 1] - TAUS[:mid], # inward gaps below the median
TAUS[mid + 1 :] - TAUS[mid:-1]]) # and above it
med = g[..., mid : mid + 1]
step = omega * gaps * F.softplus(torch.cat([g[..., :mid], g[..., mid + 1 :]], -1))
down = step[..., :mid].flip(-1).cumsum(-1).flip(-1) # sum of steps from level r to the median
up = step[..., mid:].cumsum(-1)
return torch.cat([med - down, med, med + up], -1)
One small trap is worth flagging. The construction guarantees non-decreasing, not strictly increasing, quantiles: for very negative , softplus underflows to zero and neighbouring quantiles coincide. My first test asserted strict monotonicity, and it was the test that was wrong.

7.2 The pinball loss
Training minimises the pinball (quantile) loss, averaged equally over the 21 levels and over all scored positions [1, §4.1, eq. 3]:
- Scored positions: only for observed values of target rows inside forecast blocks. Under DHF that means every patch except the first. Covariates and context tokens get no direct loss; they learn only through their influence on scored forecasts.
- Normalised space: targets and predictions are compared in each forecast patch’s frame, so a series quoted in millions and one quoted in thousandths contribute on comparable scales.
- Why it works: the expected pinball loss at level is minimised by the true -quantile [7]. Averaged over a dense grid of levels, it approximates the continuous ranked probability score (CRPS), which GIFT-Eval and TIME report; fev-bench reports the closely related scaled quantile loss.
- No auxiliary losses are used [1, §4.1].
One property shapes the training recipe. The gradient of the pinball loss is a sign. With respect to it is , or , whatever the size of the error. The loss says which way to move, never how far. Section 8 returns to this.
8. Training and inference recipes
8.1 Two stages
| Stage 1: pre-training | Stage 2: post-training | |
|---|---|---|
| data | synthetic only: univariate series with trends, seasonality, varied noise, regime changes, localised events, level shifts and count data; multivariate series built from linear and nonlinear dependencies between base signals | a mixture of real and synthetic data |
| context | 8,192 steps (256 patches) | 32,768 steps (1,024 patches) |
| length | the bulk of training | “substantially fewer steps” |
The PFN view explains the order. Stage 1 teaches the model the space of processes under a prior that the authors control completely. Stage 2 adds real series, effectively data from unknown processes, together with longer contexts. Long contexts are expensive: a row of 1,024 patches is 2,047 tokens under DHF, and attention grows quadratically in that number.
One training step, in order:
- sample tasks and crop windows of steps, at the same offset for every row of a task;
- assign covariate roles to some rows in a random subset of multivariate tasks, and hide random gaps;
- normalise and patch (Section 3);
- tile the window into forecast blocks (Section 5);
- run the forward pass under the DHF, role and task masks;
- compute the pinball loss on observed target values;
- take an optimiser step.
8.2 What is disclosed, and how I would fill the gaps
The report is clear about the architecture and the objective. As is common for technical reports, it leaves the optimisation recipe and the data mixture undisclosed. The nearest model that does publish a full recipe is Toto 2.0 [3], a causal patch transformer with variate attention, and a quantile head. It is a sensible place to borrow defaults from:
| Setting | Timestral [1] | A reasonable default |
|---|---|---|
| patch, quantile levels, longest block | 32; 21; 32 patches | — |
| dropout, stochastic depth | none | none |
| block-length distribution | not disclosed | uniform on 1–32 as a baseline; then tune (Section 9) |
| optimiser | not disclosed | NorMuon on hidden weight matrices, AdamW on input and output projections, biases and gains [3]; by analogy, also AdamW for |
| schedule | not disclosed | warm-up, then a long constant phase, then a short linear decay (warm-up–stable–decay) [3] |
| gradient clipping | not disclosed | 7.0 [3] |
| role and gap probabilities | not disclosed | about 0.5 per multivariate task; gaps on about 30% of rows (my guess) |
| real/synthetic mix in stage 2 | not disclosed | about half and half; Toto 2.0 pre-trains on 57.5% synthetic [3] |
The optimiser choice connects back to the pinball gradient. Because the size of an error never enters the gradient, the optimiser’s normalisation largely decides how far each weight moves. Adam normalises each parameter on its own. Muon instead orthogonalises the momentum matrix, so every direction of a weight matrix moves at a comparable rate. NorMuon adds back one second-moment estimate per output neuron. Toto 2.0 argues that this suits quantile losses, though it does not show a head-to-head comparison [3]. One caution on transfer: Toto’s learning rates are expressed in its u-µP parametrisation, so they do not carry over to a standard parametrisation and must be re-swept.

8.3 Inference

- Prepare. Keep at most the latest 32,768 steps, left-pad to a multiple of 32, turn NaNs into missing flags, and append the known-future rows’ horizon values.
- One forward pass with one block of prediction tokens after the context.
- De-normalise with an advancing frame. Horizon patch uses the statistics of the observed context plus the predicted medians of horizon patches (Section 3.2). The released code then caps every quantile far outside the observed range, as a guard against numerical blow-ups.
- Symmetric averaging. By default the model also forecasts the negated series and averages the reflected result in [1, §4.3]:
Before the clip in step 5, the averaged forecast is exactly odd: forecasting gives the mirror image. It is a cheap, principled ensemble, and the report is explicit that it costs two forward passes [1, §4.3]. So the announcement’s “single checkpoint, without ensembling” [2] means one set of weights, not one pass.
- Clip. In the released code, after averaging, a series with a non-negative history gets no negative quantiles.
Beyond 1,024 steps, decode 32 patches, append their medians as observed values and repeat [1, §3.1]. The medians carry no uncertainty forward, so intervals far out may come out too narrow. This is a known trade-off of median feedback, and it is worth measuring rather than assuming (Section 9).
Cost. Forecasting 96 steps from 2,048 takes 17 ms (5M) to 113 ms (209M) on 8 CPU threads with symmetric averaging. One H100 forecasts 3,650 to 18,770 series per second [1, §4.3, Table 2]. Latency grows roughly in proportion to context length beyond 2,048 steps.
What you do not get. The quantiles are marginal per step. Path-dependent quantities, such as the distribution of a cumulative return, a maximum drawdown or the total energy over a day, need joint samples, which Timestral does not produce.
9. Open questions and experiments I would run
The report sets out to describe “the model design and its benchmark results” [1, Abstract], and it does that well. Reading it closely raised a set of questions. These are not criticisms. They are the experiments I would want to run next with this architecture.
1. DHF against CPM at matched compute. DHF’s advantages are argued clearly [1, §3.1], but the report includes no ablation that isolates them. DHF doubles the training tokens, so a fair comparison holds FLOPs fixed: DHF against CPM, and against a bidirectional encoder with prediction tokens, on the same data. The useful outcome is not a single number but where DHF wins: by forecast distance, by context length, and on series with real gaps, where CPM’s confusion of “masked” and “missing” should bite.
2. The block-length law. It is the one knob that decides how often each horizon is trained (Section 5.3), and it is undisclosed. Comparing a uniform law, a law weighted towards long blocks and a curriculum, and logging the validation loss by forecast distance, would show whether the far end of a 1,024-step forecast is under-trained.
3. Gradients through the forecast frame. The report says the same median-filled statistics are used in training, so that training and inference match [1, §3.3]. Because frames never feed the inputs, this fits in one forward pass: compute every output, then the frames in order through each block. What the report does not say is whether gradients flow through the median-dependent target normalisation or are stopped there, and how much that choice matters at long distances. That seems worth stating explicitly.
4. Variate-attention cadence. Every fourth block is a reasonable default. Toto 2.0 ran exactly this search on a proxy model and found variate attention placed last in the stack to be best [3]. Running the same sweep under Timestral’s role masks is cheap at the 5M scale, and it interacts with the routes of Section 6, which need two temporal sub-layers and a variate sub-layer after the first temporal one.
5. Evaluation views that complement the benchmarks. GIFT-Eval [21], fev-bench [23] and TIME [22] already score models relative to a seasonal-naive baseline, and the report adds per-task win rates and an industrial benchmark, IND-Eval [1, App. A]. In deployment the question is always “better than what we have now?”, so I would add, per domain:
- Strong classical baselines: seasonal naive, AutoETS/AutoARIMA and a gradient-boosted model on lag and calendar features. Gradient boosting with good covariates is often the bar to beat in energy and retail.
- Metrics by forecast distance, not just aggregated: CRPS and MASE at 1, 4, 16 and 32 patches.
- Calibration of the tails: empirical coverage of the 0.01–0.99 and 0.05–0.95 intervals. Heavy-tailed series, such as prices, show problems there first.
- A leakage audit. For a model post-trained on real data, the first question a practitioner asks is whether any benchmark test window, or a near-duplicate of one, was in the training data. The report does not list its real post-training sources or describe an overlap check against benchmark test windows. A short note on how overlap was ruled out would make the zero-shot results easy to verify.
6. Adapting to a new domain. Because roles are masks, not embeddings, fine-tuning on new data needs no architectural change: new covariates are just new rows. A natural starting point is Toto 2.0’s recipe for its fine-tuned 2.5B variant: about 10,000 further steps from the fully decayed checkpoint, with both learning rates cut by about 10× [3]. Mix in a share of the original corpus to limit forgetting, and evaluate against the incumbent model on a date-cut hold-out.
7. Beyond forecasting. The report itself suggests using the context representations as embeddings for classification and anomaly detection [1, §5]. Two concrete versions:
- Embeddings. Because the context stream is causal, the last context token of each row summarises its entire history. Mean-pooling it with the other context tokens gives a fixed-size series embedding at no extra cost.
- Anomaly detection. The quantile head gives an anomaly score for free. Score each new observation by where it falls in its forecast distribution, and flag it beyond the 0.01 or 0.99 quantile. A window where such exceedances run well above the nominal 2% signals a regime change.
10. What’s next
I’m now building a smaller Timestral-style model for foreign-exchange forecasting. It is one network for the G10 currency pairs at every bar size from 5 minutes to daily, trained from scratch on a 16 GB Apple M1 laptop in under two days. Measured throughput on that machine puts the budget at roughly 5M parameters with contexts of 2,048–4,096 steps, close to Timestral-5M. The interesting parts are the ones this breakdown points to:
- A synthetic prior built for markets: volatility clustering, jumps and fat tails, regime switches, cointegrated groups, and event-driven effects around central-bank meetings.
- Covariates with honest timestamps: interest rates, positioning, risk indices and scheduled-event calendars.
- An evaluation that starts from classical baselines and calibration, not from a leaderboard.
As the report suggests [1, §5; 2], a probabilistic forecaster is also a natural tool for an LLM agent: a language model can reason about news and events, then call the forecaster for calibrated numbers rather than inventing them. Follow-up posts will cover the data pipeline, the synthetic prior and the training runs.
References
- A. Petralia, A. Gavaudan, A. Joosen, E. Goffinet et al. (Mistral AI). Timestral. arXiv:2610.37585, 2026. arxiv.org/abs/2610.37585. Inference code: github.com/mistralai/timestral. Weights: huggingface.co/collections/mistralai/timestral.
- Mistral AI. Timestral (announcement). mistral.ai/news/timestral.
- E. Khwaja et al. Toto 2.0: Time series forecasting enters the scaling era. arXiv:2605.20119, 2026.
- A. F. Ansari et al. Chronos-2: From univariate to universal forecasting. arXiv:2510.15821, 2025.
- A. Auer et al. TiRex: Zero-shot forecasting across long and short horizons with enhanced in-context learning. NeurIPS, 2025.
- S. Müller, N. Hollmann, S. Pineda Arango, J. Grabocka and F. Hutter. Transformers can do Bayesian inference. ICLR, 2022.
- R. Koenker and G. Bassett. Regression quantiles. Econometrica 46(1), 1978.
- Y. Nie, N. H. Nguyen, P. Sinthong and J. Kalagnanam. A time series is worth 64 words: Long-term forecasting with Transformers. ICLR, 2023.
- J. Su et al. RoFormer: Enhanced transformer with rotary position embedding. Neurocomputing 568, 2024.
- Z. Qiu et al. Gated attention for large language models: Non-linearity, sparsity, and attention-sink-free. NeurIPS, 2025.
- N. Shazeer. GLU variants improve Transformer. arXiv:2002.05202, 2020.
- B. Zhang and R. Sennrich. Root mean square layer normalization. NeurIPS, 2019.
- S. J. D. Prince. Understanding Deep Learning. MIT Press, 2023. udlbook.github.io/udlbook.
- K. Benidis et al. Deep learning for time series forecasting: Tutorial and literature survey. ACM Computing Surveys, 2022. arXiv:2004.10240.
- B. Cohen et al. This time is different: An observability perspective on time series foundation models. NeurIPS, 2025.
- A. Das, W. Kong, R. Sen and Y. Zhou. A decoder-only foundation model for time-series forecasting. ICML, 2024.
- D. Salinas, V. Flunkert, J. Gasthaus and T. Januschowski. DeepAR: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting 36(3), 2020.
- A. F. Ansari et al. Chronos: Learning the language of time series. Transactions on Machine Learning Research, 2024.
- Y. Liu et al. Timer: Generative pre-trained transformers are large time series models. ICML, 2024.
- A. Jain and R. Sen. TimesFM-3: A zero-shot foundation model for multivariate forecasting. Google Research Blog, 2026.
- T. Aksu et al. GIFT-Eval: A benchmark for general time series forecasting model evaluation. arXiv:2410.10393, 2024.
- Z. Qiao et al. It’s TIME: Towards the next generation of time series forecasting benchmarks. ICML, 2026.
- O. Shchur et al. fev-bench: A realistic benchmark for time series forecasting. arXiv:2509.26468, 2026.