CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting

Gerald Woo, Chenghao Liu, Doyen Sahoo, Akshat Kumar, Steven Hoi
2/3/2022
cs.LG
contrastive-ssl

Official code: salesforce/CoST (239 stars, Python, BSD-3-Clause, last commit 2026-06-25).

Abstract

Deep learning has been actively studied for time series forecasting, and the mainstream paradigm is based on the end-to-end training of neural network architectures, ranging from classical LSTM/RNNs to more recent TCNs and Transformers. Motivated by the recent success of representation learning in computer vision and natural language processing, we argue that a more promising paradigm for time series forecasting, is to first learn disentangled feature representations, followed by a simple regression fine-tuning step -- we justify such a paradigm from a causal perspective.

Show full abstract

Following this principle, we propose a new time series representation learning framework for time series forecasting named CoST, which applies contrastive learning methods to learn disentangled seasonal-trend representations. CoST comprises both time domain and frequency domain contrastive losses to learn discriminative trend and seasonal representations, respectively. Extensive experiments on real-world datasets show that CoST consistently outperforms the state-of-the-art methods by a considerable margin, achieving a 21.3% improvement in MSE on multivariate benchmarks. It is also robust to various choices of backbone encoders, as well as downstream regressors. Code is available at https://github.com/salesforce/CoST.

View on arXivView PDF

Code Implementations(1)

salesforce/CoSTOfficial100%
BSD-3-Clause

PyTorch code for CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting (ICLR 2022)

23945Python, ShellFeb 15, 20225 months agoBSD-3-Clause
contrastive-learningdeep-learningforecasting-modelmachine-learningself-supervised-learning+3 more

Similar Papers

Cite this paper

@article{woo2022cost,
  title  = {CoST: Contrastive Learning of Disentangled Seasonal-Trend Representations for Time Series Forecasting},
  author = {Gerald Woo and Chenghao Liu and Doyen Sahoo and Akshat Kumar and Steven Hoi},
  year   = {2022},
  eprint = {2202.01575},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2202.01575}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2202.01575.svg)](https://codeofpaper.com/paper/2202.01575)

Discussion