Invariant-Based Weight Sharing for Message Passing
About
Message-passing neural networks (MPNNs) are a powerful framework for learning representations of graph-structured domains. However, weights in MPNNs act on features only, limiting their ability to capture structural patterns. We introduce a novel structure-aware weight sharing principle that explicitly incorporates information inherent to the graph structure. Weights are indexed directly by user-chosen graph invariants, i.e., functions preserved under node permutations, enabling systematic reuse across structurally equivalent subgraphs. We present ShareGNNs, which instantiate this principle within a simple encoder-decoder architecture, resulting in an MPNN with learnable adjacency and transformer-like connectivity. We show that their expressivity is at least as strong as the discriminative power of the chosen invariants, providing explicit control over the model complexity. Experiments on synthetic and real-world data, as well as subgraph counting tasks, demonstrate consistent improvements over standard MPNNs, competitive expressivity beyond the 1-WL test, and scalability to large datasets.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Graph Classification | NCI1 | Accuracy86.1 | 658 | |
| Graph Classification | IMDB-M | Accuracy53.1 | 425 | |
| Graph Classification | NCI109 | Accuracy86.8 | 267 | |
| Graph Classification | IMDB-B | Mean Accuracy77.7 | 159 | |
| Graph Regression | ZINC-12K | MAE0.107 | 57 | |
| Graph Classification | NCI1 Fair setup | Accuracy85.4 | 8 | |
| Graph Classification | IMDB-Multi Fair setup | Accuracy51.6 | 8 | |
| Graph Classification | IMDB-Binary Fair setup | Accuracy75.9 | 8 | |
| Graph Classification | NCI109 Fair setup | Accuracy85.4 | 6 | |
| Graph Classification | Mutagenicity Fair setup | Accuracy83.3 | 6 |