Performance Heterogeneity in Graph Neural Networks: Lessons for Architecture Design and Preprocessing

Lukas Fesser, Melanie WeberarXiv 2025 · DOI

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.

Figure 1: Heterogeneity profiles across three datasets. The x-axis represents individual graphs sorted by performance, showing that even advanced models like GPS exhibit significant performance drops on specific instances.

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.

Figure 6: Violin plots of class-distance ratios. A ratio above 1.0 (blue dashed line) indicates a graph is closer to a different class than its own, explaining the higher difficulty of the Enzymes dataset.

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

Abstract

Graph Neural Networks have emerged as the most popular architecture for graph-level learning, including graph classification and regression tasks, which frequently arise in areas such as biochemistry and drug discovery. Achieving good performance in practice requires careful model design. Due to gaps in our understanding of the relationship between model and data characteristics, this often requires manual architecture and hyperparameter tuning. This is particularly pronounced in graph-level tasks, due to much higher variation in the input data than in node-level tasks. To work towards closing these gaps, we begin with a systematic analysis of individual performance in graph-level tasks. Our results establish significant performance heterogeneity in both message-passing and transformer-based architectures. We then investigate the interplay of model and data characteristics as drivers of the observed heterogeneity. Our results suggest that graph topology alone cannot explain heterogeneity. Using the Tree Mover's Distance, which jointly evaluates topological and feature information, we establish a link between class-distance ratios and performance heterogeneity in graph classification. These insights motivate model and data preprocessing choices that account for heterogeneity between graphs. We propose a selective rewiring approach, which only targets graphs whose individual performance benefits from rewiring. We further show that the optimal network depth depends on the graph's spectrum, which motivates a heuristic for choosing the number of GNN layers. Our experiments demonstrate the utility of both design choices in practice.
BibTeX
@misc{fesser2025performance,
  author = {Lukas Fesser and Melanie Weber},
  title = {{Performance Heterogeneity in Graph Neural Networks: Lessons for Architecture Design and Preprocessing}},
  year = {2025},
  eprint = {2503.00547},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.00547},
}
Figure