Notes

GNN-Based Recommender

Collaborative filtering has always run on indirect connections — you and I bought the same book, so what else I bought is worth showing you. A factorization model sees that connection one hop at a time. A graph neural network makes the longer chains explicit.

How the signal propagates
The interaction log is read as a bipartite graph: users on one side, items on the other, an edge wherever an interaction happened. Each layer rewrites a node's embedding as a degree-normalised average of its neighbours' embeddings, so after two layers a user vector carries information from items bought by users who overlap with them. The final embedding combines the outputs of every layer, and scoring stays an ordinary dot product.

What the real models look like
NGCF kept the per-layer weight matrices and non-linearities of generic graph networks. LightGCN deleted both, leaving neighbour averaging and a weighted sum of layers — and performed better, which settled where the value actually lies for pure collaborative filtering. PinSage is the industrial variant: neighbourhoods sampled by random walk, learned inductively, run over billions of items at Pinterest. Training is usually BPR on sampled negatives.

Why it matters

  • Sparse users gain the most, because multi-hop propagation borrows evidence they do not have themselves.
  • Embeddings are computed offline and indexed with FAISS, so serving costs no more than plain factorization.
  • Stack too many layers and over-smoothing sets in: every embedding drifts toward the graph average and personalisation fades.
  • An item with no edges gains nothing — the graph cures sparsity, not a true cold start.

A GNN-based recommender treats the interaction log as a user-item bipartite graph and refines each node's embedding by repeatedly averaging its neighbours' embeddings, so a user's vector absorbs evidence several hops away instead of from direct interactions alone. This higher-order propagation is what lifts accuracy for sparse users; LightGCN showed the averaging alone does the work, without per-layer transformations. Scoring stays a dot product, so serving cost is unchanged.

Think about how a friend passes on a restaurant tip. They may never have eaten there themselves, but someone they trust has — and that is enough to make the tip worth hearing.

A graph-based recommender works along those same chains of acquaintance. It draws a huge map joining every shopper to everything they bought, then lets information travel along the lines: what you bought shapes your profile, and so does what people two or three steps away from you bought. For someone with only a couple of purchases, those second-hand connections are where the useful evidence comes from — the difference between guessing from two clues and guessing from a borrowed crowd.