{"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/plug-in-diffusion-model-for-sequential","title":"Plug-in Diffusion Model for Sequential Recommendation","arxiv_id":"2401.02913","date":"2024-01-05","proceeding":null,"authors":["Haokai Ma","Ruobing Xie","Lei Meng","Xin Chen","Xu Zhang","Leyu Lin","Zhanhui Kang"],"abstract":"Pioneering efforts have verified the effectiveness of the diffusion models in exploring the informative uncertainty for recommendation. Considering the difference between recommendation and image synthesis tasks, existing methods have undertaken tailored refinements to the diffusion and reverse process. However, these approaches typically use the highest-score item in corpus for user interest prediction, leading to the ignorance of the user's generalized preference contained within other items, thereby remaining constrained by the data sparsity issue. To address this issue, this paper presents a novel Plug-in Diffusion Model for Recommendation (PDRec) framework, which employs the diffusion model as a flexible plugin to jointly take full advantage of the diffusion-generating user preferences on all items. Specifically, PDRec first infers the users' dynamic preferences on all items via a time-interval diffusion model and proposes a Historical Behavior Reweighting (HBR) mechanism to identify the high-quality behaviors and suppress noisy behaviors. In addition to the observed items, PDRec proposes a Diffusion-based Positive Augmentation (DPA) strategy to leverage the top-ranked unobserved items as the potential positive samples, bringing in informative and diverse soft signals to alleviate data sparsity. To alleviate the false negative sampling issue, PDRec employs Noise-free Negative Sampling (NNS) to select stable negative samples for ensuring effective model optimization. Extensive experiments and analyses on four datasets have verified the superiority of the proposed PDRec over the state-of-the-art baselines and showcased the universality of PDRec as a flexible plugin for commonly-used sequential encoders in different recommendation scenarios. The code is available in https://github.com/hulkima/PDRec.","url_abs":"https://arxiv.org/abs/2401.02913v1","url_pdf":"https://arxiv.org/pdf/2401.02913v1.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":"plug-in-diffusion-model-for-sequential","repo_url":"https://github.com/hulkima/pdrec","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"model-optimization","task_name":"Model Optimization"},{"task_slug":"sequential-recommendation","task_name":"Sequential Recommendation"},{"task_slug":"model","task_name":"model"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.02913","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.02913"}},"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/hulkima/pdrec","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/hulkima/PDRec","reach":{"status":"ok"}}],"summary":{"ran_violates":1,"ran":6,"ran_honours":3,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":12,"ran":11,"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":12,"samples":[{"code_sha256_prefix":"7aef2a8cb287a30b","entry":"str2bool","repo":"hulkima/pdrec","repo_kind":"official","path":"PDRec.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/PDRec.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":2,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7aef2a8cb287a30b"}},{"code_sha256_prefix":"e62215e71895b28f","entry":"GaussianDiffusion","repo":"hulkima/PDRec","repo_kind":"official","path":"models/gaussian_diffusion.py","file_url":"https://github.com/hulkima/PDRec/blob/HEAD/models/gaussian_diffusion.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e62215e71895b28f"}},{"code_sha256_prefix":"2ab2316ac6fdd869","entry":"betas_for_alpha_bar","repo":"hulkima/pdrec","repo_kind":"official","path":"models/gaussian_diffusion.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/models/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2ab2316ac6fdd869"}},{"code_sha256_prefix":"c26b918effa6b11b","entry":"betas_from_linear_variance","repo":"hulkima/PDRec","repo_kind":"official","path":"models/gaussian_diffusion.py","file_url":"https://github.com/hulkima/PDRec/blob/HEAD/models/gaussian_diffusion.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c26b918effa6b11b"}},{"code_sha256_prefix":"c82f65ece9dedb04","entry":"del_tensor_ele","repo":"hulkima/pdrec","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/utils/utils.py","link_basis":"harvester_set","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":"c82f65ece9dedb04"}},{"code_sha256_prefix":"50d6e75eea7b9b5d","entry":"map_into_BCELoss","repo":"hulkima/pdrec","repo_kind":"official","path":"PDRec.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/PDRec.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":"50d6e75eea7b9b5d"}},{"code_sha256_prefix":"42645975bfcda05f","entry":"min_max_normalize_batch","repo":"hulkima/pdrec","repo_kind":"official","path":"PDRec.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/PDRec.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":"42645975bfcda05f"}},{"code_sha256_prefix":"cf2798b666b231ca","entry":"normal_kl","repo":"hulkima/pdrec","repo_kind":"official","path":"models/gaussian_diffusion.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/models/gaussian_diffusion.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cf2798b666b231ca"}},{"code_sha256_prefix":"13e1db5681123f3a","entry":"random_neq","repo":"hulkima/pdrec","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"13e1db5681123f3a"}},{"code_sha256_prefix":"a1fdd0a61ec53e2d","entry":"scale_withminmax","repo":"hulkima/pdrec","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/utils/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":"a1fdd0a61ec53e2d"}},{"code_sha256_prefix":"3cef9867af2fd687","entry":"timestep_embedding","repo":"hulkima/pdrec","repo_kind":"official","path":"models/DNN.py","file_url":"https://github.com/hulkima/pdrec/blob/HEAD/models/DNN.py","link_basis":"harvester_set","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":"3cef9867af2fd687"}},{"code_sha256_prefix":"59b88f86a1b9f8a1","entry":"ModelMeanType","repo":"hulkima/PDRec","repo_kind":"official","path":"models/gaussian_diffusion.py","file_url":"https://github.com/hulkima/PDRec/blob/HEAD/models/gaussian_diffusion.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":"59b88f86a1b9f8a1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}