Tafsut adapter for external factors in time series forecasting
2 min readupdated
A compact 50.3M parameter adapter from Tafsut-FM that teaches time series forecasting models to account for external factors—covariates (additional variables from the past and known future, such as days of the week, promotions, or holidays). It takes the target series history and up to 16 covariates as input, and refines the forecast in original units for 9 quantiles at once (from q0.1 to q0.9). Unlike narrow monolithic solutions, the adapter works not only with its base Tafsut-FEV model, but also plugs into external backbones like Chronos-2 or TimesFM 2.5. Useful for analysts and ML engineers working on demand, sales, and planning tasks where calendars and external events influence the results.
Key features
- Up to 16 covariates and long context: processes up to 8,192 history steps (the base Tafsut-FEV model handles up to 32,768 steps) and supports handling missing values marked as NaN.
- Compatibility with external backbones: tested with TiRex-2, Chronos-2, t0-beta, Toto 2.0 313M, TiRex, TimesFM 2.5, and Granite PatchTST-FM-r2.
- Flexible quantile handling: when all 9 deciles are supplied, it uses trained intervals, and when three anchors (q0.1, q0.5, q0.9) are provided, it refines them and linearly interpolates the rest.
- Lightweight and open license: takes 50.3M parameters, runs even on a CPU, and is distributed under the MIT license.
What you can do
- Forecast retail sales: feed revenue history along with known store schedules, promotions, and holiday calendars for a horizon from 1 to 1,024 steps.
- Improve existing pipelines on Chronos-2 or TimesFM 2.5: pass the base univariate quantile forecast through the
adapter.refine()method to add calendar and external features without retraining the main model.
Example
import torch
from tafsut import TafsutAdapter, TafsutModel, forecast
model = TafsutModel.from_pretrained("Tafsut-FM/tafsut-fev", device="cpu")
adapter = TafsutAdapter.from_pretrained("Tafsut-FM/tafsut-adapter", device="cpu")
pred = forecast(model, history, horizon=24, adapter=adapter,
past_covariates=weekday, future_covariates=future_weekday)
print(pred.shape) # (1, 24, 9)
Read more
DetailsMetrics: the Tafsut-FEV + adapter combination (evaluated on 42 FEV-Bench tasks with dynamic covariates out of 100) achieved 36.43% MASE skill and 47.77% SQL skill across 235,039 windows.
Training: trained on the FEV corpus with synthetic dependency drivers.
Limitations: supports quantile forecasts only (point models must first build a distribution for the anchors), horizontal limit for external models is 1,024 steps.










Comments