Time Series Forecasting
Chronos
Safetensors
t5
time series
forecasting
foundation models
pretrained models
shchuro commited on
Commit
254b535
Β·
verified Β·
1 Parent(s): 95a9710

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +156 -3
README.md CHANGED
@@ -1,3 +1,156 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ model_id: chronos-2
4
+ tags:
5
+ - time-series-forecasting
6
+ - foundation models
7
+ - pretrained models
8
+ - time series foundation models
9
+ - time series
10
+ - time-series
11
+ - timeseries
12
+ - transformers
13
+ - forecasting
14
+ - safetensors
15
+ paper:
16
+ - https://arxiv.org/abs/2510.15821
17
+ datasets:
18
+ - autogluon/chronos_datasets
19
+ - Salesforce/GiftEvalPretrain
20
+ leaderboards:
21
+ - https://huggingface.co/spaces/Salesforce/GIFT-Eval
22
+ - https://huggingface.co/spaces/autogluon/fev-leaderboard
23
+ pipeline_tag: time-series-forecasting
24
+
25
+ ---
26
+
27
+ # Chronos-2
28
+ **Chronos-2** is a 120M-parameter, encoder-only time series foundation model for zero-shot forecasting.
29
+ It supports **univariate**, **multivariate**, and **covariate-informed** tasks within a single architecture.
30
+ Inspired by the T5 encoder, Chronos-2 produces multi-step-ahead quantile forecasts and uses a group attention mechanism for efficient in-context learning across related series and covariates.
31
+ Trained on large-scale synthetic datasets, it achieves **state-of-the-art zero-shot accuracy** among public models on [**fev-bench**](https://huggingface.co/spaces/autogluon/fev-leaderboard), [**GIFT-Eval**](https://huggingface.co/spaces/Salesforce/GIFT-Eval), and [**Chronos Benchmark II**](https://arxiv.org/abs/2403.07815).
32
+ Chronos-2 is also **highly efficient**, delivering over 300 time series forecasts per second on a single A10G GPU and supporting both **GPU and CPU inference**.
33
+
34
+ ## Links
35
+ - πŸš€ [Deploy Chronos-2 on Amazon SageMaker](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/deploy-chronos-to-amazon-sagemaker.ipynb)
36
+ - πŸ“„ [Technical report](https://arxiv.org/abs/2510.15821v1)
37
+ - πŸ’» [GitHub](https://github.com/amazon-science/chronos-forecasting)
38
+ - πŸ“˜ [Example notebook](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/chronos-2-quickstart.ipynb)
39
+ - πŸ“° [Amazon Science Blog](https://www.amazon.science/blog/introducing-chronos-2-from-univariate-to-universal-forecasting)
40
+
41
+
42
+ ## Overview
43
+
44
+ | Capability | Chronos-2 | Chronos-Bolt | Chronos |
45
+ |------------|-----------|--------------|----------|
46
+ | Univariate Forecasting | βœ… | βœ… | βœ… |
47
+ | Cross-learning across items | βœ… | ❌ | ❌ |
48
+ | Multivariate Forecasting | βœ… | ❌ | ❌ |
49
+ | Past-only (real/categorical) covariates | βœ… | ❌ | ❌ |
50
+ | Known future (real/categorical) covariates | βœ… | 🧩 | 🧩 |
51
+ | Max. Context Length | 8192 | 2048 | 512 |
52
+ | Max. Prediction Length | 1024 | 64 | 64 |
53
+
54
+ 🧩 Chronos & Chronos-Bolt do not natively support future covariates, but they can be combined with external covariate regressors (see [AutoGluon tutorial](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html#incorporating-the-covariates)). This only models per-timestep effects, not effects across time. In contrast, Chronos-2 supports all covariate types natively.
55
+
56
+
57
+ ## Usage
58
+
59
+ ### Local usage
60
+
61
+ For experimentation and local inference, you can use the [inference package](https://github.com/amazon-science/chronos-forecasting).
62
+
63
+ Install the package
64
+ ```
65
+ pip install "chronos-forecasting>=2.0"
66
+ ```
67
+
68
+ Make zero-shot predictions using the `pandas` API
69
+
70
+ ```python
71
+ import pandas as pd # requires: pip install 'pandas[pyarrow]'
72
+ from chronos import Chronos2Pipeline
73
+
74
+ pipeline = Chronos2Pipeline.from_pretrained("amazon/chronos-2", device_map="cuda")
75
+
76
+ # Load historical target values and past values of covariates
77
+ context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")
78
+
79
+ # (Optional) Load future values of covariates
80
+ test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet")
81
+ future_df = test_df.drop(columns="target")
82
+
83
+ # Generate predictions with covariates
84
+ pred_df = pipeline.predict_df(
85
+ context_df,
86
+ future_df=future_df,
87
+ prediction_length=24, # Number of steps to forecast
88
+ quantile_levels=[0.1, 0.5, 0.9], # Quantiles for probabilistic forecast
89
+ id_column="id", # Column identifying different time series
90
+ timestamp_column="timestamp", # Column with datetime information
91
+ target="target", # Column(s) with time series values to predict
92
+ )
93
+ ```
94
+
95
+ ### Deploying a Chronos-2 endpoint to SageMaker
96
+
97
+ For production use, we recommend deploying Chronos-2 endpoints to Amazon SageMaker.
98
+
99
+ First, update the SageMaker SDK to make sure that all the latest models are available.
100
+
101
+ ```
102
+ pip install -U sagemaker
103
+ ```
104
+
105
+ Deploy an inference endpoint to SageMaker.
106
+
107
+ ```python
108
+ from sagemaker.jumpstart.model import JumpStartModel
109
+
110
+ model = JumpStartModel(
111
+ model_id="pytorch-forecasting-chronos-2",
112
+ instance_type="ml.g5.2xlarge",
113
+ )
114
+ predictor = model.deploy()
115
+ ```
116
+
117
+ Now you can send time series data to the endpoint in JSON format.
118
+
119
+ ```python
120
+ import pandas as pd
121
+ df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")
122
+
123
+ payload = {
124
+ "inputs": [
125
+ {"target": df["#Passengers"].tolist()}
126
+ ],
127
+ "parameters": {
128
+ "prediction_length": 12,
129
+ }
130
+ }
131
+ forecast = predictor.predict(payload)["predictions"]
132
+ ```
133
+
134
+ For more details about the endpoint API, check out the [example notebook](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/deploy-chronos-to-amazon-sagemaker.ipynb)
135
+
136
+
137
+ ## Training data
138
+ More details about the training data are available in the [technical report](https://arxiv.org/abs/2510.15821).
139
+
140
+ - Subset of [Chronos Datasets](https://huggingface.co/datasets/autogluon/chronos_datasets) (excluding datasets that overlap with GIFT-Eval)
141
+ - Subset of [GIFT-Eval Pretrain](https://huggingface.co/datasets/Salesforce/GiftEvalPretrain)
142
+ - Synthetic univariate and multivariate data
143
+
144
+
145
+ ## Citation
146
+
147
+ If you find Chronos-2 useful for your research, please consider citing the associated paper:
148
+
149
+ ```
150
+ @article{ansari2025chronos2,
151
+ title = {Chronos-2: From Univariate to Universal Forecasting},
152
+ author = {Abdul Fatir Ansari and Oleksandr Shchur and Jaris KΓΌken and Andreas Auer and Boran Han and Pedro Mercado and Syama Sundar Rangapuram and Huibin Shen and Lorenzo Stella and Xiyuan Zhang and Mononito Goswami and Shubham Kapoor and Danielle C. Maddix and Pablo Guerron and Tony Hu and Junming Yin and Nick Erickson and Prateek Mutalik Desai and Hao Wang and Huzefa Rangwala and George Karypis and Yuyang Wang and Michael Bohlke-Schneider},
153
+ year = {2025},
154
+ url = {https://arxiv.org/abs/2510.15821}
155
+ }
156
+ ```