Command Palette

Search for a command to run...

crossxrGitHub
Blog

TimesFM by Google: a new era

542views

How Google Research's TimesFM brings the foundation model idea to time series forecasting, from patching and decoder-only generation to zero-shot forecasts, quantiles, versions, where to run it and what it still cannot do.

TimesFM by Google: a new era

Forecasting is one of the oldest jobs we ask of data. Retailers forecast demand so shelves are stocked, utilities forecast load so the grid stays balanced, and every product team eventually forecasts traffic, revenue or capacity. For most of the history of the field, each of those forecasts has been built the same way: take one series, pick a model, fit it to that series, and repeat for the next one. TimesFM, from Google Research, asks a different question. If one large pretrained model can handle almost any piece of text it has never seen, could one pretrained model handle almost any time series it has never seen? This post explains what TimesFM is, how it works under the hood, where you can use it, and where its limits are.

Why forecasting needed a foundation model

A time series is a sequence of measurements taken at regular intervals, and forecasting it means estimating the values that come next. The classical toolkit is strong and well understood. Exponential smoothing methods, which date back to the 1950s, weight recent observations more heavily and model level, trend and seasonality explicitly. The ARIMA family, formalised in the Box and Jenkins approach, models a series through its own past values and past errors. Later, deep learning models such as DeepAR and PatchTST learned richer patterns across many related series.

What all of these share is that they are fitted to the data you care about. That is often the right choice, but it has costs. Every new series or new dataset means another fitting run, another round of tuning and another model to monitor, and a new product with only a few weeks of history gives a per-series model very little to learn from. Language models showed that a single model pretrained on a vast and varied corpus can perform surprisingly well on tasks it was never explicitly trained for. TimesFM applies that same idea to time series.

What TimesFM is

TimesFM was introduced by Abhimanyu Das, Weihao Kong, Rajat Sen and Yichen Zhou of Google Research in the paper "A decoder-only foundation model for time-series forecasting", accepted at ICML 2024. Google described it on its research blog in February 2024 and released the first open checkpoint, timesfm-1.0-200m, on Hugging Face and GitHub in May 2024.

The original model has about 200 million parameters, which is small by the standards of modern language models. It was pretrained on a corpus of around 100 billion real-world time points, most of them search interest series from Google Trends and page view series from Wikipedia, together with synthetic series generated from statistical models and simulations to teach it basic patterns such as trends and seasonality. The claim that made it interesting was its zero-shot performance: on datasets it had never seen, across different domains and granularities, its forecasts came close to supervised models trained specifically on those datasets. In the paper's evaluation, it was compared against baselines including ARIMA, exponential smoothing, DeepAR, PatchTST and an approach that prompts GPT-3.5 directly with numbers.

Patches instead of points

A language model does not read characters one at a time. It reads tokens, which are chunks of text. TimesFM does something similar for numbers. Rather than feeding the model individual time points, it groups contiguous points into patches, and each patch becomes one token.

Context → patches → tokens

patching

The context is a single run of 256 time points. TimesFM never sees the raw points one by one.

How TimesFM reads a time series, following the input patch length of 32 described by Google Research. The series itself is illustrative.

Google's description uses an input patch length of 32. A small residual MLP turns each patch into a token, a positional encoding records where that patch sits in the sequence, and the tokens pass through a stack of transformer layers. Those layers use causal self-attention, which means each token can attend only to itself and to the tokens before it. That constraint is what makes the model decoder-only, in the same sense as GPT-style language models: it learns to predict what comes next from what has already happened, without ever looking ahead.

Patching matters for more than elegance. A context of 256 points becomes only 8 tokens, which makes attention far cheaper and lets the model look at much longer histories than it could if every point were its own token.

Decoding the future, one patch at a time

The other half of the design is how the model produces its forecast. Language models generate one token at a time and feed each new token back into the input. TimesFM does the same, but with a twist: its output patches are longer than its input patches.

Decoder-only forecasting

decoding

The model is given 256 time points of history and asked for the next 256.

Google Research's own example: 256 points of context, a 256-point horizon, and output patches of 128. The series is illustrative.

In Google's worked example, the model is trained with input patches of 32 points and output patches of 128. During training it learns, at every position, to use everything so far to predict the next 128 points. At inference time, given 256 points of context and asked for the next 256, it predicts points 257 to 384 in one step, appends that output to its context, and predicts 385 to 512 in a second step. With 32-point outputs the same horizon would take eight steps. Fewer autoregressive steps means fewer chances for errors to compound, which is why Google found that longer output patches help most on long-horizon forecasts.

Zero-shot across domains

Because the model has already seen an enormous variety of series during pretraining, you do not train it on your data before using it. You hand it your history as context and ask for a forecast, and the same weights serve every series.

One model · many domains

zero-shot

Weekly retail sales with a yearly rhythm. No training on this data, just the history as context.

Zero-shot forecasting: the same pretrained weights are handed each series as context and forecast it directly. All four series are illustrative.

That is the practical meaning of zero-shot here. A retailer, an energy company and a web team can all send completely different series to the same model, at different frequencies, without anyone fitting anything. The quality will not always match a carefully tuned model built by an expert for one specific series, but the baseline you get for free is strong, and for teams forecasting thousands of series at once, removing per-series fitting changes what is practical.

Per-series fitting vs pretrained

one model

Classical methods such as ARIMA or exponential smoothing fit a separate model to every series, one after another.

Five series forecast two ways. The series are illustrative.

Beyond a single number

A point forecast gives one value per future step. Real decisions usually need more than that. A planner deciding how much stock to hold cares about how bad things could get, not only about the most likely outcome. That is what quantile forecasts provide: estimates of, for example, the 10th and 90th percentile, which together describe a range the true value is likely to fall in.

History → forecast

quantiles

Sixty points of history go in as context.

A point forecast with quantile bands. TimesFM 2.5 supports quantile forecasts through an optional quantile head. The data and bands are illustrative.

TimesFM's support for this has grown over time. The model card for TimesFM 2.0 describes it as focused on point forecasts, with ten experimental quantile heads that had not been calibrated after pretraining. TimesFM 2.5 added continuous quantile forecasting up to a 1,000-step horizon through an optional quantile head of about 30 million parameters. In both cases, the widening of the bands with the horizon is the honest part of the forecast: the further ahead you look, the less anyone can know.

Versions and where to run it

TimesFM has moved quickly since its first release. TimesFM 2.0, with about 500 million parameters, extended the maximum context to 2,048 time points. TimesFM 2.5, released in September 2025, went the other way on size, dropping to about 200 million parameters while extending the context to 16k points, adding the optional quantile head and removing the need for a frequency indicator. Support for covariates was added back to the 2.5 codebase in October 2025. The open code and weights for these versions are released under the Apache 2.0 licence, and the repository notes that the open version is not an officially supported Google product.

There are several ways to use it. The checkpoints are published on Hugging Face and the timesfm package is on PyPI for running the model yourself in Python. In BigQuery, the built-in AI.FORECAST function runs TimesFM directly from SQL with no model to create or train, and Google's documentation notes that for TimesFM 2.5 up to 15,360 data points are passed to the model. TimesFM is also available as an endpoint through Vertex AI Model Garden, and Google has brought BigQuery forecasting into Google Sheets through Connected Sheets.

The quickest way to try it is a notebook. The one below, from Google Cloud's Vertex AI MLOps examples, walks through forecasting with TimesFM end to end.

Open in Colab

What it cannot do

A foundation model is not a crystal ball, and TimesFM has clear boundaries. It forecasts from the history you give it, so it cannot anticipate events that leave no trace in that history, such as a promotion that has not happened yet or a sudden change in policy, unless that information is supplied as a covariate. Through version 2.5 it is fundamentally a univariate model, forecasting one series at a time rather than modelling how several series interact. The TimesFM 2.0 model card also asks for a contiguous context with no gaps, and for the context and horizon to share the same frequency, so messy real-world data still needs cleaning before it goes in.

It is also worth being careful with how you judge it. Zero-shot performance close to a supervised model on a benchmark is an impressive result, but your data may look nothing like the benchmarks. The sensible approach is to backtest it on your own history against the simple baselines you already trust, such as seasonal naive or exponential smoothing, and to use it where it wins.

A new era, carefully

What makes TimesFM feel like the start of something is not any single benchmark result. It is the change in workflow. Forecasting has always started with a model to build. With a pretrained model, it can start with a question to ask, in Python, in SQL or in a spreadsheet, and the first forecast arrives before anyone has fitted anything. Classical methods and specialist models are not going away, and for many critical series they will remain the right answer. But as a strong, general-purpose starting point that anyone can reach for, TimesFM has changed what the default looks like.

Sources: Google Research's TimesFM blog post, the paper, the TimesFM repository, the TimesFM 2.0 model card and the BigQuery TimesFM documentation.

Enjoyed this article?

Leave a like to let me know this was valuable to you.

Get new posts by email

One email when a new article goes up. Unsubscribe anytime.

Discussion

(5)
  1. Anonymous Python Dev

    The Hugging Face inference pipeline example worked seamlessly. Great practical breakdown.

  2. Anonymous Financial Analyst

    Appreciate the discussion on point forecast confidence intervals. Critical for risk management applications.

  3. Anonymous ML Practitioner

    Tested TimesFM on electricity grid load forecasting benchmarks and the out-of-distribution generalization surprised our entire team.

  4. Anonymous Quant

    The patch-based tokenization mechanism handling multi-frequency seasonality without heavy manual lag feature engineering was a game changer.

  5. Anonymous Data Scientist

    Zero-shot forecasting with TimesFM matching or beating bespoke ARIMA/Prophet models trained over weeks is absurdly impressive. Huge leap for time-series.

Command Palette

Search for a command to run...