Graph Attention for Heterogeneous Graphs with Positional Encoding
Nikhil Shivakumar Nayak
TL;DR
This work tackles heterogeneity in graphs by benchmarking attention-based GNNs and identifying RGAT, GTN, and HGT as strong baselines for node classification and link prediction. It introduces spectral positional encoding (LPE) derived from the full Laplacian spectrum, leveraging eigenvalues $\lambda_i$ and eigenvectors $\phi_i$, and integrates it into RGAT, GTN, and HGT to provide both absolute and relative node positions. Empirical results show general performance gains across diverse datasets, with particularly strong improvements for HGT on $Tox21$ and $IMDB$ and for GTN on $ACM$, while RGAT can occasionally decline on $AIFB$. The work highlights the value of combining spectral embeddings with attention mechanisms and points to scalable transformer variants and broader tasks as promising future directions, with code made available.
Abstract
Graph Neural Networks (GNNs) have emerged as the de facto standard for modeling graph data, with attention mechanisms and transformers significantly enhancing their performance on graph-based tasks. Despite these advancements, the performance of GNNs on heterogeneous graphs often remains complex, with networks generally underperforming compared to their homogeneous counterparts. This work benchmarks various GNN architectures to identify the most effective methods for heterogeneous graphs, with a particular focus on node classification and link prediction. Our findings reveal that graph attention networks excel in these tasks. As a main contribution, we explore enhancements to these attention networks by integrating positional encodings for node embeddings. This involves utilizing the full Laplacian spectrum to accurately capture both the relative and absolute positions of each node within the graph, further enhancing performance on downstream tasks such as node classification and link prediction.
