Abstract
Modern recommendation systems at web-scale must navigate a complex landscape of heterogeneous user interactions. While Graph Convolutional Networks (GCNs) have proven effective for learning item embeddings, scaling these models to billions of nodes while capturing diverse signals—such as searches, clicks, and saves—remains a significant challenge. This paper presents MultiBiSage, a production-grade recommendation engine deployed at Pinterest. By decomposing a massive heterogeneous graph into multiple bipartite graphs and utilizing a two-stage Transformer architecture, MultiBiSage achieves substantial improvements in engagement across diverse surfaces including Ads, Idea Pins, and Video content.
Introduction
At Pinterest, understanding the relationship between billions of "Pins" and the context in which they are saved or interacted with is fundamental to the user experience. Previously, the system relied on PinSage, a random-walk GCN that learned embeddings primarily from the Pin-Board bipartite graph. However, the Pinterest ecosystem has evolved beyond simple board organization. Users now interact with Ads, perform specific search queries, and engage with creators through Idea Pins.
Capturing these heterogeneous signals is difficult. Standard heterogeneous graph models often struggle with the "web-scale" requirements of Pinterest, where data encompasses billions of nodes and edges. These models frequently encounter the "memory wall" or suffer from prohibitively expensive on-the-fly neighbor sampling. MultiBiSage addresses these limitations through a pragmatic decomposition strategy and a scalable attention-based architecture.
Methodology
MultiBiSage moves away from the attempt to process a single, monolithic heterogeneous graph. Instead, it adopts a modular approach based on four key pillars:
1. Graph Decomposition
The system decomposes the complex Pinterest graph into six distinct bipartite graphs. These include Pin-Board, User-Product (long-clicks), User-Ad (long-clicks), SearchQuery-Pin, Creator-IdeaPin, and IdeaPin-User-Follow. This decomposition allows the system to leverage optimized infrastructure designed for bipartite structures.
2. Neighborhood Discovery via Pixie
To identify relevant neighbors within each bipartite graph, MultiBiSage utilizes Pixie, Pinterest’s high-performance random-walk engine. For any given pin, Pixie identifies the "top-k" most relevant neighbors across the different bipartite contexts. This pre-computation step avoids the latency of real-time sampling during training.
3. Two-Stage Transformer Architecture
The core of MultiBiSage is a hierarchical aggregation mechanism:
- Stage 1 (Intra-graph Aggregation): For each of the six bipartite graphs, a Transformer layer aggregates the visual (1024-dim) and textual (64-dim) features of a pin and its specific neighbors. This produces a context-specific embedding (e.g., a "search-based" embedding vs. a "board-based" embedding).
- Stage 2 (Inter-graph Aggregation): A second Transformer layer then aggregates these context-specific embeddings. By using an attention mechanism, the model learns to weigh which graph signals are most relevant for a particular pin, resulting in a single, unified final embedding.
4. Training Objective
The model is trained using a Sampled Softmax loss. The objective is to minimize the distance in vector space between a "query pin" and an "engaged pin" (an item the user actually interacted with), ensuring that the learned embeddings are predictive of real-world user behavior.
Implementation and Scale
The deployment of MultiBiSage represents one of the largest applications of heterogeneous graph models in the industry. The training data involves:
- Nodes: Over 4.8 billion.
- Edges: Over 9.7 billion.
- Features: High-dimensional visual and textual embeddings for every node.
The infrastructure utilizes a distributed pipeline involving Spark for data orchestration, Pixie for graph walks, and a distributed GPU cluster for model training.
Results and Impact
MultiBiSage was evaluated against the existing PinSage baseline across several key Pinterest surfaces. The multi-contextual approach yielded significant gains in retrieval quality:
- Ads: A +5.07% improvement in "Good-click-through" Recall@10, indicating better alignment between user intent and sponsored content.
- Idea Pins: A +7.18% increase in Close-up engagement, demonstrating the model's ability to surface relevant creator content.
- Video Pins: A +5.60% improvement in Repin rates.
Qualitative Analysis
A notable case study highlighted the model's nuance. When processing a query for an electric scooter, the older PinSage model—relying heavily on board context—suggested automobiles because the scooter had been saved to boards containing cars. MultiBiSage, by incorporating the SearchQuery-Pin graph, correctly identified the item as a personal transport vehicle and recommended other scooters, demonstrating the value of multi-graph context.
Conclusion
MultiBiSage demonstrates that web-scale heterogeneous graph learning is achievable through a pragmatic decomposition into bipartite structures. By combining random-walk-based neighborhood discovery with a two-stage Transformer architecture, Pinterest has created a system that is both scalable and highly sensitive to the diverse ways users interact with content. Future work will explore more dynamic neighborhood pruning and the potential for efficient on-the-fly sampling to further refine the embedding space.
Summary updated