Graph Embeddings for Collaborative and Structural Signals
WHAT GRAPH EMBEDDINGS CAPTURE
Graph embeddings encode structural relationships from interaction graphs: users connected to items they clicked, items connected to categories, users connected to each other through shared behaviors. The embedding captures collaborative signals—patterns of who interacts with what—that pure text or image embeddings completely miss.
Example: User A and User B never searched the same keywords, but both clicked the same 50 products. Their text queries have zero overlap, but their graph embeddings are similar because they have demonstrated similar tastes through behavior rather than words.
HOW GRAPH EMBEDDINGS WORK
Random walk methods (Node2Vec, DeepWalk): Sample random paths through the graph, treat each path as a "sentence" of node IDs, apply word2vec-style training. Nodes that appear in similar path contexts get similar embeddings. Fast to train, scales to billions of edges.
Graph Neural Networks (GNN): Each node aggregates features from its neighbors iteratively. After K layers, each node embedding incorporates information from its K-hop neighborhood. More expressive than random walks but more expensive to train—typically used for smaller graphs or when node features matter.
COMBINING WITH CONTENT EMBEDDINGS
Graph embeddings capture who interacts with what. Content embeddings (text, image) capture what items look like. Best recommendation systems combine both: concatenate the vectors, or train a joint model that uses both signal types.
Cold start problem: new items have no graph edges, so graph embedding is meaningless. Solution: fall back to content embeddings until sufficient interactions accumulate. Typical threshold: 10-50 interactions before graph embedding becomes reliable.