{"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/multi-relational-contrastive-learning-for","title":"Multi-Relational Contrastive Learning for Recommendation","arxiv_id":"2309.01103","date":"2023-09-03","proceeding":null,"authors":["Wei Wei","Lianghao Xia","Chao Huang"],"abstract":"Personalized recommender systems play a crucial role in capturing users' evolving preferences over time to provide accurate and effective recommendations on various online platforms. However, many recommendation models rely on a single type of behavior learning, which limits their ability to represent the complex relationships between users and items in real-life scenarios. In such situations, users interact with items in multiple ways, including clicking, tagging as favorite, reviewing, and purchasing. To address this issue, we propose the Relation-aware Contrastive Learning (RCL) framework, which effectively models dynamic interaction heterogeneity. The RCL model incorporates a multi-relational graph encoder that captures short-term preference heterogeneity while preserving the dedicated relation semantics for different types of user-item interactions. Moreover, we design a dynamic cross-relational memory network that enables the RCL model to capture users' long-term multi-behavior preferences and the underlying evolving cross-type behavior dependencies over time. To obtain robust and informative user representations with both commonality and diversity across multi-behavior interactions, we introduce a multi-relational contrastive learning paradigm with heterogeneous short- and long-term interest modeling. Our extensive experimental studies on several real-world datasets demonstrate the superiority of the RCL recommender system over various state-of-the-art baselines in terms of recommendation accuracy and effectiveness.","url_abs":"https://arxiv.org/abs/2309.01103v3","url_pdf":"https://arxiv.org/pdf/2309.01103v3.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":"multi-relational-contrastive-learning-for","repo_url":"https://github.com/HKUDS/RCL","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"recommendation-systems","task_name":"Recommendation Systems"},{"task_slug":null,"task_name":"Relation"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"memory-network","method_name":"Memory Network"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.01103","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.01103"}},"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/HKUDS/RCL","reach":{"status":"ok"}}],"summary":{"ran":3,"unverified":5},"by_repo_kind":{"official":{"samples":8,"ran":3,"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":8,"samples":[{"code_sha256_prefix":"e0e7a767dc1f60ec","entry":"generate_G_from_H","repo":"HKUDS/RCL","repo_kind":"official","path":"hypergraph_utils.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/hypergraph_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e0e7a767dc1f60ec"}},{"code_sha256_prefix":"be5c206a816aad41","entry":"hit","repo":"HKUDS/RCL","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"be5c206a816aad41"}},{"code_sha256_prefix":"334fbf3e8871bb11","entry":"ndcg","repo":"HKUDS/RCL","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"334fbf3e8871bb11"}},{"code_sha256_prefix":"43a9c38f5238b37e","entry":"SpentTime","repo":"HKUDS/RCL","repo_kind":"official","path":"Utils/TimeLogger.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/Utils/TimeLogger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"43a9c38f5238b37e"}},{"code_sha256_prefix":"b120bac4f27370e0","entry":"SpentTooLong","repo":"HKUDS/RCL","repo_kind":"official","path":"Utils/TimeLogger.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/Utils/TimeLogger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b120bac4f27370e0"}},{"code_sha256_prefix":"e6fc27a1c10c5476","entry":"getParam","repo":"HKUDS/RCL","repo_kind":"official","path":"Utils/NNLayers.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/Utils/NNLayers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e6fc27a1c10c5476"}},{"code_sha256_prefix":"a2a74363aa00a906","entry":"matrix_to_tensor","repo":"HKUDS/RCL","repo_kind":"official","path":"hypergraph_utils.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/hypergraph_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a2a74363aa00a906"}},{"code_sha256_prefix":"3b7c5f93a9103398","entry":"metrics","repo":"HKUDS/RCL","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/HKUDS/RCL/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3b7c5f93a9103398"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}