TimesFM 2.5 (Google Foundation Model)
Pre-trained time series transformer with fine-tuning and quantile predictions
Overview
- ID:
timesfm-2.5-finetune-gpu - Type: Time series forecasting (foundation model)
- Architecture: Decoder-only transformer (200M parameters)
- Checkpoint:
google/timesfm-2.5-200m-pytorch - Context: Up to 16,384 time points
- Horizon: Up to 1,024 steps ahead
- Quantiles: 10 quantile heads (q10 through q90)
- Training time: 5-30 minutes (fine-tuning)
- GPU required: Yes (~4 GB VRAM)
TimesFM 2.5 is Google Research's time series foundation model. It works out of the box (zero-shot) and can be fine-tuned on your data for better accuracy.
timesfm-2.5-finetune-gpu is currently a candidate template. Check the live catalog (GET /api/builder/v1/inference/models?category=time_series) for its current status.
When to Use
Perfect for:
- Financial time series (stocks, crypto, forex)
- High-frequency data (minute-level, hourly)
- When you need prediction intervals (quantiles)
- Complex patterns that classical models miss
- Large datasets (1k+ data points)
Not ideal for:
- Very small datasets (< 100 points) -- use Classical Forecasting
- When interpretability is critical (use Prophet/ARIMA)
Quick Start
Fine-Tuning
from colabhive import ColabHive
client = ColabHive(api_key="...", account_id="...")
dataset = client.datasets.upload("btc_prices", "./btc_daily.csv")
job = client.training.create(
model="timesfm-2.5-finetune-gpu",
dataset_id=dataset.id,
hyperparameters={
"target_column": "close",
"covariate_columns": ["open", "high", "low", "volume"],
"date_column": "date",
"context_len": 1024,
"horizon_len": 12,
"epochs": 10,
"learning_rate": 1e-4,
"batch_size": 8,
"quantiles": True,
}
)
job.wait()
print(job.get_metrics()) # e.g. {"eval_mae": ..., "eval_mse": ...}
Register for Inference
endpoint = client.training.register_for_inference(
run_id=job.id,
name="btc-forecast",
description="BTC price forecasting (TimesFM 2.5 fine-tuned)",
visibility="account",
)
Run Inference
result = client.endpoints.infer(
endpoint_id=endpoint.endpoint_id,
input_data={
"values": [42000, 42500, 41800, 43000, 42700, ...],
"horizon": 12,
},
)
Response Format
{
"forecasts": [43100.5, 43250.2, 43180.7, ...],
"model_type": "TimesFM-2.5",
"horizon": 12,
"quantiles": {
"mean": [43100.5, 43250.2, ...],
"q10": [42800.1, 42900.3, ...],
"q20": [42900.2, 43000.5, ...],
"q30": [42950.3, 43050.7, ...],
"q40": [43020.4, 43150.1, ...],
"q50": [43100.5, 43250.2, ...],
"q60": [43180.6, 43350.4, ...],
"q70": [43260.7, 43450.6, ...],
"q80": [43340.8, 43550.8, ...],
"q90": [43420.9, 43650.0, ...]
}
}
Dataset Format
CSV Format
date,open,high,low,close,volume
2024-01-01,42000,42500,41800,42300,1500000
2024-01-02,42300,43000,42100,42700,1800000
2024-01-03,42700,42900,42200,42500,1200000
Requirements
- Date column: Date or datetime (name it via
date_column) - Target column: Numeric column to forecast (via
target_column) - Min 200 points (recommended 1000+)
- Covariate columns are optional but improve accuracy
Hyperparameters
| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
target_column | string | "close" | -- | Column to forecast |
covariate_columns | list | [] | -- | Additional feature columns |
date_column | string | "ds" | -- | Date/time column name |
context_len | int | 1024 | 32-16384 | History window length |
horizon_len | int | 128 | 1-1024 | Forecast steps ahead |
learning_rate | float | 1e-4 | 1e-6 to 1e-3 | Fine-tuning learning rate |
epochs | int | 10 | 1-100 | Number of training epochs |
batch_size | int | 8 | 1-64 | Training batch size |
quantiles | bool | true | -- | Enable quantile head (q10-q90) |
How It Works
-
Pre-trained Model: TimesFM 2.5 was trained by Google Research on a massive corpus of time series data (ICML 2024 paper). It understands temporal patterns out of the box.
-
Fine-Tuning: The system creates sliding windows of
(context_len, horizon_len)from your dataset, then fine-tunes the decoder using MSE loss with AdamW optimizer and cosine LR scheduling. -
Inference: The fine-tuned model receives a history window and outputs point forecasts + quantile intervals. The horizon is always respected exactly.
-
Quantiles: When enabled, the model produces 10 prediction intervals (q10 through q90), giving you confidence bounds on the forecast.
Comparison with Classical Forecasting
| Feature | TimesFM 2.5 | Classical (Prophet/ARIMA/ETS) |
|---|---|---|
| Type | Foundation model (200M params) | Statistical models |
| Training | Fine-tune pre-trained transformer | Fit from scratch |
| Context | Up to 16k points | Unlimited |
| Quantiles | Native (q10-q90) | Limited (Prophet only) |
| Speed | 5-30 min fine-tuning | 1-10 min |
| Accuracy | Higher on complex patterns | Good on seasonal data |
| GPU | Required (4GB+) | Required (6GB+) |
| Best for | Finance, high-freq, complex | Sales, demand, simple seasonal |
Tips
- Context length: Use the largest context that fits your data. More context = better pattern recognition.
- Learning rate: Start with 1e-4. If loss doesn't decrease, try 1e-5. If it oscillates, try 3e-5.
- Epochs: 5-15 is usually sufficient. The system saves the best checkpoint automatically.
- Batch size: 8 works well for most cases. Increase to 16-32 for larger datasets.
- Quantiles: Always enable them -- they give you prediction intervals at no extra cost.
- Covariates: Adding related columns (e.g. volume for price prediction) can significantly improve accuracy.
References
Next Steps
- Classical Forecasting - statistical alternative
- All Models