HiPerformer: Hierarchically Permutation-Equivariant Transformer for Time Series Forecasting

Ryo Umagami, Yu Ono, Yusuke Mukuta, Tatsuya HaradaarXiv 2023

Abstract

It is imperative to discern the relationships between multiple time series for accurate forecasting. In particular, for stock prices, components are often divided into groups with the same characteristics, and a model that extracts relationships consistent with this group structure should be effective. Thus, we propose the concept of hierarchical permutation-equivariance, focusing on index swapping of components within and among groups, to design a model that considers this group structure. When the prediction model has hierarchical permutation-equivariance, the prediction is consistent with the group relationships of the components. Therefore, we propose a hierarchically permutation-equivariant model that considers both the relationship among components in the same group and the relationship among groups. The experiments conducted on real-world data demonstrate that the proposed method outperforms existing state-of-the-art methods.

Introduction

Forecasting grouped time series, such as stock prices within sectors or players within sports teams, presents unique challenges. Traditional models often assume a fixed set of inputs in a static order, failing to account for the dynamic nature of real-world systems where entities frequently enter or exit (e.g., IPOs or bankruptcies). Furthermore, standard models typically treat all series as a flat list, neglecting the inherent hierarchical dependencies—both intra-class (within a group) and inter-class (between groups)—that drive collective trends.

To address these limitations, we introduce HiPerformer, a novel Transformer architecture designed to be hierarchically permutation-equivariant. This property ensures that the model's predictions remain consistent regardless of the ordering of groups or the ordering of individual series within those groups.

Hierarchical Permutation-Equivariance

The core innovation of HiPerformer is its adherence to hierarchical permutation-equivariance. A model is permutation-equivariant if swapping the order of inputs results in a corresponding swap in the outputs without altering the underlying logic. HiPerformer extends this to hierarchical structures: it is invariant to the permutation of classes (e.g., sectors) and the permutation of series within those classes (e.g., companies). This mathematical property allows the model to naturally handle variable-sized sets and the "entry and exit" problem without requiring retraining.

Hierarchical permutation-equivariance allows for consistent predictions regardless of the ordering of classes or series within classes.

The HiPerformer Architecture

The HiPerformer architecture leverages a 3D Self-Attention Layer to process data across three distinct dimensions:

  1. Intra-class ($S_c$): Captures dependencies among series within the same group.
  2. Inter-class ($C$): Pools group-level information to model dependencies between different groups.
  3. Time ($T$): Captures temporal evolution using standard attention mechanisms.
The HiPerformer architecture incorporates specialized self-attention blocks for intra-class, inter-class, and temporal dimensions.

Additionally, the model includes a Distribution Estimator to handle uncertainty. Instead of point forecasts, it outputs a multivariate normal distribution, utilizing a combination of RBF and linear kernels to estimate a time-varying covariance matrix. This allows the model to capture not only trends but also the correlations between different series.

Experimental Evaluation

We evaluated HiPerformer across diverse tasks, including multi-agent trajectory prediction (Charged and NBA datasets) and hierarchical forecasting (Labour, Traffic, and Wiki datasets).

Key Results

  • Trajectory Prediction: On the NBA dataset, HiPerformer achieved significantly lower Average Displacement Error (ADE) and Final Displacement Error (FDE) compared to state-of-the-art methods like GRIN and Social-GAN.
  • Hierarchical Forecasting: The model demonstrated remarkable improvements in Root Mean Square Error (RMSE) on the Labour and Wiki datasets, particularly at higher levels of the hierarchy. This suggests that respecting the hierarchical structure leads to more accurate aggregate predictions.
  • Robustness: HiPerformer proved stable in scenarios with missing data (e.g., players removed from the NBA dataset), outperforming versions that ignored group information.

Conclusion

HiPerformer introduces a robust framework for forecasting grouped time series by enforcing hierarchical permutation-equivariance. By explicitly modeling intra-class and inter-class dependencies through a 3D attention mechanism, it overcomes the limitations of traditional fixed-input models. While the current implementation benefits from predefined class information, future work will explore scaling to larger datasets and potentially learning hierarchical structures automatically.

Summary updated

BibTeX
@misc{umagami2023hiperformer,
  author = {Ryo Umagami and Yu Ono and Yusuke Mukuta and Tatsuya Harada},
  title = {{HiPerformer: Hierarchically Permutation-Equivariant Transformer for Time Series Forecasting}},
  year = {2023},
  eprint = {2305.08073},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.08073},
}
Figure