{"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/the-art-of-balancing-revolutionizing-mixture","title":"LoRAMoE: Alleviate World Knowledge Forgetting in Large Language Models via MoE-Style Plugin","arxiv_id":"2312.09979","date":"2023-12-15","proceeding":null,"authors":["Shihan Dou","Enyu Zhou","Yan Liu","Songyang Gao","Jun Zhao","Wei Shen","Yuhao Zhou","Zhiheng Xi","Xiao Wang","Xiaoran Fan","ShiLiang Pu","Jiang Zhu","Rui Zheng","Tao Gui","Qi Zhang","Xuanjing Huang"],"abstract":"Supervised fine-tuning (SFT) is a crucial step for large language models (LLMs), enabling them to align with human instructions and enhance their capabilities in downstream tasks. Increasing instruction data substantially is a direct solution to align the model with a broader range of downstream tasks or notably improve its performance on a specific task. However, we find that large-scale increases in instruction data can damage the world knowledge previously stored in LLMs. To address this challenge, we propose LoRAMoE, a novelty framework that introduces several low-rank adapters (LoRA) and integrates them by using a router network, like a plugin version of Mixture of Experts (MoE). It freezes the backbone model and forces a portion of LoRAs to focus on leveraging world knowledge to solve downstream tasks, to alleviate world knowledge-edge forgetting. Experimental results show that, as the instruction data increases, LoRAMoE can significantly improve the ability to process downstream tasks, while maintaining the world knowledge stored in the LLM.","url_abs":"https://arxiv.org/abs/2312.09979v4","url_pdf":"https://arxiv.org/pdf/2312.09979v4.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":"the-art-of-balancing-revolutionizing-mixture","repo_url":"https://github.com/ablustrund/loramoe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok"}}],"tasks":[{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"},{"task_slug":"multi-task-learning","task_name":"Multi-Task Learning"},{"task_slug":"world-knowledge","task_name":"World Knowledge"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2312.09979","atlas_url":"https://app.syntology.ai/?focus=2312.09979","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.09979"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/ablustrund/loramoe","reach":{"status":"ok"}}],"summary":{"ran":6,"ran_draft_wrong":1,"unverified":7},"by_repo_kind":{"official":{"samples":14,"ran":7,"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":14,"samples":[{"code_sha256_prefix":"5168a172bbb363a5","entry":"convert_pytorch_state_dict_to_flax","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modeling_flax_pytorch_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modeling_flax_pytorch_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":"5168a172bbb363a5"}},{"code_sha256_prefix":"ccaa0edba373622c","entry":"get_imports","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/dynamic_module_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/dynamic_module_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":"ccaa0edba373622c"}},{"code_sha256_prefix":"dd8f7751ef859581","entry":"infer_metric_tags_from_eval_results","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modelcard.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modelcard.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":"dd8f7751ef859581"}},{"code_sha256_prefix":"a4491b45d19b7a39","entry":"parse_keras_history","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modelcard.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modelcard.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":"a4491b45d19b7a39"}},{"code_sha256_prefix":"591cff6b55ba6bfb","entry":"prepare_model_for_kbit_training","repo":"ablustrund/loramoe","repo_kind":"official","path":"run_loramoe.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/run_loramoe.py","link_basis":"plan_row","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":"591cff6b55ba6bfb"}},{"code_sha256_prefix":"a66d2b78670c85e1","entry":"quick_gelu","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modeling_flax_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modeling_flax_utils.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":"a66d2b78670c85e1"}},{"code_sha256_prefix":"61779b0406a59cfc","entry":"rename_key_and_reshape_tensor","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modeling_flax_pytorch_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modeling_flax_pytorch_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":"61779b0406a59cfc"}},{"code_sha256_prefix":"2776dfe4cf53097d","entry":"build_instruction_dataset","repo":"ablustrund/loramoe","repo_kind":"official","path":"build_dataset.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/build_dataset.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":"2776dfe4cf53097d"}},{"code_sha256_prefix":"9d98806acb3144b7","entry":"dtype_byte_size","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modeling_flax_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modeling_flax_utils.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":"9d98806acb3144b7"}},{"code_sha256_prefix":"e3ce70ca9258800e","entry":"flax_shard_checkpoint","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modeling_flax_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modeling_flax_utils.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":"e3ce70ca9258800e"}},{"code_sha256_prefix":"602b6b6c04496cfd","entry":"forward","repo":"ablustrund/loramoe","repo_kind":"official","path":"flash_attn_patch.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/flash_attn_patch.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":"602b6b6c04496cfd"}},{"code_sha256_prefix":"00cc853a73f3aeb6","entry":"get_relative_import_files","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/dynamic_module_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/dynamic_module_utils.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":"00cc853a73f3aeb6"}},{"code_sha256_prefix":"450aeffe7f80f917","entry":"get_relative_imports","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/dynamic_module_utils.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/dynamic_module_utils.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":"450aeffe7f80f917"}},{"code_sha256_prefix":"ec7b1528a936234d","entry":"is_hf_dataset","repo":"ablustrund/loramoe","repo_kind":"official","path":"transformers/modelcard.py","file_url":"https://github.com/ablustrund/loramoe/blob/HEAD/transformers/modelcard.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":"ec7b1528a936234d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}