←back to Blog

Salesforce AI Releases Moirai 2.0: Salesforce’s Latest Time Series Foundation Model Built on a Decoder‑only Transformer Architecture

«`html

Salesforce AI Releases Moirai 2.0: Salesforce’s Latest Time Series Foundation Model Built on a Decoder‑only Transformer Architecture

Understanding the Target Audience

The target audience for Moirai 2.0 includes data scientists, business analysts, and IT professionals working in enterprise settings. These individuals are often tasked with leveraging data to inform business decisions, optimize operations, and enhance forecasting accuracy. Their main pain points include challenges associated with the scalability of forecasting models, the time taken for model training and inference, and the need for robust solutions that can handle diverse datasets.

Their goals typically revolve around achieving high accuracy in forecasts, reducing operational costs, and improving decision-making processes. They are interested in practical applications of AI, ease of integration into existing systems, and ongoing support for implementation. Communication preferences lean towards clear, concise technical documentation and real-world case studies that demonstrate the effectiveness of solutions.

What Makes Moirai 2.0 Special?

Architecture Innovations

  • Decoder-only Transformer: This architecture enables better modeling of autoregressive forecast generation, enhancing scalability and performance on larger datasets.
  • Efficient Multi-Token Prediction: The model predicts multiple tokens simultaneously, improving efficiency and stability in forecasting.
  • Advanced Data Filtering: Automatically filters out low-quality, non-forecastable time series during training, enhancing robustness.
  • Patch Token Embedding & Random Masking: New techniques improve handling of missing data during inference.

Expanded Dataset for Pretraining

Moirai 2.0 utilizes a diverse range of training data, including:

  • Real-world sets like GIFT-Eval Pretrain and Train
  • Chronos mixup: Synthetic time series blending for diversity
  • KernelSynth procedures from Chronos research
  • Internal operational data from Salesforce IT systems

This broad data foundation allows Moirai 2.0 to generalize across various forecasting tasks and domains.

Performance: Breaking New Ground

Moirai 2.0 outperforms its predecessors significantly:

  • Best MASE Score on GIFT-Eval for non-data-leaking models
  • CRPS Performance matches previous state-of-the-art
  • 16% better on MASE compared to Moirai_large
  • 13% better on CRPS
  • 44% faster in inference
  • 96% smaller parameter size

These advancements make high-performance, scalable forecasting accessible to a wider audience.

Why Moirai 2.0 Matters for Practitioners

The capabilities of Moirai 2.0 extend into various enterprise-critical domains, such as:

  • IT Operations: Proactive capacity scaling and anomaly detection
  • Sales Forecasting: Accurate, scalable revenue predictions
  • Demand Forecasting: Optimized inventory management
  • Supply Chain Planning: Improved scheduling and reduced waste

With reduced model size and enhanced speed, businesses can apply high-quality forecasting at scale, enabling smarter, faster decision-making regardless of their data infrastructure.

Getting Started: Moirai 2.0 in Practice

Integration for developers and data scientists is straightforward. Below is a sample workflow using open-source modules available on Hugging Face:

Sample Python Workflow

import matplotlib.pyplot as plt
from gluonts.dataset.repository import dataset_recipes
from uni2ts.eval_util.data import get_gluonts_test_dataset
from uni2ts.model.moirai2 import Moirai2Forecast, Moirai2Module

# Load Moirai 2.0
model = Moirai2Forecast(
    module=Moirai2Module.from_pretrained("Salesforce/moirai-2.0-R-small"),
    prediction_length=100,
    context_length=1680,
    target_dim=1,
    feat_dynamic_real_dim=0,
    past_feat_dynamic_real_dim=0
)

# Load Dataset & Generate Forecasts
test_data, metadata = get_gluonts_test_dataset("electricity", prediction_length=None, regenerate=False)
predictor = model.create_predictor(batch_size=32)
forecasts = predictor.predict(test_data.input)

# Visualize Results
fig, axes = plt.subplots(nrows=2, ncols=3, figsize=(25, 10))
    

Universal, Scalable, Robust

Moirai 2.0 democratizes access to general-purpose forecasting technology, poised to reshape time series modeling. With improved robustness, faster inference, and lower computational demands, Salesforce AI Research’s model enables businesses and researchers globally to leverage forecasting for transformative decision-making.

Resources

For more technical details, visit the Salesforce blog. Explore the model on Hugging Face and check out the GitHub Page for tutorials, codes, and notebooks. Follow Salesforce AI on Twitter and join the community on ML SubReddit.

«`