chapter five

5 Learning the language of time with Chronos

 

This chapter covers

  • Exploring the Chronos framework
  • Forecasting with Chronos
  • Fine-tuning Chronos
  • Detecting anomalies with Chronos

In chapters 3 and 4, 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. Chronos, however, is technically not a model but a framework for pretrained probabilistic forecasting models [1]. This means Chronos is a process in which time-series data is scaled and quantized into a fixed vocabulary so it can be used to adapt existing language models, such as T5 and GPT-2, for time-series-forecasting tasks.

The researchers had already pretrained forecasting models based on the T5 family, and those models are loosely referred to as Chronos. Those models tend to perform best with series that have no strong trends. Unlike Lag-Llama, Chronos models can be used through a Python package, making it more suitable for production-ready environments.

5.1 Discovering the T5 family

Understanding the T5 family of models is important because these models are behind Chronos. We’ll keep this exploration to a minimum, however, so we can focus on time-series forecasting. If you’re already familiar with T5, feel free to jump to section 5.2.

5.2 Exploring Chronos

5.3 Using tokenization in Chronos

5.4 Training a model with Chronos

5.4.1 Tackling data scarcity with augmentation techniques

5.4.2 Examining the pretrained Chronos models

5.4.3 Selecting the appropriate Chronos model

5.5 Forecasting with Chronos

5.5.1 Initial setup

5.5.2 Predictions

5.6 Cross-validating with Chronos

5.6.1 Running cross-validation

5.6.2 Evaluating Chronos

5.7 Fine-tuning Chronos