Introduction
In the domains of Natural Language Processing and Computer Vision, "foundation models" like GPT-4 or CLIP have become the standard, allowing a single pre-trained model to be applied across a vast array of specific tasks. In contrast, time series forecasting has historically relied on a "bespoke" paradigm, where models are trained specifically for individual datasets (e.g., electricity usage or financial trends).
MOIRAI (Masked EncOder-based UnIveRsAl TIme Series Forecasting Transformer) represents a significant shift toward a universal forecasting approach. By training on a massive 27-billion-observation dataset, MOIRAI achieves state-of-the-art zero-shot performance across diverse domains, frequencies, and variables.
The Challenge of Heterogeneity
Building a universal forecaster is difficult due to the extreme variability inherent in time series data. A robust model must address three primary forms of heterogeneity:
- Multiple Frequencies: Data intervals can range from seconds to months.
- Any-variate Dimensionality: Datasets vary from univariate to high-dimensional multivariate sequences representing different physical quantities.
- Varying Distributions: The statistical properties of financial data differ wildly from sensor data or traffic counts.
The MOIRAI Architecture
To handle this complexity, MOIRAI introduces three key architectural innovations:
- Multi-Patch Size Projection Layers: Unlike standard Transformers that use fixed windows, MOIRAI employs multiple patch sizes. It assigns larger patches to high-frequency data to capture long-term patterns efficiently and smaller patches to low-frequency data, allowing the Transformer layers to perform more granular processing.
- Any-variate Attention: MOIRAI flattens multivariate data into a single sequence of tokens. It utilizes Rotary Position Embeddings (RoPE) for temporal tracking and learned binary attention biases to distinguish between variables, ensuring the model remains invariant to variable ordering.
- Mixture Distribution Output: Rather than assuming a simple Gaussian distribution, MOIRAI predicts parameters for a mixture of four distributions: Student’s t (robustness), Negative Binomial (counts), Log-normal (right-skewed), and a low-variance Normal (high-confidence peaks).
Large-scale Open Time Series Archive (LOTSA)
The foundation of MOIRAI is the LOTSA dataset, which aggregates and expands upon existing collections like the Monash Archive and GluonTS. Containing over 27 billion observations across nine domains (Energy, Transport, Climate, etc.), it provides the scale necessary for true universal pre-training.
To optimize training on such a diverse archive, the authors implemented sequence packing. By stuffing multiple shorter series into a single training window, they reduced computational waste from padding from 61% to just 0.38%.
Key Insights and Results
Evaluation of MOIRAI in three sizes—Small (14M), Base (91M), and Large (311M)—revealed several critical findings:
- Zero-Shot Superiority: MOIRAI often outperforms "full-shot" models that were specifically trained and tuned on the target dataset. In probabilistic forecasting tests, MOIRAI-Base and Large achieved top-tier results across six domains, surpassing specialized models like PatchTST and TiDE.
- Scaling with Context: Unlike many previous time series Transformers, MOIRAI’s performance consistently improves as the historical context length increases, even up to thousands of time steps.
- Distribution Flexibility: The mixture distribution proved essential for accuracy. Using a standard Student’s t-distribution alone led to significantly worse performance on datasets with non-symmetric peaks, such as traffic data.
Conclusion and Future Work
MOIRAI demonstrates that foundation models for time series are not only viable but highly effective. While the current model relies on heuristic patching and faces computational hurdles with extremely high-dimensional data, it sets a new benchmark for zero-shot forecasting. Future iterations may incorporate multi-modal inputs, such as text descriptions or tabular metadata, to further refine predictions.
Summary updated