{"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/optimization-methods-for-personalizing-large","title":"Optimization Methods for Personalizing Large Language Models through Retrieval Augmentation","arxiv_id":"2404.05970","date":"2024-04-09","proceeding":null,"authors":["Alireza Salemi","Surya Kallumadi","Hamed Zamani"],"abstract":"This paper studies retrieval-augmented approaches for personalizing large language models (LLMs), which potentially have a substantial impact on various applications and domains. We propose the first attempt to optimize the retrieval models that deliver a limited number of personal documents to large language models for the purpose of personalized generation. We develop two optimization algorithms that solicit feedback from the downstream personalized generation tasks for retrieval optimization--one based on reinforcement learning whose reward function is defined using any arbitrary metric for personalized generation and another based on knowledge distillation from the downstream LLM to the retrieval model. This paper also introduces a pre- and post-generation retriever selection model that decides what retriever to choose for each LLM input. Extensive experiments on diverse tasks from the language model personalization (LaMP) benchmark reveal statistically significant improvements in six out of seven datasets.","url_abs":"https://arxiv.org/abs/2404.05970v1","url_pdf":"https://arxiv.org/pdf/2404.05970v1.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":"optimization-methods-for-personalizing-large","repo_url":"https://github.com/lamp-benchmark/lamp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.05970","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.05970"}},"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/lamp-benchmark/lamp","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":5,"ran":3},"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":"3c022e0b56a5b9aa","entry":"extract_after_article","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/prompts/utils.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/prompts/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3c022e0b56a5b9aa"}},{"code_sha256_prefix":"490005de8edac2a7","entry":"extract_after_description","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/prompts/utils.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/prompts/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"490005de8edac2a7"}},{"code_sha256_prefix":"f11dc768dc0cbefb","entry":"extract_strings_between_quotes","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/prompts/utils.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/prompts/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f11dc768dc0cbefb"}},{"code_sha256_prefix":"fe0e2df4d9cb5edd","entry":"mean_pooling","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/rank_profiles.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/rank_profiles.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fe0e2df4d9cb5edd"}},{"code_sha256_prefix":"702b3adb25f03d63","entry":"merge","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/utils/merge_with_rank.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/utils/merge_with_rank.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":"702b3adb25f03d63"}},{"code_sha256_prefix":"8b51adb8a6c014e5","entry":"postprocess_text","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/metrics/generation_metrics.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/metrics/generation_metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8b51adb8a6c014e5"}},{"code_sha256_prefix":"1bea9980ec25d1c5","entry":"postprocess_text","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/metrics/classification_metrics.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/metrics/classification_metrics.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":"1bea9980ec25d1c5"}},{"code_sha256_prefix":"a471ce335b09d080","entry":"retrieve_top_k_with_bm25","repo":"lamp-benchmark/lamp","repo_kind":"official","path":"LaMP/rank_profiles.py","file_url":"https://github.com/lamp-benchmark/lamp/blob/HEAD/LaMP/rank_profiles.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":"a471ce335b09d080"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}