Software Engineering UKSoftware Engineering UK

Predicting the Future with Zero-Shot Models

Avery VanceBy Avery Vance

Zero-shot forecasting is the ability of a pre-trained model to predict future values for a dataset it has never encountered before, without requiring any additional training or parameter updates for that specific task.

Imagine a retail manager trying to predict the sales of a brand-new ice cream flavour. There is no historical data for this specific product, and the manager has no time to collect a dataset and train a custom machine learning model. Traditionally, they would rely on a simple guess or a generic average. With a zero-shot foundation model, the manager can input the history of related flavours and a calendar of planned promotions. The model, having already learned the universal "shape" of retail trends from trillions of other data points, can immediately project a realistic sales curve for the new product.

Why Zero-Shot Models Outperform Custom Training

For years, the standard approach to forecasting was to build a bespoke model for every niche dataset. This created a "cold-start" problem where features could not be deployed until enough data had been collected to make training viable. Zero-shot models eliminate this bottleneck by shifting the burden of learning from the local dataset to a massive, general-purpose pre-training corpus.

The latest evolution in this space, TimesFM-3, moves beyond simple univariate forecasting (where a model only looks at one variable) to native multivariate forecasting. This allows developers to integrate multiple influencing factors into a single prediction.

Feature Univariate Models Multivariate Zero-Shot (TimesFM-3)
Data Requirement Requires historical labels for the specific target Uses general temporal priors from a large corpus
Contextual Inputs Past values of the target only Past values + related series + future covariates
Deployment Speed High (Training → Validation → Deploy) Instant (Inference only)
Handling New Series Poor (Cold-start failure) Strong (Immediate generalization)

This capability allows teams to integrate predictive features into their Software Development lifecycle without the overhead of managing separate training pipelines for every new client or product line.

How the Architecture Enables Instant Prediction, pictured for this guide to software development

How the Architecture Enables Instant Prediction

To achieve high accuracy without local training, zero-shot models use a combination of patching and alternating attention. Rather than treating every single data point as a separate token, the model groups contiguous time steps into "patches". This reduces the computational load and helps the model identify broader patterns.

The transition to multivariate forecasting is handled through a specific structural approach:

  1. Token Construction: The model creates tokens from patches of target data and past covariates. For future events (like a scheduled holiday), it uses a "lookahead" strategy to peek at upcoming signals.
  2. Causal Temporal Attention: Tokens look horizontally across time, ensuring they only see the past to prevent data leakage.
  3. Full Variate Attention: Tokens look vertically across different series, allowing the model to understand how a spike in one variable (e.g., foot traffic) correlates with a spike in another (e.g., sales).
  4. Non-Autoregressive Decoding: Instead of predicting one point at a time, the model uses "Contiguous Patch Masking" to fill in the entire future horizon in a single forward pass.

This architecture enables the model to provide a probabilistic view of the future. Instead of a single line, it predicts nine different quantiles (from the 10th to the 90th percentile), giving developers a clear measure of uncertainty.

Practical Deployment and Risk Management

While zero-shot models offer immense speed, they are not a total replacement for supervised learning in every scenario. They are most effective in data-poor environments or during rapid prototyping. As noted by Predict.ai, zero-shot is the "first path on a Tuesday afternoon when the alternative is a blank cell," providing a baseline that often beats simple seasonal averages.

However, developers must be aware of the distinction between simulation and prediction. In high-stakes environments, such as healthcare, relying on a generative model to "simulate" a future can be risky. According to Stanford HAI, treating a simulation as an "oracle" prediction can lead to unsafe decisions because the simulated frequencies may not reflect real-world probabilities.

To deploy these models safely, follow this validation sequence:

  1. Establish a Baseline: Compare the zero-shot output against a "seasonal naive" model (which assumes this week will look like last week).
  2. Perform a Backtest: Use a holdout set of historical data to see how the zero-shot model would have performed in the past.
  3. Audit for Covariate Influence: Verify that the model is reacting correctly to known future events (e.g., confirming that a planned promotion actually causes a projected lift in the forecast).
  4. Evaluate for Fine-Tuning: Once sufficient local data is collected, determine if the performance gain from a fine-tuned model justifies the additional compute cost.

For teams managing complex deployments, integrating these forecasts into a Microservices Architecture, Explained allows the forecasting engine to operate as a standalone service, providing predictions to various front-end modules without tying the rest of the system to the model's specific resource requirements.

Sources

The way through

  1. Establish a baselineCompare the zero-shot output against a seasonal naive model.
  2. Perform a backtestUse a holdout set of historical data to evaluate past performance.
  3. Audit for covariate influenceVerify the model reacts correctly to known future events like promotions.
  4. Evaluate for fine-tuningDetermine if performance gains from a fine-tuned model justify the compute cost.

Source: TimesFM-3: A zero-shot foundation model for multivariate forecasting

The usual questions

What is zero-shot forecasting?

Zero-shot forecasting is the ability of a pre-trained model to predict future values for a dataset it has never seen. It does this without requiring any additional training or parameter updates for that specific task.

How does TimesFM-3 differ from univariate models?

Unlike univariate models that only look at one variable, TimesFM-3 supports native multivariate forecasting. This allows it to integrate multiple influencing factors and related series into a single prediction.

When should I avoid using zero-shot models?

They should be used with caution in high-stakes environments like healthcare. According to Stanford HAI, treating a generative simulation as an oracle prediction can be risky because simulated frequencies may not reflect real-world probabilities.

Carry on reading

Microservices Architecture, Explained
Making Software Development Agencies London Work
A Practical Guide to CI/CD Pipelines

← All News