Poisoning Attacks Against Contrastive Recommender Systems

Zongwei Wang, Junliang Yu, Min Gao, Hongzhi Yin, Bin Cui, Shazia W. Sadiq

Introduction

Contrastive Learning (CL) has emerged as a powerful technique in recommendation systems, primarily valued for its ability to handle data sparsity and improve recommendation quality by learning more robust representations. However, recent research reveals a significant security trade-off. While CL is robust against general data noise, it introduces a "double-edged sword" effect: the very mechanism used to improve item diversity and reduce popularity bias makes these systems remarkably vulnerable to targeted poisoning attacks.

The Vulnerability of Contrastive Learning: The Dispersion Paradox

Standard recommendation models, such as LightGCN, tend to exhibit a "popularity bias," where popular items are clustered together in the embedding space, effectively marginalizing "cold" or unpopular items. Contrastive Learning addresses this by intentionally dispersing embeddings to create a more uniform, globally distributed representation space.

This paper identifies what the authors call the Dispersion Paradox. By breaking down the natural clusters that protect popular items, CL removes the "moat" that typically prevents unpopular items from being recommended. In a flatter, more dispersed embedding landscape, it becomes significantly easier for an attacker to "push" a specific target item toward a broad range of users.

Hit-Ratio@50 across different models and attack sizes on DouBan and Epinions datasets, demonstrating the increased vulnerability of Contrastive Learning-based models.

The authors provide a theoretical foundation for this vulnerability through spectral analysis. They demonstrate that minimizing the standard InfoNCE loss used in CL is equivalent to smoothing the distribution of singular values in the representation matrix. This "spectral smoothing" directly correlates with embedding dispersion, providing a mathematical link between contrastive objectives and attack susceptibility.

The CLeaR Attack Framework

To exploit this vulnerability, the researchers developed CLeaR (Contrastive Learning Recommendation Attack), a framework based on bi-level optimization. The attack is designed with two synergistic objectives:

  1. Dispersion Promotion: Instead of merely trying to increase an item's rank, CLeaR actively encourages the model's internal representations to become even more dispersed. By using a spectral approximation approach to favor "smooth" singular values, the attack essentially leverages the model's own CL objective to create a more fertile ground for item promotion.
  2. Rank Promotion: This objective utilizes a differentiable version of the Carlini-Wagner (CW) loss to directly optimize the visibility of target items, ensuring they climb to the top of users' recommendation lists.

Because CLeaR is formulated as a bi-level optimization problem—where the inner loop involves training the victim model and the outer loop optimizes the attack strategy—it is highly effective in both white-box and black-box scenarios.

Experimental Evaluation and Key Insights

The efficacy of CLeaR was evaluated on four major benchmarks: DouBan, Epinions, MovieLens 1M, and Yelp. The results consistently showed that CL-based models (such as SimGCL, SGL, and XSimGCL) are far more sensitive to poisoning than non-CL models like LightGCN.

As shown in Figure 1, the Hit Ratio@50 (the probability that a target item appears in the top 50 recommendations) increases dramatically for CL models as the attack size grows. In some instances, the success rate of an attack on a CL-enhanced model was several times higher than on the base model. Furthermore, CLeaR significantly outperformed traditional attack methods like Random or Bandwagon attacks. For example, on the Epinions dataset, CLeaR achieved a Hit Ratio@50 of 0.1490 on the XSimGCL model, vastly exceeding the 0.0161 achieved by a Random attack.

The study also demonstrated strong black-box transferability. Even without knowledge of the victim model's specific architecture, an attacker using a surrogate model could still achieve high success rates, highlighting the general risk posed to CL-based systems.

Conclusion

While Contrastive Learning offers clear benefits for recommendation accuracy and fairness, it introduces a unique security risk. The dispersion of embeddings, while beneficial for reducing bias, creates an opening for sophisticated poisoning attacks. This work underscores the need for new defense mechanisms that can preserve the performance gains of CL while mitigating the vulnerabilities inherent in its representation-learning process. Future research should focus on developing nuanced defense approaches that specifically address the spectral properties exploited by attacks like CLeaR.

Summary updated

Abstract

Contrastive learning (CL) has recently gained prominence in the domain of recommender systems due to its great ability to enhance recommendation accuracy and improve model robustness. Despite its advantages, this paper identifies a vulnerability of CL-based recommender systems that they are more susceptible to poisoning attacks aiming to promote individual items. Our analysis indicates that this vulnerability is attributed to the uniform spread of representations caused by the InfoNCE loss. Furthermore, theoretical and empirical evidence shows that optimizing this loss favors smooth spectral values of representations. This finding suggests that attackers could facilitate this optimization process of CL by encouraging a more uniform distribution of spectral values, thereby enhancing the degree of representation dispersion. With these insights, we attempt to reveal a potential poisoning attack against CL-based recommender systems, which encompasses a dual-objective framework: one that induces a smoother spectral value distribution to amplify the InfoNCE loss's inherent dispersion effect, named dispersion promotion; and the other that directly elevates the visibility of target items, named rank promotion. We validate the threats of our attack model through extensive experimentation on four datasets. By shedding light on these vulnerabilities, our goal is to advance the development of more robust CL-based recommender systems. The code is available at \url{https://github.com/CoderWZW/ARLib}.
BibTeX
@inproceedings{wang2024poisoning,
  author = {Zongwei Wang and Junliang Yu and Min Gao and Hongzhi Yin and Bin Cui and Shazia W. Sadiq},
  title = {{Poisoning Attacks Against Contrastive Recommender Systems}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
  doi = {10.1145/3637528.3671795},
}
Figure