Semantics-Aware Patch Encoding and Hierarchical Dependency Modeling for Long-Term Time Series Forecasting Official PyTorch Implementation

August 7, 2025 ยท View on GitHub

overview
Overview of MoU

๐Ÿ’ฅ Our Paper (Accepted in KDD 2025)

arXivย  KDDย 

We introduce Mixture of Universals (MoU), a novel framework designed to prevent semantic loss during patch encoding and efficiently enhance long-term dynamics through a hybrid approach. Specifically, MoU is consist of two novel designs: Mixture of Feature Extractors (MoF) and Mixture of Architectures (MoA). MoF introduces a semantics-aware encoding mechanism to preserve diverse temporal patterns and mitigating information loss. MoA, on the other hand, hierarchically captures long-term dependency with progressively expanded receptive field, improving model performance while maintaining relatively low computational costs. The proposed approach achieves state-of-the-art performance.

The overall performance of MoU for long-term forecasting is summarized in the following Table (average performance). More detailed results can be found in our paper.

ModelMoU (Ours)ModernTCNPatchTSTHDMixerRMLPDLinearS-MambaiTransformer
MetricMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAE
ETTh10.3970.4230.4040.4200.4130.4340.4080.4260.4420.4430.4230.4370.4500.4560.4650.465
ETTh20.3170.3730.3230.3790.3310.3790.3200.3740.3770.4140.4310.4470.3690.4050.3850.414
ETTm10.3480.3820.3540.3820.3520.3820.3590.3850.3570.3790.3570.3790.3670.3960.3670.395
ETTm20.2520.3150.2560.3160.2560.3170.2570.3160.2630.3180.2670.3320.2650.3260.2710.329
Weather0.2210.2620.2250.2670.2260.2640.2350.2750.2360.2730.2400.3000.2360.2730.2380.273
illness1.5000.7841.5190.7991.5130.8252.0190.8911.5930.8432.1691.0411.9770.8902.2221.012
electricity0.1570.2530.1570.2530.1590.2530.1600.2520.1720.2660.1770.2740.1660.2620.1700.265

โšก๏ธ Preparation

Installation

Download code:

git clone https://github.com/lunaaa95/mou.git
cd mou

A suitable conda environment named mou can be created and activated with:

conda create -n mou python=3.8
conda activate mou
pip install -r requirement.txt

Dataset

Download datasets to folder ./dataset. You can download all datasets from Google Drive provided by Wu, H.

๐Ÿ“ Run

  • We provide bash scripts for all datasets. Run bash scripts in folder "./scripts" to start time series long-term forecasting. For example,
bash scripts/MoU/etth1.sh

bash scripts/MoU/etth2.sh

bash scripts/MoU/ettm1.sh

bash scripts/MoU/ettm2.sh

bash scripts/MoU/weather.sh

bash scripts/MoU/electricity.sh

bash scripts/MoU/illness.sh
  • We also provide other short-term encoders and long-term encoders to switch the structure of model. Change parameters entype for other short-term encoders and ltencoder for long-term encoders.
  • We also give two baseline models of PatchTST and DLinear as well as their runing scripts.

๐ŸŒŸ Citation

@inproceedings{peng2025semantics,
  title={Semantics-Aware Patch Encoding and Hierarchical Dependency Modeling for Long-Term Time Series Forecasting},
  author={Peng, Sijia and Xiong, Yun and Zhu, Yangyong and Shen, Zhiqiang},
  booktitle={Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2},
  pages={2269--2280},
  year={2025}
}