<figure><img src="image_1.png" /></figure>

HAL
open science

# Inferring Communities of Interest in Collaborative Learning-based Recommender Systems

Yacine Belal, Mohamed Maouche, Sonia Ben Mokhtar, Anthony Simonet-Boulogne

## ► To cite this version:

Yacine Belal, Mohamed Maouche, Sonia Ben Mokhtar, Anthony Simonet-Boulogne. Inferring Communities of Interest in Collaborative Learning-based Recommender Systems. 45th IEEE International Conference on Distributed Computing Systems (ICDCS 2025), Jul 2025, Glasgow, United Kingdom. 10.1109/ICDCS63083.2025.00056. [hal-05007813v2](https://hal.science/hal-05007813v2)

HAL Id: hal-05007813

https://hal.science/hal-05007813v2

Submitted on 10 Oct 2025

HAL is a multi-disciplinary open access archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Inferring Communities of Interest in Collaborative
Learning-based Recommender Systems

1st Yacine Belal

LIRIS, INSA Lyon

Lyon, France

yacine.belal@insa-lyon.fr

2st Mohamed Maouche

INRIA, INSA Lyon, CITI, UR3720

Villeurbanne, France

mohamed.maouche@inria.fr

3rd Sonia Ben Mokhtar

LIRIS, INSA Lyon, CNRS

Lyon, France

sonia.benmokhtar@insa-lyon.fr anthony.simonet-boulogne@iex.ec

4th Anthony Simonet-Boulogne

iExec Blockchain Tech

Lyon, France

**Abstract**—Collaborative-learning-based recommender systems, such as those employing Federated Learning (FL) and Gossip Learning (GL), allow users to train models while keeping their history of liked items on their devices. While these methods were seen as promising for enhancing privacy, recent research has shown that collaborative learning can be vulnerable to various privacy attacks. In this paper, we propose a novel attack called Community Inference Attack (CIA), which enables an adversary to identify community members based on a set of target items. What sets CIA apart is its efficiency: it operates at low computational cost by eliminating the need for training surrogate models. Instead, it uses a comparison-based approach, inferring sensitive information by comparing users' models rather than targeting any specific individual model. To evaluate the effectiveness of CIA, we conduct experiments on three real-world recommendation datasets using two recommendation models under both Federated and Gossip-like settings. The results demonstrate that CIA can be up to 10 times more accurate than random guessing. Additionally, we evaluate two mitigation strategies: Differentially Private Stochastic Gradient Descent (DP-SGD) and a *Share less* policy, which involves sharing fewer, less sensitive model parameters. Our findings suggest that the *Share less* strategy offers a better privacy-utility trade-off, especially in GL.

**Index Terms**—Federated learning, gossip learning, recommender systems, privacy, adversarial attacks

## I. INTRODUCTION

Recommender systems are widely used algorithms in today's online services (e.g., movie recommendation in video-on-demand platforms, item recommendation in marketplaces, post recommendation in social media, ... etc.). Their usefulness in helping users dive into the overwhelming amount of content available online is no longer questionable. One of the downsides of today's recommender systems is their intrinsic centralization. Indeed, to compute useful recommendations, most recommender systems collect and process users' personal data such as their history of liked items, which may reveal sensitive information such as their age, sex, social status, health issues [1]. This limitation has pushed the research community to investigate private recommender systems in the past decade [2], [3].

More recently, in the aim of improving users' privacy, collaborative learning techniques have been adopted in recom-

mender systems. As a result, several solutions have emerged with as a key common property the fact of collaboratively training a recommender machine learning model while keeping users' private data local. In this context, two families of recommender systems have emerged: (i) Federated Recommender Systems [4] (FedRecs) and (ii) Gossip Learning-based Recommender Systems [5] (GossipRecs). In FedRecs, a global model is trained locally by users across various rounds orchestrated by a central server. Only model updates are sent to this server. The latter aggregates the received models and sends the next round's starting model to all or a subset of users. Instead, in GossipRecs, users train their own models locally and exchange them directly with a set of neighbors over a communication graph.

However, due to the numerous attacks that have been proposed against collaborative learning systems (e.g., [6], [7]), a legitimate concern arises regarding the sensitivity of FedRecs and GossipRecs to privacy attacks. In this paper, we propose a novel attack called Community Inference Attack (CIA). From an attacker perspective, the objective of CIA is to learn from the models received from clients, the *k* users having the most similar set of recommended items to a given dataset crafted by the attacker from a catalog of available items. The novelty of CIA resides on the type of leakage and the resulting harm it may cause to users. Indeed, CIA allows an attacker to identify communities interested in a specific set of items (e.g., politically-oriented posts or videos, health-related subjects or places), which leaks sensitive information about them (e.g., minorities, protesters or people with a given disease).

Various attacks have been proposed in the literature to leak private information from machine learning models. The closest attacks to CIA are membership inference attacks (MIAs) [6], [8] and attribute inference attacks (AIAs) [9], [10]. While the target of these attacks is different from the one of CIA, they could be leveraged as proxies to detect communities. In this paper we show that leveraging an MIA or an AIA to detect communities is both more costly and less effective than using CIA.

In this paper, we assess the leakage caused by a CIA on three recommender systems, one relying on Federated Learning [11] and two relying on Gossip Learning [5], [12]. We leverage two classical recommendation models, Generalized Matrix Factorization (GMF) [13] and Personalized Ranking

<footnote>This work was supported by the French government grant managed by the Agence Nationale de la Recherche (ANR) through the France 2030 program with reference "ANR-23-PEIA-005" (REDEEM project), as well as the ANR Labcom program, reference "ANR-21-LCV1-0012".</footnote>
Metric Embedding (PRME) [14], to examine the impact of the recommendation model on privacy. These six configurations were tested on three real-life datasets. Besides evaluating the strength of the attack, we evaluate the impact of two countermeasures: Differentially Private Stochastic Gradient Descent (DP-SGD) [15] and the *Share less* policy, which involves sharing a subset of model parameters [6].

Results show that in the Federated Learning setting, the attack can recover communities with an average accuracy exceeding random guessing by a factor of 10. Furthermore, in the Gossip Learning setting, the attack achieves an average accuracy three times better than random guessing. Augmenting GossipRecs with DP-SGD and the *Share less* policy enhances their resilience to CIA, with *Share less* offering a better privacy-utility trade-off than DP.

Our contributions are as follows:

* We propose a novel attack aimed at discovering communities based on their preferences in collaborative-learning-based recommender systems, serving as a new privacy metric to evaluate a new type of leakage from model exchanges in distributed settings.

* We present this attack both in FL and Gossip settings. While the attacker in FL is assumed to be placed on the server side, in the Gossip setting we ran experiments considering all possible attacker placements in the communication graph. We further considered a proportion of colluding nodes in this setting.

* We evaluate the leakage from our attack across different recommender models, using three real-life datasets with approximately 700 to 1000 users each.

* We compare the privacy-utility trade-off of two mitigation mechanisms, DP-SGD and the *Share less* policy.

* We investigate how other attacks in the literature namely MIA and AIA can be leveraged as proxies for CIA and evaluate their efficiency in detecting communities.

The rest of the paper is organized as follows: Section II serves as a concrete illustration of the impact of CIA when targeting health vulnerable users in the Foursquare dataset. Section III provides background on Collaborative-Learning Recommender Systems and the defense mechanisms: the *Share less* strategy and DP-SGD. Section IV details our threat model and the attack algorithm. Section V describes our evaluation setting, followed by an evaluation of the attack (Section VI) and defense mechanisms (Section VII). We then analyze CIA's sensitivity to various parameters while comparing it with MIAs and AIAs (Section VIII) and discuss our design choices (Section IX). Finally, we review related work in Section X and conclude in Section XI.

## II. MOTIVATING EXAMPLE

Consider the Foursquare dataset, which consists of times-tamped geo-localization points visited by users. Each point in this dataset can be categorized semantically (e.g., Health and Medicine, Retail...etc.) , as detailed in a previous work [16]. In order to illustrate the risks incurred by collaborative learning-based recommender systems, we performed

the following experiment. We implemented a point-of-interest recommender system on the aforementioned dataset. The recommender system is trained over Federated Learning. We ran the attack described in this paper on the server side with the objective of identifying "health vulnerable" users (i.e., those who frequently visit health categorized geo-points). As illustrated in Figure 1, by leveraging our proposed attack and utilizing only the users' models and publicly available categorizations, the adversary successfully identifies a community of three users. These users are characterized by having at least 68% of health geo-points visits per day compared to only 6.7% for the overall Foursquare users. Moreover, by using a fine-grained set of geo-points when running CIA, the adversary can achieve a relatively accurate estimate of the specific health points visited by the community (e.g., Elmhurst Hospital). This example highlights the potential privacy risks inherent to the notion of community, such as discrimination by insurers and targeted exploitation through personalized health-related advertisements.

<figure><img src="image_3.png" /><figcaption>Figure 1. CIA run targeting "health vulnerable" users in the Foursquare dataset.</figcaption></figure>

## III. BACKGROUND

In this section we present the necessary background on recommender systems (Section III-A) with a specific focus on Federated Learning-based Recommender Systems (Section III-B) and on Gossip Learning-based Recommender Systems (Section III-C). We then describe the defense mechanisms, namely, Share less (Section III-D) and DP-SGD (Section III-E).

### A. Recommender Systems

Let $\mathcal{R} \in \mathbb{R}^{|U| \times |V|}$ be an interaction (e.g., rating) matrix for a set of users (clients) $\mathcal{U}$ and a set of items $\mathcal{V}$. In this work, we are interested in Collaborative Filtering (CF) recommenders, which aim at capturing the relationship between $\mathcal{U}$ and $\mathcal{V}$ by abstracting each user $i \in \mathcal{U}$ and item $j \in \mathcal{V}$ into real-valued vectors (embeddings), $e_i \in \mathcal{E}^\mathcal{U}$ and $e_j \in \mathcal{E}^\mathcal{V}$, respectively. This set of embeddings $\mathcal{E} = \{\mathcal{E}^\mathcal{U}, \mathcal{E}^\mathcal{V}\}$ is part of a model $\Theta$ ($\mathcal{E} \subset \Theta$), which is learned by solving an optimization problem of the form:

$$ \underset{\Theta}{\operatorname{argmin}} \mathcal{L}^{\mathrm{rec}}(\Theta; \mathcal{R}) \qquad (1) $$
where $\mathcal{L}^{rec}$ is a loss function. In our settings, Stochastic Gradient Descent (SGD) is leveraged to solve this problem.

## B. Federated Recommender Systems

Federated Recommender Systems (FedRecs) allow multiple users to collaboratively train a recommender model while keeping their data on their premises. The training process consists of several communication rounds between clients, and a central server. Specifically, at each round $t \in [T]$, (1) (selected) users receive the global model $\Theta^t$ from the server; (2) they run several training steps using their local data $\mathcal{R}_u$, obtaining local model updates (gradients), say $\nabla \mathcal{L}^{rec}(\Theta^t; \mathcal{R}_u)$; (3) they send back the updates to the server. To form the new global model, the server aggregates them as in $\Theta^{t+1} = \Theta^t - \eta \sum_{u \in \mathcal{U}} W_u \nabla \mathcal{L}^{rec}(\Theta^t; \mathcal{R}_u)$, where $\eta$ is a learning rate and $W$ is a weighting vector that depends on the aggregation rule. Finally, this process is repeated until model convergence.

## C. Gossip-based Recommender Systems

Gossip-based Recommender Systems (GossipRecs) are used to train a recommendation model across a network of users connected in a peer-to-peer fashion. In this setting, each user $u$ maintains a local model $\Theta_u$, while the (dynamic) communication network is often modeled by a set of directed graphs $G^1, \dots, G^T$ where $G^t = (\mathcal{U}, \mathcal{E}^t)$ represents the network at round $t$ and $\mathcal{E}^t \in \mathcal{U}^2$ is the set of communication links (i.e., edges) between users. Let $N(u)^t = \{N_{in}(u)^t \cup N_{out}(u)^t\}$ denote the set of neighbors of $u$ (view) at round $t$. Similarly to other works [17], [18], we consider P-out-regular graphs (i.e., $\mathbb{E}(|N_{in}(u)|) = P$ and $|N_{out}(u)| = P$).

At each iteration $t$, (1) a random user $u$ (or subset of users) wakes up and casts $\Theta_u^t$ to a randomly sampled neighbor $v \in N_{out}(u)^t$. In a second phase, (2) $u$ aggregates the models received since the last waking up step, say $M_{in}^{<t}(u)$, as in $\Theta_u^{t+\frac{1}{2}} = W_{(u,\Theta_u^t)}\Theta_u^t + \sum_{\Theta \in M_{in}^{<t}(i)} W_{(u,\Theta)}\Theta$. where $W_{(u,m)}$ denotes the weight user $u$ assigns to model $m$ in the aggregation. Finally, (3) $u$ forms its new model $\Theta_{u+1}^u$ by making local training steps. Furthermore, users periodically explore new neighborhoods through a random peer-sampling protocol [19].

## D. Share less strategy

User embeddings encode latent features describing users' semantics, making them more vulnerable. Based on this ratio-nale, Yuan et al. [6] have advocated for retaining $e_u, \forall u \in \mathcal{U}$, on the user $u$'s device ($E^u$ is private), while regularizing item embeddings updates' to reduce their sensitivity (See Equation 2). This approach has been shown to improve the resilience against MIAs. We quantify its effectiveness against CIA.

$$ \mathcal{L} = \mathcal{L}^{rec} + \tau \sum_{j \in \mathcal{V}_u} \|e_{ju}^t - e_j^t\|_2 \quad (2) $$

where $e_j$ denotes the global embedding of item $e_j$ and $e_{ju}$ the updated embedding of item $j$ at user $u$, while $\tau$ is

the regularization factor. In GL, where there are no global embeddings, $e_j^t$ is replaced with $e_{ju}^{t-1}$.

## E. Differentially Private SGD

Differentially Private SGD (DP-SGD) [15] is an optimization algorithm that trains a model $\Theta$ while ensuring that neighboring input datasets (that differ in one datapoint) produce model updates with similar statistical properties (up to an $\epsilon$). To this end, gradients are clipped by a predetermined threshold $C$ and a calibrated noise, drawn from some probability distribution, is added to them during the SGD process. This has the effect of bounding the contribution of (batches of) data points. In our case, we opt for the Gaussian Distribution (i.e., noise $\sim N(0, (\epsilon C)^2I)$, where $\epsilon$ is a scaling factor). Moreover, we leverage a version of DP, referred to as local DP (LDP), where noise is added at user-level.

While DP-SGD provides formal privacy guarantees, it often incurs a substantial utility cost [20]. One of the objective of this work is therefore to investigate the privacy-utility trade-off of LDP in the context of CIA.

# IV. COMMUNITY INFERENCE ATTACK (CIA)

<figure><img src="image_4.png" /><figcaption>Figure 2. Community Inference Attack (CIA) : a comparison between FL and GL settings.</figcaption></figure>

We present in this section our threat model and assumptions (Section IV-A) before delving into our Community Inference Attack (CIA) (Section IV-B).

## A. Threat Model and Adversary's Knowledge

We assume $N$ users involved in a collaborative learning algorithm of a joint recommendation model $\Theta$. We assume the presence of an honest-but-curious adversary $A$. That is to say, the adversary complies with the learning protocol while aiming to learn sensitive information. We assume that $A$ has access to a set of items, $\mathcal{V}_{target}$, that are representative of the community to be found. In real life, $\mathcal{V}_{target}$ can be handcrafted from a catalog of available items as these are usually publicly available as we did in the illustrating example (Section II). The primary objective for the adversary is to identify a community of users, denoted as $C$ which exhibits the closest item preferences to the target item set $\mathcal{V}_{target}$. In
this work, we distinguish the following three settings:

**Federated setting:** In this setting (Figure 2, Left), we assume that the adversary takes control of the federated server. The server may contact all or part of the users in each FL round. It then uses the received models to carry out the attack.

**Gossip-based setting with a single adversary:** We first consider an adversary with a single participant under its control (Figure 2, Right). This adversary carries out her attack by using the models she receives from her neighbors throughout the execution of the protocol. Note that as we rely on a random peer sampling protocol, the adversary will periodically have new neighbors from whom she will receive models. Moreover, considering our P-out regular-graphs, the expected number of models observed by the adversary is equal to P. That is, $\mathbb{E}[\text{Adv. seen models}] = P$.

**Gossip-based setting with an adversary controlling several nodes:** In this setting, we consider an adversary that controls a proportion of $f/N$ participants that are randomly positioned in the network. As we assume the attacker to follow the honest-but-curious threat model, these participants, referred to as colluders, only share their knowledge with each other (line 14 in algorithm 2). Consequently, in this setting, $\mathbb{E}[\text{Adv. seen models}] \le f \cdot P$.

## B. Adversary Goal and CIA's Algorithm

The objective of the attacker is to discover a community $C$ of $K$ users that are the most likely to be interested in the set of items $\mathcal{V}_{\text{target}}$. Towards this purpose, $A$ uses models received from participants during the learning process (See line 6 in algorithms 1 and 2 for FL and GL, respectively). Specifically, the attack exploits the fact that a model is likely to assign higher relevance scores for items rated by users coming from the same community. To capitalize on this, an adversary can compute the relevance score assigned by each received model $\Theta_u$ to $\mathcal{V}_{\text{target}}$ (See line 12 of algorithms 1 and 2, respectively). The adversary can then rank the models over time, obtaining $\hat{C}$, the set of $K$ users most likely to belong to the community $C$ (lines 16 and 17 of algorithms 1 and 2, respectively). This can be written as follows:

$$ \hat{C} = \{c_1, c_2, \dots, c_K\} \text{ such that } \forall k \le K, \forall u \in \mathcal{U} \setminus \hat{C}: \\ \hat{Y}(\Theta_{c_k}, \mathcal{V}_{\text{target}}) \ge \hat{Y}(\Theta_u, \mathcal{V}_{\text{target}}) \tag{3} $$

Where $\hat{Y}(\Theta_u, \mathcal{V}_{\text{target}}) = \frac{1}{|\mathcal{V}_{\text{target}}|} \sum_{i \in \mathcal{V}_{\text{target}}} \hat{y}_{ui}$ and $\hat{y}_{ui}$ is the relevance score assigned by $\Theta_u$ to item $i$. In practice, the relevance can be any recommendation quality metric.

1) **FL vs GL:** The only difference between FL and GL is that the attacker does not encounter participants in the same manner (See Section IV-A). While in FL, (the server acting as an adversary) receives models from the participants of each FL round (line 6 in Algorithm 1), in GL, adversaries receive models from their neighbors or colluders (line 6 in Algorithm 2). Besides this difference, the attacker's actions remain the same.

**Algorithm 1 CIA Algorithm run by adversary $A$ in FL**

**Require:** $\mathcal{V}_{\text{target}}$: target dataset, $K$: size of the community, $\beta$: momentum coefficient

**Ensure:** $\hat{C}$: predicted community

1: **for all** $u \in \mathcal{U}$ **do**

2: $v_u \leftarrow \text{Dict()}$

3: **end for**

4: $\hat{C} \leftarrow \{\}$

5: **for** $t = 1$ to $T$ **do**

6: &nbsp;&nbsp;&nbsp;&nbsp;**for all** $u \in \mathcal{U}$ **do**

7: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**if** $t \ne 0$ **then**

8: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$v_u \leftarrow \beta \cdot v_u + (1 - \beta) \cdot \Theta_u$

9: **else**

10: &nbsp;&nbsp;&nbsp;&nbsp;$v_u \leftarrow \Theta_u$

11: **end if**

12: $y_u \leftarrow \text{EvaluateModel}(v_u, \mathcal{V}_{\text{target}})$

13: $\text{AddSorted}(\hat{C}, u, y_u)$

14: **end for**

15: **end for**

16: $\text{Slice}(\hat{C}, K)$

**Algorithm 2 CIA Algorithm run by adversary $A$ in GL**

**Require:** $\mathcal{V}_{\text{target}}$: target dataset, $K$: size of the community, $\beta$: momentum coefficient, $A_{\text{colluders}}$: Colluding partners

**Ensure:** $\hat{C}$: predicted community

1: **for all** $u \in \mathcal{U}$ **do**

2: $v_u \leftarrow \text{Dict()}$

3: **end for**

4: $\hat{C} \leftarrow \{\}$

5: **while** Training **do**

6: &nbsp;&nbsp;&nbsp;&nbsp;**for all** $\Theta_u \in M_{in}^{<t}(A)$ **do**

7: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**if** $t \ne 0$ **then**

8: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$v_u \leftarrow \beta \cdot v_u + (1 - \beta) \cdot \Theta_u$

9: **else**

10: &nbsp;&nbsp;&nbsp;&nbsp;$v_u \leftarrow \Theta_u$

11: **end if**

12: $y_u \leftarrow \text{EvaluateModel}(v_u, \mathcal{V}_{\text{target}})$

13: $\text{AddSorted}(\hat{C}, u, y_u)$

14: $\text{Multicast}(A_{\text{colluders}}, u, v_u)$

15: **end for**

16: **end while**

17: $\text{Slice}(\hat{C}, K)$

2) **Colluders in GL:** When the attacker controls more than one node in GL, she forwards models received from her neighbors to her colluders (line 14 in Algorithm 2).

3) **Limiting the Effect of Model Aging through Momentum:** Models tend to leak more information on their training data in early stages of training. Furthermore, in GL, models arrive at varying stages of the learning process, depending on the adversary's neighborhood (i.e., temporality). This makes model comparison even more difficult because the relevance score could be high due to the overall quality of the model rather than its specification to $\mathcal{V}_{\text{target}}$. To account for these
<table><caption>Table I
SUMMARY OF DATASETS.</caption><thead><tr><th>Dataset</th><th>Users</th><th>Items</th><th>Ratings</th></tr></thead><tbody><tr><td>MovieLens-100k</td><td>943</td><td>1682</td><td>100k movie ratings</td></tr><tr><td>Foursquare-NYC [21]</td><td>1083</td><td>38333</td><td>200k check-ins</td></tr><tr><td>Gowalla-NYC [22]</td><td>718</td><td>32924</td><td>185,932 check-ins</td></tr></tbody></table>

phenomena, we implemented a momentum technique. More specifically, instead of computing relevant scores directly on the new received model $\Theta_u^t$, we use $v_u^t$, an aggregated model through rounds (See Equation 4 and line 8 of algorithms 1 and 2).

$$v_u^t = \beta \times v_u^{t-1} + (1 - \beta) \times \Theta_u^t \quad (4)$$

Where $\beta$ is the momentum coefficient and $v_u^0 = \Theta_u^0$ (line 10 in algorithms 1 and 2).

### C. Adapting CIA to the Share less strategy

As discussed previously, an adversary in CIA needs to compute the relevance score $\hat{Y}(\Theta_u, V_{target})$. However, this cannot be achieved straightforwardly in the Share less strategy, where the adversary only receives partial models (i.e., $E^U$ is private). To account for this, we propose a methodology that allows the adversary to obtain a sufficiently accurate estimate of the relevance score. More precisely, the adversary creates a fictional interaction matrix $R_A$ using the target set of items $V_{target}$ in order to train a user embedding $e_A$. Semantically, this embedding represents a fictive user that likes items of $V_{target}$. Then, upon each reception of a partial model (from a victim) in the form $E^V$ (and possibly non-embedding parameters), the adversary combines it with $e_A$ to form an approximation of the model to be attacked, say $\hat{\Theta}_u$. Finally, A can conduct CIA by replacing $\Theta_u$ with $\hat{\Theta}_u$ in line 12 of algorithms 1 and 2. This approach works because of the comparative nature of CIA, as learning one user embedding provides a reference basis to compare items embeddings coming from different users.

## V. EXPERIMENTAL SETUP

We present in this section our experimental setup. First, we describe the datasets and recommendation models used. Then, we define our evaluation metrics (Section V-C). Finally, we describe the evaluated protocols and baselines (Section V-D).

### A. Datasets

² We used the datasets described in Table I. Note that we pre-process these datasets in the following way: we assign the value one to all user ratings/check-ins (i.e., observed interactions) and the value zero to non-observed ones, as is classically done for classification-based recommendation [13].

### B. Recommendation Models and Hyper-Parameters

In this work, we leveraged two standard recommendation models: Generalized Matrix Factorization [13] and Personalized Ranking Metric Embedding (PRME) [14]. For both models, we utilize the same hyper parameters as the original

works. For the gossip algorithms, we set the out-neighborhood size to 3 and the periodic change of views follows $p \sim Exp(0.1)$, while for the personalized gossip algorithm, we set the exploration ratio to 0.4. Finally, unless stated differently, the momentum coefficient $\beta = 0.99$ for all settings.

### C. Evaluation Metrics

In this section, we present the evaluation metrics and gossip protocols that were employed in our experimental evaluation. **Ground truth:** To measure the performance of CIA, the following ground truth was considered: for a given set of items $V_{target}$, the true community $C$ is defined as the top-K users whose training sets of items are most similar to $V_{target}$. Due to the nature of the data (i.e., sets), similarity is measured using the Jaccard index (see eq. (5)). Moreover, to ensure the statistical significance of the results, we made each user $u$ (separately) play the role of the adversary by using $V_{train}^{(u)}$ as $V_{target}$.

$$C = \{c_1, c_2, \dots, c_K\} \text{ such that } \forall k \le K, \forall u \in U \setminus C, \\ \left| \frac{V_{target} \cap V_{train}^{(c_k)}}{V_{target} \cup V_{train}^{(c_k)}} \right| \ge \left| \frac{V_{target} \cap V_{train}^{(u)}}{V_{target} \cup V_{train}^{(u)}} \right| \quad (5)$$

where $V_{train}^{(u)}$ is the set of items used in training by user $u$ while $K$ is a parameter defining the size of user communities. Unless stated otherwise, we set $K=50$.

**Attack Accuracy (at round R):** Given $V_{target}$ and the inferred community $\hat{C}$, the accuracy at rank K is defined as:

$$Accuracy@R(V_{target}) = \frac{|\hat{C}_{target} \cap C_{target}|}{K} \quad (6)$$

**Average Attack Accuracy (at round R):** It is defined as the average accuracy over all possible $V_{target}$ (adversaries).

**Maximum Attack Accuracy (over all rounds):** It is the maximum of average attack accuracies. We refer to it as Max AAC.

**Best 10% AAC:** It refers to the minimum attack accuracy achieved by the best 10% attackers at the round where Max AAC is obtained.

**Accuracy upper bound:** It is defined as the maximum accuracy that an adversary could achieve considering the models observed. For instance, an adversary targeting $C$ and having interacted with $p * |C|$ proportion of community users has $Accuracy \le p$. This bound is equal to 1 for the FL settings.

**Recommendation quality metrics:** As utility metrics, we leverage the hit ratio (HR) at rank K [13] to evaluate GMF and the F1-Score For PRME.

### D. Evaluated Protocols and Baselines

We implemented the following protocols:

**FL:** The classical FedAvg [11] algorithm.

**Rand-Gossip [12]:** A standard adaptation of FedAvg in a decentralized setting with a random peer-sampling.
<table><caption>Table II
SUMMARY OF ATTACK RESULTS IN THE FEDERATED SETTING.
ACCURACY UPPER BOUND OVER ALL CONFIGURATIONS IS 100%.</caption><thead><tr><th rowspan="2">Dataset (Random Bound)</th><th rowspan="2">Model</th><th colspan="2">Metric</th></tr><tr><th>Max AAC %</th><th>Best 10% AAC %</th></tr></thead><tbody><tr><td rowspan="2">Foursquare (3.6)</td><td>GMF</td><td>44.93</td><td>66</td></tr><tr><td>PRME</td><td>18.4</td><td>34</td></tr><tr><td rowspan="2">Gowalla (5)</td><td>GMF</td><td>57.3</td><td>77</td></tr><tr><td>PRME</td><td>32</td><td>52</td></tr><tr><td>Movielens (5.3)</td><td>GMF</td><td>57.4</td><td>76</td></tr></tbody></table>

**Pers-Gossip [5]:** A personalization oriented GL protocol where the performance of models is considered during peer-sampling. This version allows us to study the impact of personalization on CIA.

**Random guess:** It is defined as a random draw of K elements from N without replacement, which follows a hyper-geometric law $G(K, K, N)$. Therefore, the expected value of a random guess is $\frac{K}{N}$.

## VI. ATTACK EVALUATION

In this section, we investigate the impact of CIA on the three settings described in Section IV-A. More specifically, we aim at answering the following research questions:

* **RQ1:** How vulnerable are FedRecs to CIA?

* **RQ2:** How vulnerable are GossipRecs to CIA?

* **RQ3:** What is the impact of GossipRecs personalization schema on the accuracy of CIA?

* **RQ4:** What is the impact of colluders in GossipRecs on the performance of CIA?

We answer these questions in sections VI-A, VI-B, VI-C, and VI-D, respectively.

### A. CIA on FedRecs

In Table II, we depict the results of CIA on FedRecs. The results depicted in this table correspond to measures performed by launching as many experiments as there are users in the corresponding dataset, where each time the FL server uses the train set of a single user as $V_{target}$.

We observe that CIA obtains a high privacy leakage. Especially, when using GMF, since the server manages to reach between 44.93% and 57.4% average accuracy (depending on the dataset). This is more than 10 times the random bound (3.6%-5.3%). Naturally, we observe an even larger privacy leakage achieved by the best 10% attackers, which, for instance, achieve at least 77% attack accuracy on Gowalla with PRME. Notably, PRME seems less sensitive to the attack (between 18.4% and 32%). The reason behind this is that PRME is designed to learn a more challenging task compared to GMF. This is further illustrated by its lower utility (see Figure 4). Overall, an adversary clearly manages to leverage received models to find communities of participants in FedRecs (RQ1).

### B. CIA on GossipRecs

Compared to the results of FedRecs, Table III illustrates a reduced Max AAC in GossipRecs compared to FedRecs.

<table><caption>Table III
SUMMARY OF ATTACK RESULTS IN THE GOSSIP SETTINGS. ACCURACY UPPER BOUND OVER ALL CONFIGURATIONS IS 81% AND 72% FOR RAND-GOSSIP AND PERS-GOSSIP, RESPECTIVELY.</caption><thead><tr><th>Gossip Protocol</th><th>Dataset (Random bound)</th><th>Model</th><th>Max AAC %</th><th>Best 10% AAC %</th></tr></thead><tbody><tr><td rowspan="4">Rand-Gossip</td><td>Movielens (5.3)</td><td>GMF</td><td>14.6</td><td>32</td></tr><tr><td rowspan="2">Foursquare (3.6)</td><td>GMF</td><td>7.12</td><td>10</td></tr><tr><td>PRME</td><td>5.8</td><td>12</td></tr><tr><td rowspan="2">Gowalla (5)</td><td>GMF</td><td>11</td><td>20</td></tr><tr><td>PRME</td><td>5.8</td><td>16</td></tr><tr><td rowspan="4">Pers-Gossip</td><td>Movielens (5.3)</td><td>GMF</td><td>14.6</td><td>28</td></tr><tr><td rowspan="2">Foursquare (3.6)</td><td>GMF</td><td>8</td><td>14</td></tr><tr><td>PRME</td><td>5.8</td><td>12</td></tr><tr><td rowspan="2">Gowalla (5)</td><td>GMF</td><td>12.2</td><td>16</td></tr><tr><td>PRME</td><td>6.6</td><td>9</td></tr></tbody></table>

Specifically, the highest accuracies drop from 57.3% to 12.2% and from 57.4% to 14.6% for Gowalla and MovieLens (respectively) with the GMF model. Nevertheless, these accuracies are still at least twice as large as the random guess. This indicates that GossipRecs are less vulnerable to CIA but there still is a significant privacy leakage compared to the random bound (RQ2).

### C. Impact of Personalization on CIA

We can further compare the privacy leakage between Rand-Gossip and Pers-Gossip. Although the differences in Max ACC observed in Table III are relatively similar, it is still notable that the personalized setting tends to exhibit higher attack accuracy, especially considering it has a lower accuracy bound (i.e., 72% versus 81% as attackers meet less victims in this protocol since it is less peer exploratory). We conclude that an adversary can indeed take benefit from the personalized models, but as CIA depends on the exploration of the user space (e.g., accuracy bound), this impact is largely reduced by the more restrained peer sampling protocol of Pers-Gossip (RQ3).

### D. Impact of colluders on CIA

Table IV presents the Max AAC for 5%, 10%, and 20% colluders in a Rand-Gossip setting. The accuracy bound increases from 40.96% to 100% as the adversary's view size expands, aligning with the accuracy bound in FedRecs. However, the maximum average accuracy for 20% colluders reaches only 45%, significantly lower than in FL (45% vs. 57.3% average and 60.3% vs. 76% for the best 10% AAC). This difference persists despite both settings sharing a 100% accuracy bound, due to the colluders receiving models at different stages (i.e., temporality). Furthermore, achieving a global view would require them controlling at least 812 of 1083 users in a 3-regular graph, which is impractical. Thus, GossipRecs demonstrate greater resilience to CIA under realistic colluder numbers (RQ4).

## VII. DEFENSE EVALUATION

In this section, we investigate the ability of the defense strategies to mitigate CIA along with their impact on utility.
<table><caption>Table IV
EFFECTS OF COLLUSION IN GL (RAND-GOSSIP) WITH GMF ON MOVIELENS. THE RANDOM BOUND IS AT 5.3% AND THE ACCURACY UPPER BOUND IS AT 100%.</caption><thead><tr><th rowspan="2">Setting</th><th colspan="2">Metric</th></tr><tr><th>Max AAC %</th><th>Best 10% AAC %</th></tr></thead><tbody><tr><td>Single Adversary</td><td>14.6</td><td>32</td></tr><tr><td>5% Colluders</td><td>24.8</td><td>40</td></tr><tr><td>10% Colluders</td><td>31</td><td>56</td></tr><tr><td>20% Colluders</td><td>45</td><td>60.3</td></tr></tbody></table>

More specifically, we aim at answering the following questions:

* **RQ5:** What is the impact of using the Share less strategy on the performance of CIA in FedRecs, GossipRecs and GossipRecs with colluders?

* **RQ6:** What is the Privacy/Utility trade-off of the Share less strategy?

* **RQ7:** What is the impact of using DP-SGD on FedRecs and GossipRecs?

We answer these questions in sections VII-A, VII-B, VII-C; VII-D; and VII-E, VII-F; respectively.

### A. Share less strategy on FedRecs

Figures 3 and 4 display the privacy/utility trade-off for the different protocols, using GMF and PRME, respectively. Furthermore, these figures serve as evidence that Share less manages to reduce CIA's accuracy in all FedRecs. Specifically, Figure 3 indicates a drop from 44.93% to 40.08% on Foursquare; on Gowalla, a drop from 57.3% to 41%; and on MovieLens it decreases from 57.4% to 39.4%. Similar, though lesser reductions can also be noted for the PRME model. In conclusion, the Share less strategy undeniably reduces the impact of CIA but is not sufficient in FL (RQ5).

### B. Share less strategy on GossipRecs

In contrast with the results observed for FedRecs, the Share less strategy appears to be largely counter-productive in the GossipRecs setting (See Figures 3 and 4). Indeed, we observe a surprising increase in Max AAC (between -0.4 and +2.6) on most settings. We attribute these results to the temporality aspects of GL. Specifically, the Share less strategy's natural regularization effects makes models age at a slower pace, allowing for attackers to compare models coming at different rounds. In conclusion, the Share less strategy is unlikely to be efficient in mitigating CIA in GL (RQ5).

### C. Share less strategy with colluders

Table V presents Max AAC for the colluding Rand-Gossip setting with the Share less strategy. Interestingly, it appears that the advantage of colluding in this setting is hardly perceptible. Specifically, we observe that 20% of colluders are needed to achieve a 16% MAX AAC. Moreover, an accuracy smaller by a factor of more than 2.8, compared to the same setting in a full model sharing strategy. This makes the Share less strategy more appealing in a gossip setting with colluders (RQ5).

<table><caption>Table V
EFFECTS OF COLLUSION IN GL (RAND-GOSSIP) IN THE SHARE LESS STRATEGY SETTING. THE MODEL USED HERE IS GMF ON MOVIELENS DATASET. THE RANDOM BOUND IS AT 5.3% AND THE ACCURACY UPPER BOUND IS AT 100%.</caption><thead><tr><th rowspan="2">Setting</th><th colspan="2">Metric</th></tr><tr><th>Max AAC %</th><th>Best 10% AAC %</th></tr></thead><tbody><tr><td>Single Adversary</td><td>14</td><td>29</td></tr><tr><td>5% Colluders</td><td>11.3</td><td>19</td></tr><tr><td>10% Colluders</td><td>12.8</td><td>20</td></tr><tr><td>20% Colluders</td><td>16</td><td>28</td></tr></tbody></table>

### D. Privacy/Utility Trade-off of Share less

For GMF, utility consistently declines across all configurations, with losses ranging from 8.5% to 16% for FedRecs and 1.06% to 46.5% for GossipRecs (See Figure 3). This is due to user embeddings failing to fully offset the semantic loss caused by item embedding regularization. In contrast, PRME shows no systematic utility decrease; in some cases, it even improves slightly (e.g., a 4% F1-Score increase on Foursquare). This may stem from the extra personalization achieved by focusing on local preferences with Share less strategy. Privacy-wise, the Share less strategy significantly benefits FedRecs, but drawing firm conclusions for GossipRecs is difficult since they already approach the random bound without defense (RQ6).

<figure><img src="image_5.png" /><figcaption>Figure 3. Attack Accuracy and Hit Ratio@20 trade-off summary for the full models and Share less strategies on GMF.</figcaption></figure>

### E. DP-SGD on FedRecs

In Figure 5, left side, we directly depict the results in terms of privacy/utility trade-off of DP-SGD in the FedRecs setting. This is particularly important, because as in many use cases of DP for complex high dimensional models, it is difficult to achieve proper utility results with meaningful privacy budget (ϵ). Indeed, even with ϵ as high as 100 which would be equivalent to no actual (formal) privacy guarantee the utility is divided by a factor of 2.92. This drop-off is drastically more significant than the one observed in the Share less strategy, which in comparison, offers a much satisfying utility for a reasonable empirical privacy (RQ7).
<figure><img src="image_6.png" /><figcaption>Figure 4. Attack Accuracy and F1-Score trade-off summary for the full models and Share less strategies on PRME.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Figure 5. Average utility and empirical privacy trade-off on MovieLens under DP-SGD with different values of privacy budget $\epsilon$, $\delta = 1e^{-6}$ and clipping = 2. Utility is measured in Hit Ratio.</figcaption></figure>

## F. DP-SGD on GossipRecs

In Figure 5, right side, we illustrate the privacy/utility trade-off when applying DP-SGD in the Rand-gossip setting. The patterns observed are consistent with those seen in FL. More specifically, we notice that even when using higher values of $\epsilon$ that do not provide viable privacy guarantees, the utility metric is still significantly impacted. For instance, with $\epsilon = 1000$, the utility is at 30%, which is 2.40 times lower than what can be reached without noise. Notably, even at this utility level, the attack performs considerably better than the random guess (11.2% versus 5.3%) (RQ7).

## VIII. ATTACK VARIATIONS AND PARAMETER SENSITIVITY ANALYSIS

In this section, our focus is directed towards exploring the effects of two critical parameters of CIA, namely, the momentum (See Section VIII-A) and the size of the communities K (See Section VIII-B). Subsequently, we delve into an investigation of attack strategies that could serve as potential proxies for CIA and perform a complexity analysis with these latter (See Section VIII-C).

<table><caption>Table VI
MAX AAC WITH AND WITHOUT MOMENTUM WITH VARIOUS RATIOS OF COLLUDERS IN GL ON MOVIELENS WITH GMF.</caption><thead><tr><th>Setting</th><th>5% Colluders</th><th>10% Colluders</th><th>20% Colluders</th></tr></thead><tbody><tr><td>β = 0</td><td>18.4</td><td>21.8</td><td>17.6</td></tr><tr><td>β = 0.99</td><td>24.8</td><td>31</td><td>45</td></tr></tbody></table>

### A. Impact of Momentum on the colluding setting

Table VI illustrates the comparison of the colluding setting with and without momentum. It is easy to see that without momentum, the usefulness of colluding is largely lost (i.e., 17.6% versus 45% for 20% colluders) as the colluders acquire models that are largely heterogeneous, which undermines a comparison based attack. In fact, the accuracy of the colluding setting without momentum seems bounded, that is, increasing the number of colluders beyond a certain point does not benefit the adversary. This makes the variance reduction feature of the momentum highly important and perceptible.

### B. Different K values

<table><caption>Table VII
IMPACT OF PRIVACY RISK ASSESSMENT PARAMETER K ON THE MAX AAC.</caption><thead><tr><th>Setting</th><th>K=10</th><th>K=20</th><th>K=40</th><th>K=50</th><th>K=100</th></tr></thead><tbody><tr><td>Full models</td><td>49</td><td>51</td><td>55</td><td>57</td><td>38</td></tr><tr><td>Share less</td><td>31</td><td>32</td><td>37</td><td>40</td><td>19</td></tr><tr><td>Random Guess %</td><td>1</td><td>2</td><td>4</td><td>5</td><td>10</td></tr></tbody></table>

Table VII showcases CIA Max AAC across different K values within FL for both model sharing strategies. Notably, we observe that changes in K do not notably influence accuracy for smaller K values. This is particularly appealing for the adversary as smaller communities often hold more relevance. As shown by the random guess value, these consistent accuracies are obtained in harder setups. We note that beyond some K value (e.g., 100) the accuracy drops, which is due to the ground truth itself as the notion of community is lost.

### C. Detecting communities using other machine learning attacks as proxies

In this section, we study if the outputs of pre-existing privacy attacks, namely, membership inference attacks (MIAs) and attribute inference attacks (AIAs), could be leveraged as proxies to conduct a Community Inference attack.

1) Membership inference attacks as a proxy for CIA: MIAs determine whether a given data point was part of a model's training set of a model, requiring adversaries to have access to data points likely to belong to the training set of the victim or methods to sample those candidates. In practice, an adversary can use MIA to infer the number of items in $V_{target}$ that likely belong to the victims' training set, returning users with the most training items in $V_{target}$ (i.e., community members). However, this approach is unsound for two reasons: primarily, MIA fundamentally differs from CIA in the fact that it detects similarities between $V_{target}$ and training sets
(i.e., memorization phenomenon), while CIA does not require $V_{target}$ to have common items with training sets of users and instead relies on model generalization. Additionally, strong MIAs often require the costly training of shadow models [8].

To compare MIA and CIA, we leverage a low-cost entropy-based MIA [23]. This attack classifies data points based on a threshold $\rho$ over the entropy of model loss. Table VIII demonstrates that used as a proxy for CIA, this attack it achieves a lower Max AAC, even for lower threshold values, where the training sets found by MIA have more confidence (i.e., 36% versus 57%). The reason for this difference in performance is that i) Inferring training membership is harder than inferring if an item aligns with a victim's preferences and ii) As explained earlier, MIA tests whether a given item has been used in the train set of the victim, while CIA tests whether the item is likely to be enjoyed by the victim. Section VIII-D includes this attack in our complexity analysis.

<table><caption>Table VIII
MIA'S USAGE AS A PRIVACY ASSESSMENT METRIC FOR COMMUNITY INFERENCE IN FL FOR GMF WITH MOVIELENS.</caption><thead><tr><th>Attack</th><th>ρ = 0.2</th><th>ρ = 0.4</th><th>ρ = 0.6</th><th>ρ = 0.8</th><th>ρ = 1</th></tr></thead><tbody><tr><td>MIA Precision %</td><td>44</td><td>40</td><td>36</td><td>34</td><td>0.31</td></tr><tr><td>MIA Max AAC %</td><td>36</td><td>36</td><td>35</td><td>34</td><td>32</td></tr><tr><td>CIA Max AAC %</td><td colspan="5">57</td></tr></tbody></table>

## 2) Attribute inference attacks (AIAs) as a proxy for CIA:

AIAs aim to infer sensitive attributes in a dataset based on the model it was trained on (e.g., gender in a recommendation use case [24]). Considering community membership as an attribute, such attacks could detect communities. However, AIAs often require training a surrogate model, making them costly to launch. To investigate this, we implement an AIA attack similar to [24]. The adversary randomly samples $N$ datasets from $V_{target}$, representing fictive users belonging to the community. Similarly, $M$ datasets are sampled (with replacement) from $V \setminus V_{target}$, representing users outside of the community. On each of these $N + M$ datasets, a GMF model is trained locally. This allows the adversary to collect gradients both from withing and outside the community members. These latter are used to train a binary classifier of five fully connected layers, with Relu activation function between layers and a sigmoid output. It learns to classify users into community and none-community members. This classifier was then integrated into FL to mimic CIA for a randomly selected community. The Max AAC obtained indicate a 40% accuracy for AIA compared to a 62% for CIA, showing CIA is more effective in retrieving the community. This is likely due to the challenge of effectively training a classifier based on gradients, as gradients from locally trained $N + M$ models do not approximate those from models in FL. In Section VIII-D, we furthermore analyze the complexity of such an AIA attack compared to CIA, and the previously discussed MIA.

## D. Complexity Analysis of CIA compared to proxy attacks

In this section, we present a temporal complexity analysis of the MIA and AIA attacks evaluated in this work, compared

<table><caption>Table IX
TEMPORAL COMPLEXITY OF MIA AND AIA COMPARED TO CIA.</caption><thead><tr><th>Attack</th><th>Temporal Complexity</th></tr></thead><tbody><tr><td>CIA</td><td>O(T<sub>M</sub>) + O(I<sub>M</sub> * |U| * |V<sub>target</sub>|)</td></tr><tr><td>MIA</td><td>O(T<sub>M</sub>) + O(I<sub>M</sub> * |U| * D<sub>max</sub>)</td></tr><tr><td>AIA</td><td>O(T<sub>M</sub> * (N + M)) + O(T<sub>C</sub>) + O(I<sub>C</sub> * |U|)</td></tr></tbody></table>

to CIA. Without loss of generality, we consider a scenario where the adversary aims to find a specific community $V_{target}$ in a Share less scenario, which is a worst case scenario for CIA, from a cost perspective. We denote $T_M$, $I_M$, $T_C$ and $I_C$ as the training and inference times of the recommendation model and the classifier, respectively. We assume $I << T$ and expect $I_C \approx I_M$. Finally, we denote the size of the largest user training set as $D_{max}$. Table IX shows that CIA and MIA share similar complexities, as they both require training one fictive user embedding (i.e., $O(T_M)$) and performing a certain number of inferences. However, in practice, this number is higher for MIA as it needs to determine approximate training sets for all users before communities, thus, performing $U \cdot D_{max}$ inferences in the worst case, compared to the $U \cdot |V_{target}|$ inferences of CIA. In comparison, AIA requires $N + M$ more recommendation models training. It furthermore involves training a classifier on gradients. Given its input size (i.e., num items \ embedding size) and its architecture, $T_C$ is at least as costly as $T_M$. We conclude that CIA is marginally more efficient than AIA and is more efficient than entropy-based MIA for $|V_{target}| < D_{max}$ and equivalent in the worst case.

## E. On the universality of CIA

In this paper, we focus on attacking recommender systems. The main reason for this is that the concept of "community" within recommender systems is both intuitive and sensitive. Moreover, there is an increasing literature on FedRecs and GossipRecs overestimating the level of privacy they offer. Nonetheless, CIA can be used to attack other tasks. To illustrate this, in this section, we investigate the ability of CIA to generalize to an image classification task by leveraging the standard MNIST dataset [25]. As the notion of community is not inherent to the dataset, we simulate it by creating a strongly non-iid data distribution between clients. Specifically, we consider 100 clients and assign to each client, samples of one unique class. Thereafter, we consider a community as a set of clients, whose assigned data points belong to the same class (e.g., community of clients that have samples representing the digit "1"). These clients, train in FL a one hidden layer of 100 units and achieve a final global accuracy of 87%. The server tries to detect all of the communities of digits using CIA and the results show that the attacker achieves a 100% accuracy (the random guess is at 10% accuracy). This shows that CIA can be leveraged outside of recommender systems. The only conditions required are that the users' data distributions are non-iid and that groups of users share common distributions that form a community.
## IX. DISCUSSION

**On the fairness of the FL/GL comparison.** Privacy considerations are crucial when selecting collaborative learning protocols. This paper delves into these privacy aspects. While such analysis might appear to strengthen the attack scenario for FL, it aligns with established assumptions in the literature [17]. Additionally, we evaluate the degree of collusion required by a GL adversary to match the accuracy of an FL server, ensuring a fair comparison.

**On the usage of Secure Aggregation.** Secure Aggregation (SA) is a multi-party computation protocol designed to protect individual models during aggregation, making it effective against privacy attacks like AIA and CIA. While SA is well-suited for Federated Learning (FL) due to cost-efficient cryptographic tools [26], adapting it to other collaborative learning protocols, such as Gossip Learning (GL), presents significant challenges. SA also struggles with personalization and Byzantine-resilient learning—key for recommender systems—since these often require access to individual models, as in approaches like GossipPers. Although encrypted models can sometimes address Byzantine resilience [27], [28], this often incurs high communication costs, even in FL.

To address these limitations, advancing the flexibility of SA and exploring the privacy threat landscape through model-targeted attacks are critical, complementary research directions. This work focuses on the latter research direction.

## X. RELATED WORK

**Privacy in federated recommendation systems.** Zhang et al. [29] introduced a membership inference attack (MIA) that aimed to identify the participation of a specific user in the training process of a recommendation system, while the attack proposed in [6] aims at inferring the membership of an interaction (i.e., user-item pair) to the training set. Zhang et al. [10] proposed an attribute inference attack. Their observations in the centralized setting corroborates ours. However, they did not investigate the impact within GL. These works [10], [29] considered LDP as a defense mechanism, while Yuan et al. [6] proposed the Share less strategy evaluated in our work. Another line of work [30] leverages Secure Multi-Party Computation (SMPC) to secure mobility recommendation in FL. Nevertheless, such an approach suffers from an increased complexity as well as a Byzantine-resilience incompatibility, as discussed earlier.

**Privacy in Gossip protocols.** There have been few research efforts examining the privacy of decentralized learning protocols [31], [32]. Nevertheless, the closest works to ours are the works of [17], [18], which assessed the privacy of decentralized learning through various attacks. While they did not specifically explore Community Inference, the main distinction with our work lies mostly in the setting (i.e., fixed graphs with synchronous communication). Our work suggests that the inherent privacy of gossip stems primarily from its randomness and dynamics.

## XI. CONCLUSION

This paper evaluates the vulnerability of Federated Learning (FL) and Gossip Learning (GL)-based recommender systems to a novel, low-cost Community Inference Attack (CIA). Unlike membership and attribute inference attacks, CIA leverages comparisons between models rather than analyzing individual models, making it particularly cost efficient. It detects communities based on shared tastes, revealing that even locally stored data can leak user similarity through model exchanges. The leakage is worse in FL compared to GL. Among the tested defenses, Share less outperformed DP by achieving a better privacy-utility trade-off. Future work will explore new defenses to strengthen FedRecs and GossipRecs against attacks like CIA.

## REFERENCES

[1] A. Friedman, B. P. Knijnenburg, K. Vanhecke, L. Martens, and S. Berkovsky, "Privacy aspects of recommender systems," *Recommender systems handbook*, pp. 649–688, 2015.

[2] C. Gao, C. Huang, D. Lin, D. Jin, and Y. Li, "Dplcf: differentially private local collaborative filtering," in *Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval*, 2020, pp. 961–970.

[3] G. Rosinosky, S. Da Silva, S. Ben Mokhtar, D. Négru, L. Réveillère, and E. Rivière, "Pprox: efficient privacy for recommendation-as-a-service," in *Proceedings of the 22nd International Middleware Conference*, 2021, pp. 14–26.

[4] F. Liang, W. Pan, and Z. Ming, "Fedrec++: Lossless federated recommendation with explicit feedback," in *Proceedings of the AAAI conference on artificial intelligence*, vol. 35, no. 5, 2021, pp. 4224–4231.

[5] Y. Belal, A. Bellet, S. B. Mokhtar, and V. Nitu, "Pepper: Empowering user-centric recommender systems over gossip learning," *Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies*, vol. 6, no. 3, pp. 1–27, 2022.

[6] W. Yuan, C. Yang, Q. V. H. Nguyen, L. Cui, T. He, and H. Yin, "Interaction-level membership inference attack against federated recommender systems," in *Proceedings of the ACM Web Conference 2023*, 2023, pp. 1053–1062.

[7] C. Fu, X. Zhang, S. Ji, J. Chen, J. Wu, S. Guo, J. Zhou, A. X. Liu, and T. Wang, "Label inference attacks against vertical federated learning," in *31st USENIX Security Symposium (USENIX Security 22)*, 2022, pp. 1397–1414.

[8] N. Carlini, S. Chien, M. Nasr, S. Song, A. Terzis, and F. Tramèr, "Membership inference attacks from first principles," in *43rd IEEE Symposium on Security and Privacy, SP 2022, San Francisco, CA, USA, May 22-26, 2022*. IEEE, 2022, pp. 1897–1914. [Online]. Available: https://doi.org/10.1109/SP46214.2022.9833649

[9] C. Chen, L. Lyu, H. Yu, and G. Chen, "Practical attribute reconstruction attack against federated learning," *IEEE Transactions on Big Data*, 2022.

[10] S. Zhang, W. Yuan, and H. Yin, "Comprehensive privacy analysis on federated recommender system against attribute inference attacks," *IEEE Transactions on Knowledge and Data Engineering*, 2023.

[11] B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, "Communication-efficient learning of deep networks from decentralized data," in *Artificial intelligence and statistics*. PMLR, 2017, pp. 1273–1282.

[12] I. Hegedűs, G. Danner, and M. Jelasity, "Decentralized learning works: An empirical comparison of gossip learning and federated learning," *Journal of Parallel and Distributed Computing*, vol. 148, pp. 109–124, 2021.

[13] X. He, L. Liao, H. Zhang, L. Nie, X. Hu, and T.-S. Chua, "Neural collaborative filtering," in *Proceedings of the 26th international conference on world wide web*, 2017, pp. 173–182.

[14] S. Feng, X. Li, Y. Zeng, G. Cong, and Y. M. Chee, "Personalized ranking metric embedding for next new poi recommendation," in *IJCAI'15 Proceedings of the 24th International Conference on Artificial Intelligence*. ACM, 2015, pp. 2069–2075.
[15] M. Abadi, A. Chu, I. Goodfellow, H. B. McMahan, I. Mironov, K. Talwar, and L. Zhang, "Deep learning with differential privacy," in *Proceedings of the 2016 ACM SIGSAC conference on computer and communications security*, 2016, pp. 308–318.

[16] N. Wiedemann, K. Janowicz, M. Raubal, and O. Kounadi, "Where you go is who you are: a study on machine learning based semantic privacy attacks," *Journal of Big Data*, vol. 11, no. 1, pp. 1–31, 2024.

[17] A. E. Mrini, E. Cyffers, and A. Bellet, "Privacy attacks in decentralized learning," *arXiv preprint arXiv:2402.10001*, 2024.

[18] D. Pasquini, M. Raynal, and C. Troncoso, "On the privacy of decentralized machine learning," *arXiv preprint arXiv:2205.08443*, 2022.

[19] Y. Busnel, R. Beraldi, and R. Baldoni, "On the uniformity of peer sampling based on view shuffling," *Journal of Parallel and Distributed Computing*, vol. 71, no. 8, pp. 1165–1176, 2011.

[20] E. Bagdasaryan, O. Poursaeed, and V. Shmatikov, "Differential privacy has disparate impact on model accuracy," *Advances in neural information processing systems*, vol. 32, 2019.

[21] D. Yang, D. Zhang, V. W. Zheng, and Z. Yu, "Modeling user activity preference by leveraging user spatial temporal characteristics in lbsns," *IEEE Transactions on Systems, Man, and Cybernetics: Systems*, vol. 45, no. 1, pp. 129–142, 2014.

[22] E. Cho, S. A. Myers, and J. Leskovec, "Friendship and mobility: user movement in location-based social networks," in *Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Diego, CA, USA, August 21-24, 2011*, C. Apté, J. Ghosh, and P. Smyth, Eds. *ACM, 2011, pp. 1082–1090*. [Online]. Available: https://doi.org/10.1145/2020408.2020579

[23] L. Song and P. Mittal, "Systematic evaluation of privacy risks of machine learning models," in *30th USENIX Security Symposium (USENIX Security 21)*, 2021, pp. 2615–2632.

[24] U. Weinsberg, S. Bhagat, S. Ioannidis, and N. Taft, "Blurme: Inferring and obfuscating user gender based on ratings," in *Proceedings of the sixth ACM conference on Recommender systems*, 2012, pp. 195–202.

[25] Y. LeCun, "The mnist database of handwritten digits," http://yann.lecun.com/exdb/mnist/, 1998.

[26] J. H. Bell, K. A. Bonawitz, A. Gascón, T. Lepoint, and M. Raykova, "Secure single-server aggregation with (poly) logarithmic overhead," in *Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security*, 2020, pp. 1253–1269.

[27] J. So, B. Güler, and A. S. Avestimehr, "Byzantine-resilient secure federated learning," *IEEE Journal on Selected Areas in Communications*, vol. 39, no. 7, pp. 2168–2181, 2020.

[28] R. K. Velicheti, D. Xia, and O. Koyejo, "Secure byzantine-robust distributed learning via clustering," *arXiv preprint arXiv:2110.02940*, 2021.

[29] M. Zhang, Z. Ren, Z. Wang, P. Ren, Z. Chen, P. Hu, and Y. Zhang, "Membership inference attacks against recommender systems," in *Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security*, 2021, pp. 864–879.

[30] V. Perifanis, G. Drosatos, G. Stamatelatos, and P. S. Efraimidis, "Felpoirec: Privacy-preserving federated poi recommendation with social influence," *Information Sciences*, vol. 623, pp. 767–790, 2023.

[31] A. Bellet, R. Guerraoui, and H. Hendrikx, "Who started this rumor? quantifying the natural differential privacy of gossip protocols," in *34th International Symposium on Distributed Computing (DISC 2020)*. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2020.

[32] R. Jin, Y. Huang, Z. Zhang, and H. Dai, "On the privacy guarantees of gossip protocols in general networks," *IEEE Transactions on Network Science and Engineering*, 2023.