Skip to main content

TS-ICL: A Flexible Time-Index Foundation Model for Time Series via In-Context Learning

Project description

TS-ICL architecture

TS-ICL: a Time-Indexed Foundation Model for Time Series Forecasting & Imputation via In-Context Learning

arXiv PyPI test Python

Paper: TS-ICL: A Flexible Time-Indexed Foundation Model for Time Series via In-Context Learning

TS-ICL is a continuous probabilistic Time Series Foundation Model (TSFM) that unifies forecasting and imputation in a single zero-shot architecture, requiring no task-specific training or fine-tuning.

TS-ICL architecture

Installation

pip install tsicl

Model checkpoint can be found on TS-ICL's Huggingface repo.

Requirements: Python ≥ 3.12, PyTorch ≥ 2.5.1


Quick Start

from tsicl import TSICL

model = TSICL(model_path="checkpoints/tsicl-v1.ckpt")

# Forecasting — predict the next 96 timesteps
point, quantiles = model.forecast(
    inputs            = my_series,        # e.g. 1-D numpy array or tensor
    prediction_length = 96,
    quantile_levels   = [0.1, 0.5, 0.9],
    denormalize       = True
)

# Imputation — reconstruct NaN values
point, quantiles = model.impute(
    inputs          = my_series_with_nans,
    quantile_levels = [0.1, 0.5, 0.9],
    denormalize     = True
)

Both methods return a (point_prediction, quantile_predictions) tuple. NaN values are handled natively — no preprocessing required.


Notebooks

Step-by-step tutorials on synthetic Gaussian Processes:

Notebook Description
get_started_imputation.ipynb Pointwise & block missingness, covariate-aware imputation, output format, batch processing
get_started_forecasting.ipynb Univariate forecasting, partially observed look-back, covariate-aware forecasting, batch processing

Model

TS-ICL processes each time series through four successive modules:

  1. Time Series Encoder — a Perceiver-like architecture that compresses observed (timestamp, value) pairs into M = 32 learnable latent tokens via cross-attention. Accepts inputs of arbitrary length without preprocessing.
  2. Channel Mixer — aggregates information across channels via cross-attention. Selectively integrates covariate representations into the target's representation when covariates are provided.
  3. Temporal Context Query Module — maps any query timestamp to a context-aware embedding using Fourier (NeRF-style) positional encoding. Enables prediction at arbitrary timestamps, including on irregular grids.
  4. In-Context Regressor — a causal Transformer that reads observed (representation, value) pairs as in-context training examples and outputs 99 quantiles at the queried timestamps.

A single checkpoint (tsicl-v1.ckpt) contains two specialised components — one trained with masking for imputation, one with causal masking for forecasting — sharing the same architecture backbone.


Performance

Forecasting — fev-bench

TS-ICL is highly competitive with the best forecasting foundation models, while being fast at inference. TS-ICL efficently leverages covariate (when relevant) and is also robust to sparse look-back windows.

fev-bench results

Example — pointwise forecast with a known covariate (GFC17 dataset):

Forecast with covariate example

Forecasting — TIME benchmark

TIME benchmark results

Imputation — fm-impute-bench

TS-ICL achieves state-of-the-art imputation across 132 univariate and 24 covariate-aware tasks, outperforming the best tabular foundation model baseline while being ~50× faster at inference.

fm-impute-bench results

Example — block imputation with uncertainty quantification (COVID-19 energy dataset):

Block imputation with uncertainty quantification example

Citation

If you use TS-ICL for research purposes, please consider citing the associated paper:

@article{lenaour2026tsicl,
  title={TS-ICL: A Flexible Time-Indexed Foundation Model for Time Series via In-Context Learning},
  author={Le Naour, Etienne and Nabil, Tahar and Petralia, Adrien},
  journal={arXiv preprint arXiv:2606.05878},
  year={2026}
}

Contributors


License

TS-ICL weights and code are released under a non-commercial license, see LICENSE.

Contact

To learn more or request a commercial license, please contact us at: tsicl-contact_at_edf.fr (replace _at_ with @).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsicl-0.1.1.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsicl-0.1.1-py3-none-any.whl (76.3 kB view details)

Uploaded Python 3

File details

Details for the file tsicl-0.1.1.tar.gz.

File metadata

  • Download URL: tsicl-0.1.1.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tsicl-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fc026d17317e15d171ba03244d523378a75f2f0c874ad5f6974837e7af3b671c
MD5 7857fea07a09cf9f282dde2ea2989374
BLAKE2b-256 55e6d6e5ee79d0f1b43b85ff00f24becad02dd6057a9358446fcdbb95ff7dc17

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsicl-0.1.1.tar.gz:

Publisher: publish.yml on EDF-Lab/ts-icl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsicl-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tsicl-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 76.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tsicl-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5336b54551ec7c7073c04c1e436dbbc24d9e250286a61997b75d49d42eaac42a
MD5 61437d5d614120a4bb945a2f7ac9672b
BLAKE2b-256 77f298efea49d59ddde98113e55069181c95b7c59a3d81ad98191e1e5a158163

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsicl-0.1.1-py3-none-any.whl:

Publisher: publish.yml on EDF-Lab/ts-icl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page