{"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-based-hard-negative-mining-for","title":"Neighborhood-based Hard Negative Mining for Sequential Recommendation","arxiv_id":"2306.10047","date":"2023-06-12","proceeding":null,"authors":["Lu Fan","Jiashu Pu","Rongsheng Zhang","Xiao-Ming Wu"],"abstract":"Negative sampling plays a crucial role in training successful sequential recommendation models. Instead of merely employing random negative sample selection, numerous strategies have been proposed to mine informative negative samples to enhance training and performance. However, few of these approaches utilize structural information. In this work, we observe that as training progresses, the distributions of node-pair similarities in different groups with varying degrees of neighborhood overlap change significantly, suggesting that item pairs in distinct groups may possess different negative relationships. Motivated by this observation, we propose a Graph-based Negative sampling approach based on Neighborhood Overlap (GNNO) to exploit structural information hidden in user behaviors for negative mining. GNNO first constructs a global weighted item transition graph using training sequences. Subsequently, it mines hard negative samples based on the degree of overlap with the target item on the graph. Furthermore, GNNO employs curriculum learning to control the hardness of negative samples, progressing from easy to difficult. Extensive experiments on three Amazon benchmarks demonstrate GNNO's effectiveness in consistently enhancing the performance of various state-of-the-art models and surpassing existing negative sampling strategies. The code will be released at \\url{https://github.com/floatSDSDS/GNNO}.","url_abs":"https://arxiv.org/abs/2306.10047v1","url_pdf":"https://arxiv.org/pdf/2306.10047v1.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-based-hard-negative-mining-for","repo_url":"https://github.com/floatsdsds/gnno","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"sequential-recommendation","task_name":"Sequential Recommendation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2306.10047","atlas_url":"https://app.syntology.ai/?focus=2306.10047","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.10047"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/floatsdsds/gnno","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":6},"by_repo_kind":{"official":{"samples":7,"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":"3d59d38bbf50df0a","entry":"find_info","repo":"floatsdsds/gnno","repo_kind":"official","path":"src/exp.py","file_url":"https://github.com/floatsdsds/gnno/blob/HEAD/src/exp.py","link_basis":"plan_row","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":"3d59d38bbf50df0a"}},{"code_sha256_prefix":"625c1bd44e9bc383","entry":"extract_keys","repo":"floatsdsds/gnno","repo_kind":"official","path":"src/analysis.py","file_url":"https://github.com/floatsdsds/gnno/blob/HEAD/src/analysis.py","link_basis":"first_harvest_node","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":"625c1bd44e9bc383"}},{"code_sha256_prefix":"28b7297a7c749237","entry":"flatten","repo":"floatsdsds/gnno","repo_kind":"official","path":"src/topology.py","file_url":"https://github.com/floatsdsds/gnno/blob/HEAD/src/topology.py","link_basis":"first_harvest_node","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":"28b7297a7c749237"}},{"code_sha256_prefix":"05ebf887d85b332f","entry":"parse_global_args","repo":"floatsdsds/gnno","repo_kind":"official","path":"src/run_TPGCL.py","file_url":"https://github.com/floatsdsds/gnno/blob/HEAD/src/run_TPGCL.py","link_basis":"first_harvest_node","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":"05ebf887d85b332f"}},{"code_sha256_prefix":"2dda82a29f4c260b","entry":"parse_global_args","repo":"floatsdsds/gnno","repo_kind":"official","path":"src/topology.py","file_url":"https://github.com/floatsdsds/gnno/blob/HEAD/src/topology.py","link_basis":"first_harvest_node","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":"2dda82a29f4c260b"}},{"code_sha256_prefix":"e515f887f1662b06","entry":"parse_head","repo":"floatsdsds/gnno","repo_kind":"official","path":"src/analysis.py","file_url":"https://github.com/floatsdsds/gnno/blob/HEAD/src/analysis.py","link_basis":"first_harvest_node","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":"e515f887f1662b06"}},{"code_sha256_prefix":"aa40be92aebfaafb","entry":"parse_rst","repo":"floatsdsds/gnno","repo_kind":"official","path":"src/analysis.py","file_url":"https://github.com/floatsdsds/gnno/blob/HEAD/src/analysis.py","link_basis":"first_harvest_node","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":"aa40be92aebfaafb"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}