QM025 Hands-on Lab

Pretrained Time-Series Foundation Models

← Back to Method article

Objective

Use a two-part lab to separate information admissibility from actual pretrained-model inference.

  • Part A audits whether context values and future covariates were genuinely available at a simulated historical forecast origin.
  • Part B runs real zero-shot inference with Amazon Chronos-2 on a deterministic synthetic monthly series and compares the result with a seasonal-naive baseline.

Part B is a retrospective technology counterfactual, not a historical real-time OOS claim. A current pretrained model is being applied to a toy historical cutoff.

Part A — Information-boundary audit

python labs/python/qm025_tsfm_information_audit.py

Move the availability date of future_realized_macro to the forecast origin and rerun. Then explain whether that change is a legitimate information assumption or merely a way to make the audit pass.

Part B — Actual Chronos-2 zero-shot inference

The actual inference script follows the official Chronos dataframe interface: BaseChronosPipeline.from_pretrained(...) followed by predict_df(...). The default model ID is amazon/chronos-2.

Install the optional runtime:

pip install -r labs/python/requirements-chronos2.txt

Then run:

python labs/python/qm025_chronos2_zero_shot.py

The first run may download the pretrained checkpoint (roughly 0.5 GB) if it is not already cached. --device auto uses CUDA when available and otherwise CPU.

For a governed experiment, pin a model revision rather than silently following main:

python labs/python/qm025_chronos2_zero_shot.py --revision <HUGGING_FACE_COMMIT_SHA>

The script reports the model ID/revision request, Chronos package version, device, Chronos-2 RMSE/MAE, seasonal-naive RMSE/MAE, and a toy 10–90% interval coverage diagnostic when those quantiles are returned.

Offline contract check

The project gate does not require network access or a 0.5 GB model download. It validates the inference-data contract with:

python labs/python/qm025_chronos2_zero_shot.py --check-only

This checks context/holdout separation and forecast timestamps without importing or loading Chronos.

Interpretation boundary

One synthetic holdout cannot establish that Chronos-2 is superior to conventional models. The purpose is to experience the real pretrained inference interface while keeping the epistemic boundary explicit:

actual current-model inference + historical toy inputs ≠ historical live track record.

For current API details, use the official Chronos repository and the Amazon Chronos-2 model card.