Paper commentary
Federated Social Recommendation with Graph Neural Network
- Problem Social recommenders need both social links and rating histories, yet storing both centrally raises privacy risks, and existing federated recommenders keep only the rating side local.
- Method Runs a graph attention network on each client over its local ratings and social links, scores social and item neighbours with separate attention, and uploads gradients protected by pseudo-item labels, clipping and Laplacian noise.
- Results Improved RMSE by up to 5.26% and MAE by up to 5.46% over the compared baselines on three datasets, and by 2.99% in RMSE and 4.03% in MAE on average over FedGNN.

Fig. 3 . The framework of FeSoG. For simplicity and without loss of generality, we present a two-client scenario. In each client, we use the local GAT layer to infer node embeddings and adopt the attention layer to aggregate social neighbors and item neighbors. Then, we sample a set of pseudo items bundled with local data to calculate the loss and gradients. Both the embedding gradients and model gradients are uploaded to the server for aggregation after LDP operation.
Original paper · CC BY 4.0 · Zhiwei Liu, Liangwei Yang, Ziwei Fan, Hao Peng, Philip S. Yu · Federated Social Recommendation with Graph Neural Network · Original paper figure · Extracted the figure area from page 10 of the original PDF.Why social recommenders resist central and federated designs
Users with few rating records give a recommender little to learn from, and their social links are one way to add signal. Recent social recommenders such as GraphRec and ConsisRec fuse social links with user-item transactions inside a graph neural network. They keep the social network and the transaction history of all users in one central store, which exposes both to privacy leakage.
Data protection rules such as GDPR make a central store a weaker long-term choice for online platforms.
Federated learning keeps raw data on each client and sends only gradients to a server, and federated recommenders apply this idea to user-item interactions. FedGNN brings a graph neural network into that setting but does not address social links, and its client models are not personalized. A federated social recommender therefore has to hold two kinds of relation locally and fuse them.
Three difficulties follow: the two relation types are heterogeneous, each client's data is non-iid, and uploaded gradients can leak information about the raw interactions. FeSoG is designed around these three requirements.
What each client holds and how the local graph is built
Each client holds its user's rating row and social row, and these raw records are never uploaded to the server. Together they form a local graph with user nodes and item nodes, where rating values are attributes on user-item edges and social links are user-user edges. The rated items T(n) and the social neighbours U(n) of client c_n define that graph, and the task is to predict a rating for an item the user has not rated.
Framed this way, the problem is link prediction over the local graphs, solved without reading the raw data of any graph. The adversary model is honest-but-curious: clients and the server supply correct information but may try to infer private data.
The server holds the user and item embedding tables, and each client downloads them before its local update. A client uses the ids in its records to look up embeddings for its rated items and social neighbours and passes them to the local GNN. Figure 3 shows the two-client version of this loop, with local graph attention, pseudo-item sampling and LDP applied before upload.
Relational graph attention over social and item neighbours
Social neighbours do not contribute equally to a user, so each one receives a weight from an attention layer. For a social pair (u_n, u_p), one shared linear map W_1 is applied to both embeddings, the results are concatenated, and a vector a scores the pair through LeakyReLU: \( o_{np} = \mathrm{LeakyReLU}\left(a^\top \left[W_1 e_{u_n} \,\|\, W_1 e_{u_p}\right]\right) \).
A softmax over the P social neighbours turns these scores into weights \( \alpha_{np} = \dfrac{\exp(o_{np})}{\sum_{i=1}^{P}\exp(o_{ni})} \) that form a probability distribution.
Rated items use a separate pair of parameters, W_2 and b, which gives a score \( v_{nk} \) for each rated item. A softmax over the K rated items then gives the item weights \( \beta_{nk} \). Two attention branches let each relation type be weighted on its own terms, which is how the method handles heterogeneity.
Combining neighbours with relation vectors
Each branch takes a weighted sum of linearly mapped neighbour embeddings with a shared map W_h, giving hidden user-neighbour and item-neighbour embeddings: \( h^{(n)}_u = \sum_{p=1}^{P}\alpha_{np} W_h e_{u_p} \) and \( h^{(n)}_t = \sum_{k=1}^{K}\beta_{nk} W_h e_{t_k} \). Social links, user-item interactions and the centre node do not contribute equally, so three relation vectors v_u, v_t and v_s carry the social, user-item and centre-node semantics.
Each hidden embedding is concatenated with its relation vector and scored by a vector c, and a softmax over the three scores gives the weights gamma_u, gamma_t and gamma_s.
The local user embedding is the gamma-weighted sum of the centre embedding and the two hidden neighbour embeddings: \( e^*_{u_n} = \gamma_s e_{u_n} + \gamma_u h^{(n)}_u + \gamma_t h^{(n)}_t \). This embedding is inferred and kept on the client, which is how the method addresses personalization.
Rating prediction and the local loss
A rating is predicted as the dot product of the inferred user embedding and a downloaded item embedding: \( \hat R_{ut} = e^*_u \cdot e_t \). The local loss is a root of the mean squared error over the rated items T(u) of user u, normalized by the number of those items: \( L_u = \sqrt{\dfrac{\sum_{t\in T(u)}(R_{ut}-\hat R_{ut})^2}{|T(u)|}} \).
The gradients of this loss with respect to all trainable parameters are what each client protects and uploads.
Protecting uploaded gradients
Only rated items receive non-zero embedding gradients, so an uploaded gradient reveals which items a user rated. The authors note that gradients from two consecutive steps can expose a user's ratings, citing FedMF for this. FedMF hides gradients with encryption, which needs key generation and extra computation, while FedGNN adds Gaussian noise with matched mean and variance to pseudo-interacted items.
The LDP module clips each gradient in the L∞-norm to a threshold δ and adds zero-mean Laplacian noise of strength λ: \( \tilde g^{(n)} = \mathrm{clip}(g^{(n)},\delta) + \mathrm{Laplacian}(0,\lambda) \). FeSoG makes the noise scale follow the gradient instead of staying constant, so the Laplacian scale is λ times the mean of g^(n): \( \tilde g^{(n)} = \mathrm{clip}(g^{(n)},\delta) + \mathrm{Laplacian}(0,\lambda\cdot\mathrm{mean}(g^{(n)})) \).
Before computing the loss, a client samples q unrated items, predicts their ratings with the local model and rounds them into pseudo ratings; the algorithm calls this number p. The loss then covers the rated and pseudo items, still divided by |T(u)|, so the gap between each prediction and its rounded value supplies gradient for the pseudo items.
The authors argue that the pseudo labels add rating information that can ease cold start, and that the step works as a data augmentation. On each client, pseudo-item labelling and LDP run in sequence, between loss computation and upload.
Server aggregation and the training loop
In each round the server contacts a batch of clients, with 128 given as an example, and sends the current model parameters and embeddings. Each client returns its protected gradients together with its number of interactions, which counts pseudo interactions as well. The server averages the gradients weighted by interaction counts, and the item and user gradients are normalized by the counts for that item or that user.
The parameters are then updated by gradient descent as \( \Theta^* = \Theta - \eta \bar g \), with learning rate η, and the loop repeats until convergence. In Algorithm 1 the server loop does the sampling and averaging, while ClientUpdate runs on each device.
Datasets, baselines and evaluation protocol
Experiments use Ciao, Epinions and Filmtrust, each with user ratings and trust links used as social relations. Ciao and Epinions use integer ratings from 1 to 5, and Filmtrust uses ratings from 1 to 8. Ciao has 7,317 users, 104,975 items and 283,320 ratings; Epinions has 18,069 users, 261,246 items and 762,938 ratings; Filmtrust has 874 users, 1,957 items and 18,662 ratings.
Each user is treated as one client, and global graph information reaches the client through the user embeddings.
Matrix factorization baselines are SoRec, SoReg, SocialMF and CUNE. GNN-based baselines are GCMC+SN, GraphRec and ConsisRec, and ConsisRec is described as the state of the art in social recommendation. Federated baselines are FedMF and FedGNN. The authors note that the centralized groups cannot protect user privacy, while the federated methods cannot fuse social and rating information.
Performance is measured by MAE and RMSE, where smaller values are better. Evaluation runs locally on the devices, because the server has no access to local data, and the errors are pooled over the rated items of the test users. Ratings are split randomly into 60% training, 20% validation and 20% test, and the reported scores come from the test split.
The pseudo-item count was searched over {10, 50, 100, 500, 1000}, the embedding size d over {4, 8, 16, 32, 64}, the user batch size over {16, 32, 64, 128, 256}, and the learning rate η over {0.1, 0.05, 0.01}. Training stopped when validation RMSE did not improve for 5 successive validations.
Comparison with federated baselines
Against FedGNN, FeSoG reaches an average relative improvement of 2.99% in RMSE and 4.03% in MAE across the datasets. Compared with the other baselines across all three datasets, the improvement reaches up to 5.26% in RMSE and 5.46% in MAE. The authors credit three sources: social information helps, as the gain over FedMF shows; relational attention and aggregation combine user-item and social signals; and pseudo-item sampling adds to performance.
The authors present FeSoG as the first federated learning framework for social recommendation, to their knowledge.
How many pseudo items to sample
More pseudo items means more ratings to predict, and the counts 10, 50, 100, 500 and 1000 were tested on the three datasets. FedGNN serves as the comparison; it samples negative items and assigns them random gradients. Figure 6 shows the RMSE of FeSoG and FedGNN across these pseudo-item counts on the three datasets.
On Ciao and Epinions both methods get worse as the pseudo-item count rises, but FeSoG's error stays much lower than FedGNN's. On Filmtrust, FedGNN's error first rises and then drops once more than 500 pseudo items are sampled. The authors attribute this to pseudo-item gradients from different users offsetting each other, since FedGNN draws them from one Gaussian and Filmtrust has only 1957 items.
The authors describe a trade-off: the extra computational cost grows linearly with the pseudo-item count, the server finds it harder to infer which items were truly interacted, and accuracy declines. For Ciao they propose 100 pseudo items, reasoning that accuracy changes little below that count.
Embedding size
The embedding size d was varied over 4, 8, 16, 32 and 64, with FeSoG compared against FedGNN and FedMF on RMSE and MAE. The authors report that FeSoG beats the other federated methods at every embedding size tested, and that FedGNN is much better than FedMF, which they read as support for using GNNs. FeSoG's error changes less as the embedding size moves than the errors of FedGNN and FedMF do.
All federated methods are best at d = 16 or d = 32; a very small d = 4 gives too little representation capacity, while d = 64 may overfit the limited data.
Learning rate and convergence
Figure 10 plots validation RMSE over communication steps for learning rates 0.1, 0.05 and 0.01 on the three datasets. The loss converges smoothly as communication steps increase, which the authors read as evidence that the federated process transfers useful gradients.
The fastest convergence differs by dataset: learning rate 0.1 on Epinions, and 0.05 on Ciao and Filmtrust. The learning rate also sets how many communication rounds are needed, and fewer rounds mean fewer exchanges between server and clients.
Clipping threshold and noise strength
Figure 11 shows RMSE as a function of δ and λ on the three datasets. With λ fixed, FeSoG performs better as δ grows, which the authors attribute to fewer gradients being clipped. With δ fixed, FeSoG performs worse as λ grows, because the Laplacian noise overwhelms the signal from the data, so a smaller λ is preferred.
Larger δ and smaller λ improve accuracy but weaken privacy, and with δ unbounded and λ at 0 the server could recover interactions from the uploaded gradients.
Which components matter
Three variants were built: sharing GAT layer uses one GAT layer for both neighbour types, w/o relational vectors drops the social and user-item relation vectors during aggregation, and w/o pseudo items sets the pseudo-item count to 0.
On Ciao, the sharing GAT layer variant reaches RMSE 2.0262 against 1.9136 for FeSoG, a relative difference of 5.8%. Removing the relational vectors raises Ciao RMSE to 2.1545, a relative difference of 12.58%.
The w/o pseudo items variant has lower RMSE and MAE than FeSoG on all three datasets, with RMSE relative differences of -0.57% on Ciao, -5.1% on Epinions and -0.56% on Filmtrust. The authors keep this variant for comparison and note that it cannot protect user privacy, so its lower error does not by itself show that pseudo items are unnecessary.
Limitations
Pseudo items are sampled at random, and the authors propose adaptive sampling as future work. The local relational GNN is trained only on local data, and extending the local graph to a high-order graph would need data transfer among clients. Communication efficiency is left open, since federated training needs many rounds.
Large δ and small λ improve RMSE but increase privacy risk, so the authors argue for choosing a pair that keeps the privacy budget small. In the ablation, removing pseudo items lowers error, so the reported benefit of pseudo items rests on protection and robustness rather than accuracy in these runs. Results cover three datasets, and the comparisons in this article are against federated baselines; no numeric comparison with centralized baselines is given here.
Paper info
- Authors
- Zhiwei Liu, Liangwei Yang, Ziwei Fan, Hao Peng, Philip S. Yu
- Venue
- arXiv · Preprint
- First published
- 2021-11-21
- Added
- 2026-11-6
- Updated
- 2021-11-21
- Version
- v1
- arXiv
- 2111.10778
- DOI
- 10.1145/3501815
- Category
- cs.IR · cs.LG
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Recommender systems have become prosperous nowadays, designed to predict users' potential interests in items by learning embeddings. Recent developments of the Graph Neural Networks~(GNNs) also provide recommender systems with powerful backbones to learn embeddings from a user-item graph. However, only leveraging the user-item interactions suffers from the cold-start issue due to the difficulty in data collection. Hence, current endeavors propose fusing social information with user-item interactions to alleviate it, which is the social recommendation problem. Existing work employs GNNs to aggregate both social links and user-item interactions simultaneously. However, they all require centralized storage of the social links and item interactions of users, which leads to privacy concerns. Additionally, according to strict privacy protection under General Data Protection Regulation, centralized data storage may not be feasible in the future, urging a decentralized framework of social recommendation. To this end, we devise a novel framework \textbf{Fe}drated \textbf{So}cial recommendation with \textbf{G}raph neural network (FeSoG). Firstly, FeSoG adopts relational attention and aggregation to handle heterogeneity. Secondly, FeSoG infers user embeddings using local data to retain personalization. Last but not least, the proposed model employs pseudo-labeling techniques with item sampling to protect the privacy and enhance training. Extensive experiments on three real-world datasets justify the effectiveness of FeSoG in completing social recommendation and privacy protection. We are the first work proposing a federated learning framework for social recommendation to the best of our knowledge.
Quote from the paper
Zhiwei Liu, Liangwei Yang, Ziwei Fan, Hao Peng, Philip S. Yu (2021). Federated Social Recommendation with Graph Neural Network. arXiv:2111.10778v1. https://doi.org/10.1145/3501815
BibTeX
@article{liu2021federated,
title = {{Federated Social Recommendation with Graph Neural Network}},
author = {Zhiwei Liu and Liangwei Yang and Ziwei Fan and Hao Peng and Philip S. Yu},
year = {2021},
eprint = {2111.10778},
archivePrefix = {arXiv},
doi = {10.1145/3501815},
url = {https://arxiv.org/abs/2111.10778v1}
}