Time Series Forecasting with Hypernetworks Generating Parameters in Advance

Jaehoon Lee, Chan Kim, Gyumin Lee, Haksoo Lim, Jeongwhan Choi, Kookjin Lee, Dongeun Lee, Sanghyun Hong, Noseong Park

TL;DR

HyperGPA is a novel hypernetwork framework designed to tackle "temporal drift"—when the underlying patterns in time series data change over time. Instead of slowly retraining a model on new data, HyperGPA proactively predicts and generates the optimal parameters for a target forecasting model before the new data arrives, leading to significantly higher accuracy and faster adaptation.

What Problem Does This Paper Address?

Standard time series forecasting models (like LSTMs or Neural ODEs) assume that the future will look somewhat like the past. However, real-world data often suffers from temporal drift, where the underlying dynamics shift due to latent factors. Think of COVID-19 infection rates or stock market volatility; a model trained on last year's data might be completely ill-equipped for today's sudden shift in trends.

The traditional solution is continuous retraining, but this is reactive and slow. A model needs to see enough "new" data to adjust its weights, during which time its forecasts are likely inaccurate. The authors identify this lag in parameter adjustment as the primary bottleneck in forecasting under drift.

Methods

The authors propose HyperGPA (Hypernetwork Generating Parameters in Advance). A hypernetwork is essentially a neural network that generates the weights for another "target" neural network.

As shown in the comparison below, while a vanilla approach trains a single set of parameters for all periods, HyperGPA generates specific parameters for each upcoming period.

Figure 2: In a vanilla setting, a time series model is trained with all historical periods. On the contrary, in Hyper- GPA, the first layer (𝐿1) understands the recent periods (D1, D2, D3) and forecasts a hidden representation for the next period (D4) with the discovered underlying dynam- ics. Based on the forecast hidden representation, the second layer (𝐿2) generates the parameters of a time series model which would work well for D4.

The architecture consists of two main components:

  1. Layer 1 ($L1$) - Shared Multi-Task Layer: This layer "reads" recent time series data to understand the current dynamics. It uses Neural Controlled Differential Equations (NCDEs) to model continuous-time patterns and Adaptive Graph Convolutional (AGC) networks to discover latent relationships between multiple correlated time series (e.g., flu data across different states). It outputs a hidden representation ($h_{i,N}$) that characterizes the expected dynamics of the next period.
  2. Layer 2 ($L2$) - Parameter Generating Layer: This layer takes the predicted characteristics from $L1$ and generates the actual weights ($\theta$) for the target forecasting model. Crucially, it uses the computation graph of the target model (via Graph Attention Networks) and an attention-based generation method. Instead of mapping directly to thousands of parameters, it generates attention coefficients to combine a smaller set of "candidate" parameters, which prevents overfitting and keeps the hypernetwork size efficient.

Datasets

The researchers evaluated HyperGPA on four diverse time series benchmarks:

  • Flu: Weekly influenza patient data across 51 U.S. states (2011–2020).
  • Stock-US & Stock-China: Daily historical stock prices for top-30 companies over 20 months.
  • USHCN: A climate dataset containing monthly temperature and precipitation records in the U.S. (1981–2012).

Key Insights and Ideas

  • Proactive vs. Reactive: The core "aha" moment is shifting from adjusting parameters after seeing drift to predicting the necessary parameters in advance.
  • Model Agnosticism: HyperGPA isn't a forecasting model itself; it's a parameter generator. The authors successfully tested it with six different target models, including LSTMs, GRUs, and Neural ODEs.
  • Harnessing Latent Correlations: By treating multiple time series (like different stocks or states) as a multi-task problem and using graph convolutions to find hidden links, the model learns the "drift dynamics" much more effectively than looking at a single series in isolation.
  • Efficiency through Attention: Generating every single weight of a large neural network is computationally expensive. By using an attention mechanism to select from candidate parameter sets, HyperGPA remains relatively small while still being highly expressive.

Key Results

HyperGPA consistently outperformed all baselines (including specialized drift-handling methods like RevIN and AdaRNN) across all datasets and target models.

  • Accuracy Gains: HyperGPA improved Mean Squared Error (MSE) by up to 64.1% compared to vanilla training.
  • Robustness to Model Size: Interestingly, HyperGPA allowed very small target models (e.g., a hidden size of only 16) to achieve better results than much larger vanilla models. This suggests that how you set the parameters is often more important than how many parameters you have.
  • Drift Adaptation: Visualizations show that HyperGPA's predicted lines follow ground truth almost exactly, even during sharp distribution shifts where other models fail (see Figure 4 in the paper).
Figure 4: Forecast lines showing HyperGPA (solid red) closely tracking the ground truth during a drift period compared to baselines.

Limitations and Future Work

The authors note that HyperGPA relies heavily on NCDEs in its first layer. While powerful, the long-term accuracy of NCDEs on very extended time series is still an open research question. Future work will likely explore extending the framework to handle even longer sequences and potentially integrating more complex graph-based target models.

Summary updated

BibTeX
@misc{lee2022time,
  author = {Jaehoon Lee and Chan Kim and Gyumin Lee and Haksoo Lim and Jeongwhan Choi and Kookjin Lee and Dongeun Lee and Sanghyun Hong and Noseong Park},
  title = {{Time Series Forecasting with Hypernetworks Generating Parameters in Advance}},
  year = {2022},
  eprint = {2211.12034},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.12034},
}
Figure