Abstract
Graph Neural Networks (GNNs) have inherent representational limitations due to their message-passing structure. Recent work has suggested that these limitations can be overcome by using unique node identifiers (UIDs). Here we argue that despite the advantages of UIDs, one of their disadvantages is that they lose the desirable property of permutation-equivariance. We thus propose to focus on UID models that are permutation-equivariant, and present theoretical arguments for their advantages. Motivated by this, we propose a method to regularize UID models towards permutation equivariance, via a contrastive loss. We empirically demonstrate that our approach improves generalization and extrapolation abilities while providing faster training convergence. On the recent BREC expressiveness benchmark, our proposed method achieves state-of-the-art performance compared to other random-based approaches.
Introduction: The Expressivity Paradox
Standard Graph Neural Networks (GNNs) rely on message passing, which is theoretically limited by the 1-WL (Weisfeiler-Lehman) isomorphism test. This means they are often "blind" to certain complex structures, such as identifying specific cycles or distinguishing between certain non-isomorphic graphs where local neighborhoods appear identical.
To overcome this, researchers have introduced Unique Node Identifiers (UIDs)—essentially giving every node a unique "name tag." While this makes GNNs Turing complete in theory, these random tags break permutation invariance. If the tags are shuffled, the GNN may produce different outputs for the same graph, leading to poor generalization. Previous attempts like Random Node Initialization (RNI) use simple resampling, but often suffer from slow convergence and overfitting.
The SIRI Framework
We introduce SIRI (Self-supervised Invariant Random Initialization), a method that leverages contrastive learning to retain the expressive power of UIDs while mathematically enforcing the necessary symmetry for generalization.
1. Controlled Non-Invariance
We theoretically identify an "Invariance Paradox": if every layer of a GNN is forced to be invariant to random IDs, the model loses the very expressive power the IDs were meant to provide. To resolve this, SIRI allows intermediate layers to be "aware" of the UIDs, only enforcing invariance at the final output layer.
2. Contrastive Regularization
During training, SIRI processes the same graph twice with different sets of random UIDs. A contrastive loss is applied to the final embeddings, forcing them to be identical regardless of the specific random values assigned to the nodes. This teaches the network to extract structural information from the IDs while ignoring their specific noise.
Empirical Results
Generalization and Invariance
As shown in the invariance ratio plots, SIRI effectively regularizes the model toward permutation invariance. On the isInTriangle task, SIRI achieved 88.45% accuracy in interpolation settings, significantly outperforming the RNI heuristic (74.87%).
Convergence Speed
On the EXP and CEXP datasets—benchmarks specifically designed to test expressivity beyond 1-WL—SIRI demonstrates superior training efficiency. While both RNI and SIRI can eventually reach high accuracy, SIRI converges much faster, requiring far fewer epochs to learn the underlying structural patterns.
State-of-the-Art Expressiveness
On the BREC (Benchmark for Rigorous Expressiveness Comparison), SIRI achieved a total accuracy of 56.5%, the highest among all random-based GNN approaches. It was particularly effective on "Regular" graphs, correctly distinguishing 71.4% of pairs compared to RNI’s 35.7%.
Conclusion
SIRI demonstrates that the benefits of unique node identifiers can be harnessed without sacrificing the fundamental symmetries of graph data. By using contrastive regularization, we achieve a model that is more expressive than standard GNNs, generalizes better than previous UID methods, and converges significantly faster. Future work will explore the integration of "matching oracles" to further refine how models identify nodes without relying solely on random initialization.
Summary updated