asteinh commited on
Commit
807c1c3
·
0 Parent(s):

TinyCast v1.0.0: weights and model card

Browse files
Files changed (5) hide show
  1. .gitattributes +1 -0
  2. .gitignore +2 -0
  3. README.md +210 -0
  4. config.json +31 -0
  5. model.safetensors +3 -0
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ .DS_Store
2
+ __pycache__/
README.md ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: tinycast
4
+ pipeline_tag: time-series-forecasting
5
+ datasets:
6
+ - Salesforce/GiftEvalPretrain
7
+ tags:
8
+ - time-series
9
+ - time-series-forecasting
10
+ - foundation-model
11
+ - attention-free
12
+ - gift-eval
13
+ - edge
14
+ - streaming
15
+ - quantization
16
+ ---
17
+
18
+ # TinyCast
19
+
20
+ **Probabilistic zero-shot forecasting at 146,505 parameters: the smallest GIFT-Eval entry that
21
+ publishes per-configuration results and declares no leakage.**
22
+
23
+ TinyCast forecasts a series it has never seen, with no fitting and no fine-tuning, and returns nine
24
+ quantiles rather than a single number. It is attention-free, and it computes each context's
25
+ periodicity instead of learning it, so no capacity is spent rediscovering seasonality.
26
+
27
+ **Below 1.4 M parameters it is the only zero-shot model on the GIFT-Eval board that emits a
28
+ predictive distribution**, and it fits on a microcontroller.
29
+
30
+ | | |
31
+ |---|---|
32
+ | **Paper** | https://arxiv.org/abs/2608.15767 |
33
+ | **Code, training and replication** | https://github.com/raws-labs/tinycast |
34
+ | **Parameters** | 146,505 (fp32 weights, about 0.6 MB) |
35
+ | **GIFT-Eval, zero-shot** | 0.774 nGMASE, 0.545 nWQL, 0.554 nMSIS over 97 configurations |
36
+ | **On a Cortex-M7** | 138.1 KiB INT8 weights, 730.7 KiB peak RAM, 4.08 s per call ([firmware profile](#on-device), 0.833 nGMASE) |
37
+ | **License** | Apache-2.0 |
38
+
39
+ ## GIFT-Eval results (zero-shot)
40
+
41
+ | Metric | Value |
42
+ |--------|-------|
43
+ | **nGMASE** (point accuracy) | **0.774** |
44
+ | **nWQL** (probabilistic accuracy) | **0.545** |
45
+ | **nMSIS** (interval score) | **0.554** |
46
+
47
+ All three are geometric means, over the 97 benchmark configurations, of the ratio between the
48
+ model's metric and the seasonal-naive reference's; 1.000 is parity with seasonal naive. Every number
49
+ on this page comes from one profile: bf16 autocast at compute, flip-invariance symmetrization and
50
+ period-alignment downsampling, which the reproduction command below runs.
51
+
52
+ **Below 1.4 M parameters, no zero-shot model on the board emits a predictive distribution** (counting
53
+ models with a public per-configuration result and no declared test-data leakage, as the table below
54
+ does). TinyCast emits nine quantiles at 146,505 parameters, so below that size the probabilistic
55
+ frontier does not exist until this model defines it. Every board model that scores below TinyCast's
56
+ nWQL of 0.545 carries at least 1.4 M parameters: TTM-R3 spends about 10 times the budget for 0.026 of
57
+ nWQL, and FlowState-9.1M spends 62 times for 0.043. The two smaller models emit point forecasts only,
58
+ and the nearest model in that family that emits quantiles carries eighteen times TinyCast's
59
+ parameters.
60
+
61
+ Point accuracy extends the same frontier by scaling. TinyCast is smaller than every zero-shot model
62
+ on the board with a public per-configuration result and no declared test-data leakage, and it is
63
+ level with the smallest of them at three quarters of its parameters: 0.774 nGMASE against
64
+ Reverso-Nano's 0.760, a gap that does not survive resampling by base dataset.
65
+
66
+ Against every zero-shot model on the board up to 10 M parameters with a public per-configuration
67
+ result and no declared leakage, recomputed from one pinned snapshot against the same reference:
68
+
69
+ | Model | Params | nGMASE | nWQL | Predictive distribution |
70
+ |---|---:|---:|---:|:---:|
71
+ | **TinyCast** | **146 K** | 0.774 | **0.545** | yes |
72
+ | Reverso-Nano | 200 K | 0.760 | (0.661) | no |
73
+ | Reverso-Small | 550 K | 0.726 | (0.626) | no |
74
+ | TTM-R3 | 1.4 M | 0.724 | 0.520 | yes |
75
+ | Reverso | 2.6 M | 0.711 | (0.610) | no |
76
+ | Toto-2.0-4m | 4.1 M | 0.757 | 0.524 | yes |
77
+ | YingLong-6m | 7.3 M | 0.880 | 0.609 | yes |
78
+ | FlowState-9.1M | 9.1 M | 0.726 | 0.502 | yes |
79
+ | Kairos-10m | 9.9 M | 0.753 | 0.554 | yes |
80
+
81
+ The Reverso models emit no predictive distribution, so their nWQL column is a point error and is not
82
+ comparable with the rest; it is parenthesized for that reason.
83
+
84
+ **Other benchmarks.** On Chronos-ZS (27 tasks) TinyCast reaches relative MASE 0.880 and relative WQL
85
+ 0.722; on fev-bench (100 tasks) relative MASE 0.819, relative WQL 0.658 and a skill score of 0.304.
86
+ On both, every neural model ahead of it carries at least 28 times its parameters. Each benchmark
87
+ normalizes over its own dataset set, so these aggregates are not comparable with the GIFT-Eval
88
+ figures above.
89
+
90
+ ## Model description
91
+
92
+ | | |
93
+ |---|---|
94
+ | Backbone | 10 dilated causal Conv1d blocks, kernel 3, dilations doubling from 1 to 512 (receptive field 2047 over a context of 2048) |
95
+ | Efficiency | depthwise-separable convolutions, one SwiGLU feed-forward ALBERT-tied across all ten blocks |
96
+ | Structural prior | Fisher's significance test for harmonic analysis on the normalized periodogram, alpha 0.05, up to four periods, zero parameters, then a 16-bin phase fold |
97
+ | Decoder | pooled summary, phase-gather seasonal profile and a causal future-conv correction; nine decile quantiles |
98
+ | Normalization | per-context min-max over the observed history, inverted on the output |
99
+ | Context / horizon | context 2048; forecasts in blocks of 48 steps, rolled out autoregressively (evaluated to 720) |
100
+ | Attention | none |
101
+ | Working memory | bounded per-layer ring buffers that do not grow as the model runs; causal padding, so a per-step streaming variant is exact rather than approximate |
102
+
103
+ Every learned operation is a convolution, a matrix multiplication or a normalization, so the model
104
+ exports to a static INT8 graph and runs a forecast end to end on an embedded device.
105
+
106
+ ### On device
107
+
108
+ Deployed on an STM32H753 (Arm Cortex-M7) development board as a static W8A8 graph with quantization
109
+ scales calibrated once and frozen. Single core, no neural accelerator, no off-chip memory.
110
+
111
+ | | |
112
+ |---|---|
113
+ | INT8 matrix and convolution coefficients | 138.1 KiB |
114
+ | Complete firmware image, including an 8 KiB context | 365.5 KiB |
115
+ | Peak RAM (statics, heap, stack high-water) | 730.7 KiB |
116
+ | One core call at a 2048-step context | 4.08 s |
117
+
118
+ The board runs the **firmware configuration**, which scores **0.833 nGMASE and 0.581 nWQL**, not the
119
+ 0.774 / 0.545 headlined above: it executes INT8 and drops both inference-time strategies.
120
+ Quantization alone, with the strategies kept, costs 2.1% of aggregate point accuracy over all 97
121
+ configurations.
122
+
123
+ **Training data.** Pretrained once on GIFT-Eval-Pretrain with every dataset overlapping the GIFT-Eval
124
+ and Chronos-ZS test sets removed, plus Chronos KernelSynth and four synthetic shards. No per-dataset
125
+ fine-tuning: all results above are zero-shot.
126
+
127
+ ## Files
128
+
129
+ - `model.safetensors`: 146,505 fp32 parameters, about 0.6 MB. The weight-tied feed-forward is stored
130
+ once, so counting parameters by summing a loaded `state_dict()` overcounts; instantiate from the
131
+ config instead.
132
+ - `config.json`: the `TinyCastConfig` the loader rebuilds the architecture from.
133
+
134
+ ## Usage
135
+
136
+ There is no PyPI package. Install from this repository:
137
+
138
+ ```bash
139
+ git clone https://github.com/raws-labs/tinycast.git
140
+ cd tinycast && pip install -e .
141
+ ```
142
+
143
+ Load the weights:
144
+
145
+ ```python
146
+ from huggingface_hub import hf_hub_download
147
+ from tinycast import load_model
148
+
149
+ weights = hf_hub_download("raws-labs/tinycast", "model.safetensors")
150
+ hf_hub_download("raws-labs/tinycast", "config.json") # sibling, picked up automatically
151
+
152
+ model, config = load_model(weights) # TinyCastForPrediction, 146,505 params
153
+ ```
154
+
155
+ Forecast with the gluonts predictor these results were produced with:
156
+
157
+ ```python
158
+ from tinycast import TinyCastPredictor
159
+
160
+ predictor = TinyCastPredictor(prediction_length=48, checkpoint_path=weights,
161
+ freq="H", domain="Energy", device="cpu")
162
+ forecasts = predictor.predict(test_input) # QuantileForecasts, nine deciles
163
+ ```
164
+
165
+ Reproduce the table above. The GIFT-Eval data loader is a separate install, needed only by the
166
+ benchmark driver; note that its distribution name and its import name differ:
167
+
168
+ ```bash
169
+ pip install "salesforce-gift-eval @ git+https://github.com/SalesforceAIResearch/gift-eval.git"
170
+
171
+ export GIFT_EVAL=/path/to/gift-eval
172
+ python -m tinycast.eval --ckpt model.safetensors --flip \
173
+ --device cuda --output all_results.csv
174
+ ```
175
+
176
+ The repository README documents the thread caps that keep this from running many times slower, and
177
+ everything else that moves the numbers. It also covers the training recipe, checkpoint averaging and
178
+ export, and the synthetic-corpus builder, all of which ship in the same package.
179
+
180
+ ## Intended use and limitations
181
+
182
+ TinyCast is built for forecasting a univariate signal on hardware that was not chosen for machine
183
+ learning, where a per-signal model would have to be fitted and maintained for every deployment.
184
+
185
+ - It is univariate. It uses no covariates and no cross-series structure, so a task that supplies
186
+ either will be forecast without them.
187
+ - The model emits no signal when its input leaves the regime its pretraining covers, so degradation
188
+ there is silent.
189
+ - The period comes from a rounded FFT bin, so its resolution falls as the ratio of window to period
190
+ falls: about seven percent for a weekly cycle in hourly data.
191
+ - Min-max normalization is per context window and therefore sensitive to a single extreme value.
192
+ - Fresh deployments degrade toward the seasonal-naive baseline rather than failing: parity at 64
193
+ observed samples, and two thirds of the way back to full-context accuracy by 512.
194
+
195
+ ## License
196
+
197
+ Apache-2.0. Third-party attributions are in the code repository's `NOTICE`.
198
+
199
+ ## Citation
200
+
201
+ ```bibtex
202
+ @misc{tinycast2026,
203
+ title = {TinyCast: Probabilistic Zero-Shot Forecasting with Computed Periodicity},
204
+ author = {Armin Steinhauser},
205
+ year = {2026},
206
+ eprint = {2608.15767},
207
+ archivePrefix = {arXiv},
208
+ primaryClass = {cs.LG}
209
+ }
210
+ ```
config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "quantiles": [
3
+ 0.1,
4
+ 0.2,
5
+ 0.3,
6
+ 0.4,
7
+ 0.5,
8
+ 0.6,
9
+ 0.7,
10
+ 0.8,
11
+ 0.9
12
+ ],
13
+ "seq_len": 2048,
14
+ "output_token_len": 48,
15
+ "top_k_periods": 4,
16
+ "significance_alpha": 0.05,
17
+ "n_harmonics": 1,
18
+ "conv_dim": 64,
19
+ "n_layers": 10,
20
+ "kernel_size": 3,
21
+ "ffn_mult": 1.0,
22
+ "pool_kind": "mean_last",
23
+ "causal": true,
24
+ "phase_bins": 16,
25
+ "decoder_depth": 1,
26
+ "separable_conv": true,
27
+ "share_ffn": true,
28
+ "future_conv": true,
29
+ "future_conv_layers": 6,
30
+ "future_conv_seed": 128
31
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e436c98bd9c8b62b866ccbdfc5ceea4552eac26e05928b57b269ff2813312e81
3
+ size 602044