Manuscript Offprint

arXiv:2611.04670

Sheaf-MPNN: A Library for Sheaf Neural Networks as Message Passing

Alessio Borgi, Mario Severino, Luke Braithwaite, Steve Azzolin, Rémi Bourgerie, Olga Zaghen, Emanuele Mule, Riccardo Ali, Leo Minh Kustermann, Edoardo Coppola, Antonio Purificato, Stefano Fiorini, Christopher Irwin, Filippo Spiga, Fabrizio Silvestri, Michael Bronstein, Pietro Liò

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Alessio Borgi1,2,∗^{1,2,*} [ALESSIO.BORGI@UNIROMA1.IT, AB3352@CAM.AC.UK]

Mario Severino1^{1} [MS3413@CAM.AC.UK]

Luke Braithwaite1^{1} [LB2027@CAM.AC.UK]

Steve Azzolin3^{3} [STEVE.AZZOLIN@UNITN.IT]

Rémi Bourgerie4^{4} [REMIBO@KTH.SE]

Olga Zaghen5^{5} [O.ZAGHEN@UVA.NL]

Emanuele Mule6^{6} [EMANUELE.MULE@TELECOM-PARIS.FR]

Riccardo Ali1^{1} [RMA55@CAM.AC.UK]

Leo Minh Kustermann7^{7} [LKUSTERMANN@ETHZ.CH]

Edoardo Coppola1^{1} [EC2013@CAM.AC.UK]

Antonio Purificato2^{2} [PURIFICATO@DIAG.UNIROMA1.IT]

Stefano Fiorini8^{8} [S.FIORINI1994@GMAIL.COM]

Christopher Irwin1^{1} [CLI23@CAM.AC.UK]

Filippo Spiga9^{9} [FSPIGA@NVIDIA.COM]

Fabrizio Silvestri2^{2} [FSILVESTRI@DIAG.UNIROMA1.IT]

Michael Bronstein10,11^{10,11} [MICHAEL.BRONSTEIN@CS.OX.AC.UK]

Pietro Liò1^{1} [PL219@CAM.AC.UK]

1^{1}Department of Computer Science and Technology, University of Cambridge, Cambridge, UK

2^{2}Department of Computer, Control and Management Engineering, Sapienza University of Rome, Rome, Italy

3^{3}Department of Information Engineering and Computer Science, University of Trento, Trento, Italy

4^{4}KTH Royal Institute of Technology, Stockholm, Sweden

5^{5}AMLab, University of Amsterdam, Amsterdam, Netherlands

6^{6}Télécom Paris, Institute Polytechnique de Paris, Paris, France

7^{7}ETH Zürich

8^{8}Independent researcher

9^{9}NVIDIA

10^{10}Department of Computer Science, University of Oxford, Oxford, UK

11^{11}AITHYRA, Vienna, Austria

  • Corresponding Author.

Abstract

Standard Graph Neural Networks (GNNs) implicitly assume that neighboring nodes share the same feature space, which contributes to oversmoothing and poor performance on heterophilic graphs. Sheaf Neural Networks (SNNs) remove this assumption by giving each node and edge its own vector space and learning restriction maps that transform features as they move between neighbors. These maps define a sheaf Laplacian that drives diffusion over the graph, but existing implementations often assemble it explicitly as a global sparse block matrix, which adds memory and computational overhead and can hinder scalability. In this paper, we introduce Sheaf-MPNN, a PyTorch Geometric library that reformulates sheaf diffusion as

©2026 Alessio Borgi et al..

License: CC-BY 4.0, see https://creativecommons.org/licenses/by/4.0/.

local incidence-wise transport and aggregation, eliminating the need to construct the global Laplacian. Sheaf-MPNN implements fifteen families of SNNs under a unified message-passing framework, each supporting both homogeneous and heterogeneous graphs, and directed and undirected settings, with diagonal, general, orthogonal, and low-rank restriction maps and attention-based predictors. We further provide a unified benchmarking suite covering node-and graph-level tasks, heterogeneous graph learning, and computational efficiency, enabling systematic and reproducible comparisons across architectures. We establish theoretical equivalence between these message-passing formulations and their original counterparts and identify the architectural mechanisms needed to preserve their propagation dynamics. This unified perspective provides a principled foundation for implementing, comparing, and extending sheaf-based architectures within standard graph learning frameworks. Source code is available at https://github.com/alessioborgi/sheaf-mpnn.

Keywords: Sheaf neural networks, Cellular sheaves, Message passing, Graph neural networks, Heterophily, Open source software, PyTorch Geometric

1 Introduction

Graph Neural Networks (GNNs) typically learn graph-structured representations through the message-passing paradigm, in which nodes update their representations by aggregating information from their neighbours (Gilmer et al., 2017). Sheaf Neural Networks (SNNs) enrich graph learning with cellular sheaves, which assign local vector spaces, or stalks, to nodes and edges, together with linear restriction maps for each node-edge incidence. These maps transport node representations into a shared edge stalk, where neighbouring signals can be compared. SNNs use this structure to define propagation operators, commonly based on the sheaf Laplacian, that allow neighbouring representations to remain consistent after transport even when their original features differ (Hansen and Gebhart, 2020; Bodnar et al., 2022). Subsequent research has explored how sheaves are constructed (Barbero et al., 2022a; Caralt et al., 2024; Gillespie et al., 2024), how information propagates through them (Suk et al., 2022; Barbero et al., 2022b; Zaghen et al., 2024; Bamberger et al., 2025; Borgi et al., 2026b; Bourgerie et al., 2026a), and extensions to different graph structures and feature spaces (Braithwaite et al., 2026; Fiorini et al., 2026a; Duta et al., 2023b; Mule et al., 2026; Borgi et al., 2026a; Ribeiro et al., 2026b; Ali et al., 2026; Van Looy et al., 2026). Despite their common foundations, these models differ in their restriction maps, propagation operators, normalization schemes, and update rules. Appendix A surveys these developments.

A common computational challenge arises from the explicit construction of sheaf operators. Existing SNN implementations assemble the global sheaf Laplacian as a sparse block matrix and apply it to the stacked node representations. For a graph with nn nodes and dd-dimensional stalks, this produces an nd×ndnd \times nd operator whose nonzero blocks may contain dense d×dd \times d matrices. Constructing and storing this operator introduces additional memory and computational overhead, particularly for large graphs or higher-dimensional stalks. Yet the action of the sheaf Laplacian is inherently local: each edge compares its endpoint representations after transport into a shared stalk, and the resulting contributions are mapped back to the incident nodes and aggregated. This suggests that sheaf propagation can be implemented directly through local message passing, without explicitly assembling the global Laplacian. Such a formulation removes the need for operator assembly, although its practical efficiency depends on the implementation and must be evaluated empirically.

Motivated by this observation, we introduce Sheaf-MPNN, a PyTorch Geometric library that implements sheaf propagation through local incidence-wise transport and aggregation. By expressing different SNN architectures within a common computational interface, Sheaf-MPNN facilitates their implementation, reuse, and comparison while integrating them with established graph learning tools. The library provides 15 families of SNNs, each with homogeneous and heterogeneous variants, and supports directed and undirected graph settings. It includes diagonal, general, orthogonal, and low-rank restriction maps, together with attention-based map predictors where applicable. To enable systematic evaluation, we also provide a unified benchmarking suite, covering more than 20 datasets, including node-and graph-level learning, heterogeneous graph benchmarks, and computational efficiency, with shared experimental configurations and reproducible evaluation protocols.

Beyond the library itself, we also develop the unified Sheaf Message Passing Neural Network (Sheaf-MPNN) theoretical framework that characterises how existing sheaf architectures can be expressed through local message passing. We derive explicit message-passing formulations for 15 architecture configurations and establish their theoretical equivalence to the original models, identifying the mechanisms required to preserve their propagation dynamics. These include augmented node states, type-conditioned restriction maps, and directed aggregation rules. We further show that the SHEAFPOOL graph-level readout (Braithwaite et al., 2026) can be formulated within the same framework by aggregating locally aligned node representations into a receive-only virtual node. Together, our contribution provides a common theoretical and computational foundation for implementing, comparing, and extending sheaf-based graph learning. Appendix C details the supported architectures, implementation choices, and normalization conventions.

References (53)