Neural Sheaf Diffusion: A Topological Perspective on Heterophily and Oversmoothing in GNNs

Cristian Bodnar, Francesco Di Giovanni, Benjamin Paul Chamberlain, Pietro Lio, Michael M. Bronstein

Graph Neural Networks (GNNs) have become the standard tool for learning on graph-structured data. However, they typically rely on two major assumptions that often fail in real-world applications. First is homophily—the belief that connected nodes likely share the same label. In heterophilic graphs (like chemical networks or transaction graphs), neighbors are often different, causing standard GNNs to perform poorly. Second is the assumption of a trivial geometry. Standard GNNs use a fixed graph Laplacian that treats all edges the same way. As more layers are added, this leads to oversmoothing, where node features become an indistinguishable "gray mush."

In this paper, the authors argue that these are not just separate bugs, but symptoms of a trivial underlying geometry. To address this, they introduce Neural Sheaf Diffusion (NSD), a framework that uses algebraic topology—specifically cellular sheaf theory—to learn a custom geometry for a graph, allowing models to flexibly smooth or "sharpen" features.

The Core Idea: Cellular Sheaves

To build a more expressive geometry, the authors turn to cellular sheaf theory. In this mathematical setup, a graph is augmented with additional structure:

  • Stalks: Each node and edge is assigned a vector space (a "stalk") of dimension $d$.
  • Restriction Maps: Each edge is equipped with linear maps that "transport" data from a node's stalk to the edge's stalk.
Restriction maps transporting data between node and edge stalks
  • Sheaf Laplacian: Instead of the standard scalar Laplacian, the graph's structure is represented by a block-matrix Sheaf Laplacian ($\Delta_\mathcal{F}$) that incorporates these linear restriction maps.

The core innovation of this paper is Neural Sheaf Diffusion. Instead of using a fixed, pre-defined sheaf, the model learns the restriction maps from the data itself using a small Multi-Layer Perceptron (MLP). This allows the model to "decide" how information should flow: it can learn to synchronize features (smoothing) or polarize them (sharpening) along specific edges.

They propose a discrete-time diffusion model: $$X_{t+1} = X_t - \sigma(\Delta_{\mathcal{F}(t)}(I \otimes W_1^t)X_tW_2^t)$$ where the sheaf $\mathcal{F}(t)$ can dynamically evolve over time based on the current node features.

Key Insights and Theoretical Findings

The introduction of sheaf theory provides several powerful theoretical insights into why standard GNNs fail and how NSD overcomes these limitations:

  • Stalk Dimension Matters: The authors prove that to linearly separate $C$ classes in the infinite time limit, the stalks need sufficient dimensionality. For diagonal maps, you need $d \geq C$; for orthogonal maps, $d \geq C/2$ is sufficient. This explains why standard GNNs (where $d=1$) inherently struggle with multi-class heterophilic tasks.
  • Path Dependence: In standard GNNs, moving information from node A to node B is the same regardless of the path taken. In a sheaf, transport can be path-dependent, allowing the model to capture much more complex relational structures.
  • Escaping the Kernel: Standard GNNs are mathematically "trapped" by the graph's structure—they can only decrease the "energy" (smoothness) of the signal. Sheaf convolutions are more flexible and can actually increase energy, effectively "un-smoothing" features when the task requires it.
Sheaf diffusion process over time, demonstrating the linear separation of classes

By learning the sheaf from data, the model effectively performs topological representation learning, evolving the underlying geometry of the graph alongside the node features to achieve clear class separation.

Empirical Results

The authors evaluated their models on a comprehensive suite of 9 datasets, covering both heterophilic (e.g., Texas, Wisconsin, Squirrel) and homophilic (e.g., Citeseer, Pubmed, Cora) graphs.

The NSD models—specifically the version using orthogonal maps, O(d)-NSD—showed dominant performance:

  • State-of-the-Art on Heterophily: NSD ranked 1st in 5 out of 6 heterophilic benchmarks, often by significant margins (e.g., a +7% improvement on the Squirrel dataset compared to the next best non-sheaf model).
  • Robustness on Homophily: Unlike many specialized heterophily models that fail on standard graphs, NSD remained highly competitive on traditional homophilic benchmarks, staying within ~1% of the top performers.
  • Efficiency: Despite the added complexity of stalks and restriction maps, the authors used small dimensions ($d=2$ or $3$), resulting in only a constant computational overhead compared to standard Graph Convolutional Networks (GCNs).

Limitations and Future Work

While Neural Sheaf Diffusion offers a powerful new paradigm, the authors note a few open challenges. First, their theoretical analysis focuses heavily on the "infinite time limit" (asymptotic behavior), leaving the generalization properties of learned sheaves as an open question. Second, while the stalk dimension $d$ is small, the Sheaf Laplacian is a larger block matrix; scaling this to massive graphs with millions of edges may require further optimization of sparse matrix operations. Finally, the current work focuses on 0-sheaves (nodes and edges). Future work could extend this to "cellular complexes" that incorporate triangles and higher-order faces to capture even deeper topological features.

Summary updated

BibTeX
@inproceedings{bodnar2022neural,
  author = {Cristian Bodnar and Francesco Di Giovanni and Benjamin Paul Chamberlain and Pietro Lio and Michael M. Bronstein},
  title = {{Neural Sheaf Diffusion: A Topological Perspective on Heterophily and Oversmoothing in GNNs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=vbPsD-BhOZ},
}
Figure