Sheaf4Rec: What a Recommender Gains from a Vector Space per Node

13 minute read

Published:

TL;DR: A user's behaviour depends on which items they interact with, so a single embedding vector is arguably the wrong object — the same user is a different thing in different contexts. Sheaf4Rec puts a cellular sheaf on the bipartite user–item graph, so each node carries a vector space and each interaction a restriction map, and trains it with the Bayesian Personalized Ranking loss. It reports up to +11.29% NDCG@10 and +8.53% F1@10 over NGCF, KGTORe and other GNN recommenders, with every improvement significance-tested. Two things to read carefully: the gains are driven by recall, not precision, and the abstract's "2.5% to 37%" efficiency range does not map onto the timing table.
Paper: Sheaf4Rec: Sheaf Neural Networks for Graph-based Recommender Systems
Authors: Antonio Purificato, Giulia Cassarà, Federico Siciliano, Fabrizio Silvestri (Sapienza University of Rome), Pietro Liò (University of Cambridge)
Preprint: arXiv:2304.09097v3, March 2024 · code

Why a recommender might want a vector space per node

Collaborative filtering on a bipartite user–item graph is the canonical GNN success story: nodes are users and items, edges are observed interactions, and stacked propagation layers cluster users with shared tastes. NGCF, LightGCN and UltraGCN all work this way.

The paper’s objection is about representation, not propagation. Every one of those models assigns each user a single static vector, and the claim is that this cannot carry what a user is:

Take, for instance, a user’s behaviour, which is influenced by the items they interact with. Traditional vector representations may lack expressive power to capture the nuances of such behaviours, underscoring the need for a full vector space.

The mapping onto sheaf structure. Node stalks hold user and item representations, so the 0-cochains \(C^0\) are the collection of all user and item embeddings. Edge stalks correspond to the observed preference scores \(r_{i,j}\) — the interaction is the discourse space. The restriction map for a (user, item) pair says how that user's representation manifests in that specific interaction, which is precisely the "same user, different context" intuition made into a linear map.

This is a different use of a sheaf from the rest of Book III. In NSD or Sheaf Hypergraph Networks the sheaf exists to fix heterophily and oversmoothing on a graph whose labels are the target. Here it exists because relationships are the label — the ranking task is about the edges, so putting structure on the edges is the natural move.

The pipeline

Nodes start as bare identifiers, so two embedding tables \(\Psi_u = \bigcup_{j\in U}\psi^u_j\) and \(\Psi_v = \bigcup_{i \in I}\psi^v_i\) are randomly initialised and trained end-to-end. The embedded graph feeds a stack of \(N\) sheaf layers, each aggregating a node’s embedding with the transported representations of its neighbours, following the NSD discretisation \(X(t+1) = X(t) - \sigma(\Delta_{\mathcal{F}(t)}(I_n \otimes W^t_1)X_tW^t_2)\).

Scoring is a single matrix product. The final layer’s user and item representations \(\mathcal{F}^u\) and \(\mathcal{F}^v\) combine into

\[ S = (\mathcal{F}^u)^{\top}\mathcal{F}^v, \]

and each row is ranked to produce a user’s recommendation list.

Training uses Bayesian Personalized Ranking, which fits the setting exactly: positive edges are observed interactions, negatives are absences, and the loss

\[ \mathrm{BPR}(S) = -\ln\sigma\!\big(s_{\text{pos}} - s_{\text{neg}}\big) \]

maximises the probability that an observed item outranks a sampled unobserved one. Mini-batches sample one positive and one negative item per user.

The bipartite step is the least reproducible part of the paper. Sheaf models have trouble on bipartite graphs — NSD's own Proposition 9 is an impossibility result about balanced bipartite graphs, so this is a real obstacle, not a technicality. Sheaf4Rec's answer is one sentence: the method "involves computing a projection on the bipartite graph, transforming it into a structure that is not strictly bipartite but retains the same properties." No equation, no definition of which properties are retained, and no ablation against the unprojected graph. Given that the entire architecture rests on it, this is the gap a reimplementation would hit first.

Results

Three datasets spanning four orders of magnitude of density: Facebook Books (1,398 users, 2,933 items, 1,878 ratings, 0.025% density), Yahoo! Movies (4,000 / 2,626 / 69,846, 0.664%), MovieLens 1M (6,040 / 3,900 / 1,000,000, 4.24%). Splits are 80/10/10; the tuned configuration is 64 latent dimensions and 5 layers.

Headline ranking metrics, with every improvement marked significant by paired Wilcoxon tests at \(p < 0.01\) with Bonferroni correction:

 Facebook BooksYahoo! MoviesMovieLens 1M
F1@100.029 (+7.41%)0.076 (+4.11%)0.140 (+8.53%)
NDCG@100.066 (+11.29%)0.147 (+7.30%)0.182 (+7.69%)
F1@200.024 (+9.09%)0.062 (+8.77%)0.151 (+7.09%)
NDCG@200.081 (+3.85%)0.162 (+1.82%)0.197 (+8.24%)

The significance testing is worth crediting — it is not standard in this literature, and it converts “our model is better” into a checkable claim. The absolute values are low (F1@10 of 0.029 on Facebook Books) but that is the dataset: 1,878 ratings across 1,398 users is barely more than one interaction each.

The gains are recall, not precision. Table 5 breaks F1 apart, and the picture changes:
  • MovieLens 1M P@10: UltraGCN 0.170 and KGTORe 0.153, against Sheaf4Rec's 0.141.
  • Facebook Books P@10: KGTORe 0.021 against Sheaf4Rec's 0.017.
  • Recall, meanwhile, is where Sheaf4Rec leads: 0.104 / 0.202 / 0.138 at \(K=10\).
The paper frames this as achieving "a good trade-off between precision and recall", which is fair, but "consistently outperforms all the competing baselines" (its wording for F1) is not true component-wise. Two smaller inconsistencies sit in the same section: the body text names LightGCN as the high-precision/low-recall competitor while LightGCN's numbers are the worst in the table on every metric, and UltraGCN's reported Recall@20 of 0.910 on Facebook Books is out of line with its Precision@20 of 0.011 and with every other row — worth checking against the code before quoting.

MRR tells a consistent story with one honest exception: Sheaf4Rec wins five of six columns, and reports −5.88% on MRR@20 for Facebook Books, where KGTORe’s 0.054 beats its 0.051. Reporting a negative delta in your own results table is a point in the paper’s favour.

The loss function and the depth ablations

The loss function. Table 8 varies the objective on MovieLens 1M:

LossLayersF1@10Training time
RMSE2 / 50.112 / 0.118283 / 371 min
BCE2 / 50.087 / 0.101198 / 262 min
BPR2 / 50.123 / 0.140163 / 210 min

BPR wins on accuracy and is the cheapest to train, at both depths — a rare clean result. The reading offered is that a ranking loss matches a structure whose edges carry the supervision, which is coherent with the whole design.

Depth. Best performance at \(N = 5\) layers on all three datasets, with NDCG@20 rising monotonically from \(N=1\). Given that GNN recommenders are notoriously depth-limited — LightGCN’s whole design is about avoiding oversmoothing — this is the same oversmoothing-resistance that sheaf models report on node classification, showing up in a different task.

Separately, latent dimension peaks at 64 and degrades at 128 and 256 while training time keeps climbing (to over 300 minutes on MovieLens 1M at \(d = 256\)), so the capacity is not free.

The matched-parameter expressiveness test

The best-designed experiment is Table 9, which asks whether the sheaf structure earns its keep at matched parameter count. Fix the total budget at the sheaf model’s \(d \times d\) and redistribute it across three stalk configurations:

\(\dim\mathcal{F}(v)\)\(\dim\mathcal{F}(e)\)ReadingF1@10NDCG@10NDCG@20
1\(N\)GAT-equivalent0.0480.0930.111
11fully trivial0.0450.0930.114
\(N\)\(N\)Sheaf4Rec0.0510.1050.129

The full sheaf wins on every metric with the same number of parameters, which is the right way to make an expressiveness argument — it rules out the obvious objection that the gains are just extra capacity.

One of the three declared baselines is absent from the table. Section 6.3.2 and Figure 8 define three configurations: GAT-equivalent \((1, N)\), GCN-equivalent \((N, 1)\), and Sheaf4Rec \((N,N)\). Table 9 reports \((1,N)\), \((1,1)\) and \((N,N)\) — the GCN-equivalent row is described in the text and never reported, while a fully trivial \((1,1)\) row appears that the text does not introduce. Since GCN is the base model most of the strong baselines derive from, that is the comparison a reader most wants. The table also does not say which dataset it uses, and its values (F1@10 of 0.051) are far below Table 4's MovieLens 1M figure of 0.140, so the two are not directly comparable.

Checking the efficiency claim

The abstract advertises “substantial runtime improvements ranging from 2.5% up to 37%”. Table 7 reports the time to produce 100 recommendations, over 10 attempts:

ModelFacebook BooksYahoo! MoviesMovieLens 1M
Sheaf4Rec0.586 ± 0.0451.309 ± 0.0453.770 ± 0.051
GAT0.594 ± 0.0901.344 ± 0.0773.796 ± 0.068
NGCF0.607 ± 0.0571.329 ± 0.0733.821 ± 0.060
KGTORe0.763 ± 0.1101.458 ± 0.0664.001 ± 0.035
LightGCN0.804 ± 0.3491.434 ± 0.3773.633 ± 0.297
UltraGCN1.278 ± 0.0441.388 ± 0.1113.823 ± 0.076

Against the fastest baseline on each dataset the margin is about 1.3% on Facebook Books and 1.5% on Yahoo! Movies, and on MovieLens 1M LightGCN is faster (3.633 against 3.770). Against the slowest, the gap on Facebook Books is 54% (0.586 against UltraGCN’s 1.278). Neither endpoint of the advertised 2.5–37% band appears in the table, and the strongest defensible efficiency statement is the one the paper makes about stability: Sheaf4Rec has the lowest standard deviation in every column, against LightGCN’s 0.349, 0.377 and 0.297.

That stability claim is real and independently interesting — a sheaf model being the most predictable rather than the most erratic is the opposite of what its complexity would suggest.

Why this paper matters to the rest of Book III

Two reasons beyond the results.

It is the sheaf literature’s clearest non-node-classification application. Almost everything in Book III is benchmarked on the same nine heterophilic node-classification datasets, and it is genuinely hard to tell how much of the field’s progress is dataset-specific. Sheaf4Rec is evaluated on three ranking datasets against recommender baselines, and the depth result — best at 5 layers — reproduces the oversmoothing-resistance finding in a setting where nothing else about the setup is shared.

The framing generalises. The closing suggestion is that sheaves suit “contexts where relationships and their representations are complex and inherently ambiguous”, with side information embeddable in the stalks and next-point-of-interest recommendation named as the next target. That is the same argument Sheaf Hypergraph Networks makes for group interactions and HetSheaf makes for typed relations — three papers, largely overlapping author groups, converging on the claim that when the relation is the object of interest, it deserves more than a scalar.

✅ Key Takeaways

  • Sheaf4Rec puts a cellular sheaf on the bipartite user–item graph: node stalks hold user and item representations, edge stalks correspond to observed preference scores, and scoring is \(S = (\mathcal{F}^u)^{\top}\mathcal{F}^v\).
  • Gains of +7.4 to +11.3% on NDCG and +4.1 to +9.1% on F1 across three datasets, all significance-tested with paired Wilcoxon and Bonferroni correction.
  • Those gains come from recall. UltraGCN and KGTORe beat Sheaf4Rec on Precision@10 on two of three datasets, so "outperforms all baselines" holds for F1 and NDCG, not component-wise.
  • BPR beats RMSE and BCE on both accuracy and training time at both depths — the cleanest result in the paper.
  • Best at 5 layers on every dataset: sheaf oversmoothing-resistance reproduced in a ranking task rather than node classification.
  • The matched-parameter stalk ablation is the right experiment, but the GCN-equivalent \((N,1)\) configuration is defined in the text and missing from the table, and the table's dataset is unlabelled.
  • The abstract's 2.5–37% efficiency range does not match Table 7, where margins over the fastest baselines are ~1–2% and LightGCN is faster on MovieLens 1M. The defensible claim is lowest variance in every column.
  • The bipartite projection that makes the whole method work is described in one sentence with no equations.

References