{"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/dynamic-mixture-of-experts-an-auto-tuning","title":"Dynamic Mixture of Experts: An Auto-Tuning Approach for Efficient Transformer Models","arxiv_id":"2405.14297","date":"2024-05-23","proceeding":null,"authors":["Yongxin Guo","Zhenglin Cheng","Xiaoying Tang","Zhaopeng Tu","Tao Lin"],"abstract":"The Sparse Mixture of Experts (SMoE) has been widely employed to enhance the efficiency of training and inference for Transformer-based foundational models, yielding promising results. However, the performance of SMoE heavily depends on the choice of hyper-parameters, such as the number of experts and the number of experts to be activated (referred to as top-k), resulting in significant computational overhead due to the extensive model training by searching over various hyper-parameter configurations. As a remedy, we introduce the Dynamic Mixture of Experts (DynMoE) technique. DynMoE incorporates (1) a novel gating method that enables each token to automatically determine the number of experts to activate. (2) An adaptive process automatically adjusts the number of experts during training. Extensive numerical results across Vision, Language, and Vision-Language tasks demonstrate the effectiveness of our approach to achieve competitive performance compared to GMoE for vision and language tasks, and MoE-LLaVA for vision-language tasks, while maintaining efficiency by activating fewer parameters. Our code is available at https://github.com/LINs-lab/DynMoE.","url_abs":"https://arxiv.org/abs/2405.14297v3","url_pdf":"https://arxiv.org/pdf/2405.14297v3.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":"dynamic-mixture-of-experts-an-auto-tuning","repo_url":"https://github.com/lins-lab/dynmoe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"},{"task_slug":"visual-question-answering-1","task_name":"Visual Question Answering"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/visual-question-answering-on-mm-vet","task":"Visual Question Answering","dataset":"MM-Vet","model":"DynMOE-LLaVA","rank_in_archive_order":172,"of":231,"metrics":{"GPT-4 score":"33.6"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2405.14297","atlas_url":"https://app.syntology.ai/?focus=2405.14297","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.14297"}},"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/lins-lab/dynmoe","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_violates":1,"ran":1},"by_repo_kind":{"official":{"samples":2,"ran":2,"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":"6ba8cee9f5daea41","entry":"pair","repo":"LINs-lab/DynMoE","repo_kind":"official","path":"Examples/DeepSpeed-MoE/dynmoe_vit.py","file_url":"https://github.com/LINs-lab/DynMoE/blob/HEAD/Examples/DeepSpeed-MoE/dynmoe_vit.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6ba8cee9f5daea41"}},{"code_sha256_prefix":"09c070245728e6e2","entry":"split_tensor_along_last_dim","repo":"lins-lab/dynmoe","repo_kind":"official","path":"DeepSpeed-0.9.5/deepspeed/compression/basic_layer.py","file_url":"https://github.com/lins-lab/dynmoe/blob/HEAD/DeepSpeed-0.9.5/deepspeed/compression/basic_layer.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":"09c070245728e6e2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}