TL;DR
TCVAE (Temporal Conditional Variational Autoencoder) is a new framework designed to tackle the "distributional drift" problem in multivariate time series forecasting. By combining Hawkes-process-inspired attention with conditional continuous normalizing flows, it learns to dynamically adapt its internal architecture to non-stationary data, significantly outperforming current state-of-the-art models like Informer and Autoformer.
What Problem Does This Paper Address?
Most deep learning models for multivariate time series (MTS) forecasting—ranging from LSTMs to Transformers—rely on a fundamental assumption: stationarity. They assume that the underlying statistical properties of the data remain constant over time.
In the real world, this is rarely true. Traffic patterns shift due to accidents or holidays, electricity demand changes with the seasons, and pandemic case counts fluctuate wildly based on policy interventions. This phenomenon is known as distributional drift. When the relationship between historical observations and future predictions changes, static models degrade in performance. As shown in the figure below, even successive time slices in traffic data can exhibit significant mean shifts and variance changes.
Methods
The authors propose TCVAE, a generative framework that treats forecasting as an inference problem over latent variables that are themselves conditioned on temporal factors. The architecture consists of three core innovations:
- Temporal Hawkes Attention (THA): Standard attention mechanisms often treat all historical points equally. THA uses the logic of a Hawkes process—a self-exciting point process—to model how influential past events "excite" future values and how that influence decays over time. This extracts robust "temporal factors" that represent the current drift context.
- Gated Attention Mechanism (GAM): Instead of a static Transformer, TCVAE uses a gated mechanism. The temporal factors from the THA act as a "gate," dynamically adjusting the information flow within the encoder and decoder. This allows the model to effectively "re-wire" its internal logic to match the current data distribution.
- Conditional Continuous Normalizing Flow (CCNF): Standard Variational Autoencoders (VAEs) usually assume that latent variables follow a simple Gaussian distribution. However, real-world drift is often multi-modal and complex. TCVAE uses CCNF—an ODE-based transformation—to warp a simple Gaussian prior into a flexible, "form-free" distribution that can better capture the nuances of the data.
The overall architecture, integrating these components into a Transformer-based skeleton, is detailed in the following diagram:
Datasets
The model was evaluated on six diverse, real-world MTS datasets, chosen specifically for their high degrees of non-stationarity (measured via the Augmented Dickey-Fuller test):
- Traffic & METR-LA: Highway occupancy and traffic flow in San Francisco and Los Angeles.
- Electricity: Hourly consumption for 370 clients.
- Solar-Energy: Solar power production records.
- COVID-19: Daily new confirmed cases.
- PeMSD7(M): Freeway traffic sensor data in California.
Key Insights and Ideas
- Generative vs. Discriminative: While most models try to map $X$ to $Y$ directly, TCVAE models the conditional distribution $p(Y|X, C)$. By introducing the temporal factor $C$, the model treats drift as a hidden context that can be inferred.
- Breaking the Gaussian Constraint: One of the "aha" moments is the realization that a univariate Gaussian cannot accurately approximate the complex multivariate distributions found in drifting time series. The use of Normalizing Flows allows the model to fit "wiggly" distributions that a standard VAE would smooth over.
- Hawkes Process for Attention: Using a self-exciting process to weight historical data provides a more mathematically grounded way to handle "shocks" to a system (like a sudden traffic jam) compared to standard self-attention.
Key Results
TCVAE established a new state-of-the-art across all six datasets. Quantitatively, it achieved:
- 0.91% to 15% improvement in MAE (Mean Absolute Error) over baselines.
- 3.95% to 25.36% improvement in RMSE (Root Mean Squared Error).
- Superior Long-Range Forecasting: On the Solar-Energy dataset, while GNN-based models like AGCRN ran out of memory at long horizons ($h=720$), TCVAE remained stable and accurate.
Qualitatively, the flexible posterior learned by the CCNF was shown to match the true data distribution much more closely than a standard Gaussian posterior, as visualized in Figure 4 of the paper.
Limitations and Future Work
- Computational Cost: The CCNF module, while effective, is time-consuming. The authors noted that a variant "w/o CCNF" is much faster and still outperforms most baselines, though it loses some accuracy.
- Drift Frequency Assumption: The model currently assumes that the frequency of distributional drift is similar between the training and testing sets. If a system suddenly begins drifting much faster than seen during training, the model might struggle.
- Future Directions: The authors plan to explore applications in even more volatile domains, such as stock trend forecasting and real-time product demand analysis.
Summary updated