Official code for "Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Models"
31
stars
13
commits
Python
primary language
Jun 15, 2026
updated
Kairos is a flexible and parameter-efficient Time Series Foundation Model (TSFM) designed to handle the dynamic and heterogeneous nature of real-world time series data. Unlike existing models that rely on rigid, non-adaptive processing pipelines and massive parameterization, Kairos decouples temporal heterogeneity from model capacity through three key architectural innovations:
🔀 Mixture-of-Size Encoder: Adaptively tokenizes time series at multiple granularities based on local information density. It utilizes a Top-K granularity router with null experts to efficiently model diverse temporal patterns.
🔄 Heterogeneity-Aware Transformer: Incorporates Dynamic Rotary Position Embedding (DRoPE), a granularity-aware positional encoding that modulates temporal scales using instance-level spectral features. It adapts to the varying physical durations of dynamic patches, enabling robust modeling of diverse temporal dependencies.
⏩ Multi-Patch Decoder: Employs learnable forecast tokens to predict multiple future patches in parallel, mitigating cumulative errors in autoregressive generation and offering flexibility for variable-length prediction horizons.
Trained on the large-scale Predictability-Stratified Time Series (PreSTS) corpus comprising over 300 billion time points, Kairos achieves superior zero-shot forecasting performance with significantly fewer parameters compared to existing methods on both GIFT-Eval and Time-Series-Library benchmarks.
Overview of the Kairos architecture, highlighting the Mixture-of-Size Encoder, Heterogeneity-Aware Transformer with DRoPE, and the Multi-Patch Decoder.
Kairos achieves superior performance with fewer parameters on two common zero-shot benchmarks.
Choose one of the following methods to set up the environment:
Option 1: Install from Source (Recommended)
Best for users who want to use the library directly. This ensures tsfm is globally accessible in your environment and resolves path issues automatically.
uv pip install git+https://github.com/foundation-model-research/Kairos
Option 2: Local Setup Best for running demos or modifying the code locally.
git clone https://github.com/foundation-model-research/Kairos.git
cd Kairos
uv sync
Note: If you choose Option 2, please ensure the project root is added to your
PYTHONPATHor usesys.path.appendin your scripts to avoidModuleNotFoundError.
Our model weights are available on Hugging Face. You can access them at the following links:
The datasets folder contains a specific sequence segment from the ETTh1 dataset, which is a component of the zero-shot test dataset.
You can run our forecasting demo using the quickstart_zero_shot.ipynb notebook.
Alternatively, you can use the following Python code snippet for a quick start to load the Kairos model and generate a forecast:
import torch
from tsfm.model.kairos import AutoModel
# load model
model = AutoModel.from_pretrained(
"mldi-lab/Kairos_50m", trust_remote_code=True
)
# forecasting configurations
batch_size, context_length, prediction_length = 1, 2048, 96
seqs = torch.randn(batch_size, context_length)
prediction_length = 96
forecast = model(
past_target=seqs.clone().detach().float(),
prediction_length=prediction_length,
generation=True,
preserve_positivity=True,
average_with_flipped_input=True
)
# extract the prediction results
forecast = forecast["prediction_outputs"]
print(forecast.shape)
This repository includes code adapted from Chronos: Learning the Language of Time Series. We thank the authors for their excellent work and open-source contributions. We also extend our gratitude to the creators of the following datasets used in our work:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
We welcome any questions, feedback, or potential collaborations. You can reach us at:
If you find Kairos models useful for your research, please consider citing the associated paper:
@article{feng2025kairos,
title={Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Models},
author={Feng, Kun and Lan, Shaocheng and Fang, Yuchen and He, Wenchao and Lu, Sihan and Gu, Shuqi and Ma, Lintao and Lu, Xingyu and Ren, Kan},
journal={arXiv preprint arXiv:2509.25826},
year={2025}
}
Python
58.6%
Jupyter Notebook
41.4%
Official code for "Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Models"
31
stars
13
commits
Python
primary language
Jun 15, 2026
updated
Kairos is a flexible and parameter-efficient Time Series Foundation Model (TSFM) designed to handle the dynamic and heterogeneous nature of real-world time series data. Unlike existing models that rely on rigid, non-adaptive processing pipelines and massive parameterization, Kairos decouples temporal heterogeneity from model capacity through three key architectural innovations:
🔀 Mixture-of-Size Encoder: Adaptively tokenizes time series at multiple granularities based on local information density. It utilizes a Top-K granularity router with null experts to efficiently model diverse temporal patterns.
🔄 Heterogeneity-Aware Transformer: Incorporates Dynamic Rotary Position Embedding (DRoPE), a granularity-aware positional encoding that modulates temporal scales using instance-level spectral features. It adapts to the varying physical durations of dynamic patches, enabling robust modeling of diverse temporal dependencies.
⏩ Multi-Patch Decoder: Employs learnable forecast tokens to predict multiple future patches in parallel, mitigating cumulative errors in autoregressive generation and offering flexibility for variable-length prediction horizons.
Trained on the large-scale Predictability-Stratified Time Series (PreSTS) corpus comprising over 300 billion time points, Kairos achieves superior zero-shot forecasting performance with significantly fewer parameters compared to existing methods on both GIFT-Eval and Time-Series-Library benchmarks.
Overview of the Kairos architecture, highlighting the Mixture-of-Size Encoder, Heterogeneity-Aware Transformer with DRoPE, and the Multi-Patch Decoder.
Kairos achieves superior performance with fewer parameters on two common zero-shot benchmarks.
Choose one of the following methods to set up the environment:
Option 1: Install from Source (Recommended)
Best for users who want to use the library directly. This ensures tsfm is globally accessible in your environment and resolves path issues automatically.
uv pip install git+https://github.com/foundation-model-research/Kairos
Option 2: Local Setup Best for running demos or modifying the code locally.
git clone https://github.com/foundation-model-research/Kairos.git
cd Kairos
uv sync
Note: If you choose Option 2, please ensure the project root is added to your
PYTHONPATHor usesys.path.appendin your scripts to avoidModuleNotFoundError.
Our model weights are available on Hugging Face. You can access them at the following links:
The datasets folder contains a specific sequence segment from the ETTh1 dataset, which is a component of the zero-shot test dataset.
You can run our forecasting demo using the quickstart_zero_shot.ipynb notebook.
Alternatively, you can use the following Python code snippet for a quick start to load the Kairos model and generate a forecast:
import torch
from tsfm.model.kairos import AutoModel
# load model
model = AutoModel.from_pretrained(
"mldi-lab/Kairos_50m", trust_remote_code=True
)
# forecasting configurations
batch_size, context_length, prediction_length = 1, 2048, 96
seqs = torch.randn(batch_size, context_length)
prediction_length = 96
forecast = model(
past_target=seqs.clone().detach().float(),
prediction_length=prediction_length,
generation=True,
preserve_positivity=True,
average_with_flipped_input=True
)
# extract the prediction results
forecast = forecast["prediction_outputs"]
print(forecast.shape)
This repository includes code adapted from Chronos: Learning the Language of Time Series. We thank the authors for their excellent work and open-source contributions. We also extend our gratitude to the creators of the following datasets used in our work:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
We welcome any questions, feedback, or potential collaborations. You can reach us at:
If you find Kairos models useful for your research, please consider citing the associated paper:
@article{feng2025kairos,
title={Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Models},
author={Feng, Kun and Lan, Shaocheng and Fang, Yuchen and He, Wenchao and Lu, Sihan and Gu, Shuqi and Ma, Lintao and Lu, Xingyu and Ren, Kan},
journal={arXiv preprint arXiv:2509.25826},
year={2025}
}
Python
58.6%
Jupyter Notebook
41.4%