{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/neighborhood-enhanced-supervised-contrastive","title":"Neighborhood-Enhanced Supervised Contrastive Learning for Collaborative Filtering","arxiv_id":"2402.11523","date":"2024-02-18","proceeding":null,"authors":["Peijie Sun","Le Wu","Kun Zhang","Xiangzhi Chen","Meng Wang"],"abstract":"While effective in recommendation tasks, collaborative filtering (CF) techniques face the challenge of data sparsity. Researchers have begun leveraging contrastive learning to introduce additional self-supervised signals to address this. However, this approach often unintentionally distances the target user/item from their collaborative neighbors, limiting its efficacy. In response, we propose a solution that treats the collaborative neighbors of the anchor node as positive samples within the final objective loss function. This paper focuses on developing two unique supervised contrastive loss functions that effectively combine supervision signals with contrastive loss. We analyze our proposed loss functions through the gradient lens, demonstrating that different positive samples simultaneously influence updating the anchor node's embeddings. These samples' impact depends on their similarities to the anchor node and the negative samples. Using the graph-based collaborative filtering model as our backbone and following the same data augmentation methods as the existing contrastive learning model SGL, we effectively enhance the performance of the recommendation model. Our proposed Neighborhood-Enhanced Supervised Contrastive Loss (NESCL) model substitutes the contrastive loss function in SGL with our novel loss function, showing marked performance improvement. On three real-world datasets, Yelp2018, Gowalla, and Amazon-Book, our model surpasses the original SGL by 10.09%, 7.09%, and 35.36% on NDCG@20, respectively.","url_abs":"https://arxiv.org/abs/2402.11523v1","url_pdf":"https://arxiv.org/pdf/2402.11523v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"neighborhood-enhanced-supervised-contrastive","repo_url":"https://github.com/PeiJieSun/NESCL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"collaborative-filtering","task_name":"Collaborative Filtering"},{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"recommendation-systems","task_name":"Recommendation Systems"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"supervised-contrastive-loss","method_name":"Supervised Contrastive Loss"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/collaborative-filtering-on-gowalla","task":"Collaborative Filtering","dataset":"Gowalla","model":"NESCL","rank_in_archive_order":3,"of":11,"metrics":{"NDCG@20":"0.1617","Recall@20":"0.1917"},"uses_additional_data":false},{"leaderboard":"/sota/collaborative-filtering-on-yelp2018","task":"Collaborative Filtering","dataset":"Yelp2018","model":"NESCL","rank_in_archive_order":1,"of":9,"metrics":{"NDCG@20":"0.0611","Recall@20":"0.0743"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-amazon-book","task":"Recommendation Systems","dataset":"Amazon-Book","model":"NESCL","rank_in_archive_order":8,"of":16,"metrics":{"Recall@20":"0.0624","nDCG@20":"0.0513"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-gowalla","task":"Recommendation Systems","dataset":"Gowalla","model":"NESCL","rank_in_archive_order":2,"of":13,"metrics":{"Recall@20":"0.1917","nDCG@20":"0.1617"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-yelp2018","task":"Recommendation Systems","dataset":"Yelp2018","model":"NESCL","rank_in_archive_order":1,"of":11,"metrics":{"NDCG@20":"0.0611","Recall@20":"0.0743"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2402.11523","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.11523"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/PeiJieSun/NESCL","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":1},"by_repo_kind":{"listed":{"samples":2,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"b5b0bb176f34b7a4","entry":"activation_layer","repo":"PeiJieSun/NESCL","repo_kind":"listed","path":"recbole/model/layers.py","file_url":"https://github.com/PeiJieSun/NESCL/blob/HEAD/recbole/model/layers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b5b0bb176f34b7a4"}},{"code_sha256_prefix":"b33b61d781d779f2","entry":"item_list","repo":"PeiJieSun/NESCL","repo_kind":"listed","path":"recbole/debug/model_fusion.py","file_url":"https://github.com/PeiJieSun/NESCL/blob/HEAD/recbole/debug/model_fusion.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b33b61d781d779f2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}