{"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/large-language-model-can-interpret-latent","title":"Large Language Model Can Interpret Latent Space of Sequential Recommender","arxiv_id":"2310.20487","date":"2023-10-31","proceeding":null,"authors":["Zhengyi Yang","Jiancan Wu","Yanchen Luo","Jizhi Zhang","Yancheng Yuan","An Zhang","Xiang Wang","Xiangnan He"],"abstract":"Sequential recommendation is to predict the next item of interest for a user, based on her/his interaction history with previous items. In conventional sequential recommenders, a common approach is to model item sequences using discrete IDs, learning representations that encode sequential behaviors and reflect user preferences. Inspired by recent success in empowering large language models (LLMs) to understand and reason over diverse modality data (e.g., image, audio, 3D points), a compelling research question arises: ``Can LLMs understand and work with hidden representations from ID-based sequential recommenders?''.To answer this, we propose a simple framework, RecInterpreter, which examines the capacity of open-source LLMs to decipher the representation space of sequential recommenders. Specifically, with the multimodal pairs (\\ie representations of interaction sequence and text narrations), RecInterpreter first uses a lightweight adapter to map the representations into the token embedding space of the LLM. Subsequently, it constructs a sequence-recovery prompt that encourages the LLM to generate textual descriptions for items within the interaction sequence. Taking a step further, we propose a sequence-residual prompt instead, which guides the LLM in identifying the residual item by contrasting the representations before and after integrating this residual into the existing sequence. Empirical results showcase that our RecInterpreter enhances the exemplar LLM, LLaMA, to understand hidden representations from ID-based sequential recommenders, especially when guided by our sequence-residual prompts. Furthermore, RecInterpreter enables LLaMA to instantiate the oracle items generated by generative recommenders like DreamRec, concreting the item a user would ideally like to interact with next. Codes are available at https://github.com/YangZhengyi98/RecInterpreter.","url_abs":"https://arxiv.org/abs/2310.20487v1","url_pdf":"https://arxiv.org/pdf/2310.20487v1.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":"large-language-model-can-interpret-latent","repo_url":"https://github.com/yangzhengyi98/recinterpreter","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"large-language-model-can-interpret-latent","repo_url":"https://github.com/yangzhengyi98/dreamrec","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"sequential-recommendation","task_name":"Sequential Recommendation"}],"methods":[{"method_slug":"adapter","method_name":"Adapter"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.20487","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.20487"}},"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/yangzhengyi98/recinterpreter","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yangzhengyi98/dreamrec","reach":{"status":"ok"}}],"summary":{"ran_honours":2,"ran_fixture":2,"ran":1,"unverified":2},"by_repo_kind":{"listed":{"samples":7,"ran":5,"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":7,"samples":[{"code_sha256_prefix":"3a6233722b4f0cd6","entry":"cosine_beta_schedule","repo":"yangzhengyi98/dreamrec","repo_kind":"listed","path":"DreamRec.py","file_url":"https://github.com/yangzhengyi98/dreamrec/blob/HEAD/DreamRec.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3a6233722b4f0cd6"}},{"code_sha256_prefix":"df116dde4bb6ab3e","entry":"extract","repo":"yangzhengyi98/dreamrec","repo_kind":"listed","path":"DreamRec.py","file_url":"https://github.com/yangzhengyi98/dreamrec/blob/HEAD/DreamRec.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"df116dde4bb6ab3e"}},{"code_sha256_prefix":"66b65be6c96f7959","entry":"extract_axis_1","repo":"yangzhengyi98/dreamrec","repo_kind":"listed","path":"utility.py","file_url":"https://github.com/yangzhengyi98/dreamrec/blob/HEAD/utility.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"66b65be6c96f7959"}},{"code_sha256_prefix":"4b3d941e8a7485c5","entry":"linear_beta_schedule","repo":"yangzhengyi98/dreamrec","repo_kind":"listed","path":"DreamRec.py","file_url":"https://github.com/yangzhengyi98/dreamrec/blob/HEAD/DreamRec.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4b3d941e8a7485c5"}},{"code_sha256_prefix":"43e16c6d0160f46c","entry":"pad_history","repo":"yangzhengyi98/dreamrec","repo_kind":"listed","path":"utility.py","file_url":"https://github.com/yangzhengyi98/dreamrec/blob/HEAD/utility.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":"43e16c6d0160f46c"}},{"code_sha256_prefix":"ab60a151ae33e8fa","entry":"calcu_propensity_score","repo":"yangzhengyi98/dreamrec","repo_kind":"listed","path":"SASRec.py","file_url":"https://github.com/yangzhengyi98/dreamrec/blob/HEAD/SASRec.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":"ab60a151ae33e8fa"}},{"code_sha256_prefix":"73b6b074af2837ad","entry":"normalize","repo":"yangzhengyi98/dreamrec","repo_kind":"listed","path":"utility.py","file_url":"https://github.com/yangzhengyi98/dreamrec/blob/HEAD/utility.py","link_basis":"harvester_set","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":"73b6b074af2837ad"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}