Why Message Passing Is Not Enough: The Case for Sheaves
Published:

The Fundamental Assumption of Message Passing
Intuition First: Standard message passing is like asking every person in a room to shout their opinion, then averaging what you hear. In a room where everyone agrees (homophilic graph), the average is a good summary. But in a room where your neighbours all have opposite political views, the average is a useless mush that says nothing about your views. Sheaves give each pair of people a translation device: instead of averaging raw opinions, you first transform what each person says into a common frame of reference — then compare.
Standard message passing (e.g., GCN, GAT) computes something like:
For this to make sense, the features \(h_u^{(k)}\) from different neighbouring nodes must live in the same feature space and be meaningfully aggregatable (averageable, summable).
This is a strong assumption. Consider:
Heterophilic graphs: in a social network, a user interested in cooking might be connected to a user interested in music. Their feature vectors are in very different semantic directions. Averaging them produces something meaningful to neither.
Multi-relational graphs: “A is-parent-of B” and “A works-with B” are very different relationships. Aggregating \(h_B\) via both gives a confused mixture.
Cross-domain graphs: a node representing a paper (text features) connected to a node representing an author (profile features). These live in literally different feature spaces.
What Goes Wrong: The Heterophily Problem
On homophilic graphs (connected nodes tend to have the same label), GNNs work well — averaging similar nodes gives a good representation of the node’s label.
On heterophilic graphs (connected nodes tend to have different labels), the standard GNN suffers:
- It averages over nodes with different labels → the average is “between” all label classes → uninformative
- Oversmoothing pushes all nodes toward the global average faster → even worse on heterophilic data
- The model must learn to “undo” the averaging to recover discriminative information
Empirically this shows up as a clear gap. On the classic heterophilic benchmarks Chameleon and Squirrel (edge homophily \(h \approx 0.23\) and \(h \approx 0.22\), five classes each), a plain GCN sits in the mid-50s to mid-60s in accuracy, while models built for heterophily — and sheaf models in particular — sit several points higher. Note that these accuracies are still far above the 20% chance level: the failure of GCN here is a relative failure, not a collapse to random guessing.
The Core Issue: Features on Edges
Standard GNNs attach features to nodes and send them unchanged along edges. There is no mechanism to transform features as they cross an edge.
Consider two nodes \(u\) and \(v\) connected by an edge, with features \(x_u \in \mathbb{R}^d\). The message from \(u\) to \(v\) is (some function of) \(x_u\). But what if the “right” message from \(u\) to \(v\) should be a different projection of \(x_u\) — one that highlights what is relevant from \(u\)’s perspective to \(v\)?
Sheaves formalise exactly this. Each edge \(e\) gets its own vector space, and each endpoint gets its own linear map into it. For the edge \(e = (u,v)\) these are
so that \(u\)’s features are transformed before they are compared to \(v\)’s (also transformed) features. Note that the transformation happens on the way to the shared edge space, not directly from node to node.
From Flat to Structured Aggregation
Standard message passing:
All neighbour features aggregated directly.
Sheaf message passing:
Each neighbour feature is first pushed into the edge space by \(\mathcal{F}_{u \trianglelefteq e}\) and then pulled back into \(v\)’s space by \(\mathcal{F}_{v \trianglelefteq e}^{\top}\) — a transport from \(u\)’s frame to \(v\)’s frame.
The restriction maps can be constrained to different matrix classes:
- Scalar (\(d = 1\)): a single signed number per endpoint. Crucially the sign is free, so the transport \(\mathcal{F}_{v \trianglelefteq e}^{\top}\mathcal{F}_{u \trianglelefteq e}\) can be negative — something softmax attention (GAT) cannot express.
- Diagonal: elementwise rescaling — captures which stalk coordinates to emphasise.
- Orthogonal: rotations and reflections in feature space — preserves norm, changes direction.
- General (\(d \times d\) matrix): full linear transformation — most expressive.
The Mathematical Object: A Cellular Sheaf
A cellular sheaf \(\mathcal{F}\) on a graph \(G = (V, E)\) assigns:
- A vector space \(\mathcal{F}(v)\) to each node \(v\) (the “stalk” over \(v\))
- A vector space \(\mathcal{F}(e)\) to each edge \(e\) (the “stalk” over \(e\))
- A linear map \(\mathcal{F}_{v \trianglelefteq e} : \mathcal{F}(v) \to \mathcal{F}(e)\) for each node \(v\) incident to \(e\) (the “restriction map”)
The restriction maps “restrict” the node feature to the edge — producing a view of the node from the edge’s perspective. The notation \(v \trianglelefteq e\) reads “\(v\) is a face of \(e\)”, i.e. \(v\) is an endpoint of \(e\).
This structure, coming from algebraic topology, provides a principled mathematical foundation for understanding information flow on graphs beyond simple averaging.
Why This Matters for Deep Learning
Sheaf-based GNNs can:
- Handle heterophilic graphs by learning restriction maps that align features of nodes with different labels
- Model multi-relational graphs with different maps per edge type
- Enable richer information flow: the “disagreement” \(\mathcal{F}_{v \trianglelefteq e} x_v - \mathcal{F}_{u \trianglelefteq e} x_u\) measures edge inconsistency — a useful signal
- Connect to topological data analysis, providing interpretability
The next posts build this intuition into concrete architectures: the sheaf Laplacian, Neural Sheaf Diffusion, and Polynomial Neural Sheaf Diffusion.
References
- Hansen, J., & Gebhart, T. (2020). Sheaf Neural Networks. NeurIPS 2020 GRL+ Workshop (first application of cellular sheaves to graph neural networks, using a hand-crafted sheaf Laplacian in a synthetic setting).
- Hansen, J., & Ghrist, R. (2019). Toward a Spectral Theory of Cellular Sheaves. Journal of Applied and Computational Topology (the spectral theory of the sheaf Laplacian that all sheaf GNNs build on).
- Bodnar, C., Di Giovanni, F., Chamberlain, B. P., Liò, P., & Bronstein, M. M. (2022). Neural Sheaf Diffusion: A Topological Perspective on Heterophily and Oversmoothing in GNNs. NeurIPS 2022 (NSD: learning restriction maps from data to build the sheaf Laplacian, with theoretical analysis of heterophily and oversmoothing).
- Zhu, M., Wang, X., Shi, C., Ji, H., & Cui, P. (2021). Interpreting and Unifying Graph Neural Networks with An Optimization Framework. WWW 2021 (unified GNN analysis showing that oversmoothing corresponds to feature homogenisation by the graph Laplacian).
