{"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/adapting-large-language-models-by-integrating","title":"Adapting Large Language Models by Integrating Collaborative Semantics for Recommendation","arxiv_id":"2311.09049","date":"2023-11-15","proceeding":null,"authors":["Bowen Zheng","Yupeng Hou","Hongyu Lu","Yu Chen","Wayne Xin Zhao","Ming Chen","Ji-Rong Wen"],"abstract":"Recently, large language models (LLMs) have shown great potential in recommender systems, either improving existing recommendation models or serving as the backbone. However, there exists a large semantic gap between LLMs and recommender systems, since items to be recommended are often indexed by discrete identifiers (item ID) out of the LLM's vocabulary. In essence, LLMs capture language semantics while recommender systems imply collaborative semantics, making it difficult to sufficiently leverage the model capacity of LLMs for recommendation. To address this challenge, in this paper, we propose a new LLM-based recommendation model called LC-Rec, which can better integrate language and collaborative semantics for recommender systems. Our approach can directly generate items from the entire item set for recommendation, without relying on candidate items. Specifically, we make two major contributions in our approach. For item indexing, we design a learning-based vector quantization method with uniform semantic mapping, which can assign meaningful and non-conflicting IDs (called item indices) for items. For alignment tuning, we propose a series of specially designed tuning tasks to enhance the integration of collaborative semantics in LLMs. Our fine-tuning tasks enforce LLMs to deeply integrate language and collaborative semantics (characterized by the learned item indices), so as to achieve an effective adaptation to recommender systems. Extensive experiments demonstrate the effectiveness of our method, showing that our approach can outperform a number of competitive baselines including traditional recommenders and existing LLM-based recommenders. Our code is available at https://github.com/RUCAIBox/LC-Rec/.","url_abs":"https://arxiv.org/abs/2311.09049v4","url_pdf":"https://arxiv.org/pdf/2311.09049v4.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":"adapting-large-language-models-by-integrating","repo_url":"https://github.com/rucaibox/lc-rec","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"},{"task_slug":"recommendation-systems","task_name":"Recommendation Systems"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.09049","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.09049"}},"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/rucaibox/lc-rec","reach":{"status":"ok"}}],"summary":{"ran_honours":1,"ran":8},"by_repo_kind":{"official":{"samples":9,"ran":9,"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":9,"samples":[{"code_sha256_prefix":"6dbf1b2a5b901370","entry":"atoi","repo":"rucaibox/lc-rec","repo_kind":"official","path":"convert/zero_to_fp32.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/convert/zero_to_fp32.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":"6dbf1b2a5b901370"}},{"code_sha256_prefix":"821a5d97132f11ad","entry":"get_metrics_results","repo":"rucaibox/lc-rec","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/evaluate.py","link_basis":"harvester_set","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":"821a5d97132f11ad"}},{"code_sha256_prefix":"3a53f3109825e747","entry":"get_model_state_file","repo":"rucaibox/lc-rec","repo_kind":"official","path":"convert/zero_to_fp32.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/convert/zero_to_fp32.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":"3a53f3109825e747"}},{"code_sha256_prefix":"ca14fff52bd00067","entry":"get_topk_results","repo":"rucaibox/lc-rec","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/evaluate.py","link_basis":"harvester_set","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":"ca14fff52bd00067"}},{"code_sha256_prefix":"7052cf0436949e37","entry":"natural_keys","repo":"rucaibox/lc-rec","repo_kind":"official","path":"convert/zero_to_fp32.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/convert/zero_to_fp32.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":"7052cf0436949e37"}},{"code_sha256_prefix":"9c6f5ffc9e56c40a","entry":"ndcg_k","repo":"rucaibox/lc-rec","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/evaluate.py","link_basis":"harvester_set","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":"9c6f5ffc9e56c40a"}},{"code_sha256_prefix":"dbf71154d12a9f53","entry":"parse_dataset_args","repo":"rucaibox/lc-rec","repo_kind":"official","path":"utils.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/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":"dbf71154d12a9f53"}},{"code_sha256_prefix":"2be50b7fb0f78745","entry":"parse_global_args","repo":"rucaibox/lc-rec","repo_kind":"official","path":"utils.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/utils.py","link_basis":"harvester_set","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":"2be50b7fb0f78745"}},{"code_sha256_prefix":"0f855b150af608b8","entry":"parse_train_args","repo":"rucaibox/lc-rec","repo_kind":"official","path":"utils.py","file_url":"https://github.com/rucaibox/lc-rec/blob/HEAD/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":"0f855b150af608b8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}