Sequences, streaming data, robotics, and scientific extensions · Entry index · SEQ014 · Model
Chronos: tokenized probabilistic time-series forecasting
The original Chronos family treats scaled and quantized time-series observations as discrete tokens and trains language-model architectures for probabilistic forecasting.
In CodeSplash
A CodeSplash method runs this entry in Python and R. Set it up from the method's page.
- Chronos zero-shot forecast Checked in one engine
- Chronos-2 zero-shot forecast with covariates Experimental
Do it in CodeSplash Run it on your own data, in Python or R.
- Availability
- Runs in CodeSplash
- Code example
- Component demo, not a trained model
- Who ran it
- CodeSplash's own run
- CodeSplash's run
- Checked in one engine through forecast.chronos. The reference's example ran in Python and R here, and they agree.
- The reference's record
- Python: Ran in the reference's review, but on a different version of the code. R: Reviewed but not run: R wasn't available to the reference's authors.
Purpose
The original Chronos family treats scaled and quantized time-series observations as discrete tokens and trains language-model architectures for probabilistic forecasting. Sampling token sequences yields forecast trajectories after decoding. This entry describes the original tokenization-based construction; subsequent releases can use different architectures and interfaces.
Question / hypotheses
Can pretraining across many series support accurate and calibrated probabilistic forecasts on a new series with little or no task-specific fitting? There is no test null. Assess zero-shot and adapted forecasts separately under chronological, leakage-controlled benchmarks.
Architecture / computational structure
The original pipeline combines numeric scaling/quantization with a language-model backbone such as T5 and token decoding into numeric trajectories. Numerical preprocessing is essential to the architecture’s interface. Later Chronos variants should be documented by their own release-specific backbone, output head, and supported covariates.
Assumptions
Available context, scaling, discretization, missing values, and forecast horizons must match the selected implementation. Quantization loses numerical precision, extreme values can saturate bins, and transfer depends on training-domain coverage. Foundation-model status does not establish superiority over simple or task-fitted baselines.
Formula / computational definition
After context-based scaling, , a quantizer maps to token . Training minimizes in the selected sequence-model formulation. Sampled future tokens map back through bin representatives and scale ; finite bins discretize the predictive support.
Parameters and notation
Learned parameters: sequence-model attention/feed-forward layers, token embeddings, and output logits. Hyperparameters: binning range/count, scaling convention, context length, forecast horizon, sampling settings, and adaptation schedule. Token count and model size trade representation granularity against compute; additional samples improve Monte Carlo precision only.
Fitting, fine-tuning, and adaptation
Evaluate a frozen pretrained model before adaptation. Fine-tune on training-origin windows with a small learning rate and chronological validation, keeping the intended tokenizer/scaler conventions consistent. Distinguish transfer gains from leakage through pooled series or benchmark reuse. Any new covariate mechanism needs explicit implementation rather than assuming text-style prompting supplies it.
How to use and calibrate
Report proper forecast scores, coverage and interval width, point errors, and performance by horizon and scale. Compare against seasonal-naive and suitable fitted models. Use rolling origins and inspect whether saturation or quantization creates stepped forecasts or poorly represented extreme tails.
Example application
Quantize a synthetic standardized demand sequence, plot its reconstructed bin centers, and inspect the loss of precision before evaluating any trained model’s forecasts.
Interpretation / pitfalls
Watch out
Python: the official Chronos forecasting package and matching release/model card; R: reticulate for inference and native forecast scoring. The example only demonstrates fixed-bin quantization without training, token generation, context scaling, or probabilistic forecast calibration.
Python and R code examples (dependencies/validation)
Python uses NumPy and the shared mse helper when called; base R uses the shared helper when called. Validation: Python component executed; R companion reviewed, not executed. Scope: the specific component described above, not the full model or its training.
Python and R
The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.
Component demo, not a trained model — synthetic mathematical component, not a full-model implementation
Shared setup for this chapter
import numpy as np
def mse(a,b):
a,b=np.asarray(a),np.asarray(b)
if a.shape!=b.shape or a.size==0:
raise ValueError("MSE needs nonempty equal shapes")
return float(np.mean((a-b)**2))
values=np.array([-2.4,-.3,1.8]); edges=np.linspace(-3.,3.,7); centers=(edges[:-1]+edges[1:])/2
bins=np.clip(np.digitize(values,edges)-1,0,len(centers)-1); reconstructed=centers[bins]
result={"bins_zero_based":bins.tolist(),"reconstructed":reconstructed.tolist()}
print(result)
Component demo, not a trained model — synthetic mathematical component, not a full-model implementation
Shared setup for this chapter
mse <- function(a,b) {
stopifnot(length(a)>0L, identical(dim(a),dim(b)), length(a)==length(b))
mean((a-b)^2)
}
values <- c(-2.4,-.3,1.8); edges <- seq(-3,3,length.out=7); centers <- (head(edges,-1)+tail(edges,-1))/2
bins <- as.integer(cut(values,edges,include.lowest=TRUE)); reconstructed <- centers[bins]
result <- list(bins_zero_based=bins-1L,reconstructed=reconstructed)
print(result)
Sources
- Source 1arxiv.org
- Source 2chronos-ts.ai
- Source 3github.com
From the CodeSplash reference, entry SEQ014.