Introduction to Graph Neural Networks and Their Applications in Recommendation Systems
This article introduces graph neural networks, explains their underlying sampling and aggregation mechanisms, and demonstrates how they are applied in large‑scale recommendation scenarios such as video and content feeds at Tencent, highlighting practical results and lessons learned.
Guide
With the growth of data diversity, graph computing has become an important research direction, and graph neural networks (GNNs) are widely used for graph representation learning. Compared with traditional graph learning, GNNs can learn both the topology of the graph and aggregate neighbor features, making them crucial for downstream recommendation tasks.
01. Graph Neural Network Introduction
1. Everything is Connected
Using social networks as an example, earlier constructions relied on simple "follow" relationships, while modern approaches also consider likes, shares, comments, and other interactions. Graph algorithms are now applied across many Tencent scenarios.
2. Application Scenarios
Key‑person recommendation: combine graph structures with algorithms such as PageRank to identify influential users and apply targeted promotion.
Circle‑based recommendation: build circles based on geography, tasks, or interests to drive product and ad recommendations.
3. Graph Mining Algorithms in Recommendation
Traditional graph mining includes algorithms like PageRank and closeness, community‑detection methods for finding key nodes/groups, and representation‑learning methods such as DeepWalk and node2vec. This article focuses on the use of graph neural networks.
GNNs consider node and edge features, aggregating neighbor features together with the node's own features to learn expressive embeddings, which have shown clear performance gains in various scenarios.
02. Angel Graph Neural Network
1. What is a Graph Neural Network
A GNN applies neural‑network frameworks to graph data. Traditional neural networks process Euclidean data (images, text), whereas GNNs handle non‑Euclidean graph topology, where neighbor count and order vary and the graph can be massive.
Because of this structural difference, GNNs aggregate neighbor node features instead of using standard convolution.
2. Angel GNN Framework
The Angel platform provides a variety of GNN algorithms (GraphSAGE, supervised/unsupervised, homogeneous/heterogeneous). It supports one‑hop and two‑hop neighbor sampling, with one‑hop features stored on Spark executors for fast sampling and two‑hop adjacency tables placed on parameter servers.
3. GraphSAGE Principle
GraphSAGE relies on two key steps: sampling and aggregation.
Sampling: For a target node, randomly sample a set of first‑order neighbors, then sample second‑order neighbors from those first‑order nodes. Experiments show that two‑hop sampling yields good performance.
Aggregation: First aggregate second‑order neighbor features, then fuse them with first‑order neighbor features, and finally combine the result with the target node's own features to produce the final embedding.
03. Practice in Recommendation Scenarios
1. GNN Recommendation Overview
Networks are constructed from social, payment, communication, e‑commerce, etc., and fed into GNNs to obtain embeddings used for downstream tasks such as feature generation, recall, cold‑start, and user profiling.
Scenario 1: Tencent Video Recommendation
User watch histories are used to build a graph; each user and video become nodes, and edges capture interactions. One‑hop features are stored on Spark executors, while two‑hop adjacency is on a parameter server. A semi‑supervised GraphSAGE model runs on tens of millions of nodes and billions of edges, improving top‑50 hit rate by ~3% and increasing video watch time by ~1%.
Scenario 2: WeChat Content Recommendation
For recommending public accounts, the raw follow graph contains super‑nodes (e.g., "People's Daily"). The graph is transformed to a public‑account‑to‑public‑account graph, and additional behaviors (clicks, reads) are added as edges. Features include account attributes, user attributes, and denoised representations. Algorithms such as GraphSAGE and DGI were evaluated, with DGI chosen. One‑hop sampling performed better than two‑hop, avoiding embedding collapse. The final pipeline processes millions of nodes and billions of edges, achieving +2.38% exposure, +1.61% click‑through, and +0.5% follow‑rate improvements.
04. Experience Summary
Network construction and feature engineering are critical and must focus on noise reduction. Algorithms are not universally applicable; they need to be tuned per scenario, and multi‑model fusion (e.g., GNN+Transformer, GNN+XGBoost, GNN+KMeans, GNN+ItemCF) generally yields better results.
Thank you for reading.
DataFunTalk
Dedicated to sharing and discussing big data and AI technology applications, aiming to empower a million data scientists. Regularly hosts live tech talks and curates articles on big data, recommendation/search algorithms, advertising algorithms, NLP, intelligent risk control, autonomous driving, and machine learning/deep learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.