DSTP-RNN: A dual-stage two-phase attention-based recurrent neural network for long-term and multivariate time series prediction

Yeqi Liu, Chuanyang Gong, Ling Yang, Yingyi Chen

Abstract

Multivariate time series forecasting, particularly over long horizons, remains a significant challenge due to complex inter-variable dependencies and the accumulation of errors over time. Traditional attention-based Recurrent Neural Networks (RNNs) often suffer from noisy or "jittery" attention weights, leading to performance degradation in long-term tasks. This paper introduces the Dual-Stage Two-Phase RNN (DSTP-RNN), a novel architecture inspired by the biphasic nature of human attention. By employing a two-phase spatial attention mechanism to refine feature selection and a dual-stage structure to separate spatial and temporal dependencies, the model achieves state-of-the-art performance across diverse domains, including finance, energy, and medicine.

Introduction

Predicting the future states of complex, high-dimensional systems—such as stock market indices, regional energy consumption, or neural activity—is a cornerstone of modern data science. These systems are inherently multivariate, where numerous variables interact dynamically. While deep learning models, specifically those utilizing attention mechanisms, have improved short-term forecasting, they often struggle with long-term horizons.

The authors identify a critical flaw in existing attention models: the generation of "violent and decentralized" attention weights. In these models, the focus shifts erratically between variables, making the system highly susceptible to noise and interference over long sequences. To address this, the DSTP-RNN borrows from human visual processing, which uses a multi-stage filtering process to focus on relevant stimuli while suppressing background noise.

Methodology: The Dual-Stage Two-Phase Architecture

The DSTP-RNN architecture is defined by two primary structural innovations: the dual-stage flow and the two-phase spatial attention module.

Dual-Stage Processing

The model decomposes the forecasting task into two distinct stages. The first stage focuses on Spatial Attention, determining which exogenous variables are most relevant at each time step. The second stage focuses on Temporal Attention, identifying which historical time points are most predictive of the future. This separation allows the model to handle spatial and temporal correlations more cleanly than monolithic architectures.

The overall dual-stage architecture of DSTP-RNN, illustrating the transition from spatial attention (First stage) to temporal attention (Second stage).

Two-Phase Spatial Attention

The "Two-Phase" component is the model's core innovation. Instead of a single pass to calculate spatial weights, the spatial module operates in two phases:

  1. Phase I: Generates a broad set of initial weights across all input variables.
  2. Phase II: Refines these weights, acting as a stabilizer that produces "stationary and concentrated" focus. This mimics the human brain's ability to filter out secondary distractions after an initial scan.

Advanced Variant: DSTP-RNN-II

An enhanced version, DSTP-RNN-II, introduces parallel attention modules to explicitly distinguish between the "target" series (the variable being predicted) and "non-target" (exogenous) variables. This mimics the specific stimulus response of human neurons, ensuring that the target's own historical patterns are given appropriate weight alongside external drivers.

The DSTP-RNN-II architecture featuring parallel first-phase attention modules to better distinguish target and non-target information.

Experimental Evaluation

The model was rigorously tested against nine baseline methods, including traditional statistical models (ARIMA, SVR) and advanced deep learning architectures (DA-RNN, GeoMAN). Testing spanned four diverse datasets: SML2010 (Environment), NASDAQ100 (Finance), Appliances Energy (Energy), and EEG (Medicine).

Key Results

The DSTP-RNN consistently outperformed all baselines, particularly as the prediction horizon increased. In a 120-step-ahead forecast on the NASDAQ100 dataset, DSTP-RNN achieved an RMSE of 0.0895, a nearly 42% improvement over the competitive DA-RNN model (RMSE 0.1541).

The researchers also investigated the "Deep Attention Trap." They found that simply stacking attention layers (a 3-layer "DeepAttn" model) led to performance degradation. Deeper layers tended to average out weights, diluting the model's focus and rendering the attention mechanism no more effective than a simple mean.

Conclusion and Future Directions

The DSTP-RNN demonstrates that "bionic" design—mimicking biological attention processes—can significantly enhance the stability and accuracy of long-term time series forecasting. By concentrating attention weights and explicitly modeling target-exogenous relationships, the model avoids the noise sensitivity of previous architectures.

Future research will explore hybrid architectures that combine DSTP-RNN with Convolutional Neural Networks (CNNs) to further improve spatial feature extraction. Additionally, the team aims to develop unified learning frameworks that can compute spatio-temporal weights simultaneously across multiple dimensions.

Summary updated

BibTeX
@article{liu2020dstp,
  author = {Yeqi Liu and Chuanyang Gong and Ling Yang and Yingyi Chen},
  title = {{DSTP-RNN: A dual-stage two-phase attention-based recurrent neural network for long-term and multivariate time series prediction}},
  journal = {Expert Systems with Applications},
  year = {2020},
  doi = {10.1016/j.eswa.2019.113082},
}
Figure