Dynamic TMoE: A Drift-Aware Dynamic Mixture of Experts Framework for Non-Stationary Time Series Forecasting

June 29, 2026 ยท View on GitHub

Paper Python PyTorch

This repository contains the official implementation of Dynamic TMoE, accepted as a poster at ICML 2026.

framework

Dynamic TMoE framework architecture

๐Ÿ“– Overview

Dynamic TMoE is an adaptive Mixture of Experts (MoE) framework for non-stationary time series forecasting. It overcomes the rigidity of traditional MoEs by using Maximum Mean Discrepancy (MMD) to detect distribution shifts, dynamically expanding or pruning its heterogeneous expert pool to optimize capacity. Paired with a temporal memory router for stable, context-aware expert selection, Dynamic TMoE achieves state-of-the-art results across nine benchmarks, outperforming advanced baselines by reducing MSE and MAE by an average of 10.4% and 7.8%, respectively.

๐Ÿš€ Quick Start

Environment Setup

To set up the environment, install Python 3.10 and the required dependencies:

conda create -n dynamic_tmoe python=3.10
conda activate dynamic_tmoe
pip install -r requirements.txt

Dataset Preparation

Place the benchmark datasets in the ./dataset folder with the following structure:

dataset/
โ”œโ”€โ”€ ETT-small/
โ”‚   โ”œโ”€โ”€ ETTh1.csv
โ”‚   โ”œโ”€โ”€ ETTh2.csv
โ”‚   โ”œโ”€โ”€ ETTm1.csv
โ”‚   โ””โ”€โ”€ ETTm2.csv
โ”œโ”€โ”€ electricity/
โ”‚   โ””โ”€โ”€ electricity.csv
โ”œโ”€โ”€ traffic/
โ”‚   โ””โ”€โ”€ traffic.csv
โ”œโ”€โ”€ weather/
โ”‚   โ””โ”€โ”€ weather.csv
โ”œโ”€โ”€ exchange_rate/
โ”‚   โ””โ”€โ”€ exchange_rate.csv
โ””โ”€โ”€ illness/
    โ””โ”€โ”€ national_illness.csv

Running Experiments

Run the following scripts for different long-term forecasting benchmarks:

# eg. ETTh1 benchmarks
bash ./scripts/ETTh1.sh

๐Ÿ“š Citation

If you find this repository useful, please cite our paper:

@inproceedings{
  zhu2026dynamic_tmoe,
  title={Dynamic {TMoE}: A Drift-Aware Dynamic Mixture of Experts Framework for Non-Stationary Time Series Forecasting},
  author={Jiawen Zhu and Shuhan Liu and Di Weng and Yingcai Wu},
  booktitle={Forty-third International Conference on Machine Learning},
  year={2026},
  url={https://openreview.net/forum?id=JabkBcaoa9}
}

๐Ÿ™ Acknowledgement

We thanks to the following repositories for their invaluable code and datasets: