Overview
Inspired by large language models, these models are pretrained on very large and diverse corpora of real and synthetic series. At inference you pass a context window and get a forecast, often probabilistic, without fitting anything. That makes them attractive for cold-start products, thousands of short series, and quick baselines.
| Model | From | Architecture | Output | Weights |
|---|---|---|---|---|
| Chronos | Amazon, 2024 | T5 language model on scaled, quantised values (tokens) | Sample paths | Open |
| TimesFM | Google Research, 2024 | Decoder-only Transformer on patches | Point + quantiles | Open |
| Moirai | Salesforce, 2024 | Masked-encoder Transformer, multiple patch sizes, any-variate attention | Mixture distribution | Open |
| Lag-Llama | 2023–24 | Decoder-only (LLaMA-style) with lag features | Student-t distribution | Open |
| TimeGPT | Nixtla, 2023 | Transformer encoder–decoder | Point + intervals | API only |
How it works
Chronos, for example, scales each context window by its mean absolute value, quantises the scaled values into \(B\) bins, and trains a language model with cross-entropy to predict the next token:
\[\tilde x_t=\frac{x_t}{s},\quad s=\frac{1}{C}\sum_{t=1}^{C}\lvert x_t\rvert,\qquad z_t=\mathrm{bin}(\tilde x_t)\in\{1,\dots,B\}\] \[\mathcal L=-\sum_{t}\log p_\theta\big(z_{t+1}\mid z_{1:t}\big)\]Sampling tokens autoregressively and mapping them back gives forecast sample paths, and therefore quantiles.
When to use it
Use it for
- Thousands of series where per-series models are impractical
- New products or sensors with little history
- Fast baselines before building custom models
Avoid it for
- Assuming zero-shot beats a tuned model: always benchmark
- Strict latency or memory limits (models are large)
- Data with strong covariate effects the model can’t see
Key settings
| Setting | What it controls | Typical value |
|---|---|---|
context length | How much history you pass in | model maximum, e.g. 512 |
prediction_length | Horizon | within the model’s recommended range |
num_samples / quantiles | Probabilistic output | 20–100 samples |
model size | Tiny to large checkpoints | start small, scale if it helps |
Python example
# pip install chronos-forecasting (needs PyTorch; the model downloads on first run) import numpy as np import pandas as pd import torch from chronos import ChronosPipeline pipeline = ChronosPipeline.from_pretrained("amazon/chronos-t5-small", device_map="cpu", torch_dtype=torch.bfloat16) URL = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/airline-passengers.csv" y = pd.read_csv(URL)["Passengers"].to_numpy(dtype=float) context, actual = torch.tensor(y[:-12]), y[-12:] # zero-shot: no training. Returns sample paths with shape [series, samples, horizon] samples = pipeline.predict(context, prediction_length=12, num_samples=50) low, median, high = np.quantile(samples[0].numpy(), [0.1, 0.5, 0.9], axis=0) print(f"Chronos MAE: {np.mean(np.abs(median - actual)):.1f}") print(f"80% interval coverage: {np.mean((actual >= low) & (actual <= high)):.0%}")
Tips & pitfalls
- Benchmark against seasonal naive and ETS on your own data. Benchmarks used in papers may overlap with pretraining data.
- Fine-tuning on your domain often helps more than switching models.
- Respect licences and data-privacy rules, especially for API-based models.
References
- Ansari, A. F., et al. (2024). Chronos: Learning the Language of Time Series. Transactions on Machine Learning Research.
- Das, A., Kong, W., Sen, R., & Zhou, Y. (2024). A decoder-only foundation model for time-series forecasting. Proceedings of ICML 2024.
- Woo, G., Liu, C., Kumar, A., Xiong, C., Savarese, S., & Sahoo, D. (2024). Unified Training of Universal Time Series Forecasting Transformers. Proceedings of ICML 2024.
- Rasul, K., et al. (2023). Lag-Llama: Towards Foundation Models for Probabilistic Time Series Forecasting. arXiv:2310.08278.
- Garza, A., & Mergenthaler-Canseco, M. (2023). TimeGPT-1. arXiv:2310.03589.