Abstract
Graph Neural Networks (GNNs) are typically evaluated based on their average performance across a dataset. However, this metric masks a significant phenomenon: performance heterogeneity. This paper investigates why GNNs exhibit extreme performance variance across individual graphs within the same dataset. By leveraging the Tree Mover’s Distance (TMD) and spectral analysis, we identify structural and feature-based drivers of difficulty. We propose two heterogeneity-informed interventions—Selective-FoSR and a Spectral Depth Heuristic—that improve model robustness and performance by tailoring preprocessing and architecture to the specific needs of individual graphs.
Introduction
In the development of Graph Neural Networks (GNNs), researchers often focus on improving mean accuracy or minimizing mean absolute error (MAE) across benchmark datasets. While these aggregate metrics provide a high-level view of model capability, they obscure a critical reality: GNNs often perform exceptionally well on some graphs while failing completely on others within the same task. This "performance heterogeneity" suggests that a "one-size-fits-all" approach to architecture design and preprocessing may be suboptimal.
Previous work has explored node-level difficulty in social networks, often linking it to simple topological features like node degree. However, for graph-level tasks such as molecular property prediction or protein analysis, the causes of difficulty are more complex. This study systematically characterizes these performance gaps and introduces principled methods to mitigate them.
Quantifying Performance Heterogeneity
To understand this phenomenon, we generated "Heterogeneity Profiles" for standard models, including Graph Convolutional Networks (GCN) and the transformer-based GraphGPS. By tracking performance on every individual graph across 100 trials, we observed massive variance. In datasets like Enzymes, a model might achieve 100% accuracy on one subset of graphs while consistently failing on another.
Interestingly, simple topological features like graph density or clustering coefficients fail to predict which graphs will be "hard." This suggests that the difficulty is rooted in a deeper interplay between graph structure and node features.
The "Bad Neighbor" Problem and Tree Mover’s Distance
To explain why certain graphs are inherently more difficult, we utilize the Tree Mover’s Distance (TMD). TMD is a metric that compares graphs by considering both their hierarchical structure and their node features simultaneously.
Our analysis reveals a "Bad Neighbor" problem: difficult graphs are often those that are mathematically closer (via TMD) to a graph with a different label than to graphs of their own class. When a GNN is trained to be stable, it naturally struggles to distinguish these "imposter" graphs from the target class. As shown in the class-distance ratio analysis, datasets with higher heterogeneity, like Enzymes, contain many more graphs that are closer to other classes than to their own, compared to simpler datasets like Mutag.
Heterogeneity-Informed Interventions
Recognizing that not all graphs require the same treatment, we propose two interventions:
1. Selective-FoSR (First-order Spectral Rewiring)
Standard spectral rewiring techniques aim to reduce bottlenecks by adding edges to every graph in a dataset. However, we found that this can actually degrade performance on graphs that are already well-structured. Selective-FoSR applies rewiring only to "difficult" graphs identified by small spectral gaps. This targeted approach prevents over-smoothing on simple graphs while providing necessary connectivity to complex ones.
2. Spectral Depth Heuristic
Choosing the number of GNN layers is typically a matter of grid-search. We propose a more principled approach by treating GNN layers as time steps in a consensus process. Using the "Fiedler value" ($\lambda_2$, the second smallest eigenvalue of the graph Laplacian), we can predict the optimal depth as approximately $1/\lambda_2$. This heuristic ensures that information can propagate across bottlenecks without the risk of over-squashing or over-smoothing.
Key Results and Conclusion
Experimental results demonstrate that these targeted strategies consistently outperform global approaches. On the Enzymes dataset, Selective-FoSR improved GCN accuracy to 30.1%, compared to 23.8% for the baseline and 27.2% for standard FoSR. Furthermore, the Spectral Depth Heuristic suggested a 7-layer architecture for Mutag and Enzymes, which yielded a 3-5% accuracy boost over the 4-layer models typically found via standard tuning.
In conclusion, performance heterogeneity is a fundamental characteristic of GNNs that practitioners must address. By moving toward selective preprocessing and mathematically grounded architecture choices, we can build more robust models that perform reliably across the full spectrum of graph diversity.
Summary updated