{"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/diffurec-a-diffusion-model-for-sequential","title":"DiffuRec: A Diffusion Model for Sequential Recommendation","arxiv_id":"2304.00686","date":"2023-04-03","proceeding":null,"authors":["Zihao Li","Aixin Sun","Chenliang Li"],"abstract":"Mainstream solutions to Sequential Recommendation (SR) represent items with fixed vectors. These vectors have limited capability in capturing items' latent aspects and users' diverse preferences. As a new generative paradigm, Diffusion models have achieved excellent performance in areas like computer vision and natural language processing. To our understanding, its unique merit in representation generation well fits the problem setting of sequential recommendation. In this paper, we make the very first attempt to adapt Diffusion model to SR and propose DiffuRec, for item representation construction and uncertainty injection. Rather than modeling item representations as fixed vectors, we represent them as distributions in DiffuRec, which reflect user's multiple interests and item's various aspects adaptively. In diffusion phase, DiffuRec corrupts the target item embedding into a Gaussian distribution via noise adding, which is further applied for sequential item distribution representation generation and uncertainty injection. Afterward, the item representation is fed into an Approximator for target item representation reconstruction. In reverse phase, based on user's historical interaction behaviors, we reverse a Gaussian noise into the target item representation, then apply a rounding operation for target item prediction. Experiments over four datasets show that DiffuRec outperforms strong baselines by a large margin.","url_abs":"https://arxiv.org/abs/2304.00686v4","url_pdf":"https://arxiv.org/pdf/2304.00686v4.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":"diffurec-a-diffusion-model-for-sequential","repo_url":"https://github.com/whuir/diffurec","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"recommendation-systems","task_name":"Recommendation Systems"},{"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=2304.00686","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2304.00686"}},"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/whuir/diffurec","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":"ec3425eb7cd519f7","entry":"betas_for_alpha_bar_left","repo":"whuir/diffurec","repo_kind":"official","path":"src/diffurec.py","file_url":"https://github.com/whuir/diffurec/blob/HEAD/src/diffurec.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":"ec3425eb7cd519f7"}},{"code_sha256_prefix":"c362b740206a0e2d","entry":"betas_for_alpha_bar","repo":"whuir/diffurec","repo_kind":"official","path":"src/diffurec.py","file_url":"https://github.com/whuir/diffurec/blob/HEAD/src/diffurec.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":"c362b740206a0e2d"}},{"code_sha256_prefix":"8cb66e197ea43788","entry":"cal_hr","repo":"whuir/diffurec","repo_kind":"official","path":"src/trainer.py","file_url":"https://github.com/whuir/diffurec/blob/HEAD/src/trainer.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":"8cb66e197ea43788"}},{"code_sha256_prefix":"9c5a21f758ef3923","entry":"cal_ndcg","repo":"whuir/diffurec","repo_kind":"official","path":"src/trainer.py","file_url":"https://github.com/whuir/diffurec/blob/HEAD/src/trainer.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":"9c5a21f758ef3923"}},{"code_sha256_prefix":"86a00d2143d636b3","entry":"create_named_schedule_sampler","repo":"whuir/diffurec","repo_kind":"official","path":"src/step_sample.py","file_url":"https://github.com/whuir/diffurec/blob/HEAD/src/step_sample.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":"86a00d2143d636b3"}},{"code_sha256_prefix":"89291455f7bf3776","entry":"get_named_beta_schedule","repo":"whuir/diffurec","repo_kind":"official","path":"src/diffurec.py","file_url":"https://github.com/whuir/diffurec/blob/HEAD/src/diffurec.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":"89291455f7bf3776"}},{"code_sha256_prefix":"93022759a17e6501","entry":"optimizers","repo":"whuir/diffurec","repo_kind":"official","path":"src/trainer.py","file_url":"https://github.com/whuir/diffurec/blob/HEAD/src/trainer.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":"93022759a17e6501"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}