Spectral Invariant Learning for Dynamic Graphs under Distribution Shifts
Zeyang Zhang, Xin Wang, Ziwei Zhang, Zhou Qin, Weigao Wen, Hui Xue, Haoyang Li, Wenwu Zhu
TL;DR
This paper tackles distribution shifts in dynamic graphs by shifting focus from the time domain to the spectral domain. It introduces SILD, a spectral invariant learning framework that transforms ego-graph trajectories with Fourier transforms, disentangles invariant and variant spectral patterns via per-frequency masks, and enforces invariance through an invariant spectral filtering objective. The approach yields a predictive model that relies on invariant spectral components, improving robustness for node classification and link prediction under distribution shifts, as demonstrated on both real-world and synthetic datasets. The work highlights the potential of spectral-domain techniques to uncover stable patterns in dynamic graphs and opens avenues for continuous-dynamics extensions and broader OOD generalization in graph-structured data.
Abstract
Dynamic graph neural networks (DyGNNs) currently struggle with handling distribution shifts that are inherent in dynamic graphs. Existing work on DyGNNs with out-of-distribution settings only focuses on the time domain, failing to handle cases involving distribution shifts in the spectral domain. In this paper, we discover that there exist cases with distribution shifts unobservable in the time domain while observable in the spectral domain, and propose to study distribution shifts on dynamic graphs in the spectral domain for the first time. However, this investigation poses two key challenges: i) it is non-trivial to capture different graph patterns that are driven by various frequency components entangled in the spectral domain; and ii) it remains unclear how to handle distribution shifts with the discovered spectral patterns. To address these challenges, we propose Spectral Invariant Learning for Dynamic Graphs under Distribution Shifts (SILD), which can handle distribution shifts on dynamic graphs by capturing and utilizing invariant and variant spectral patterns. Specifically, we first design a DyGNN with Fourier transform to obtain the ego-graph trajectory spectrums, allowing the mixed dynamic graph patterns to be transformed into separate frequency components. We then develop a disentangled spectrum mask to filter graph dynamics from various frequency components and discover the invariant and variant spectral patterns. Finally, we propose invariant spectral filtering, which encourages the model to rely on invariant patterns for generalization under distribution shifts. Experimental results on synthetic and real-world dynamic graph datasets demonstrate the superiority of our method for both node classification and link prediction tasks under distribution shifts.
