[edit]
GNNs Getting ComFy: Community and Feature Similarity Guided Rewiring
Proceedings of the Geometry, Topology, and Machine Learning Workshop, PMLR 325:277-318, 2026.
Abstract
Maximizing the spectral gap through graph rewiring has been proposed to enhance the performance of message-passing graph neural networks (GNNs) by addressing over-squashing. However, as we show, minimizing the spectral gap can also improve generalization. To explain this, we analyze how rewiring can benefit GNNs within the context of stochastic block models. Since spectral gap optimization primarily influences community strength, it improves performance when the community structure aligns with node labels. Building on this insight, we propose three distinct rewiring strategies that explicitly target community structure, node labels, and their alignment: (a) community structure-based rewiring (ComMa), a more computationally efficient alternative to spectral gap optimization that achieves similar goals; (b) feature similarity-based rewiring (FeaSt), which focuses on maximizing global homophily; and (c) a hybrid approach (ComFy), which enhances local feature similarity while preserving community structure to optimize label-community alignment. Extensive experiments confirm the effectiveness of these strategies and support our theoretical insights.\footnote[2]{This work is an extended abstract which was presented as a lightning talk at GTML 2025. It is based on a previously published work at ICLR 2025 \citep{rubio-madrigal2025gnns}. The appendix reproduces relevant material from the full paper for completeness.}