Bayesian Sheaf Neural Networks
- Bayesian Sheaf Neural Networks are variational extensions of sheaf-based graph neural networks that treat the sheaf Laplacian as a latent random variable.
- They improve robustness on heterophilic graphs by replacing deterministic message passing with Bayesian averaging over learned sheaf restriction maps.
- Key techniques include variational inference using the ELBO, specialized distributions such as the Cayley transform for SO(d) maps, and robust optimization strategies.
Bayesian Sheaf Neural Networks (BSNNs) are variational Bayesian extensions of sheaf-based graph neural networks in which the sheaf Laplacian, or equivalently the restriction maps defining a cellular sheaf on a graph, is treated as latent random structure rather than as a deterministic point estimate. In this formulation, the network retains sheaf-diffusion message passing while replacing deterministic sheaf learning with variational inference over sheaves, with the stated aim of improving robustness on heterophilic graph data, especially when labeled data are limited (Gillespie et al., 2024). Within the broader sheaf-neural literature, deterministic Sheaf Neural Networks provide the mathematical substrate—stalks, restriction maps, global sections, and sheaf Laplacians—on top of which a Bayesian treatment can be built, but not every sheaf neural network is Bayesian in the technical sense (Mehrab et al., 29 Jan 2026).
1. Conceptual position within graph representation learning
BSNNs are motivated by the limitations of ordinary message passing on heterophilic graphs. Standard GNNs and many higher-order extensions work best on homophilic graphs, where neighboring nodes tend to share labels. On heterophilic graphs, adjacent nodes often belong to different classes, and ordinary message passing can oversmooth features and destroy class-separating information. Sheaf neural networks address this by replacing the graph Laplacian with a sheaf Laplacian or its normalized variant , so that neighboring nodes need not be aggregated through a single uniform averaging geometry (Gillespie et al., 2024).
The immediate precursor is deterministic Neural Sheaf Diffusion. In that setting, the sheaf is learned as a function of node features, which is expressive but also potentially overly sensitive to limited labeled data, random initialization, hyperparameter choices, and noise in the input features. BSNNs replace that point-estimate view by treating the sheaf itself as a latent random variable and learning a distribution over sheaves rather than a single sheaf. The resulting model is framed as a Bayesian counter-measure to brittle sheaf learning, not as a replacement for sheaf diffusion as such.
A recurring misconception is to equate any sheaf-based graph network with a Bayesian model. That is incorrect. Deterministic sheaf architectures may learn restriction maps, normalized sheaf Laplacians, and sheaf-aware diffusion operators without introducing priors, posteriors, variational objectives, or explicit uncertainty quantification. In the technical sense used by the BSNN literature, the defining Bayesian step is the introduction of a variational posterior over sheaf structure.
2. Sheaf-theoretic and diffusion foundations
The sheaf-neural framework begins with an undirected graph . In the deterministic SNN presentation, the graph is viewed as a finite topological space via the Alexandrov topology. Each vertex has an associated open star , each edge has , and a sheaf of vector spaces is specified by assigning a vector space to each vertex, a vector space 0 to each edge, and linear restriction maps
1
whenever 2 is a vertex of 3 (Mehrab et al., 29 Jan 2026).
If a graph with features is denoted 4, each node 5 carries a feature vector 6. The collection 7 can be regarded as sections of a constant sheaf 8. The essential sheaf-theoretic departure from ordinary GNNs is that node-to-edge relations need not be identity maps: the restriction maps encode structured local compatibility. The usual sheaf principle then applies: local data can be “glued” into global data when the local pieces are consistent.
This consistency is measured through the sheaf Laplacian. With chain spaces
9
and a coboundary operator 0 defined for an oriented edge 1 connecting 2 and 3 by
4
the sheaf Laplacian is
5
It is positive semidefinite, and its kernel corresponds to global sections. When all stalks are 6 and all restriction maps are identities, the construction reduces to the ordinary graph Laplacian 7, so the sheaf model is a strict generalization of Laplacian-based GNNs (Mehrab et al., 29 Jan 2026).
The same structure underlies sheaf diffusion. In Neural Sheaf Diffusion, node features evolve under
8
where 9. The harmonic space is
0
and the diffusion limit satisfies
1
Accordingly, sheaf diffusion learns a task-adapted local consistency geometry whose limiting space need not be the constant-signal subspace of the ordinary graph Laplacian (Dönmez et al., 11 May 2026).
3. Variational Bayesian formulation
The BSNN formulation is given for semi-supervised node classification on a graph 2 with node features 3, observed labels 4, and unobserved labels 5. The predictive model is 6, implemented by a sheaf neural network whose layers use sampled sheaves 7. The paper’s graphical model is summarized by
8
where 9 is the adjacency matrix, 0 parameterizes the variational sheaf learner, and 1 parameterizes the classifier and sheaf-network weights (Gillespie et al., 2024).
The sheaf diffusion layer is based on the discretized process
2
and the layer update used in the paper is
3
with 4, 5, stalk dimension 6, feature-channel count 7, and nonlinearity 8. A stack of such layers is used, and each layer can have its own sampled sheaf 9.
The Bayesian step is to promote the sheaf to a latent variable. The intractable posterior 0 is approximated by a variational family 1. The evidence lower bound is written as
2
with
3
This is the objective optimized during training.
The variational sheaf learner is defined per incident node-edge pair 4. Both posterior and prior are factorized: 5 Their distributional parameters are produced by an MLP: 6 where 7 is the other endpoint of edge 8. This is an amortized posterior over restriction maps: the network infers local sheaf geometry from endpoint features rather than storing a single deterministic map for each incidence.
4. Restriction-map families and the Cayley-distribution construction
The paper treats three families of restriction maps. For general linear restriction maps, 9 is a 0 matrix, with 1. A latent Gaussian sample
2
is reshaped into a 3 matrix, with reparameterization
4
and prior
5
For invertible diagonal restriction maps, 6, a Gaussian sample is drawn in 7, and the matrix is set to
8
with standard normal prior on the diagonal vector.
The special orthogonal case is the paper’s distinctive probabilistic contribution. Here 9, 0 is a mean rotation, 1 is a concentration parameter, and the posterior family is
2
with prior equal to the uniform distribution 3. The family 4 is defined through the Cayley transform
5
whose inverse, for 6 with 7 not an eigenvalue, is
8
This yields a reparameterizable probability distribution on 9, which is essential for gradient-based variational optimization (Gillespie et al., 2024).
The density with respect to normalized Haar measure is given in closed form: 0 For 1, the paper identifies 2 with a wrapped Cauchy distribution on the circle 3. For 4, it relates 5 to an angular central Gaussian distribution on 6, pushed forward through the standard two-fold cover 7.
The same paper also strengthens an expressivity claim for special orthogonal sheaves. It proves that for any 8, if 9 denotes the class of connected graphs with 0 classes, then 1 has linear separation power over 2. This supports the use of 3-valued restriction maps not only as a probabilistic convenience but also as an expressive sheaf family.
5. Optimization, inference, and empirical behavior
Training optimizes a Monte Carlo estimate of the ELBO. When the KL term is tractable, the objective is
4
and when it is not, the paper uses
5
A KL weight 6 is cyclically annealed to prevent KL vanishing. For Gaussian posteriors against standard normal priors, analytic KL expressions are used; for Cayley versus uniform on 7, analytic KL formulas are given for 8, while for 9 the KL is estimated by sampling (Gillespie et al., 2024).
The implementation pipeline is explicit. The variational sheaf learner first applies a linear layer to resize node features to dimension 00, concatenates endpoints of each edge to build 01 incident-pair inputs, uses an MLP to produce 02, samples sheaf restriction maps 03, propagates features through 04 sheaf layers, applies a final linear classifier, and optimizes the ELBO estimator with backpropagation. At test time, prediction is performed by ensembling over multiple sampled sheaves so that uncertainty in the learned variational posterior is integrated out in the predictive point estimate.
The reported experiments are on the WebKB datasets Texas, Wisconsin, and Cornell. Node features are 1703-dimensional bag-of-words vectors, classes are five—student, project, course, staff, and faculty—and the graph sizes are 183 nodes and 325 edges for Texas, 183 nodes and 298 edges for Cornell, and 251 nodes and 515 edges for Wisconsin. The evaluation protocol uses 10 fixed splits of the data with 05 train/validation/test proportions, hyperparameter grid search, retraining and evaluation with 30 random seeds for the best setting, and a Wilcoxon signed-rank test at 06. The grid includes hidden channels 07, stalk dimensions 08, layers 09, dropout 10, learning rate 11, ELU activation, weight decay 12, patience 13, max epochs 14, Adam optimization, and ensemble size 15 for BSNN.
Empirically, the paper reports that on each dataset the best test accuracy among the compared models is achieved by one of the BSNN variants; 16-BSNN outperforms the corresponding deterministic 17-NSD on all three datasets; Gen-BSNN significantly outperforms Gen-NSD on all three datasets; and diagonal results are mixed but still competitive. The standard deviation across 30 seeds is generally lower for BSNN than NSD, and when performance is averaged over all hyperparameter settings, BSNN consistently dominates the corresponding deterministic model. The stated interpretation is that Bayesian averaging over plausible sheaves is especially helpful when the sheaf family is expressive and training data are limited.
6. Deterministic sheaf neural networks and the non-Bayesian biomedical case
A separate sheaf-neural development presents Sheaf Neural Networks as a deterministic generalization of graph neural networks and applies them to a biomedical classification problem. That model uses a sheaf-aware diffusion operator in place of a standard graph convolution, with learned sheaves at each layer and general, unconstrained restriction maps. When the sheaf in every layer is the constant sheaf 18, the architecture reduces to the ordinary Laplacian-based GNN case. Training is standard supervised node classification in a transductive setting, using Adam with a learning-rate scheduler for 400 epochs, no mini-batching, and regularization through dropout, batch normalization, layer normalization, and weight decay. Hyperparameters are selected by exhaustive grid search within each cross-validation fold, with the best setting chosen by mean validation accuracy across repeated 10-fold stratified cross-validation runs (Mehrab et al., 29 Jan 2026).
The biomedical application is osteosarcoma classification. The dataset contains 224 XANES spectra from bone tissue samples, each spectrum having 501 data points. The binary labels are 147 tumor samples and 77 control samples. Samples are reduced to 50 dimensions by PCA before graph construction; the graph is built by computing cosine similarity between every pair of samples in PCA space, sorting similarities, and adding edges from the most similar pairs until the graph becomes connected. Each node is therefore a patient tissue sample with a 50-dimensional feature vector, and the task is tumor-versus-healthy node classification.
Evaluation uses 10-fold stratified cross-validation repeated 5 times with different shuffles. The main metrics are fold accuracy and majority-vote accuracy; the appendix additionally reports precision, recall, F1, and AUC. The best-performing model is SheafGeneral, with fold accuracy
19
and majority-vote accuracy
20
For comparison, GraphSAGE achieves 21 fold accuracy and 22 majority-vote accuracy, while GAT and GCN are much lower, around 23 and 24, respectively. In the appendix, SheafGeneral also achieves precision 25, recall 26, F1 27, and AUC 28.
This result is directly relevant to BSNNs because it demonstrates that the underlying deterministic sheaf architecture can outperform standard GNN baselines on a concrete biomedical task. It is not, however, a Bayesian sheaf neural network in the explicit sense of Bayesian inference, variational learning, priors, posteriors, or uncertainty quantification. The paper itself states that a Bayesian treatment could be built later on top of the deterministic sheaf-Laplacian framework.
7. Oversmoothing, representation geometry, and limitations
A later theoretical development reinterprets Neural Sheaf Diffusion through incidence-quiver representations. For an undirected graph 29, the incidence quiver 30 has vertices 31 and arrows 32 for every incidence 33. Under the paper’s correspondence, finite-dimensional cellular sheaves on 34 are equivalent to finite-dimensional representations of 35, with fixed stalk dimensions giving a representation space
36
and gauge group
37
acting by base change
38
On this view, oversmoothing is not only spectral collapse but representation degeneration: direct-sum decompositions of the learned sheaf induce decompositions of the harmonic space
39
so collapse toward low-complexity summands can destroy discriminative information in the diffusion limit (Dönmez et al., 11 May 2026).
The same work studies the trivial subrepresentation 40, in which all stalks align so that restriction maps act as identities on a one-dimensional subspace. On this summand, the Dirichlet energy reduces to ordinary graph Laplacian energy, and for a connected graph the corresponding global sections are constant. To bias training away from such collapse, the paper introduces the moment-map-inspired regularizers CentMM and ThetaMM: 41
42
It also identifies an equal-stalk obstruction: when 43, admissibility for learnable stability parameters forces the trivial all-object summand onto a stability wall, whereas non-uniform stalk dimensions such as 44 remove this obstruction. On heterophilic benchmarks, the reported results are consistent with this mechanism: rectangular architectures can reduce variance or improve validation behavior, and on Wisconsin the rectangular ThetaMM model reaches 45, while both rectangular and square models remain resilient up to 46 before numerical instability appears at 47 (Dönmez et al., 11 May 2026).
For Bayesian sheaf models, these results do not constitute a formal Bayesian derivation, but they sharpen the geometry of what a posterior over sheaves is implicitly ranging over. This suggests that priors over restriction maps should respect representation geometry rather than treat matrix entries as naive isotropic parameters; a plausible implication is that CentMM and ThetaMM can be read as soft geometric priors or MAP regularizers; and the equal-stalk obstruction suggests that the choice 48 functions as a structural prior over feasible stability behavior, not merely as a capacity choice.
The current BSNN formulation also has explicit limitations. The variational posterior is factorized over incident node-edge pairs and therefore ignores posterior correlations between restriction maps; the Cayley family is exploited analytically most conveniently for 49, while for 50 KL terms are sampled rather than closed form; experiments are limited to WebKB node classification in a low-data regime; prediction cost is higher because inference uses ensembling over sampled sheaves; and the empirical study focuses on accuracy, standard deviation, and hyperparameter robustness rather than on calibration curves, predictive entropy, or out-of-distribution uncertainty analysis (Gillespie et al., 2024).