{"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/moelora-an-moe-based-parameter-efficient-fine","title":"When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applications","arxiv_id":"2310.18339","date":"2023-10-21","proceeding":null,"authors":["Qidong Liu","Xian Wu","Xiangyu Zhao","Yuanshao Zhu","Derong Xu","Feng Tian","Yefeng Zheng"],"abstract":"The recent surge in Large Language Models (LLMs) has garnered significant attention across numerous fields. Fine-tuning is often required to fit general LLMs for a specific domain, like the web-based healthcare system. However, two problems arise during fine-tuning LLMs for medical applications. One is the task variety problem, which involves distinct tasks in real-world medical scenarios. The variety often leads to sub-optimal fine-tuning for data imbalance and seesaw problems. Besides, the large amount of parameters in LLMs leads to huge time and computation consumption by fine-tuning. To address these two problems, we propose a novel parameter efficient fine-tuning framework for multi-task medical applications, dubbed as MOELoRA. The designed framework aims to absorb both the benefits of mixture-of-expert (MOE) for multi-task learning and low-rank adaptation (LoRA) for parameter efficient fine-tuning. For unifying MOE and LoRA, we devise multiple experts as the trainable parameters, where each expert consists of a pair of low-rank matrices to retain the small size of trainable parameters. Then, a task-motivated gate function for all MOELoRA layers is proposed, which can control the contributions of each expert and produce distinct parameters for various tasks. We conduct experiments on a multi-task medical dataset, indicating MOELoRA outperforms the existing parameter efficient fine-tuning methods. The code is available online.","url_abs":"https://arxiv.org/abs/2310.18339v2","url_pdf":"https://arxiv.org/pdf/2310.18339v2.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":"moelora-an-moe-based-parameter-efficient-fine","repo_url":"https://github.com/applied-machine-learning-lab/moelora-peft","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"moelora-an-moe-based-parameter-efficient-fine","repo_url":"https://github.com/liuqidong07/moelora-peft","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"moelora-an-moe-based-parameter-efficient-fine","repo_url":"https://github.com/Leeroo-AI/mergoo","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"LGPL-3.0"}}],"tasks":[{"task_slug":"multi-task-learning","task_name":"Multi-Task Learning"},{"task_slug":"parameter-efficient-fine-tuning","task_name":"parameter-efficient fine-tuning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.18339","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.18339"}},"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/applied-machine-learning-lab/moelora-peft","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Leeroo-AI/mergoo","reach":{"status":"ok","spdx":"LGPL-3.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/liuqidong07/moelora-peft","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"ran_fixture":1,"ran_violates":1,"unverified":2},"by_repo_kind":{"official":{"samples":6,"ran":4,"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":0,"samples":[{"code_sha256_prefix":"43c9688838aff8b2","entry":"gelu","repo":"applied-machine-learning-lab/moelora-peft","repo_kind":"official","path":"resources/modeling_chatglm.py","file_url":"https://github.com/applied-machine-learning-lab/moelora-peft/blob/HEAD/resources/modeling_chatglm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"43c9688838aff8b2"}},{"code_sha256_prefix":"c8f235d13277facd","entry":"gelu_impl","repo":"applied-machine-learning-lab/moelora-peft","repo_kind":"official","path":"resources/modeling_chatglm.py","file_url":"https://github.com/applied-machine-learning-lab/moelora-peft/blob/HEAD/resources/modeling_chatglm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c8f235d13277facd"}},{"code_sha256_prefix":"1b3b0b10b6eb22b0","entry":"llama_apply_rotary_pos_emb","repo":"applied-machine-learning-lab/moelora-peft","repo_kind":"official","path":"src/MLoRA/peft/tuners/adaption_prompt.py","file_url":"https://github.com/applied-machine-learning-lab/moelora-peft/blob/HEAD/src/MLoRA/peft/tuners/adaption_prompt.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1b3b0b10b6eb22b0"}},{"code_sha256_prefix":"47805bd9ef4bfdd8","entry":"llama_rotate_half","repo":"applied-machine-learning-lab/moelora-peft","repo_kind":"official","path":"src/MLoRA/peft/tuners/adaption_prompt.py","file_url":"https://github.com/applied-machine-learning-lab/moelora-peft/blob/HEAD/src/MLoRA/peft/tuners/adaption_prompt.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"47805bd9ef4bfdd8"}},{"code_sha256_prefix":"84584d174a70b559","entry":"llama_compute_query_states","repo":"applied-machine-learning-lab/moelora-peft","repo_kind":"official","path":"src/MLoRA/peft/tuners/adaption_prompt.py","file_url":"https://github.com/applied-machine-learning-lab/moelora-peft/blob/HEAD/src/MLoRA/peft/tuners/adaption_prompt.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"84584d174a70b559"}},{"code_sha256_prefix":"25fd6233234767aa","entry":"load_tf_weights_in_chatglm_6b","repo":"applied-machine-learning-lab/moelora-peft","repo_kind":"official","path":"resources/modeling_chatglm.py","file_url":"https://github.com/applied-machine-learning-lab/moelora-peft/blob/HEAD/resources/modeling_chatglm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"25fd6233234767aa"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}