Preserving Dynamic Attention for Long-Term Spatial-Temporal Prediction

Haoxing Lin, Rufan Bai, Weijia Jia, Xinyu Yang, Yongjian You

Abstract

Predicting urban dynamics over long horizons is often hampered by spatial noise and the compounding of errors over time. We present the Dynamic Switch-Attention Network (DSAN), a novel architecture that mitigates these issues through a dual-encoder system for noise filtration and a switch-attention decoder that establishes direct links between historical inputs and future predictions. Evaluations on real-world datasets show that DSAN reduces prediction errors by at least 5% over a 6-hour horizon compared to existing state-of-the-art models.

Introduction: The Challenges of Long-Term Forecasting

Urban spatial-temporal forecasting, such as predicting traffic flow or cellular demand, involves modeling complex, non-linear correlations across both space and time. While short-term "nowcasting" has seen significant improvements, long-term prediction (e.g., 6 hours ahead) remains difficult due to two primary hurdles:

  1. The Noise Problem: In a dense urban grid, most spatial data is irrelevant to a specific target location. Standard models often aggregate this data indiscriminately, allowing irrelevant noise to drown out valuable signals.
  2. Error Propagation (The "Butterfly Effect"): Most models employ a recursive strategy, using their own previous predictions as inputs for subsequent steps. Small initial errors compound rapidly, rendering long-term forecasts unreliable.
Spatial correlations in an urban grid where target location $v_i$ is influenced by various distant points of interest, illustrating the challenge of filtering relevant signals from noise.

The DSAN Architecture

To address these challenges, the DSAN architecture moves away from traditional recurrent (RNN) or convolutional (CNN) structures in favor of a pure attention-based approach.

Key Components

  • Multi-Space Attention (MSA): Inspired by multi-head attention in NLP, MSA decomposes spatial-temporal information into different subspaces. This prevents the model from "smoothing out" important features through over-averaging.
  • Dynamic Attention Encoder (DAE): This is a dual-encoder system. One encoder looks at the "Global" input (the whole city), while the other focuses on a "Local" block of strongly correlated neighbors. The DAE dynamically filters out noise from the global view by using the local query to "extract" only the most relevant distant features.
  • Switch-Attention Decoder (SAD): To stop error propagation, the SAD directly connects every future time step to the purified historical inputs. It uses a "switch" mechanism that transposes attention across different subspaces to maintain a sharp focus on relevant data across long horizons.
  • Spatial-Temporal Positional Encoding (STPE): Since attention mechanisms are "position-blind," the authors use sine/cosine functions to encode 2D coordinates and temporal features (time of day, day of week, weather) into the data.
The overall architecture of the Dynamic Switch-Attention Network (DSAN), showing the flow from input $X$ through the DAE and SAD modules to output $Y$.

Experimental Evaluation

The model was evaluated on three real-world datasets: Taxi-NYC (60 days of trip records), Bike-NYC (60 days of Citi-Bike records), and CTM (45 days of cellular service records in Macau).

Key Insights

  • Direct Links Beat Recursion: Long-term prediction should not rely on a chain of previous predictions. By "bridging" future steps directly to historical inputs via the SAD, the model avoids absorbing the errors of intermediate steps.
  • Relative Coordinates Matter: The authors found that using relative spatial coordinates (distance from the target) performed better than absolute coordinates, likely because relative patterns are more stable and easier for the model to learn.
  • The "Goldilocks" Zone for Input Size: Feeding a model the entire city grid can hurt performance without a noise-filtering mechanism. DSAN’s DAE allows it to handle larger input areas effectively where other models start to fail due to noise.

Results and Conclusion

DSAN consistently outperformed seven major baselines, including ST-ResNet, ConvLSTM, and STDN. On the Taxi-NYC dataset, DSAN reduced the Root Mean Square Error (RMSE) by at least 5% for every one of the 12 future time steps. While baseline models showed "rising tails" (errors exploding as they predicted further into the future), DSAN’s error curve remained remarkably flat, demonstrating its resilience to error propagation.

In conclusion, the Dynamic Switch-Attention Network offers a robust solution to the twin problems of spatial noise and error propagation. Future work will investigate more computationally efficient ways to retrieve information from even larger spatial-temporal spaces without sacrificing performance.

Summary updated

BibTeX
@inproceedings{lin2020preserving,
  author = {Haoxing Lin and Rufan Bai and Weijia Jia and Xinyu Yang and Yongjian You},
  title = {{Preserving Dynamic Attention for Long-Term Spatial-Temporal Prediction}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2020},
  doi = {10.1145/3394486.3403046},
}
Figure