Nearest Neighbor Multivariate Time Series Forecasting
Huiliang Zhang, Ping Nie, Lijun Sun, Benoit Boulet
TL;DR
The paper tackles the limitation of conventional MTS forecasting methods, especially STGNNs, that rely on finite input windows and underutilize the full historical dataset. It introduces kNN-MTS, a non-parametric framework that augments pretrained MTS models with a datastore of segment-level representations generated by a Hybrid Spatial-Temporal Encoder (HSTEncoder); predictions are refined by retrieving and weighting neighboring historical segments from the datastore. The key contributions are the datastore-based retrieval mechanism, the HSTEncoder that captures long-term temporal and short-term spatial-temporal dependencies, and extensive experiments showing consistent gains across multiple real-world datasets, with demonstrated interpretability and training efficiency. This approach enables large-scale, memory-based use of historical patterns to enhance forecasting without additional training, offering practical gains for real-time MTS applications and opening avenues for further contrastive learning and efficient retrieval enhancements.
Abstract
Multivariate time series (MTS) forecasting has a wide range of applications in both industry and academia. Recently, spatial-temporal graph neural networks (STGNNs) have gained popularity as MTS forecasting methods. However, current STGNNs can only use the finite length of MTS input data due to the computational complexity. Moreover, they lack the ability to identify similar patterns throughout the entire dataset and struggle with data that exhibit sparsely and discontinuously distributed correlations among variables over an extensive historical period, resulting in only marginal improvements. In this article, we introduce a simple yet effective k-nearest neighbor MTS forecasting ( kNN-MTS) framework, which forecasts with a nearest neighbor retrieval mechanism over a large datastore of cached series, using representations from the MTS model for similarity search. This approach requires no additional training and scales to give the MTS model direct access to the whole dataset at test time, resulting in a highly expressive model that consistently improves performance, and has the ability to extract sparse distributed but similar patterns spanning over multivariables from the entire dataset. Furthermore, a hybrid spatial-temporal encoder (HSTEncoder) is designed for kNN-MTS which can capture both long-term temporal and short-term spatial-temporal dependencies and is shown to provide accurate representation for kNN-MTSfor better forecasting. Experimental results on several real-world datasets show a significant improvement in the forecasting performance of kNN-MTS. The quantitative analysis also illustrates the interpretability and efficiency of kNN-MTS, showing better application prospects and opening up a new path for efficiently using the large dataset in MTS models.
