DiffWire: Inductive Graph Rewiring via the Lovász Bound

Adrián Arnaiz-Rodríguez, Ahmed Begga, Francisco Escolano, Nuria Oliver

Abstract

Graph Neural Networks (GNNs) have become the standard for graph-based learning, yet they are frequently hampered by structural issues such as over-smoothing, over-squashing, and under-reaching. We introduce DiffWire, a novel framework that addresses these challenges through fully differentiable, inductive graph rewiring. By utilizing the Lovász bound to bridge commute times and spectral gaps, DiffWire enables GNNs to learn optimal graph topologies. Our proposed CT-LAYER and GAP-LAYER demonstrate significant performance improvements across social network and bioinformatics datasets while maintaining the graph's global structure.

Introduction

Modern Message Passing Neural Networks (MPNNs) update node representations by aggregating information from immediate neighbors. While powerful, this local focus leads to three primary failures:

  1. Over-smoothing: Features become indistinguishable across deep layers.
  2. Over-squashing: Information loss occurs at graph bottlenecks.
  3. Under-reaching: Inability to capture long-range dependencies in shallow networks.

Existing solutions often involve "rewiring" the graph as a preprocessing step. However, these methods typically rely on non-differentiable "black box" algorithms that lack inductivity and require extensive manual hyperparameter tuning. DiffWire overcomes these hurdles by making the rewiring process an integral, trainable part of the neural network.

The DiffWire Framework

DiffWire is grounded in the Lovász bound, a mathematical principle that relates the Commute Time (the expected time for a random walk to travel between nodes) to the Spectral Gap (a measure of graph connectivity). This connection allows for a unified approach to both diffusion-based and curvature-based rewiring.

Differentiable Rewiring Layers

The framework introduces two primary layers:

  • CT-LAYER (Commute Time Layer): This layer treats the graph as an electrical network, calculating "effective resistance" between nodes. It identifies edges critical for global topology and assigns them higher weights, effectively performing spectral sparsification to remove noise while preserving essential connections.
  • GAP-LAYER (Spectral Gap Layer): This layer targets bottlenecks directly. By calculating the gradient of the spectral gap, it can strategically add or remove edges to optimize information flow for specific tasks.
Comparison of the standard MINCUT baseline (a) and the proposed DiffWire architecture (b) incorporating a rewiring layer.

As shown in the architecture comparison above, DiffWire integrates the rewiring step directly into the pipeline, allowing the model to learn the best graph structure for the given data.

The internal mechanism of the CT-LAYER, showing the transformation from input features X and adjacency A to a rewired transition matrix T, guided by a specific loss function.

Experimental Evaluation

DiffWire was evaluated on a broad spectrum of benchmarks, including social networks (REDDIT-B, IMDB-B), bioinformatics (MUTAG, PROTEINS), and node classification tasks (Cora, Wisconsin).

Key Results

  • Performance Gains: DiffWire achieved state-of-the-art results on social network datasets. For instance, on IMDB-B, accuracy improved from approximately 60% to 70% compared to traditional rewiring methods like SDRF.
  • Heterophily Handling: The CT-LAYER proved exceptionally effective for heterophilic graphs (where connected nodes have different labels), outperforming standard GCNs by nearly 10% on the Wisconsin dataset.
  • Inductive Capability: Unlike preprocessing methods, DiffWire learns a generalizable rewiring strategy. When presented with unseen graphs at test time, the model can instantly apply its learned rewiring logic without further optimization.

Discussion and Conclusion

The primary innovation of DiffWire is the transition from heuristic-based preprocessing to end-to-end differentiable graph optimization. By leveraging the Lovász bound, the model discovers optimal structures through gradient descent, eliminating the need for manual tuning.

While the current implementation faces computational challenges—specifically $O(n^3)$ complexity for spectral calculations—it sets a new precedent for structural learning in GNNs. Future research will focus on developing sparse implementations to scale these benefits to massive, real-world networks.

Summary updated

BibTeX
@inproceedings{arnaizrodriguez2022diffwire,
  author = {Adrián Arnaiz-Rodríguez and Ahmed Begga and Francisco Escolano and Nuria Oliver},
  title = {{DiffWire: Inductive Graph Rewiring via the Lovász Bound}},
  booktitle = {LoG},
  year = {2022},
  url = {https://openreview.net/forum?id=nOaW_iFb1R},
}
Figure