Structure-Aware Random Fourier Kernel for Graphs

Jinyuan Fang, Qiang Zhang, Zaiqiao Meng, Shangsong LiangNeurIPS 2021

Introduction

Gaussian Processes (GPs) are a cornerstone of Bayesian machine learning, prized for their ability to provide well-calibrated uncertainty estimates. However, their generalization capabilities depend heavily on the choice of kernels. This paper introduces the Structure-Aware Random Fourier (SRF) kernel, a novel approach that enables GPs to effectively model graph-structured data. By combining the representational power of Graph Neural Networks (GNNs) with the flexibility of spectral kernel learning, the authors achieve state-of-the-art performance on node classification and link prediction while maintaining linear scalability.

The Challenge: GPs on Graphs

Applying GPs to graph-structured data presents two major hurdles:

  1. The Expressiveness Gap: Standard GP kernels are usually "feature-based" (ignoring graph topology) or "structure-based" (ignoring node features). Neither adequately captures the complex interplay where neighboring nodes often share similar properties.
  2. The Scalability Wall: Traditional GPs suffer from $O(N^3)$ computational complexity, making them impractical for large-scale graphs with thousands or millions of nodes.

Existing "deep kernels" or "spectral kernels" attempt to bridge this gap but often rely on simple base kernels or computationally expensive optimization procedures that struggle to capture local geometric structures efficiently.

Methodology: The GPSRF Model

The authors propose the Structure-aware Random Fourier (SRF) kernel to tackle these issues through three key innovations:

  • Subgraph-Aware Inputs: Instead of operating on raw node features, the SRF kernel takes $L$-hop subgraphs as inputs. A Graph Neural Network (GNN) acts as a transformation function, aggregating local structural information into a latent representation.
  • Spectral Kernel Learning: Leveraging Bochner’s theorem, the authors define the kernel in the spectral domain. Rather than picking a fixed kernel shape (like a Radial Basis Function), they learn the underlying spectral distribution $p(\omega)$. This transforms kernel selection into a distribution inference problem, allowing the model to adapt its "smoothness" to the specific data.
  • Random Fourier Features (RFF): To solve the scalability problem, the kernel is approximated using RFF. This turns the GP into a Bayesian linear model in a high-dimensional feature space, reducing the computational complexity from cubic to linear ($O(N)$) relative to the number of nodes.

To train the model (dubbed GPSRF), the authors developed a Variational EM algorithm. The E-step performs posterior inference over latent variables, while the M-step updates the GNN parameters and the spectral distribution. They also incorporate a "pseudo-label" threshold $\tau$ to leverage unlabeled nodes during training, which helps prevent overfitting in semi-supervised settings.

Key Insights

  • GNNs as Kernel Pre-processors: A powerful insight of this work is using a GNN not as the final classifier, but as a "structure-aware" feature extractor inside a GP kernel. This allows the GP to "see" the graph topology.
  • Learning the "Frequency" of Graphs: By learning the spectral distribution $p(\omega)$, the model can discover the optimal frequencies for the data. This allows the SRF kernel to fit highly oscillatory or complex functions that standard RBF kernels completely smooth over.
1D and 2D regression tasks comparing GPSRF to baseline kernels.
  • Linear Scaling for GPs: The use of Random Fourier Features is critical. It bypasses the need to invert large covariance matrices, making GPs a viable alternative to pure GNNs for large-scale graph tasks.

Results & Performance

The model was evaluated on five real-world benchmarks, including citation networks (Cora, Citeseer, Pubmed) and Amazon product co-purchase networks (Photo, Computers).

  • State-of-the-Art Performance: GPSRF consistently outperformed other GP-based models (like GP-SM and Deep Kernel GPs) and matched or exceeded the performance of popular GNNs like GCN, GAT, and GraphSAGE across all datasets.
  • Superior Link Prediction: On link prediction tasks, GPSRF achieved significantly higher AUC scores (e.g., 96.7% on Cora) compared to GAE and VGAE, likely due to its ability to capture local patterns more effectively.
  • Efficiency and Stability: The model converges quickly. As seen in the loss curves below, the training and validation losses stabilize within a few hundred steps. Furthermore, the pseudo-labeling threshold $\tau$ effectively reduces validation loss, demonstrating its utility in semi-supervised learning.
Training and validation loss curves on Cora and Photo datasets.

Limitations and Future Work

While highly effective, the current formulation is designed primarily for homogeneous graphs. Extending this to heterogeneous graphs with multiple relation types remains an open challenge. Additionally, while the model learns a spectral distribution, even more complex distributions (like mixture models or flow-based distributions) could further improve expressiveness. Finally, the current approach requires offline training, which might be a bottleneck for real-time applications where graphs evolve rapidly.

Summary updated

BibTeX
@inproceedings{fang2021structure,
  author = {Jinyuan Fang and Qiang Zhang and Zaiqiao Meng and Shangsong Liang},
  title = {{Structure-Aware Random Fourier Kernel for Graphs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=S8cydiLXQV},
}
Figure