{"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/positional-encoding-is-not-the-same-as","title":"Positional encoding is not the same as context: A study on positional encoding for sequential recommendation","arxiv_id":"2405.10436","date":"2024-05-16","proceeding":null,"authors":["Alejo Lopez-Avila","Jinhua Du","Abbas Shimary","Ze Li"],"abstract":"The rapid growth of streaming media and e-commerce has driven advancements in recommendation systems, particularly Sequential Recommendation Systems (SRS). These systems employ users' interaction histories to predict future preferences. While recent research has focused on architectural innovations like transformer blocks and feature extraction, positional encodings, crucial for capturing temporal patterns, have received less attention. These encodings are often conflated with contextual, such as the temporal footprint, which previous works tend to treat as interchangeable with positional information. This paper highlights the critical distinction between temporal footprint and positional encodings, demonstrating that the latter offers unique relational cues between items, which the temporal footprint alone cannot provide. Through extensive experimentation on eight Amazon datasets and subsets, we assess the impact of various encodings on performance metrics and training stability. We introduce new positional encodings and investigate integration strategies that improve both metrics and stability, surpassing state-of-the-art results at the time of this work's initial preprint. Importantly, we demonstrate that selecting the appropriate encoding is not only key to better performance but also essential for building robust, reliable SRS models.","url_abs":"https://arxiv.org/abs/2405.10436v2","url_pdf":"https://arxiv.org/pdf/2405.10436v2.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":"positional-encoding-is-not-the-same-as","repo_url":"https://github.com/researcher1741/position_encoding_srs","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"recommendation-systems","task_name":"Recommendation Systems"},{"task_slug":"sequential-recommendation","task_name":"Sequential Recommendation"}],"methods":[{"method_slug":"srs","method_name":"SRS"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/recommendation-systems-on-amazon-beauty","task":"Recommendation Systems","dataset":"Amazon Beauty","model":"CARCA Abs + Con","rank_in_archive_order":1,"of":6,"metrics":{"Hit@10":"0.6793","NDCG":"0.4871"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-amazon-beauty","task":"Recommendation Systems","dataset":"Amazon Beauty","model":"CARCA-Rotatory","rank_in_archive_order":3,"of":6,"metrics":{"Hit@10":"0.6187","NDCG":"0.4260"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-amazon-fashion","task":"Recommendation Systems","dataset":"Amazon Fashion","model":"RMHA-4","rank_in_archive_order":4,"of":4,"metrics":{"Hit@10":"0.7726","NDCG":"0.4975"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-amazon-games","task":"Recommendation Systems","dataset":"Amazon Games","model":"CARCA-Rotatory + Con.","rank_in_archive_order":2,"of":6,"metrics":{"Hit@10":"0.8062","NDCG":"0.5607"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-amazon-men","task":"Recommendation Systems","dataset":"Amazon Men","model":"CARCA Learnt + Con","rank_in_archive_order":1,"of":3,"metrics":{"Hit@10":"0.7386","NDCG":"0.5889"},"uses_additional_data":false},{"leaderboard":"/sota/recommendation-systems-on-amazon-men","task":"Recommendation Systems","dataset":"Amazon Men","model":"RMHA-4","rank_in_archive_order":2,"of":3,"metrics":{"Hit@10":"0.7013","NDCG":"0.4641"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.10436","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.10436"}},"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/researcher1741/position_encoding_srs","reach":{"status":"ok"}}],"summary":{"ran":8},"by_repo_kind":{"official":{"samples":8,"ran":8,"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":"0ee87fa991912f33","entry":"check_device","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/src/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":"0ee87fa991912f33"}},{"code_sha256_prefix":"18fbb3595177237b","entry":"convert_to_float","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"Results/results_analysis.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/Results/results_analysis.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":"18fbb3595177237b"}},{"code_sha256_prefix":"58bc3f1d6b757fa7","entry":"get_UserData","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"src/data_preprocessing.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/src/data_preprocessing.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":"58bc3f1d6b757fa7"}},{"code_sha256_prefix":"ea5d9e3461446c08","entry":"get_files","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"Results/results_analysis.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/Results/results_analysis.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":"ea5d9e3461446c08"}},{"code_sha256_prefix":"32656231792740e8","entry":"load_data","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/src/utils.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":"32656231792740e8"}},{"code_sha256_prefix":"2660cad125666143","entry":"random_neq","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"src/sampler.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/src/sampler.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":"2660cad125666143"}},{"code_sha256_prefix":"66c8a630be3ca9f6","entry":"seed_filter","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"Results/results_analysis.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/Results/results_analysis.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":"66c8a630be3ca9f6"}},{"code_sha256_prefix":"8f8983954debe79b","entry":"str2bool","repo":"researcher1741/position_encoding_srs","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/researcher1741/position_encoding_srs/blob/HEAD/src/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":"8f8983954debe79b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}