razvan commited on
Commit
db0f6e8
Β·
verified Β·
1 Parent(s): 1f32aed

Add comprehensive TimesFM analysis

Browse files
Files changed (1) hide show
  1. timesfm_analysis.md +166 -0
timesfm_analysis.md ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TimesFM: What It Is, What It's Good For, What It's Bad At, and How to Decide
2
+
3
+ ## The Architecture in 30 Seconds
4
+
5
+ TimesFM is a **decoder-only transformer where the "tokens" are patches of real-valued time series**, not discrete words. Think GPT, but instead of predicting the next word, it predicts the next chunk of a time series.
6
+
7
+ | Design Choice | Detail | Implication |
8
+ |---|---|---|
9
+ | **Tokenization** | Non-overlapping patches of 32 time points β†’ MLP β†’ 1280-dim embedding | Continuous values, no quantization. Contrast with Chronos which discretizes into bins. |
10
+ | **Asymmetric patches** | Input patch = 32 pts, Output patch = 128 pts | Generates 128 future steps per autoregressive step β†’ fast inference, but coarse for short series |
11
+ | **Attention** | Causal self-attention (each patch sees only past patches) | Standard GPT-style. No cross-series attention. |
12
+ | **Normalization** | RevIN (instance normalization by context mean/std) | Shallow stationarization. Does not handle structural breaks. |
13
+ | **Loss** | Quantile (pinball) regression | Produces point forecasts + experimental quantile heads. **Quantiles are NOT calibrated post-training.** |
14
+ | **Size** | v1.0: 200M params (20 layers) / v2.0: 500M (50 layers) / v2.5: 200M (HF-native) | Runs on a single GPU. Lightweight by LLM standards. |
15
+
16
+ ---
17
+
18
+ ## What It Was Trained On β€” And Why This Matters More Than Architecture
19
+
20
+ | Source | Scale | Character |
21
+ |---|---|---|
22
+ | **Wikipedia page views** | ~374 **billion** time points | Smooth, trend + weekly/annual seasonality |
23
+ | **Synthetic (ARMA + sines + trends)** | ~6B time points | Textbook stationary processes |
24
+ | **Google Trends** | ~537M | Search interest curves β€” smooth, seasonal |
25
+ | **M4 competition** | ~23M | Mixed-frequency competition data |
26
+ | **Electricity, traffic, weather, retail** | ~200M combined | Real-world but tiny fraction of training mix |
27
+
28
+ **The training distribution is overwhelmingly smooth consumer-web engagement data.** This is the single most important fact for deciding if TimesFM will work for you. The model has an extraordinary prior on trend-plus-seasonality patterns. It has a weak prior on everything else.
29
+
30
+ v2.0 added subsets of the LOTSA corpus (cloud VMs, ERA5 weather, buildings energy), broadening domain coverage β€” but financial return data, clinical vitals, industrial sensor anomalies, and log-scale series remain **absent from pretraining**.
31
+
32
+ ---
33
+
34
+ ## Where It's Genuinely Good
35
+
36
+ ### 1. Zero-shot univariate forecasting at scale
37
+ You have 50,000 SKUs, each with 2 years of daily sales. You need a forecast tomorrow. No time to train. TimesFM gives you a competitive point forecast in seconds per series, with zero training. On the GIFT-Eval benchmark (the most rigorous, contamination-controlled evaluation available), **TimesFM ranks #1 in the Economic/Finance domain** for point forecasts.
38
+
39
+ ### 2. Rapid prototyping / establishing a baseline
40
+ Before committing to a supervised model, run TimesFM zero-shot. If it's already 90% as good as your production model, that tells you something about the information content of your features. If it's terrible, that tells you the series distribution is far from its training corpus.
41
+
42
+ ### 3. Medium-horizon, sub-daily granularity
43
+ Its training data density is highest at hourly/daily frequencies. Forecast horizons of 1–512 steps in this regime is its sweet spot.
44
+
45
+ ### 4. Fine-tuning with small domain data
46
+ Standard transformer β†’ LoRA adapters work. With 1k–10k domain series, fine-tuning is well-documented and significantly boosts performance over zero-shot (demonstrated in medical, energy, and retail domains).
47
+
48
+ ### 5. Compute-constrained deployment
49
+ 200M params, Apache 2.0 license, v2.5 ships natively in `transformers`. Inference is fast. This is a real engineering advantage over Moirai-Large or Chronos-Large.
50
+
51
+ ---
52
+
53
+ ## Where It Fails β€” The Hard Constraints
54
+
55
+ ### ❌ 1. Strictly Univariate β€” No Cross-Series Modeling
56
+ Each series is processed independently. There is **zero cross-asset attention**. No covariates (holidays, promotions, macro factors). The paper explicitly states: *"Currently the model is not pretrained with covariates."*
57
+
58
+ **For a quant**: If your signal comes from cross-sectional relationships (pairs trading, factor models, lead-lag), TimesFM cannot see them. Period.
59
+
60
+ ### ❌ 2. Uncalibrated Uncertainty
61
+ The quantile heads are experimental and the model card explicitly warns they are *"not calibrated after pretraining."* If you need VaR, prediction intervals for safety stock, or any decision that depends on the tails of the forecast distribution β€” **do not trust TimesFM's uncertainty estimates**. Use Chronos (cross-entropy loss over discrete bins β†’ naturally calibrated) or add a conformal prediction wrapper post-hoc.
62
+
63
+ ### ❌ 3. Financial Return Prediction
64
+ The most damning evidence: a comprehensive 2025 study ([arxiv:2511.18578](https://arxiv.org/abs/2511.18578)) tested zero-shot TimesFM on daily excess-return prediction across **94 countries, 1990–2023**. Result: **underperforms XGBoost, CatBoost, and LightGBM** on RΒ²_OOS, directional accuracy, and F1. Fine-tuning helps modestly but still doesn't beat tree ensembles. Pre-training from scratch on financial data helps significantly β€” confirming the domain mismatch hypothesis.
65
+
66
+ **Translation**: The model learned "how Wikipedia page views behave." Financial returns are a fundamentally different DGP β€” low SNR, heavy tails, regime switches, non-stationarity. The pretrained prior doesn't help and may actively hurt.
67
+
68
+ ### ❌ 4. Structural Breaks / Regime Change
69
+ RevIN normalizes by context mean and std. If the DGP changes mid-context (COVID shock, rate regime change, mean reversion β†’ trending), the model treats pre- and post-break data uniformly. There is no mechanism for break detection or regime-conditional forecasting.
70
+
71
+ ### ❌ 5. Context Window at High Frequencies
72
+ - v1.0: max 512 points, v2.0: max 2048 points
73
+ - At 1-second resolution: 2048 points = **34 minutes of history**
74
+ - At tick-level: essentially useless
75
+ - Even at 1-minute bars: 2048 points β‰ˆ 1.4 trading days
76
+
77
+ ### ❌ 6. Irregular / Event-Driven Series
78
+ v2.0 handles NaN via linear interpolation before inference β€” a crude band-aid. Transaction data with variable gaps, clinical vitals with missing readings, event-triggered sensor logs all need careful preprocessing that may destroy the signal.
79
+
80
+ ### ❌ 7. Exponential Growth
81
+ Training data is dominated by linear/polynomial trends and ARMA processes. Exponential dynamics (cumulative infection curves, viral growth, compound returns) are underrepresented. Log-transform your data if this applies.
82
+
83
+ ---
84
+
85
+ ## The Benchmark Contamination Problem
86
+
87
+ This is critical and often ignored: TimesFM's training corpus (Wikipedia, Google Trends, M4, ETT) **overlaps with standard benchmarks**. A dedicated paper ([arxiv:2510.13654](https://arxiv.org/abs/2510.13654)) identifies that published zero-shot numbers for TimesFM, Chronos, and Moirai all suffer from potential information leakage. **All published zero-shot numbers should be read with a 10–20% skepticism discount.** Run your own held-out evaluation.
88
+
89
+ ---
90
+
91
+ ## The Competitive Landscape (Mid-2025)
92
+
93
+ | Model | Probabilistic? | Multivariate? | Key Advantage Over TimesFM |
94
+ |---|---|---|---|
95
+ | **Chronos / Chronos-2** (Amazon) | βœ… Calibrated | βœ… (v2) | Calibrated uncertainty; v2 adds multivariate + covariates |
96
+ | **Moirai / Moirai-2.0** (Salesforce) | βœ… Mixture dist | βœ… (v1) / ❌ (v2) | Wins GIFT-Eval overall; Moirai-2.0 is 30Γ— smaller at similar accuracy |
97
+ | **Moirai-MoE** (Salesforce) | βœ… | ❌ | No frequency heuristic needed β€” token-level specialization via sparse MoE |
98
+ | **Lag-Llama** (Academic) | βœ… Student-t | ❌ | Lag features for long-range dependencies |
99
+ | **TabPFN-v2** (Prior-Data Fitted Networks) | N/A | N/A | **Beats all TSFMs on GIFT-Eval** when time series is framed as tabular prediction with lag features |
100
+
101
+ That last row is the most sobering: a tabular foundation model with engineered lag features outperforms every time series foundation model on the most rigorous benchmark. The implication is that **feature engineering + a strong tabular model remains an extremely competitive baseline** for many forecasting tasks.
102
+
103
+ ---
104
+
105
+ ## How to Decide If TimesFM Will Work for Your Use Case
106
+
107
+ ```
108
+ 1. Is your problem fundamentally multivariate or covariate-driven?
109
+ β”œβ”€ YES β†’ Stop. Use Chronos-2, Moirai, TFT, or a supervised model.
110
+ └─ NO (each series is self-contained) β†’ Continue
111
+
112
+ 2. Do you need calibrated prediction intervals?
113
+ β”œβ”€ YES β†’ Use Chronos (or add conformal prediction to TimesFM).
114
+ └─ NO (point forecast sufficient) β†’ Continue
115
+
116
+ 3. Is your target variable financial returns / alpha signal?
117
+ β”œβ”€ YES β†’ Use XGBoost/CatBoost/LightGBM with lag features.
118
+ β”‚ TSFMs empirically lose here across 94 countries.
119
+ └─ NO β†’ Continue
120
+
121
+ 4. Is your series regular, contiguous, and β‰₯32 data points?
122
+ β”œβ”€ NO β†’ Heavy preprocessing needed. Consider alternatives.
123
+ └─ YES β†’ Continue
124
+
125
+ 5. Does your series exhibit smooth trend + seasonality
126
+ (like web traffic, retail demand, energy consumption)?
127
+ β”œβ”€ YES β†’ TimesFM is likely excellent. Run zero-shot first.
128
+ └─ NO (chaotic, heavy-tailed, structural breaks) β†’ Expect degradation.
129
+ Fine-tune on domain data or use supervised models.
130
+
131
+ 6. Is your context window sufficient?
132
+ β”œβ”€ Need >2048 points of history β†’ TimesFM v2.0 won't fit it.
133
+ └─ ≀2048 β†’ Continue
134
+
135
+ 7. Practical test: Run TimesFM zero-shot on a held-out sample.
136
+ Compare against:
137
+ (a) Seasonal naΓ―ve baseline
138
+ (b) XGBoost with lag features
139
+ (c) Chronos zero-shot
140
+ If TimesFM beats (a) and is within 10% of (b),
141
+ it's a viable production candidate.
142
+ ```
143
+
144
+ ---
145
+
146
+ ## The Bottom Line
147
+
148
+ TimesFM is a **fast, lightweight, zero-shot point-forecast engine with a strong prior on smooth, seasonal, consumer-internet-style time series**. It pioneered the decoder-only patched architecture that every subsequent TSFM has adopted. For univariate demand forecasting, KPI monitoring, web traffic, and energy consumption β€” it's an excellent starting point.
149
+
150
+ Its three **structural limitations** that no amount of scaling will fix: (1) univariate-only, (2) uncalibrated uncertainty, (3) training distribution dominated by Wikipedia/Google Trends rather than your domain. For financial return prediction specifically, the empirical evidence is clear: it loses to tree-based models with lag features.
151
+
152
+ **The sharpest insight**: If your series "looks like Wikipedia traffic" β€” regular frequency, trend + seasonality, medium noise β€” TimesFM will probably work well zero-shot. If it doesn't look like that, treat TimesFM as a feature extractor or a fine-tuning base, not a finished product.
153
+
154
+ ---
155
+
156
+ ## Essential References
157
+
158
+ | Resource | What It Contains |
159
+ |---|---|
160
+ | [arxiv:2310.10688](https://arxiv.org/abs/2310.10688) | Original TimesFM paper (ICML 2024); Sections 4 (architecture), 5 (training data), A.1 (limitations) |
161
+ | [arxiv:2403.07815](https://arxiv.org/abs/2403.07815) | Chronos paper; Section 5.7 has qualitative failure mode analysis across TSFMs |
162
+ | [arxiv:2410.10393](https://arxiv.org/abs/2410.10393) | GIFT-Eval benchmark; Table 6 has domain-level breakdown of all models |
163
+ | [arxiv:2510.13654](https://arxiv.org/abs/2510.13654) | Information leakage in TSFM benchmarking β€” critical for trusting published numbers |
164
+ | [arxiv:2511.18578](https://arxiv.org/abs/2511.18578) | Finance-specific evaluation; zero-shot TSFMs beaten by tree models |
165
+ | [arxiv:2410.10469](https://arxiv.org/abs/2410.10469) | Moirai-MoE; articulates the frequency-embedding coarseness problem in TimesFM |
166
+ | [arxiv:2501.02945](https://arxiv.org/abs/2501.02945) | TabPFN-v2; tabular model that beats all TSFMs on GIFT-Eval |