chapter five

5 Learning the language of time with Chronos

 

This chapter covers

  • Exploring the Chronos framework
  • Forecasting with Chronos
  • Fine-tuning Chronos
  • Anomaly detection with Chronos

In previous chapters, we explored TimeGPT and Lag-Llama, which are pretrained foundation models for time series forecasting. After the release of these two models, researchers from Amazon released Chronos. However, Chronos is technically not a model but a framework for pretrained probabilistic forecasting models [1].

In short, Chronos designs a process in which time series data is scaled and quantized into a fixed vocabulary, such that it can be used to train existing language models, like T5 or GPT-2.

Luckily for us, the researchers already pretrained forecasting models based on the T5 family, and those models are loosely referred to as Chronos.

There is a lot to uncover about Chronos. We first dive into the details of the framework before moving on to applying it in our scenario of sales forecasting and anomaly detection.

5.1 Quickly discovering the T5 family

It is important to understand the T5 family of models, as they are the models behind Chronos. We will keep this exploration to a minimum such that we can focus on time series forecasting. If you are already familiar with T5, feel free to jump right into the next section of the chapter.

Now, T5 represents a group of language models developed by Google Research [2]. T5 actually stands for Text-to-Text Transfer Transformer.

5.2 Exploring Chronos

5.2.1 Tokenization in Chronos

5.2.2 Training a model with Chronos

5.2.3 Tackling data scarcity with augmentation techniques

5.2.4 Examine the pretrained Chronos models

5.2.5 Selecting the appropriate Chronos model

5.3 Forecasting with Chronos

5.3.1 Zero-shot forecasting with Chronos

5.3.2 Cross-validation with Chronos

5.4 Fine-tuning Chronos

5.5 Anomaly detection with Chronos

5.6 Next steps

5.7 Summary