Friend recommendation is inherently graph-structured: the relevance of a potential connection depends on multi-hop social context rather than user attributes alone. However, deploying message-passing GNNs on a production-scale social graph with hundreds of millions of users and tens of billions of edges requires addressing numerous modeling and systems challenges. We present a scalable end-to-end GNN ranking system for production social graphs, focusing on two design choices that are critical in this setting: multi-hash ID embeddings and temporal neighbor sampling. Multi-hash embeddings are common for high-cardinality features, but industrial GNN systems typically either ignore trainable IDs or accept full embedding tables, exceeding 200 GB for our graph. We integrate multi-hash as the primary node representation, reducing the ID-embedding table size by more than 98 percent while preserving ranking quality. Temporal neighbor sampling is well understood in principle, but existing implementations scan full adjacency lists, which is a non-starter for users with tens of thousands of friends. We implement timestamp-sorted CSR storage with binary search, reducing the per-node temporal sampling cost from O(deg(v)+k) to O(log(deg(v))+k). Beyond these components, we show that this combination scales and yields measurable production impact. On a graph with 194M users and 28B edges, offline ablations isolate each design choice's contribution. In an online A/B test, our system increases friend additions from recommendations by 16 percent and unique friend adders by 11.5 percent over a strong production baseline. We release our framework for distributed training and inference on large temporal graphs.
Figures & tables
Figure 1: Model overview. User features and multi-hash user-ID representations are combined into the initial node embedding, processed by a sampled-neighborhood GNN encoder, and projected into separate query and candidate representations.
Figure 2: Temporal neighbor sampling. Left: arbitrary-order neighbors require scanning. Right: timestamp-sorted neighbors allow a binary-search split into a valid past prefix and a future suffix.
Figure 3: Training system overview. Batch construction is decoupled from GPU training: a CPU-side native sampler constructs sampled subgraphs, while GPU workers consume prepared minibatches and train the GNN model.
Figure 4: Inference and embedding refresh. The periodic offline refresh pipeline samples local neighborhoods from the updatable graph storage, runs the trained GNN encoder, and writes refreshed user embeddings to the embedding storage. The online ranker reads these embeddings during serving.
Statistic
∣V∣
∣E∣
Train interactions
Test interactions
Value
194M
28B
1.4B
25M
Table 1: Dataset statistics.
Component
Setting
GNN encoder
GATv2, L=2 layers, 8 attention heads
Hidden dimension
H=512
Head output dimension
128 (query, candidate)
Multi-hash slots
k=3
Shared hash table
B=221 rows, dim d=256
Hash function
64-bit integer multiplicative hashing
Table 2: Base training configuration. All ablations are run with one parameter changed at a time; the rest are held fixed at the values below.
Top-pop
MF
WalkGNN
Ours
ROC-AUC
0.5050
0.5316
0.5572
0.6278
Table 3: Offline ranking quality on the held-out test interactions, measured as per-user ROC-AUC (higher is better).
ID scheme
Embedding table size
ROC-AUC
Features only
—
0.5244
Multi-hash IDs only (no features)
2 GB
0.5997
Features + full table
202.88 GB
0.6246
Features + multi-hash IDs (ours)
2 GB
0.6278
Table 4: Effect of the ID-representation scheme on offline ranking quality (per-user ROC-AUC).
B
217
218
219
220
221
222
Hash table memory
128 MB
256 MB
512 MB
1 GB
2 GB
4 GB
ROC-AUC
0.5952
0.6044
0.6092
0.6184
0.6278
0.6310
Table 5: Effect of the shared-table size B on offline ranking quality (per-user ROC-AUC) and on the memory required.
Sampler
ROC-AUC
Sampling time
Non-temporal
0.5907
581 ms
Temporal, naive scan
0.6278
1473 ms
Temporal, binary search (ours)
0.6278
595 ms
Table 6: Effect of temporal neighbor sampling on offline quality and on per-batch sampling cost. Sampling time is wall-clock cost per minibatch under the base configuration.
Training time
GPU step (forward + backward per batch)
927 ms
Wall-clock time per epoch
43.4 h
Iterations to early stopping
252 k
Total training time to convergence
63 h
Inference and memory
Embedding computation for all 194M users
6.57 h
Table 7: End-to-end system numbers.
Metric
Relative change
Friend additions from recommendations
+16.0%
Unique users adding a recommended friend
+11.5%
Total time spent in content feed
+0.28%
Ranker p50/p90/p99 latency
no regression
Table 8: Online A/B test results against the previous production ranker.
Recommender systems are essential components of modern online platforms which presents personalized content in various domain. The traditional collaborative filtering methods depends on static user-item interaction graphs and a limited subset of similarity measures which fail to capture the changing nature of preferences of an individual. Recent graph neural network (GNN) based approaches focus on user-item bipartite graphs which do not use explicit user-user relational modelling and dynamic graph evolution during training. To address these limitations, this paper proposes a Dynamic Graph SimilarityAware Attention Graph Neural Network (DG-SA-GNN) framework that integrates dynamic user similarity graph construction with multi-similarity propagation and attention-based aggregation. The proposed architecture constructs four parallel user similarity graphs using Cosine, Jaccard, Discounted Pearson Correlation Coefficient (Discount PCC), and IPIJ similarity functions, each processed by a dedicated UserGNN module. A Graph Transformer fuses the four graph views, and a CrossAttention module refines user embeddings through interaction with item embeddings. Crucially, the graphs are reconstructed at scheduled epochs during training, enabling the model to adapt to the learned embedding space constituting the dynamic graph component. Mini-batch training with hard negative sampling improves scalability and convergence. Experiments on the MovieLens100K benchmark demonstrate that DG-SA-GNN achieves a Recall@20 of 0.162 and NDCG@20 of 0.065 which is better than the LightGCN baseline in recall. The results validate that dynamic multi-similarity graph construction coupled with attention-based fusion which produce recommendation performance
Aadarsh Senapati, Neha Kujur, Vivek Yelleti
Department of Computer Science and Engineering, SRM University Andhra Pradesh, Mangalagiri, Andhra Pradesh 522502, India
Aggregating temporal signals from historic interactions is a key step in future link prediction on dynamic graphs. However, incorporating long histories is resource-intensive. Hence, temporal graph neural networks (TGNNs) often rely on historical neighbors sampling heuristics such as uniform sampling or recent neighbors selection. These heuristics are static and fail to adapt to the underlying graph structure. We introduce FLASH, a learnable and graph-adaptive neighborhood selection mechanism that generalizes existing heuristics. FLASH integrates seamlessly into TGNNs and is trained end-to-end using a self-supervised ranking loss. We provide theoretical evidence that commonly used heuristics hinder TGNNs performance, motivating our design. Extensive experiments across multiple benchmarks demonstrate consistent and significant performance improvements for TGNNs equipped with FLASH.
Or Feldman, Krishna Sri Ipsit Mantri, Carola-Bibiane Schönlieb +2
Ben-Gurion University of the Negev, Israel · Purdue University, USA · University of Cambridge, UK
Temporal link prediction on the Temporal Graph Benchmark 2.0 (TGB 2.0) faces a scalability ceiling: on the benchmark's three largest datasets, every existing embedding method runs out of memory or exceeds the time budget. These large-scale graphs are the ones nearest real deployment scale, so failing on them is a real production limitation. EdgeReMIND sets the highest reported test mean reciprocal rank (MRR) on six of eight TGB 2.0 datasets and is the only relation-aware method that runs on all of them. This linear memorization model, with learned per-relation weights over data-calibrated features, is therefore not merely a fallback where embeddings fail but a practical state-of-the-art baseline across the benchmark.