{"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/llava-mod-making-llava-tiny-via-moe-knowledge","title":"LLaVA-MoD: Making LLaVA Tiny via MoE Knowledge Distillation","arxiv_id":"2408.15881","date":"2024-08-28","proceeding":null,"authors":["Fangxun Shu","Yue Liao","Le Zhuo","Chenning Xu","Lei Zhang","Guanghao Zhang","Haonan Shi","Long Chen","Tao Zhong","Wanggui He","Siming Fu","Haoyuan Li","Bolin Li","Zhelun Yu","Si Liu","Hongsheng Li","Hao Jiang"],"abstract":"We introduce LLaVA-MoD, a novel framework designed to enable the efficient training of small-scale Multimodal Language Models (s-MLLM) by distilling knowledge from large-scale MLLM (l-MLLM). Our approach tackles two fundamental challenges in MLLM distillation. First, we optimize the network structure of s-MLLM by integrating a sparse Mixture of Experts (MoE) architecture into the language model, striking a balance between computational efficiency and model expressiveness. Second, we propose a progressive knowledge transfer strategy to ensure comprehensive knowledge migration. This strategy begins with mimic distillation, where we minimize the Kullback-Leibler (KL) divergence between output distributions to enable the student model to emulate the teacher network's understanding. Following this, we introduce preference distillation via Direct Preference Optimization (DPO), where the key lies in treating l-MLLM as the reference model. During this phase, the s-MLLM's ability to discriminate between superior and inferior examples is significantly enhanced beyond l-MLLM, leading to a better student that surpasses its teacher, particularly in hallucination benchmarks. Extensive experiments demonstrate that LLaVA-MoD outperforms existing models across various multimodal benchmarks while maintaining a minimal number of activated parameters and low computational costs. Remarkably, LLaVA-MoD, with only 2B activated parameters, surpasses Qwen-VL-Chat-7B by an average of 8.8% across benchmarks, using merely 0.3% of the training data and 23% trainable parameters. These results underscore LLaVA-MoD's ability to effectively distill comprehensive knowledge from its teacher model, paving the way for the development of more efficient MLLMs. The code will be available on: https://github.com/shufangxun/LLaVA-MoD.","url_abs":"https://arxiv.org/abs/2408.15881v3","url_pdf":"https://arxiv.org/pdf/2408.15881v3.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":"llava-mod-making-llava-tiny-via-moe-knowledge","repo_url":"https://github.com/shufangxun/llava-mod","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"computational-efficiency","task_name":"Computational Efficiency"},{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2408.15881","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.15881"}},"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/shufangxun/llava-mod","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":3,"ran_draft_wrong":1,"unverified":8},"by_repo_kind":{"official":{"samples":12,"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":"d4d3da2053042c5b","entry":"MoELlamaDecoderLayer_forward","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_llama_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_llama_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":"d4d3da2053042c5b"}},{"code_sha256_prefix":"94fd3e834862f43a","entry":"MoELlamaDecoderLayer_forward_before","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_llama_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_llama_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":"94fd3e834862f43a"}},{"code_sha256_prefix":"fa8801310651c9e1","entry":"MoEMiniCPMDecoderLayer_forward","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_minicpm_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_minicpm_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":"fa8801310651c9e1"}},{"code_sha256_prefix":"a7bee88c1c7fd6a3","entry":"image_parser","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/eval/run_llava.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/eval/run_llava.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a7bee88c1c7fd6a3"}},{"code_sha256_prefix":"c1673eb73f71bb52","entry":"MoEGemma2DecoderLayer_forward","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_gemma2_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_gemma2_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":"c1673eb73f71bb52"}},{"code_sha256_prefix":"90ff55bb1e7b6ade","entry":"MoEGemma2Model_forward","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_gemma2_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_gemma2_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":"90ff55bb1e7b6ade"}},{"code_sha256_prefix":"978df8a5436dec07","entry":"MoELlamaModel_forward_before","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_llama_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_llama_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":"978df8a5436dec07"}},{"code_sha256_prefix":"2dd7035083ebd746","entry":"MoEMiniCPMModel_forward","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_minicpm_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_minicpm_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":"2dd7035083ebd746"}},{"code_sha256_prefix":"23374f774ccd816e","entry":"MoEMistralDecoderLayer_forward","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_mistral_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_mistral_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":"23374f774ccd816e"}},{"code_sha256_prefix":"b9973d7b9463a950","entry":"MoEMistralModel_forward","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/model/language_model/llava_mistral_moe.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/model/language_model/llava_mistral_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":"b9973d7b9463a950"}},{"code_sha256_prefix":"4552e857b0cf7ef7","entry":"load_image","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/eval/run_llava.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/eval/run_llava.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":"4552e857b0cf7ef7"}},{"code_sha256_prefix":"99d66c86efac69ff","entry":"load_images","repo":"shufangxun/llava-mod","repo_kind":"official","path":"llavamod/eval/run_llava.py","file_url":"https://github.com/shufangxun/llava-mod/blob/HEAD/llavamod/eval/run_llava.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":"99d66c86efac69ff"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}