Time Series Forecasting
Chronos
Safetensors
t5
time series
forecasting
foundation models
pretrained models
abdulfatir commited on
Commit
b687585
·
1 Parent(s): abdb14e
Files changed (3) hide show
  1. README.md +152 -3
  2. config.json +58 -0
  3. model.safetensors +3 -0
README.md CHANGED
@@ -1,3 +1,152 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ model_id: chronos-2
4
+ tags:
5
+ - time series
6
+ - forecasting
7
+ - foundation models
8
+ - pretrained models
9
+ - safetensors
10
+ paper:
11
+ - https://arxiv.org/abs/2510.15821
12
+ datasets:
13
+ - autogluon/chronos_datasets
14
+ - Salesforce/GiftEvalPretrain
15
+ leaderboards:
16
+ - Salesforce/GIFT-Eval
17
+ - autogluon/fev-leaderboard
18
+ pipeline_tag: time-series-forecasting
19
+ library_name: chronos-forecasting
20
+
21
+ ---
22
+
23
+ # Chronos-2
24
+ **Chronos-2** is a 120M-parameter, encoder-only time series foundation model for zero-shot forecasting.
25
+ It supports **univariate**, **multivariate**, and **covariate-informed** tasks within a single architecture.
26
+ 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.
27
+ Trained on a combination of real-world and 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).
28
+ 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**.
29
+
30
+ ## Links
31
+ - 🚀 [Deploy Chronos-2 on Amazon SageMaker](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/deploy-chronos-to-amazon-sagemaker.ipynb)
32
+ - 📄 [Technical report](https://arxiv.org/abs/2510.15821v1)
33
+ - 💻 [GitHub](https://github.com/amazon-science/chronos-forecasting)
34
+ - 📘 [Example notebook](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/chronos-2-quickstart.ipynb)
35
+ - 📰 [Amazon Science Blog](https://www.amazon.science/blog/introducing-chronos-2-from-univariate-to-universal-forecasting)
36
+
37
+
38
+ ## Overview
39
+
40
+ | Capability | Chronos-2 | Chronos-Bolt | Chronos |
41
+ |------------|-----------|--------------|----------|
42
+ | Univariate Forecasting | ✅ | ✅ | ✅ |
43
+ | Cross-learning across items | ✅ | ❌ | ❌ |
44
+ | Multivariate Forecasting | ✅ | ❌ | ❌ |
45
+ | Past-only (real/categorical) covariates | ✅ | ❌ | ❌ |
46
+ | Known future (real/categorical) covariates | ✅ | 🧩 | 🧩 |
47
+ | Max. Context Length | 8192 | 2048 | 512 |
48
+ | Max. Prediction Length | 1024 | 64 | 64 |
49
+
50
+ 🧩 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.
51
+
52
+
53
+ ## Usage
54
+
55
+ ### Local usage
56
+
57
+ For experimentation and local inference, you can use the [inference package](https://github.com/amazon-science/chronos-forecasting).
58
+
59
+ Install the package
60
+ ```
61
+ pip install "chronos-forecasting>=2.0"
62
+ ```
63
+
64
+ Make zero-shot predictions using the `pandas` API
65
+
66
+ ```python
67
+ import pandas as pd # requires: pip install 'pandas[pyarrow]'
68
+ from chronos import Chronos2Pipeline
69
+
70
+ pipeline = Chronos2Pipeline.from_pretrained("amazon/chronos-2", device_map="cuda")
71
+
72
+ # Load historical target values and past values of covariates
73
+ context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")
74
+
75
+ # (Optional) Load future values of covariates
76
+ test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet")
77
+ future_df = test_df.drop(columns="target")
78
+
79
+ # Generate predictions with covariates
80
+ pred_df = pipeline.predict_df(
81
+ context_df,
82
+ future_df=future_df,
83
+ prediction_length=24, # Number of steps to forecast
84
+ quantile_levels=[0.1, 0.5, 0.9], # Quantiles for probabilistic forecast
85
+ id_column="id", # Column identifying different time series
86
+ timestamp_column="timestamp", # Column with datetime information
87
+ target="target", # Column(s) with time series values to predict
88
+ )
89
+ ```
90
+
91
+ ### Deploying a Chronos-2 endpoint to SageMaker
92
+
93
+ For production use, we recommend deploying Chronos-2 endpoints to Amazon SageMaker.
94
+
95
+ First, update the SageMaker SDK to make sure that all the latest models are available.
96
+
97
+ ```
98
+ pip install -U sagemaker
99
+ ```
100
+
101
+ Deploy an inference endpoint to SageMaker.
102
+
103
+ ```python
104
+ from sagemaker.jumpstart.model import JumpStartModel
105
+
106
+ model = JumpStartModel(
107
+ model_id="pytorch-forecasting-chronos-2",
108
+ instance_type="ml.g5.2xlarge",
109
+ )
110
+ predictor = model.deploy()
111
+ ```
112
+
113
+ Now you can send time series data to the endpoint in JSON format.
114
+
115
+ ```python
116
+ import pandas as pd
117
+ df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")
118
+
119
+ payload = {
120
+ "inputs": [
121
+ {"target": df["#Passengers"].tolist()}
122
+ ],
123
+ "parameters": {
124
+ "prediction_length": 12,
125
+ }
126
+ }
127
+ forecast = predictor.predict(payload)["predictions"]
128
+ ```
129
+
130
+ 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)
131
+
132
+
133
+ ## Training data
134
+ More details about the training data are available in the [technical report](https://arxiv.org/abs/2510.15821).
135
+
136
+ - Subset of [Chronos Datasets](https://huggingface.co/datasets/autogluon/chronos_datasets) (excluding test portion of datasets that overlap with GIFT-Eval)
137
+ - Subset of [GIFT-Eval Pretrain](https://huggingface.co/datasets/Salesforce/GiftEvalPretrain)
138
+ - Synthetic univariate and multivariate data
139
+
140
+
141
+ ## Citation
142
+
143
+ If you find Chronos-2 useful for your research, please consider citing the associated paper:
144
+
145
+ ```
146
+ @article{ansari2025chronos2,
147
+ title = {Chronos-2: From Univariate to Universal Forecasting},
148
+ 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},
149
+ year = {2025},
150
+ url = {https://arxiv.org/abs/2510.15821}
151
+ }
152
+ ```
config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Chronos2Model"
4
+ ],
5
+ "chronos_config": {
6
+ "context_length": 8192,
7
+ "input_patch_size": 16,
8
+ "input_patch_stride": 16,
9
+ "max_output_patches": 64,
10
+ "output_patch_size": 16,
11
+ "quantiles": [
12
+ 0.01,
13
+ 0.05,
14
+ 0.1,
15
+ 0.15,
16
+ 0.2,
17
+ 0.25,
18
+ 0.3,
19
+ 0.35,
20
+ 0.4,
21
+ 0.45,
22
+ 0.5,
23
+ 0.55,
24
+ 0.6,
25
+ 0.65,
26
+ 0.7,
27
+ 0.75,
28
+ 0.8,
29
+ 0.85,
30
+ 0.9,
31
+ 0.95,
32
+ 0.99
33
+ ],
34
+ "time_encoding_scale": 8192,
35
+ "use_arcsinh": true,
36
+ "use_reg_token": true
37
+ },
38
+ "chronos_pipeline_class": "Chronos2Pipeline",
39
+ "d_ff": 3072,
40
+ "d_kv": 64,
41
+ "d_model": 768,
42
+ "dense_act_fn": "relu",
43
+ "dropout_rate": 0.1,
44
+ "feed_forward_proj": "relu",
45
+ "initializer_factor": 0.05,
46
+ "is_gated_act": false,
47
+ "layer_norm_epsilon": 1e-06,
48
+ "model_type": "t5",
49
+ "num_heads": 12,
50
+ "num_layers": 12,
51
+ "pad_token_id": 0,
52
+ "reg_token_id": 1,
53
+ "rope_theta": 10000.0,
54
+ "torch_dtype": "float32",
55
+ "transformers_version": "4.49.0",
56
+ "use_cache": true,
57
+ "vocab_size": 2
58
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddcda3c7508bf2528087723e98a20707cc04b7f370ae275a9fd88078ddba4f42
3
+ size 477930472