Skip to content

About

Tiny (4.73M) zero-shot time-series foundation model. 19 MB checkpoint, ~6 ms CPU inference, competitive on GIFT-Eval.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

goia-forecast

A 4.73M-parameter probabilistic time-series foundation model, trained from scratch on public corpora on a single consumer GPU and evaluated zero-shot on GIFT-Eval. Training uses the ground-truth quantile loss throughout, plus an auxiliary distillation term from Chronos-2 on a minority of batches (~22% of the total training signal; exact formula in the credits section).

Weights: https://huggingface.co/gredio/goia-forecast-nano-v0 · Full pipeline (data → distillation → training → evaluation) in this repo.

Results (GIFT-Eval, 97 configs)

Geometric means over the 97 dataset configurations, normalized by the seasonal-naive baseline (lower is better). Scores for other models come from the official leaderboard.

Model Params Type CRPS (norm.) MASE (norm.)
FlowState-9.1M 9.1M zero-shot 0.502 0.726
Toto-2.0-4m 4M pretrained¹ 0.524 0.757
TempoPFN 38M zero-shot 0.533 0.788
timesfm_2_0_500m 500M pretrained 0.550 0.758
goia-forecast-nano-v0 4.73M zero-shot² 0.553 0.815
chronos_bolt_base 205M pretrained 0.574 0.808

¹ pretrained models trained on the GIFT-Eval training splits; zero-shot models never saw any GIFT-Eval data, so the comparison is not apples-to-apples. ² Trained from scratch on real data; ~40% of batches additionally include an auxiliary distillation term from Chronos-2, computed on our own pretraining corpus only (details below).

Per-config, goia-forecast-nano-v0 is statistically indistinguishable from chronos_bolt_base (wins 55.7% of the 97 configs in CRPS), timesfm_2_0_500m (56.7%) and TempoPFN (56.7%) — win rates within binomial noise of a coin flip (p ≈ 0.1–0.2). Read it as per-config parity with models 8–100× larger; the aggregate geomean gap concentrates in a handful of configs discussed below.

Efficiency

Checkpoint size 18.9 MB (fp32 safetensors)
Batched GPU throughput ~14,100 series/s (batch 256, ctx 2048, horizon 1024, RTX 4090)
Single-series CPU latency 5.6 ms (ctx 2048, full 1024-step horizon)
Peak VRAM at inference 391 MB (batch 256, ctx 2048)

Measured with the benchmark cell in 06_export_and_inference.ipynb.

Sample forecasts

Qualitative demos, not evidence: AirPassengers is a 144-point classic that every model has effectively seen, and the hourly series belongs to our own pretraining corpus (in-distribution by construction). They show what the quantile bands look like in practice (median, q30–q70 and q10–q90; red dashed = held-out truth). Reproducible from 06_export_and_inference.ipynb; an external, post-corpus series is on the roadmap.

AirPassengers zero-shot forecast

Hourly corpus series, 192-step forecast

Where the gap is (and is not)

The aggregate gap to the top of the leaderboard decomposes in a way worth stating carefully:

  • Against supervised/fine-tuned models, on their own data. The worst per-config ratios look dramatic (solar/H/long is 70× the best submission) but the "best" there is crossformer — a model trained on that dataset's training split. On the same config our model beats seasonal naive by ~3× (CRPS ratio 0.31). The same pattern holds for jena_weather (0.18–0.28 vs naive; the rival is a fine-tuned Chronos-2 LoRA) and loop_seattle. This is the expected zero-shot vs supervised gap, concentrated in hourly data with strong deterministic seasonality — a 24- or 168-step season does not fit in an 8-token local-attention window at patch 16, which is the first thing the roadmap addresses.
  • Genuinely worse than naive: sub-minute frequencies. On bizitobs_application (10S) the CRPS ratio vs naive is ~1.5. Ten-second telemetry is essentially absent from the pretraining mix; this is a data-coverage failure, not a capacity one.
  • Same-class zero-shot models. FlowState-9.1M remains clearly ahead in aggregate (0.502 vs 0.553 CRPS) and TempoPFN slightly ahead (0.533), per-config parity with the latter notwithstanding. FlowState is the benchmark to beat at this size, and the roadmap items below are aimed at that gap.
  • Median vs quantiles. Aggregate MASE (0.815) lags CRPS (0.553) relative to peers: the quantile spread is well calibrated but the point forecast is the weaker component.

Architecture (brief)

Patch-based encoder-decoder over RevIN-normalized series: an adaptive multi-scale patch router (16/32/64, top-2) with spectral summary features, a stack of 6 dilated causal-conv blocks (dilations 1–32) with one local- and one global-attention block, and a cross-attention decoder that emits all 1024 future steps in one shot as 9 quantiles (0.1–0.9), sorted at inference to guarantee monotonicity. Native horizon 1024; longer horizons via median-feedback rollout.

Training data, distillation and credits

  • GiftEvalPretrain (Salesforce): ~90% of training windows. Disjoint by construction from the GIFT-Eval train/test data — no GIFT-Eval evaluation or training splits were used at any point.
  • TempoPFN synthetic corpus (University of Freiburg): ~7%.
  • KernelSynth (1M) synthetic series from the Chronos project (Ansari et al., 2024): ~3%.
  • Auxiliary teacher — Chronos-2 (Amazon, Apache-2.0): the ground-truth quantile loss is always present; 40% of batches (p_distill = 0.4) add a distillation term with L = L_gt + λ·L_teacher, λ = 0.7 — so the teacher term is 0.4·0.7 / (0.6 + 0.4·1.7) ≈ 22% of the total loss mass. Targets were produced by the teacher on our pretraining corpus only. On the teacher's side: according to its authors, Chronos-2 was trained on autogluon/chronos_datasets, Salesforce/GiftEvalPretrain and synthetic data, and its own GIFT-Eval leaderboard submission declares no test-data leakage — so no GIFT-Eval data reaches this model through the teacher either, to the best of anyone's public knowledge.
  • GIFT-Eval (Aksu et al., Salesforce) for the benchmark and leaderboard infrastructure.

Thanks to all of the above teams.

Why the last checkpoint, not the best

The released weights are model_last.pt (final step), not the best-on-validation checkpoint. Across our runs, later checkpoints generalized better on the external benchmark even when internal validation had plateaued: the validation set (held-out tails of the pretraining corpus) is not distributed like GIFT-Eval, so "best on val" overfits the corpus mix.

Install & use

pip install torch safetensors huggingface_hub
from inference import Forecaster

fc = Forecaster.from_pretrained("gredio/goia-forecast-nano-v0")
pred = fc.predict(series, horizon=96)      # series: list / numpy / pandas Series
pred.median                                 # point forecast
pred.q(0.1), pred.q(0.9)                    # prediction interval
fc.predict_df(series, horizon=96)           # DataFrame with future DatetimeIndex

inference.py is fully standalone (torch + safetensors + numpy) and also ships inside the HF repo:

from huggingface_hub import hf_hub_download
path = hf_hub_download("gredio/goia-forecast-nano-v0", "inference.py")

See 06_export_and_inference.ipynb for checkpoint conversion, worked examples with plots, the efficiency benchmark and HF publishing.

Repository layout

src/                      training package (model, trainer, data, distillation)
01_download.ipynb         download the pretraining corpora
02_process.ipynb          clean + pack into memory-mapped shards
03_precompute_teacher.ipynb   Chronos-2 quantile targets for distillation
04_training.ipynb         train (480k steps, bf16, single GPU)
05_evaluation.ipynb       GIFT-Eval benchmark + leaderboard comparison
06_export_and_inference.ipynb safetensors export, inference demo, benchmark, HF upload
inference.py              standalone inference (the file shipped with the weights)

Evaluation protocol

src/gift_eval_run.py mirrors the official GIFT-Eval notebooks: same 97 configs, same multivariate-to-univariate handling, same gluonts.evaluate_model settings (axis=None, mask_invalid_label=True, allow_nan_forecast=False, seasonality from get_seasonality) and the official metric set including mean_weighted_sum_quantile_loss over quantiles 0.1–0.9. As in the official Chronos-Bolt wrapper, the "mean" forecast key is the median, so MSE/RMSE columns are median-based; leaderboard rankings (CRPS/MASE) are unaffected.

Roadmap

  • Close the hourly gap vs supervised models: oversample H/10T (freq_alpha) and revisit the local-attention window vs long deterministic seasonalities.
  • Add sub-minute frequencies to the pretraining mix (the one place we are worse than naive).
  • Improve the median: raise loss_median_weight / the MASE auxiliary weight to fix the CRPS–MASE imbalance.
  • Distillation ablations (p_distill, λ_teacher) and a larger sibling (~15–25M) on the same pipeline.
  • An external post-corpus demo series; covariates; multivariate support.

Citation

@software{goia_forecast_nano_2026,
  title   = {goia-forecast-nano: a 4.73M-parameter time-series foundation model},
  author  = {{Gredio}},
  year    = {2026},
  url     = {https://github.com/gredio/goia-forecast},
  note    = {Zero-shot on GIFT-Eval; trained from scratch with auxiliary Chronos-2 distillation}
}

License

Code and weights: MIT. The teacher (Chronos-2) is Apache-2.0, which permits use of the model and its outputs, including for training derivative models, with attribution — which this document provides. The datasets above keep their own (permissive) licenses.

About

Tiny (4.73M) zero-shot time-series foundation model. 19 MB checkpoint, ~6 ms CPU inference, competitive on GIFT-Eval.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages