{"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/moe-tinymed-mixture-of-experts-for-tiny","title":"Med-MoE: Mixture of Domain-Specific Experts for Lightweight Medical Vision-Language Models","arxiv_id":"2404.10237","date":"2024-04-16","proceeding":null,"authors":["Songtao Jiang","Tuo Zheng","Yan Zhang","Yeying Jin","Li Yuan","Zuozhu Liu"],"abstract":"Recent advancements in general-purpose or domain-specific multimodal large language models (LLMs) have witnessed remarkable progress for medical decision-making. However, they are designated for specific classification or generative tasks, and require model training or finetuning on large-scale datasets with sizeable parameters and tremendous computing, hindering their clinical utility across diverse resource-constrained scenarios in practice. In this paper, we propose a novel and lightweight framework Med-MoE (Mixture-of-Experts) that tackles both discriminative and generative multimodal medical tasks. The learning of Med-MoE consists of three steps: multimodal medical alignment, instruction tuning and routing, and domain-specific MoE tuning. After aligning multimodal medical images with LLM tokens, we then enable the model for different multimodal medical tasks with instruction tuning, together with a trainable router tailored for expert selection across input modalities. Finally, the model is tuned by integrating the router with multiple domain-specific experts, which are selectively activated and further empowered by meta expert. Comprehensive experiments on both open- and close-end medical question answering (Med-VQA) and image classification tasks across datasets such as VQA-RAD, SLAKE and Path-VQA demonstrate that our model can achieve performance superior to or on par with state-of-the-art baselines, while only requiring approximately 30\\%-50\\% of activated model parameters. Extensive analysis and ablations corroborate the effectiveness and practical utility of our method.","url_abs":"https://arxiv.org/abs/2404.10237v3","url_pdf":"https://arxiv.org/pdf/2404.10237v3.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":"moe-tinymed-mixture-of-experts-for-tiny","repo_url":"https://github.com/jiangsongtao/med-moe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"moe-tinymed-mixture-of-experts-for-tiny","repo_url":"https://github.com/jiangsongtao/tinymed","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":null,"task_name":"Medical Question Answering"},{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"visual-question-answering","task_name":"Visual Question Answering (VQA)"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"moe","method_name":"MoE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.10237","atlas_url":"https://app.syntology.ai/?focus=2404.10237","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.10237"}},"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/jiangsongtao/tinymed","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jiangsongtao/med-moe","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":3,"ran":3,"unverified":6},"by_repo_kind":{"official":{"samples":10,"ran":6,"repositories":2}},"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":2,"samples":[{"code_sha256_prefix":"0d5ea0366375f84c","entry":"MoEStablelmDecoderLayer_forward","repo":"jiangsongtao/med-moe","repo_kind":"official","path":"moellava/model/language_model/llava_stablelm_moe.py","file_url":"https://github.com/jiangsongtao/med-moe/blob/HEAD/moellava/model/language_model/llava_stablelm_moe.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0d5ea0366375f84c"}},{"code_sha256_prefix":"97286a837fefce75","entry":"einsum","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"moe/sharded_moe.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/moe/sharded_moe.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"97286a837fefce75"}},{"code_sha256_prefix":"42a46570620cd9fa","entry":"get_chunk","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"model_vqa_med.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/model_vqa_med.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"42a46570620cd9fa"}},{"code_sha256_prefix":"dee86097e6631190","entry":"is_moe_param","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"moe/utils.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/moe/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dee86097e6631190"}},{"code_sha256_prefix":"076c252c52cbb161","entry":"split_list","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"model_vqa_med.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/model_vqa_med.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"076c252c52cbb161"}},{"code_sha256_prefix":"593d61d6861a857f","entry":"split_params_into_shared_and_expert_params","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"moe/utils.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/moe/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"593d61d6861a857f"}},{"code_sha256_prefix":"3b6fa807ed00b1da","entry":"gumbel_rsample","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"moe/sharded_moe.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/moe/sharded_moe.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3b6fa807ed00b1da"}},{"code_sha256_prefix":"d327fe6cbd808182","entry":"has_moe_layers","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"moe/utils.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/moe/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d327fe6cbd808182"}},{"code_sha256_prefix":"77678f2758141df9","entry":"load_jsonl","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"run_eval.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/run_eval.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"77678f2758141df9"}},{"code_sha256_prefix":"765e66c4d56297b6","entry":"multiplicative_jitter","repo":"jiangsongtao/tinymed","repo_kind":"official","path":"moe/sharded_moe.py","file_url":"https://github.com/jiangsongtao/tinymed/blob/HEAD/moe/sharded_moe.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"765e66c4d56297b6"}},{"code_sha256_prefix":"e2e5c3a95a6aebb4","entry":"save_image_to_local","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"e2e5c3a95a6aebb4"}},{"code_sha256_prefix":"22930d58d32e2d08","entry":"save_video_to_local","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"22930d58d32e2d08"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}