Lesson 1 sold you the bet: pretrain once on a mountain of data, adapt cheaply to your problem. That’s how a single language model writes Python, French and limericks without being retrained for each. This lesson cashes the bet out for time series — the actual machinery that lets one frozen model forecast a series it has never seen, with no fitting at all.
The catch is that a series of returns is not a sentence. A transformer eats tokens — discrete things with embeddings — and a price chart is a stream of continuous reals. So before any of the foundation-model magic, somebody has to answer an annoyingly concrete question: how do you turn a wiggly line into tokens? Two camps answer it differently, and the rest of the lesson is built on that fork.
Let’s earn it.
From one-model-per-series to a forecasting foundation model
Before you read — take a guess
You have 5,000 separate product-demand series and want a forecast for each. What's the defining difference between the classical approach and a time-series foundation model?
The analogy. The classical forecaster is a locksmith who files a brand-new key for every single lock — ARIMA coefficients for this series, a GARCH fit for that one, a fresh neural net for the next. Beautiful craftsmanship, and utterly un-scalable: 5,000 series means 5,000 fits, each needing enough history to estimate its own parameters. A foundation model is a master locksmith who has already opened millions of locks and learned what locks are. Hand it a new one and it opens it on sight — no new key filed.
Precise definition. The classical recipe (lesson 1’s “specialist”) estimates parameters separately for each series : fit here, there, a fresh net somewhere else. Each fit needs that series to carry enough signal to pin down its own . A time-series foundation model instead learns one shared parameter set by pretraining on a corpus of millions of series across many domains, then forecasts a new series in a single forward pass:
with frozen — no gradient step touches the new series. That’s zero-shot forecasting, the headline trick of the whole field (lesson 3 makes “zero-shot” precise).
Worked example — the fitting budget. Say each ARIMA fit needs at least 100 observations to estimate its handful of coefficients reliably, and you have 5,000 series.
- Classical: 5,000 separate estimations. A series with only 30 points of history? You can barely fit it — too few observations for its own parameters. Cold-start is fatal.
- Foundation model: 0 estimations on your data. The 30-point series gets the same forward pass as the 30,000-point one; the model brings the prior it learned from millions of other series, so short history is survivable.
The shift is from “every series teaches its own model from scratch” to “one model has already learned the shape of time series in general, and merely conditions on your history.”
Zero-shot is not zero-knowledge
“No fitting on your series” does not mean the model knows nothing about your series — it means everything it knows was learned at pretraining, on other data. If your series looks nothing like anything in that corpus (foreshadowing: market returns), zero-shot can be confidently wrong. No fitting also means no chance to correct it on the way in.
When to use it
Reach for the one-model-per-series classical approach when each series is long, well-behaved, and you have time to babysit individual fits. Reach for a foundation model when you have many series, short histories, or a cold-start need (a brand-new SKU with three weeks of data) — exactly where per-series fitting starves. We’ll see the catch for finance specifically by the end of this lesson.
Fill in the defining property.
Pick the right option for each blank, then check.
A time-series foundation model forecasts a brand-new series with , which is why it survives cold-start where the classical recipe starves.
Tokenizing a continuous series — the core technical problem
Before you read — take a guess
Why can't you feed a raw stream of price floats straight into a transformer the way you feed words into a language model?
The analogy. A transformer is a reader who only understands words. Hand it the raw acoustic waveform of someone speaking and it’s helpless — somebody has to first cut that continuous sound into discrete syllables it can look up. Tokenizing a time series is that cut: turning an unbroken line into a sequence of bite-sized units the attention mechanism can attend over. The two families below cut the line in two very different ways.
(a) Patching — chop into windows, project each to an embedding
Precise definition. Slice the context into contiguous, fixed-length windows called patches. A patch of length is a vector in ; a learned linear map projects it to a -dimensional embedding — one token per patch. A context of length with patch length (non-overlapping) yields
tokens. This is the PatchTST idea, adopted by TimesFM and Moirai. Patching does two jobs at once: it shrinks the sequence length the attention has to chew (lesson 1’s cost worry), and it lets each token carry local shape instead of a single lonely point.
Worked example — a length-512 context, patch length 32. Number of patch tokens:
So 512 raw observations collapse to 16 patch tokens. Suppose . Each patch is a vector in , and the projection maps it to a token in . The attention then runs over 16 tokens, not 512 — the score matrix is entries instead of . Same information, roughly less attention arithmetic. The model forecasts by predicting the next patch (a length-32 block), so it emits 32 future points per output step.
(b) Scaling + quantization into a vocabulary — the Chronos route
Precise definition. Instead of projecting real-valued patches, Chronos turns the series into literal discrete tokens so it can reuse an off-the-shelf language-model stack (a T5-style encoder-decoder). Two steps:
- Mean-scale the context: divide every value by the mean absolute value of the context, , giving scaled values . This makes a series of millions and a series of decimals look comparable.
- Quantize each scaled value into one of bins (Chronos uses ) spanning a fixed range. The bin index is the token — an integer in — exactly like a word ID in a vocabulary.
Now a price series is a sentence of integers, and a vanilla T5 language model can be trained on it with no architectural surgery. Forecasting samples next-token IDs, which you de-quantize (back to a bin centre) and un-scale (multiply by ).
Worked example — scale then bin a tiny window. Context . Mean absolute value:
Scaled context: . Now suppose the bin grid is uniform on with bins, so each bin has width
The scaled value lands in bin index
So the value becomes token 2294. The whole window becomes a short string of such integers, and the T5 stack treats it exactly like text.
Naive global normalization LEAKS the future
The cardinal sin here: computing the scale (or any mean / std / min-max) over the whole series — including the part you’re trying to forecast. That bleeds future information into the inputs, and your zero-shot “forecast” is secretly peeking. Scale using only the context window the model is allowed to see, never the test horizon and never global statistics that span it. This is the same leakage trap lesson 5 dissects at length — and it’s the single most common way a published time-series-FM result turns out to be fiction.
When to use each
Patching keeps values continuous (no quantization error) and shrinks sequence length — great when you want fidelity and a purpose-built stack. Tokenizing into a vocabulary throws away some precision (every value is rounded to a bin centre) but lets you inherit the entire mature language-model toolchain for free. Patching trades engineering effort for accuracy; quantization trades accuracy for reuse.
Sort each property under the tokenization family it describes.
Place each item in the right group.
- Bins scaled values into a fixed vocabulary so a T5 language stack can be reused
- Linearly projects each window to a d-dimensional token, keeping values continuous
- Chops the context into fixed-length windows, one embedding per window
- Introduces rounding error because every value snaps to a bin centre
The pretraining objective — autoregressive and probabilistic
Before you read — take a guess
A time-series foundation model is trained self-supervised. Where do the training labels come from?
The analogy. It’s the language-model trick, ported to numbers. A language model learns by covering the next word and guessing it; the word it covered is the answer key, so the text labels itself. A time-series foundation model covers the next patch (or next quantized token) and guesses it — the future of the window is its own free label. Train on millions of series this way and the model absorbs the grammar of time series: trend, seasonality, mean-reversion, level shifts.
Precise definition — autoregressive next-step. Factor the sequence likelihood left-to-right and maximize it:
where each “step” is a patch (TimesFM, Moirai) or a vocabulary token (Chronos). Because a position may only condition on the past , attention is causal — exactly the masked, lower-triangular attention from the deep-learning course. Each patch token attends only to earlier patch tokens.
Precise definition — probabilistic, not point. A good forecaster doesn’t just guess a number; it guesses a distribution, because “the next return is +0.3% give or take 2%” is far more useful than a bare “+0.3%”. Two ways foundation models deliver a distribution:
- Quantile heads (TimesFM): the model outputs several quantiles at once — e.g. the 10th, 50th and 90th percentiles — trained with the pinball (quantile) loss. For a quantile level and prediction , the pinball loss on outcome is
- Sampled trajectories (Chronos): because the output is a probability distribution over the next token, you can sample many possible next tokens, roll each forward autoregressively, and read percentiles off the cloud of sampled futures — a Monte-Carlo predictive distribution. (Lag-Llama instead heads a parametric Student-t distribution, capturing fat tails directly.)
Worked example — pinball loss tells the median from the 90th. True outcome .
- Median forecast (), prediction : error , so .
- 90th-percentile forecast (), same prediction : .
The high- head is punished harder for under-shooting (it’s supposed to sit above most outcomes), so training pushes the 90th-percentile prediction upward relative to the median. That asymmetry is exactly how one network learns a whole spread of quantiles instead of a single point — the spread is the uncertainty estimate.
The pretraining objective made visual: a decoder-only forecaster attends causally over PAST PATCH TOKENS. Each row is one patch token asking 'which earlier patches matter to me?'; the softmax weights in that row sum to 1, and the upper triangle is masked — a patch token can attend to itself and earlier patch tokens only, never to future patches (that would leak the very thing it must predict). Flip between a 'Recent (momentum)' pattern that hugs the diagonal, an 'Event-driven' pattern that pins onto one earlier patch (a regime shock), and a 'Diffuse' pattern that averages the past; drag the temperature slider to watch how many earlier patches each token effectively pools over.
A point forecast hides the only thing that matters in finance
If a model only emits a single number, you have no idea whether it’s “confidently +0.3%” or “haven’t a clue, somewhere in ±5%.” In finance the spread is the product — position sizing, VaR, option pricing all live on the distribution, not the mean. Always prefer the probabilistic output (quantiles or sampled trajectories), and be suspicious of any benchmark that scores these models on point error (MAE/MSE) alone. A model can nail the median and still be uselessly overconfident about the tails.
When to use it
Lean on the probabilistic output whenever you need calibrated uncertainty — risk limits, scenario fans, anything where being wrong about how wrong you might be is expensive. The autoregressive structure is the right inductive bias when the future genuinely depends on the past in a causal, left-to-right way (almost all forecasting). The one regime where this objective struggles is precisely low-signal data: if “predict the next step” is near-impossible (efficient-market returns), the objective still trains happily — it just learns to output a wide, near-trivial distribution, which lessons 3 and 6 will show is often the honest answer.
Pick a term, then click its definition.
The lineage — TimesFM, Chronos, Moirai, Lag-Llama
Before you read — take a guess
Which design choice most distinguishes Moirai from the other three flagship models below?
The analogy. Think of these four as rival house styles for the same instrument. They all play “forecast the future from the past,” but they differ in how they read the sheet music (tokenization), how the band is arranged (architecture), whether they play one voice or many at once (uni- vs multivariate), and whether they hand you a single note or a whole chord of possibilities (probabilistic output).
Precise comparison.
| Model (lab) | Tokenization | Architecture | Univariate vs multivariate | Probabilistic? |
|---|---|---|---|---|
| TimesFM (Google) | Patching (linear-projected patches) | Decoder-only | Univariate | Yes — point + quantile heads |
| Chronos (Amazon) | Scale + quantize into a fixed vocabulary | T5-style (encoder-decoder LM stack) | Univariate | Yes — via sampling next-token rollouts |
| Moirai (Salesforce) | Patching, multiple patch sizes | Masked encoder | Any-variate / multivariate | Yes — distributional head |
| Lag-Llama (open / academic) | Lagged features as inputs | Decoder-only | Univariate | Yes — parametric Student-t head |
A few things to read off the table. TimesFM and Lag-Llama are both decoder-only (the GPT-style causal stack), but TimesFM patches the raw series while Lag-Llama feeds lagged features (the value at lag 1, 7, 30, …) — engineering seasonality straight into the input, then heading a Student-t to capture fat tails. Chronos is the odd one out: by quantizing into a vocabulary it gets to be a language model, inheriting that whole ecosystem, at the price of rounding error. Moirai is the multivariate specialist — it can attend across several variates at once and chooses among patch sizes, which matters when your series come at different frequencies.
Worked example — picking from the lineage. You must forecast 200 correlated commodity series jointly, where one series’ move informs another’s. Univariate TimesFM/Chronos/Lag-Llama would forecast each in isolation, ignoring the cross-series structure. Moirai’s any-variate design is built precisely to attend across the 200 series together — the natural pick. Flip the task to a single, very long, fat-tailed series where you care about tail risk, and Lag-Llama’s Student-t head earns its place.
Same family, very different failure surfaces
Don’t treat these as interchangeable just because they share a press release. Chronos’s quantization caps its precision and can mangle values far outside its bin range; a univariate model literally cannot see cross-series contagion; Lag-Llama’s lag features bake in assumptions about which seasonalities matter. A benchmark win for one says little about another on your data — and (next section) says even less when your data is financial.
When to use which
Use TimesFM as a strong general univariate baseline with clean quantiles; Chronos when you want to ride the language-model toolchain and tolerate quantization; Moirai when the problem is genuinely multivariate or multi-frequency; Lag-Llama when seasonality is strong and tails are fat and you want an open, Student-t model. None of these choices, note, changes the uncomfortable fact coming next: what they were trained on.
Fill in the lineage distinction.
Pick the right option for each blank, then check.
Among the flagship models, , using multiple patch sizes and a masked encoder, while TimesFM, Chronos and Lag-Llama are primarily univariate.
The pretraining corpora — billions of points, almost none of them market-like
Before you read — take a guess
The pretraining corpora behind these models run to billions of time points. For forecasting financial returns, what's the central worry?
The analogy. Imagine training a champion sommelier by having them taste millions of glasses of — water. Mineral water, sparkling water, tap water from forty cities. They’ll become extraordinary at distinguishing waters. Then you ask them to grade a Bordeaux. The skill they built is real and deep, but it was built on the wrong distribution. The foundation-model corpora are oceans of well-behaved series — and returns are the Bordeaux.
Precise statement. The pretraining corpora (think the LOTSA / Chronos-style mixtures) aggregate billions of time points across energy (electricity load), weather, traffic, retail/web demand, transport, and a sprinkling of finance. The defining property of most of these domains is high signal-to-noise: electricity load has a thundering daily-and-weekly seasonality you can forecast in your sleep; traffic and demand are strongly autocorrelated and regular. Financial returns are the opposite — near-efficient, dominated by unforecastable noise, non-stationary across regimes (the brutal-low-SNR regime from the deep-learning course). So two problems stack:
- Coverage: market-like series are a tiny slice of the corpus, so the model spent almost none of its capacity learning their dynamics.
- Even where present, low SNR: the financial fraction is the hardest possible data to extract a transferable pattern from — there often isn’t a stable pattern to learn.
Worked example — the mix is lopsided. Suppose a corpus holds 10 billion points, split roughly: energy 35%, traffic 20%, weather 15%, demand/web 25%, finance 5%. That’s million financial points — sounds enormous. But “financial” here is mostly prices, much of it low-frequency, and the returns you actually care about carry almost no forecastable signal per point. So the effective market-relevant, signal-bearing fraction the model learned from is far smaller than 5% — and what little it saw may teach the wrong lessons (a trending crypto sample is not a stationary law). Contrast 3.5 billion points of metronomic electricity load, where every point reinforces a clean seasonal prior.
A pretrained prior from clean series can hurt on returns
Transfer learning’s quiet assumption is that the source and target distributions share structure. When they don’t, the prior isn’t neutral — it actively misleads. A model that learned “series have strong recurring seasonality” may hallucinate seasonality in returns that isn’t there, or under-state tail risk because its training domains rarely had fat tails. This is why a glittering benchmark on energy/traffic data tells you almost nothing about financial forecasting — and lessons 3 and 6 will measure exactly how much (often: not much) survives the jump to markets.
When the corpus mismatch matters most
If your target series resembles the corpus — a demand forecast, a load curve, a well-behaved seasonal business metric — the mismatch barely bites and zero-shot transfer can be excellent. If your target is a single adversarial return series, the corpus mismatch is maximal and the pretrained prior is on its weakest footing. The decision rule is blunt: the more your series looks like the training domains, the more you should trust the model; the more it looks like returns, the more you should test before believing anything.
If the corpora hold hundreds of millions of financial points, why is transfer to returns still doubtful?
Answer. Two reasons compound. First, quantity isn’t coverage of the right thing: most “financial” data is prices and low-frequency, while the forecastable signal in returns is vanishingly small per point — you can have a billion noisy points and still have almost no learnable structure. Second, the corpus is dominated by high-SNR, strongly-seasonal domains, so the model’s learned prior expects clean recurring patterns. Returns violate that prior (near-efficient, non-stationary, fat-tailed), so the transferred knowledge can mislead rather than help. Lots of data about the wrong distribution does not make a good prior for returns.
When a time-series foundation model is the right tool
Before you read — take a guess
Given everything above, where does a time-series foundation model most clearly earn its keep?
The trade-off, stated plainly. A time-series foundation model is a magnificent cold-start baseline: hand it a new, well-behaved series with little history and it produces a calibrated, probabilistic forecast in one forward pass, no fitting, no babysitting. That is genuinely useful and genuinely new. But the same machine, pointed at a single low-SNR return series, is leaning on a prior built from the wrong distribution — and “no fitting” now means “no chance to adapt to how unlike-the-corpus your series is.”
| Scenario | Foundation model verdict | Why |
|---|---|---|
| New SKU, 3 weeks of demand history | Strong | Cold-start + corpus-like seasonality; zero-shot shines |
| 200 correlated load curves | Strong (use Moirai) | High-SNR, multivariate, looks like training data |
| Single equity’s daily returns | Doubtful | Low-SNR + corpus mismatch; prior may mislead |
| Tail-risk on a fat-tailed return series | Test hard first | Lag-Llama’s Student-t helps, but transfer is unproven |
Worked example — choosing on two desks. Desk A forecasts next-week electricity demand for 5,000 substations, most with under two months of data. A foundation model is close to ideal: corpus-like, cold-start, many series — exactly its strengths from the first section. Desk B forecasts tomorrow’s return for one large-cap stock. Same model, opposite footing: one series, brutal SNR, a prior trained on water trying to grade a Bordeaux. Desk A should ship the zero-shot baseline today; Desk B should treat any impressive backtest as guilty-until-proven-innocent (lesson 5’s leakage minefield, lesson 6’s honest evaluation).
A zero-shot win on clean data is not a license for markets
The most expensive mistake in this whole field is generalizing a benchmark. “TimesFM beat ARIMA on the M-competitions” is true and irrelevant to whether it predicts returns. The corpus mismatch and the low SNR of returns mean a strong general forecaster can be a terrible market forecaster — and you only find out by evaluating honestly on your own series, out of sample, with leakage controlled. Until then, treat foundation-model alpha claims as unproven by default.
When to use it
Use a time-series foundation model as your first, cheap, zero-shot baseline whenever you have many series, short histories, or a cold-start — and especially when those series resemble the high-SNR, seasonal domains it was trained on. Be deeply skeptical of it as a standalone market-return forecaster on a single adversarial series; there the corpus mismatch and the noise floor conspire against the very transfer that makes it powerful elsewhere. The next lesson makes “zero-shot vs few-shot” precise and asks whether the scaling laws that lift these models on clean data lift them on markets at all.
Sort each situation by whether a time-series foundation model is a strong fit or a doubtful one.
Place each item in the right group.
- Standalone alpha from one stock's daily returns, zero-shot
- Cold-start demand forecast for a brand-new product with weeks of history
- A single, adversarial, low-SNR return series with no corpus analogue
- Many correlated, high-SNR load curves forecast jointly
Recap
Big picture
Time-series foundation models
- Time-series foundation models
- One model, not one-per-series
- Classical: fit ARIMA/GARCH/net per series
- FM: pretrain once, forecast new series zero-shot
- Survives cold-start / short history
- Tokenizing the line
- Patching: chop into windows → embed (TimesFM, Moirai)
- 512 / 32 = 16 patch tokens
- Quantize: scale + bin into a vocab (Chronos)
- Scale on CONTEXT only — global leaks
- Pretraining objective
- Autoregressive next patch/token; future = label
- Causal attention over past patch tokens
- Probabilistic: quantiles or sampled trajectories
- The lineage
- TimesFM — decoder, patched, quantiles
- Chronos — vocab tokens, T5, sampling
- Moirai — any-variate, multi patch size, encoder
- Lag-Llama — decoder, lag features, Student-t
- Corpora & the catch
- Billions of points: energy, weather, traffic, demand
- Little is market-like; returns are low-SNR
- Strong cold-start baseline; doubtful on returns
- One model, not one-per-series
Time-series foundation models — check yourself
A context of length 512 is patched with patch length 64 (non-overlapping). How many patch tokens does the transformer attend over?
Check your answer to continue.