Table of Contents
Fetching ...

Learning Latent Spaces for Domain Generalization in Time Series Forecasting

Songgaojun Deng, Maarten de Rijke

TL;DR

This paper tackles domain generalization in time series forecasting by uncovering latent temporal dependencies that span and differentiate domains. It introduces LTG, a framework combining time series decomposition with a Conditional $β$-VAE to learn domain-shared and domain-specific latent factors, guided by a domain-regularized objective. The model integrates these latent representations into a forecasting decoder, achieving probabilistic forecasts and improved generalization on five real-world datasets across web, retail, finance, and energy domains. Key contributions include the decomposition-based latent factor learning, a domain-conditioned decoder, and a regularization strategy that explicitly disentangles shared and domain-specific factors, enabling better performance on unseen domains and offering interpretable insights into temporal dynamics.

Abstract

Time series forecasting is vital in many real-world applications, yet developing models that generalize well on unseen relevant domains -- such as forecasting web traffic data on new platforms/websites or estimating e-commerce demand in new regions -- remains underexplored. Existing forecasting models often struggle with domain shifts in time series data, as the temporal patterns involve complex components like trends, seasonality, etc. While some prior work addresses this by matching feature distributions across domains or disentangling domain-shared features using label information, they fail to reveal insights into the latent temporal dependencies, which are critical for identifying common patterns across domains and achieving generalization. We propose a framework for domain generalization in time series forecasting by mining the latent factors that govern temporal dependencies across domains. Our approach uses a decomposition-based architecture with a new Conditional $β$-Variational Autoencoder (VAE), wherein time series data is first decomposed into trend-cyclical and seasonal components, each modeled independently through separate $β$-VAE modules. The $β$-VAE aims to capture disentangled latent factors that control temporal dependencies across domains. We enhance the learning of domain-specific information with a decoder-conditional design and introduce domain regularization to improve the separation of domain-shared and domain-specific latent factors. Our proposed method is flexible and can be applied to various time series forecasting models, enabling effective domain generalization with simplicity and efficiency. We validate its effectiveness on five real-world time series datasets, covering web traffic, e-commerce, finance and power consumption, demonstrating improved generalization performance over state-of-the-art methods.

Learning Latent Spaces for Domain Generalization in Time Series Forecasting

TL;DR

This paper tackles domain generalization in time series forecasting by uncovering latent temporal dependencies that span and differentiate domains. It introduces LTG, a framework combining time series decomposition with a Conditional -VAE to learn domain-shared and domain-specific latent factors, guided by a domain-regularized objective. The model integrates these latent representations into a forecasting decoder, achieving probabilistic forecasts and improved generalization on five real-world datasets across web, retail, finance, and energy domains. Key contributions include the decomposition-based latent factor learning, a domain-conditioned decoder, and a regularization strategy that explicitly disentangles shared and domain-specific factors, enabling better performance on unseen domains and offering interpretable insights into temporal dynamics.

Abstract

Time series forecasting is vital in many real-world applications, yet developing models that generalize well on unseen relevant domains -- such as forecasting web traffic data on new platforms/websites or estimating e-commerce demand in new regions -- remains underexplored. Existing forecasting models often struggle with domain shifts in time series data, as the temporal patterns involve complex components like trends, seasonality, etc. While some prior work addresses this by matching feature distributions across domains or disentangling domain-shared features using label information, they fail to reveal insights into the latent temporal dependencies, which are critical for identifying common patterns across domains and achieving generalization. We propose a framework for domain generalization in time series forecasting by mining the latent factors that govern temporal dependencies across domains. Our approach uses a decomposition-based architecture with a new Conditional -Variational Autoencoder (VAE), wherein time series data is first decomposed into trend-cyclical and seasonal components, each modeled independently through separate -VAE modules. The -VAE aims to capture disentangled latent factors that control temporal dependencies across domains. We enhance the learning of domain-specific information with a decoder-conditional design and introduce domain regularization to improve the separation of domain-shared and domain-specific latent factors. Our proposed method is flexible and can be applied to various time series forecasting models, enabling effective domain generalization with simplicity and efficiency. We validate its effectiveness on five real-world time series datasets, covering web traffic, e-commerce, finance and power consumption, demonstrating improved generalization performance over state-of-the-art methods.

Paper Structure

This paper contains 38 sections, 10 equations, 8 figures, 5 tables.

Figures (8)

  • Figure 1: The proposed framework, LTG, consists of three components: (1) Time Series Decomposition, which decomposes a raw time sequence into trend-cyclical and seasonal components for more effective modeling of distinct temporal patterns. (2) Latent Factor Learning with Conditional $\beta$-VAE, which learns latent representations that capture temporal dependencies across different domains and ideally achieves disentangled latent factors for each dimension. (3) Domain Regularization, which regularizes domain-specific and shared latent features to enhance the disentangling of latent factors. The forecasting decoder is a flexible model that integrates the raw sequence, any external factors, and the latent vectors learned by the Conditional $\beta$-VAE to generate time series forecasts.
  • Figure 2: Forecasting results for a test domain sample from the Web-traffic dataset, using DLinear and WaveNet with various generalization methods.
  • Figure 3: Latent space t-SNE visualization of the domain-shared and domain-specific components on the test domains of the Web-traffic (top) and Favorita-cat (bottom) datasets.
  • Figure 4: Forecasting window sensitivity and runtime analysis on the Web-traffic dataset using DeepAR as the base model.
  • Figure 5: Forecasting results of Q(0.5) and Q(mean) on the Web-traffic dataset with varying values of $\beta$.
  • ...and 3 more figures