{"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/knowledge-graph-self-supervised","title":"Knowledge Graph Self-Supervised Rationalization for Recommendation","arxiv_id":"2307.02759","date":"2023-07-06","proceeding":null,"authors":["Yuhao Yang","Chao Huang","Lianghao Xia","Chunzhen Huang"],"abstract":"In this paper, we introduce a new self-supervised rationalization method, called KGRec, for knowledge-aware recommender systems. To effectively identify informative knowledge connections, we propose an attentive knowledge rationalization mechanism that generates rational scores for knowledge triplets. With these scores, KGRec integrates generative and contrastive self-supervised tasks for recommendation through rational masking. To highlight rationales in the knowledge graph, we design a novel generative task in the form of masking-reconstructing. By masking important knowledge with high rational scores, KGRec is trained to rebuild and highlight useful knowledge connections that serve as rationales. To further rationalize the effect of collaborative interactions on knowledge graph learning, we introduce a contrastive learning task that aligns signals from knowledge and user-item interaction views. To ensure noise-resistant contrasting, potential noisy edges in both graphs judged by the rational scores are masked. Extensive experiments on three real-world datasets demonstrate that KGRec outperforms state-of-the-art methods. We also provide the implementation codes for our approach at https://github.com/HKUDS/KGRec.","url_abs":"https://arxiv.org/abs/2307.02759v1","url_pdf":"https://arxiv.org/pdf/2307.02759v1.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":"knowledge-graph-self-supervised","repo_url":"https://github.com/hkuds/kgrec","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"graph-learning","task_name":"Graph Learning"},{"task_slug":"recommendation-systems","task_name":"Recommendation Systems"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2307.02759","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.02759"}},"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/kgrec","reach":{"status":"ok","spdx":"Apache-2.0"}}],"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":0,"samples":[{"code_sha256_prefix":"44c2871f40d5a80b","entry":"build_graph","repo":"hkuds/kgrec","repo_kind":"official","path":"utils/data_loader.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/utils/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"44c2871f40d5a80b"}},{"code_sha256_prefix":"a6bc535edeabcd18","entry":"build_graph","repo":"hkuds/kgrec","repo_kind":"official","path":"utils/data_loader_kgcl.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/utils/data_loader_kgcl.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a6bc535edeabcd18"}},{"code_sha256_prefix":"a943eb44a36720f5","entry":"read_cf","repo":"hkuds/kgrec","repo_kind":"official","path":"utils/data_loader.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/utils/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a943eb44a36720f5"}},{"code_sha256_prefix":"0671d5a4cbb1c2ac","entry":"get_auc","repo":"hkuds/kgrec","repo_kind":"official","path":"utils/evaluate.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/utils/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0671d5a4cbb1c2ac"}},{"code_sha256_prefix":"21b932e40a1ee1c5","entry":"get_feed_dict","repo":"hkuds/kgrec","repo_kind":"official","path":"run_kgrec.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/run_kgrec.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"21b932e40a1ee1c5"}},{"code_sha256_prefix":"aa1574c6d12e18d2","entry":"get_feed_dict","repo":"hkuds/kgrec","repo_kind":"official","path":"run_kgin.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/run_kgin.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"aa1574c6d12e18d2"}},{"code_sha256_prefix":"cb052aef6a869c15","entry":"neg_sampling_cpp","repo":"hkuds/kgrec","repo_kind":"official","path":"run_kgrec.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/run_kgrec.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cb052aef6a869c15"}},{"code_sha256_prefix":"a62b98b0ef1ddefd","entry":"read_triplets","repo":"hkuds/kgrec","repo_kind":"official","path":"utils/data_loader.py","file_url":"https://github.com/hkuds/kgrec/blob/HEAD/utils/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a62b98b0ef1ddefd"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}