← AI HoodmanNo. 006 · Recommendations

People You May Know

What did the friend-suggestion model miss?

01of 07
Use the arrows, swipe or the arrow keys to turn the slides. Click a slide to read it page by page.
  1. Slide 1 of 7: On paper, Alice and Bob have nothing in common. A B Alice Stanford Adobe San Jose Bob ≠ ≠ ≠ U of Michigan Ford Detroit 0.08 Friend suggestion score Not suggested A B 6 days later, they became friends. What did your model miss?
  2. Slide 2 of 7: What the model missed: They share 4 friends. Carol Dan A Alice B Eve Bob 2 hops from Alice Frank Node = a user Edge = a friendship Starts with their profile as a vector Messages or profile views can be edges too The model only saw profiles. A GNN also learns from their connections.
  3. Slide 3 of 7: One GNN layer: Each user absorbs their friends. 1. Average Alice's friends Carol [0.8, 0.3, 0.6] Dan [0.6, 0.1, 0.8] Eve [0.7, 0.2, 0.5] Frank [0.5, 0.2, 0.5] Average [0.65, 0.20, 0.60] 2. Stack her own vector with the average, then multiply by W new = ReLU(W · [own ; average]) 0.5 0 0 1.0 0 0.25 0 0.2 0 0 0.6 0 0.5 0 0 0 0.5 1.0 · W (d × 2d) 0.2 0.9 0.1 0.65 0.20 0.60 0.9 = 0.3 0.8 new [own ; average] d = vector size. ReLU turns negatives into 0. W starts random and training tunes it. Every user shares the same W.
  4. Slide 4 of 7: Popular GNNs: They differ in how they combine friends. GCN The original GraphSAGE Most common GAT Weighted average of all friends. Needs the whole graph in memory. Samples a fixed number of friends per hop. Works on brand-new users. Graph attention Learns which friends matter more, so a best friend counts more than an old classmate. PinSage GraphSAGE at web scale: 3 billion nodes in production. Pinterest Each layer adds one hop, so 2 layers reach Bob. Past 3, everyone starts to look the same.
  5. Slide 5 of 7: How it's trained: Predict which friendships form. Score a pair: dot product of their GNN vectors, then sigmoid Alice [0.9, 0.3, 0.8] · Bob [0.8, 0.3, 0.8] = 1.45 sigmoid(1.45) = 0.81 Profiles alone gave 0.08 Labels: take last month's graph, then predict the friendships made since Pair Where it came from Target Score (Alice, Bob) friends since 1 0.81 (Alice, Gina) random user 0 0.12 (Alice, Omar) random user 0 0.05 The loss flows back through every layer and updates W.
  6. Slide 6 of 7: How it's served: Precompute, then look up. 1 2 Nightly Compute every user's vector from their friends and friends of friends. Index Load all the vectors into a nearest-neighbor index. Alice opens the app 3 Gather candidates: friends of friends + her nearest vectors. A ranking model orders them. People you may know See all Priya Bob Marcus 4 mutual friends 3 mutual friends Add friend Add friend 2 mutual friends Add friend The heavy work runs offline. Each request is a quick lookup.
  7. Slide 7 of 7: Takeaway: Profiles show who you are. GNNs show who you know.

Keep reading

People You May Know · 1 / 7
  1. Slide 1 of 7: On paper, Alice and Bob have nothing in common. A B Alice Stanford Adobe San Jose Bob ≠ ≠ ≠ U of Michigan Ford Detroit 0.08 Friend suggestion score Not suggested A B 6 days later, they became friends. What did your model miss?
  2. Slide 2 of 7: What the model missed: They share 4 friends. Carol Dan A Alice B Eve Bob 2 hops from Alice Frank Node = a user Edge = a friendship Starts with their profile as a vector Messages or profile views can be edges too The model only saw profiles. A GNN also learns from their connections.
  3. Slide 3 of 7: One GNN layer: Each user absorbs their friends. 1. Average Alice's friends Carol [0.8, 0.3, 0.6] Dan [0.6, 0.1, 0.8] Eve [0.7, 0.2, 0.5] Frank [0.5, 0.2, 0.5] Average [0.65, 0.20, 0.60] 2. Stack her own vector with the average, then multiply by W new = ReLU(W · [own ; average]) 0.5 0 0 1.0 0 0.25 0 0.2 0 0 0.6 0 0.5 0 0 0 0.5 1.0 · W (d × 2d) 0.2 0.9 0.1 0.65 0.20 0.60 0.9 = 0.3 0.8 new [own ; average] d = vector size. ReLU turns negatives into 0. W starts random and training tunes it. Every user shares the same W.
  4. Slide 4 of 7: Popular GNNs: They differ in how they combine friends. GCN The original GraphSAGE Most common GAT Weighted average of all friends. Needs the whole graph in memory. Samples a fixed number of friends per hop. Works on brand-new users. Graph attention Learns which friends matter more, so a best friend counts more than an old classmate. PinSage GraphSAGE at web scale: 3 billion nodes in production. Pinterest Each layer adds one hop, so 2 layers reach Bob. Past 3, everyone starts to look the same.
  5. Slide 5 of 7: How it's trained: Predict which friendships form. Score a pair: dot product of their GNN vectors, then sigmoid Alice [0.9, 0.3, 0.8] · Bob [0.8, 0.3, 0.8] = 1.45 sigmoid(1.45) = 0.81 Profiles alone gave 0.08 Labels: take last month's graph, then predict the friendships made since Pair Where it came from Target Score (Alice, Bob) friends since 1 0.81 (Alice, Gina) random user 0 0.12 (Alice, Omar) random user 0 0.05 The loss flows back through every layer and updates W.
  6. Slide 6 of 7: How it's served: Precompute, then look up. 1 2 Nightly Compute every user's vector from their friends and friends of friends. Index Load all the vectors into a nearest-neighbor index. Alice opens the app 3 Gather candidates: friends of friends + her nearest vectors. A ranking model orders them. People you may know See all Priya Bob Marcus 4 mutual friends 3 mutual friends Add friend Add friend 2 mutual friends Add friend The heavy work runs offline. Each request is a quick lookup.
  7. Slide 7 of 7: Takeaway: Profiles show who you are. GNNs show who you know.