TL;DR
Mamba4Cast is an efficient zero-shot time series foundation model that combines the linear-time Mamba2 state space architecture with synthetic pretraining inspired by Prior-data Fitted Networks (PFNs). Trained entirely on synthetic data, Mamba4Cast predicts entire forecast horizons in a single forward pass, delivering competitive accuracy with 200M-parameter Transformer models like Chronos while dramatically cutting inference latency and memory scaling costs.
What Problem Does This Paper Address?
Traditional time series forecasting models typically require fine-tuning or full retraining on every target dataset—a compute-heavy, impractical workflow for real-time deployments. While recent Transformer-based foundation models (such as Chronos) show remarkable zero-shot capabilities, they inherit two major bottlenecks:
- Quadratic Complexity ($O(L^2)$): Self-attention struggles to scale efficiently over long historical context windows.
- Autoregressive Decoding Bottlenecks: Predicting future values step-by-step is slow and susceptible to error accumulation over long horizons.
Mamba4Cast tackles these issues by exploring whether state space models (SSMs) can serve as scalable zero-shot forecasters that predict non-autoregressively without ever training on real-world time series data.
Methods
Mamba4Cast pairs an efficient SSM backbone with specialized synthetic data priors:
- Mamba2 Backbone: Builds upon the Mamba2 architecture, which replaces standard diagonal transitions with chunked, hardware-efficient scalar-identity state spaces computed via matrix multiplication on tensor cores.
- Dilated Causal Convolutions: To enrich local multi-scale temporal context, input embeddings pass through stacked causal 1D convolutions with dilations of 1, 2, 4, and 8, followed by an inception-style projection before the Mamba2 layers.
- Single-Pass Multipoint Forecasting: Rather than unrolling predictions step-by-step autoregressively, the model takes historical context alongside masked target tokens (set to 0) and predicts the entire forecast horizon simultaneously in a single forward pass.
- 100% Synthetic Pretraining: The model never sees real time series during training. Instead, it trains on:
- ForecastPFN Priors (30%): Decomposed trend (linear only), multiscale seasonal harmonics (minutely to monthly), and Weibull noise.
- Gaussian Process Priors (70%): Complex composite kernels (Periodic, Matérn, Linear, Polynomial) sampled via GPyTorch with jitter-based noise.
- Signal-Level Artifacts: Irregular masking, spikes, and alternating step shifts to mimic real-world distribution jumps.
The final model contains just 27M parameters (embedding dimension of 1024 across 2 encoder blocks).
Datasets
- Training: Exclusively synthetic data sampled on the fly across 420k batches (batch size 64) with variable context lengths (30–512) and prediction horizons (10–60), ensuring the model never sees the same synthetic series twice.
- Evaluation: Evaluated zero-shot across 17 public datasets from the GluonTS repository (CIF 2016, Car Parts, Covid Deaths, ERCOT Load, Exchange Rate, FRED-MD, Hospital, M1, M3, NN5, Tourism, Traffic, Weather), capped at a maximum context length of 512.
Key Insights and Ideas
- No Real Data Needed: Training on a mixture of Gaussian Processes and structured decomposition priors is sufficient to generalize to real-world financial, energy, transport, and web traffic series.
- Multipoint Decoding Outperforms Autoregression: Feeding predicted values autoregressively back into the model severely degraded performance (geometric mean MASE jumped from 1.153 to 2.044) due to compounding errors and overconfidence. Predicting the entire horizon at once in a single pass resolved this issue.
- Convolutions are Essential Complements to SSMs: Removing the causal convolution layers from the input embedding caused MASE to jump from 1.153 to 1.556, highlighting that local receptive fields provide crucial inductive bias alongside the SSM's global recurrence.
- Sub-Linear Inference Scaling: Because Mamba2 operates with linear complexity and avoids iterative decoding, inference latency remains flat as the prediction horizon expands, whereas autoregressive Transformer runtimes scale steeply.
Key Results
- Competitive Accuracy: On the 17-dataset GluonTS benchmark, Mamba4Cast (27M) performs on par with Chronos-Base (200M) and outperforms Chronos-Small (46M), ForecastPFN, DeepAR, and statistical baselines (AutoARIMA, Seasonal Naive).
- Speed & Efficiency: In synthetic benchmarking (2,048 series, context length 512), Mamba4Cast exhibits several-fold speedups over Chronos-Small. Its inference runtime remains virtually constant as the prediction horizon scales from 8 to 50 steps, whereas Chronos scales linearly in prediction length and hits steep latency cliffs at larger batch sizes.
Limitations and Future Work
- Univariate Only: The model processes each time series independently and cannot currently leverage inter-series cross-correlations in multivariate problems.
- Prior Dependencies: Performance relies heavily on the diversity and balance of synthetic priors (e.g., exponential trends had to be omitted from the FPFN prior as they harmed generalization).
- Sub-hourly and Ultra-long Contexts: Extremely long context windows and sub-hourly frequencies (e.g., per-second data) were excluded from evaluation and left for future architectural iterations.
Summary updated