Papers › Empowering Collaborative Filtering with Principled Adversarial Contrastive Loss

Empowering Collaborative Filtering with Principled Adversarial Contrastive Loss

28 Oct 2023NeurIPS 2023 11arXiv:2310.18700archive 2025-07-28

An Zhang, Leheng Sheng, Zhibo Cai, Xiang Wang, Tat-Seng Chua

Contrastive Learning (CL) has achieved impressive performance in self-supervised learning tasks, showing superior generalization ability. Inspired by the success, adopting CL into collaborative filtering (CF) is prevailing in semi-supervised top-K recommendations. The basic idea is to routinely conduct heuristic-based data augmentation and apply contrastive losses (e.g., InfoNCE) on the augmented views. Yet, some CF-tailored challenges make this adoption suboptimal, such as the issue of out-of-distribution, the risk of false negatives, and the nature of top-K evaluation. They necessitate the CL-based CF scheme to focus more on mining hard negatives and distinguishing false negatives from the vast unlabeled user-item interactions, for informative contrast signals. Worse still, there is limited understanding of contrastive loss in CF methods, especially w.r.t. its generalization ability. To bridge the gap, we delve into the reasons underpinning the success of contrastive loss in CF, and propose a principled Adversarial InfoNCE loss (AdvInfoNCE), which is a variant of InfoNCE, specially tailored for CF methods. AdvInfoNCE adaptively explores and assigns hardness to each negative instance in an adversarial fashion and further utilizes a fine-grained hardness-aware ranking criterion to empower the recommender's generalization ability. Training CF models with AdvInfoNCE, we validate the effectiveness of AdvInfoNCE on both synthetic and real-world benchmark datasets, thus showing its generalization ability to mitigate out-of-distribution problems. Given the theoretical guarantees and empirical superiority of AdvInfoNCE over most contrastive loss functions, we advocate its adoption as a standard loss in recommender systems, particularly for the out-of-distribution tasks. Codes are available at https://github.com/LehengTHU/AdvInfoNCE.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.18700")

Code

Syntology Ran 7 of 8 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 3 ran · our draft was wrong; 4 ran with no contract checked.

By repository: official repository: 8 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

lehengthu/advinfonce officialmentioned in paperpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

8 samples harvested; 7 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · our draft was wrong
4ran
1unverified

Licence: 0 of the 8 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from lehengthu/advinfonce. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

AdvInfoNCE lehengthu/advinfonce/model.py official repository ran MIT (permissive) · cf3edb57afbf264e · report
MF lehengthu/advinfonce/model.py official repository ran MIT (permissive) · d08e6a8f2f8b1da8 · report
helper_load LehengTHU/AdvInfoNCE/data.py official repository ran MIT (permissive) · 029327c4f6fb55d0 · report
helper_load_train LehengTHU/AdvInfoNCE/data.py official repository ran MIT (permissive) · f1fe817c737b6fed · report
merge_user_list lehengthu/advinfonce/train_AdvInfoNCE.py official repository ran · our draft was wrong MIT (permissive) · 7513663e5a710c16 · report
merge_user_list_no_dup lehengthu/advinfonce/train_AdvInfoNCE.py official repository ran · our draft was wrong MIT (permissive) · 63bb511f56afa437 · report
save_checkpoint lehengthu/advinfonce/train_AdvInfoNCE.py official repository ran · our draft was wrong MIT (permissive) · 380a5cea5655f733 · report
LGN lehengthu/advinfonce/model.py official repository unverified MIT (permissive) · 6cab2d4c2ffaeb32 · report

Tasks

Collaborative FilteringContrastive LearningData AugmentationRecommendation SystemsSelf-Supervised Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

FocusInfoNCE

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections