Paper commentary
MoE-LLaVA: Mixture of Experts for Large Vision-Language Models
- Problem Dense LVLM scaling activates every parameter for every token, and sparsifying an LVLM directly tends to degrade performance.
- Method Trains MoE-LLaVA in three stages, copying FFN weights into four experts and routing each token to its top two experts.
- Results Exceeded LLaVA-1.5-13B by 1.0% on POPE adversarial sampling, 1.5% on popular and 0.8% on random sampling, with 2.2B activated parameters.

Figure 2 . Illustration of MoE-Tuning. The MoE-Tuning consists of three stages. In stage I, only the MLP is trained. In stage II, all parameters are trained except for the Vision Encoder (VE). In stage III, FFNs are used to initialize the experts in MoE, and only the MoE layers are trained. For each MoE layer, only two experts are activated for each token, while the other experts remain silent.
Original paper · CC BY 4.0 · Bin Lin, Zhenyu Tang, Yang Ye, Jinfa Huang, Junwu Zhang, Yatian Pang, Peng Jin, Munan Ning, Jiebo Luo, Li Yuan · MoE-LLaVA: Mixture of Experts for Large Vision-Language Models · Original paper figure · Extracted the figure area from page 2 of the original PDF.Why sparse experts for LVLMs
In a dense model, every token passes through all of the parameters, so each additional unit of capacity adds cost to every step. Recent gains in LVLMs have come from larger backbones, with several works moving the LLM to 13B parameters, and from bigger instruction datasets. Training and deploying models of this size demand substantial computation and efficient use of parallel hardware.
Sparse mixtures of experts offer a way to add capacity while keeping the per-token compute fixed, since each token uses only a chosen subset of experts. The obstacle is that converting an LLM into an LVLM and sparsifying it at the same time degrades performance. The authors report that initialization is what makes sparsifying an LVLM workable, and they build their training recipe around it.
The study therefore covers two things: a training recipe called MoE-Tuning, and the sparse LVLM MoE-LLaVA built with it, evaluated on visual understanding and object hallucination.
Three training stages
MoE-Tuning runs in three stages, and each stage changes which parameters are updated and what the next stage starts from. Figure 2 summarizes the stages, with trainable and frozen components marked for each.
Stage I trains a visual projection layer, an MLP, that maps image patches into the input space of the LLM by treating them as pseudo-text tokens, and MoE layers are not present yet. The figure caption says only the MLP is trained in this stage, whereas the stage text also says the LLM is trained to describe images, so the two descriptions of which LLM parameters move here do not agree.
The stage II data combines MIMIC-IT, LRV, SViT and LVIS sources. For a dense model this would complete training, but here the stage II weights become the starting point for the sparse stage.
Stage III copies the FFN weights into each expert, so every expert begins from the same dense solution. Only the MoE layers are trained in this stage, and the router belongs to those layers.
Routers, top-k experts and the loss
MoE-LLaVA keeps a vision encoder, a visual projection layer and a word embedding layer in front of stacked LLM blocks, and concatenates image and text tokens before the blocks. Table 1 lists the dense bases used, with four experts and top-2 routing in each MoE variant.
Equation 3 writes an MoE sub-layer in every block, but the experiments replace the FFN in alternating blocks, so that half of the layers are MoE layers.
The router is a linear layer with a weight matrix W of size D by E, which turns each token into logits f(x) = W x, and a softmax converts these logits into probabilities over the E experts. \[ P(x)_i = \frac{e^{f(x)_i}}{\sum_{j=1}^{E} e^{f(x)_j}}, \quad f(x) = W x \]
Each token is handled by the k experts with the highest probabilities, and the output is a weighted sum of their outputs, weighted by the softmax probabilities. \[ \mathrm{MoE}(x) = \sum_{i=1}^{k} P(x)_i \, E(x)_i \] The equation uses these probabilities directly, without renormalizing them over the selected k experts.
For MoE layers, the training uses Batch Priority Routing, which takes the routing results and decides which tokens to drop when an expert exceeds its capacity, so the expert workloads stay more even.
Training minimizes the total loss, which is the auto-regressive loss plus alpha times a load-balancing term, with alpha set to 0.01. The auto-regressive term is a negative log-likelihood over the generated text tokens, conditioned on the image tokens and earlier text tokens, and it is computed only for generated text. \[ L_{regressive} = -\sum_{i=1}^{N} \log p_\theta\big(Y[P+i] \mid V, T[:i-1]\big) \]
The load-balancing term, added to each MoE layer, is E times the sum over experts of F_i times G_i, where F_i is the fraction of tokens sent to expert i and G_i is its average routing probability, both defined in the paper's equations 10 and 11. \[ L_{aux} = E \cdot \sum_{i=1}^{E} F_i \, G_i \]
Image understanding against dense models
Table 3 places the MoE-LLaVA variants next to dense LVLMs and lists each model's activated parameters and input resolution.
MoE-LLaVA-Phi-2.7B×4 uses 3.6B activated parameters and is reported 2.7% above LLaVA-1.5-7B on ScienceQA-IMG. The introduction gives 1.9% for the same ScienceQA comparison, and the two percentages do not match each other; the paper does not explain how either was computed.
The 30.7% gain on LLaVA-Bench is stated against LLaVA-1.5-7B, and Table 3's scores of 94.1 and 63.4 differ by 30.7 points, so that figure is a difference in score points.
MoE-LLaVA-Qwen-1.8B×4 scores 59.7 on MMBench with 2.2B activated parameters, against 38.2 for Qwen-VL-7B, which uses 448 resolution. The text summarizes this gap as 21.5%, while the two table scores differ by 21.5 points.
Against LLaVA-1.5-7B, the 3.6B Phi variant scores lower on VQAv2, GQA, VisWiz, VQAT and MME, and higher on ScienceQA-IMG, POPE, MMBench, LLaVA-Bench and MM-Vet. The authors describe performance as very close to LLaVA-1.5 on five benchmarks, and the text says the StableLM variant surpasses IDEFICS-80B with 2.0B activated parameters.
Object hallucination on POPE
POPE is a polling-based benchmark with Adversarial, Popular and Random subsets, and the authors use its pipeline to test object hallucination in a zero-shot setting. Figure 1 plots the average of the three POPE subsets against the activated parameters of open-source LVLMs, with MoE-LLaVA-1.8B×4 among them. The red line in that figure is a linear fit to all models except MoE-LLaVA.
MoE-LLaVA-1.8B×4-Top2, with 2.2B activated parameters, is reported above LLaVA-1.5-13B by 1.0% on adversarial sampling, 1.5% on popular sampling and 0.8% on random sampling. The text does not say whether these percentages refer to accuracy or to F1-Score.
The authors note that the yes ratio for MoE-LLaVA stays relatively balanced, which they take as evidence that its answers follow the questions. MM-GPT answers yes at a rate of 100.0 in all three subsets.
The introduction gives a 1.1% gain on POPE for MoE-LLaVA-1.8B×4 with 2.2B activated parameters, but the text does not restate which measure that figure uses.
Initialization of the sparse stage
Variant (a) swaps the FFN for an MoE layer and trains with the original second-stage script. Variant (b) is the main recipe, using Hybrid-FT in stage II and LLaVA-FT in stage III. Variant (c) keeps a dense model and expands the data of the original LLaVA second stage.
Table 6 gives GQA 58.4, SQAI 58.1, POPE 81.9 and LLaVA-W 88.0 for variant (a), 61.5, 63.1, 87.0 and 88.7 for variant (b), and 60.9, 60.2, 86.4 and 86.3 for variant (c).
Variant (b) is highest on all four metrics, and the authors take this as evidence that a reasonable LVLM initialization lets the model move quickly from a dense model to a sparse one. The authors read the weakness of variant (a) as a sign that the instruction data available is too small to convert an LLM into an LVLM and sparsify it at the same time.
Each variant has one value per metric in the table.
Tuning scope, expert count and layer placement
Table 5a compares tuning only the FFN layers, which the text defines as the FFN and MoE layers, with tuning all parameters. Scores are GQA 61.5 against 61.3, VisWiz 32.6 against 31.9, VQAT 48.0 against 47.6, POPE 87.0 against 87.0 and LLaVA-W 88.7 against 88.1. Training takes 20h for the FFN setting and 27h for the full setting, measured on 8 V100-32G.
The authors state that tuning the FFN reaches results comparable to full tuning in about 75% of the time, so they fine-tune only FFN layers.
Table 5b compares one expert with two; two experts give GQA 61.2 against 60.9, SQAI 60.8 against 60.2, POPE 87.5 against 86.4 and LLaVA-W 86.5 against 86.3. VQAT drops from 48.3 to 47.0 in the two-expert setting, and the text does not discuss this. The text attributes gains of 1.1% on POPE and 0.6% on SQAI to the sparse experts, with the number of activated experts held the same.
Table 5c varies top-k: top-1 gives VQAv2 74.5, GQA 58.4, SQAI 58.0, VQAT 44.0 and POPE 85.7, while top-2 gives 76.2, 61.5, 63.1, 48.0 and 88.7. Training time rises from 19h to 20h, and the authors set the number of activated experts to 2.
Interval reaches VQAv2 76.2, GQA 61.5, SQAI 63.1, VQAT 48.0 and POPE 88.7 in 20h, while All reaches 74.5, 61.5, 62.1, 47.1 and 87.0 in 32h. The authors say that All does not improve results and takes longer, so MoE-LLaVA alternates the MoE layers.
Base model size and the MoE gain
Table 7 applies MoE to four base models, and the gains are not uniform. For StableLM, VQAv2 rises from 74.5 to 76.7 and SQAI from 62.0 to 62.6, while for Phi-2 VQAv2 rises from 75.6 to 77.6 and SQAI from 67.8 to 68.5. For Qwen, VQAv2 rises from 74.9 to 76.2, but VQAT falls from 48.3 to 48.0 and MMBench from 60.6 to 59.7.
Table 10 reports the StableLM comparison with VQAv2 76.0 and VQAT 47.8 for the MoE version, whereas Table 7 gives 76.7 and 50.1 for that same model. Table 10 also includes OpenChat-7B, with dense VQAv2 77.9 and SQAI 69.0 against 78.9 and 62.8 for the MoE version, and LLaVA-W 89.7 against 86.3.
The text says the overall performance of the OpenChat variant is clearly below the dense model, and the authors speculate that current multi-modal instruction data is insufficient for sparse learning at the 10B level. For the smaller models, the authors read the improvement with model size as a scaling pattern.
Where experts specialize
Figure 4 shows expert loads and modality preferences for MoE-LLaVA-2.7B×4-Top2 on ScienceQA-IMG. The authors first describe the expert loads across all MoE layers as balanced.
In deeper layers, the load of expert 3 rises in layers 17 to 27, and the text says it dominates the workload of almost all tokens there. In shallow layers 5 to 11, experts 2, 3 and 4 share the work, while expert 1 is active mainly in the first few layers.
Figure 5 breaks each expert's load down into text and image tokens, with interrupted lines marking a perfectly balanced split. Routing for text and image is highly similar, and the authors read this as each expert serving both modalities rather than favouring one.
At the token level, the authors track paths over downstream tasks and use PCA to pick the top-10 pathways. For unseen text or image tokens, the model tends to send experts 2 and 3 to the deeper layers, while experts 1 and 4 handle tokens during the initial phase.
The appendix repeats the routing analysis on six benchmarks for four bases, and the authors describe the OpenChat base as more balanced and the Phi-2, Qwen and StableLM bases as showing specific patterns.
Limitations
The authors report difficulties with training stability, particularly with 16-bit float precision. They also say fp16 sometimes made the loss NaN, so the models were trained in bf16 precision, and stage III used ZeRO stage 2 with offload because DeepSpeed did not support MoE training under ZeRO stage 3.
The OpenChat-7B variant is the clearest case of weaker results, and the authors attribute it to insufficient multi-modal fine-tuning data. Its routing is more balanced than that of the smaller bases, which the authors say may be why it did not gain from sparsity as expected.
The appendix gives the multi-modal fine-tuning data as 655k in one place, while Table 2 lists the LLaVA 1.5 mix as 665k.
Training uses 336x336 images in all three stages and one epoch per stage, because the authors found that models overfit with two epochs. The efficiency comparisons come from 8 V100-32G runs in the ablations, while the main results were run on 8 A800-80G.
The authors suggest that the expert structure could extend to detection, segmentation, generation and other modalities, and the paper does not test any of these.
Paper info
- Authors
- Bin Lin, Zhenyu Tang, Yang Ye, Jinfa Huang, Junwu Zhang, Yatian Pang, Peng Jin, Munan Ning, Jiebo Luo, Li Yuan
- Venue
- arXiv · Preprint
- First published
- 2024-1-29
- Added
- 2026-11-6
- Updated
- 2024-12-23
- Version
- v5
- arXiv
- 2401.15947
- Category
- cs.CV
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Recent advances demonstrate that scaling Large Vision-Language Models (LVLMs) effectively improves downstream task performances. However, existing scaling methods enable all model parameters to be active for each token in the calculation, which brings massive training and inferring costs. In this work, we propose a simple yet effective training strategy MoE-Tuning for LVLMs. This strategy innovatively addresses the common issue of performance degradation in multi-modal sparsity learning, consequently constructing a sparse model with an outrageous number of parameters but a constant computational cost. Furthermore, we present the MoE-LLaVA, a MoE-based sparse LVLM architecture, which uniquely activates only the top-k experts through routers during deployment, keeping the remaining experts inactive. Extensive experiments show the significant performance of MoE-LLaVA in a variety of visual understanding and object hallucination benchmarks. Remarkably, with only approximately 3B sparsely activated parameters, MoE-LLaVA demonstrates performance comparable to the LLaVA-1.5-7B on various visual understanding datasets and even surpasses the LLaVA-1.5-13B in object hallucination benchmark. Through MoE-LLaVA, we aim to establish a baseline for sparse LVLMs and provide valuable insights for future research in developing more efficient and effective multi-modal learning systems. Code is released at https://github.com/PKU-YuanGroup/MoE-LLaVA.
Quote from the paper
Bin Lin, Zhenyu Tang, Yang Ye, Jinfa Huang, Junwu Zhang, Yatian Pang, Peng Jin, Munan Ning, Jiebo Luo, Li Yuan (2024). MoE-LLaVA: Mixture of Experts for Large Vision-Language Models. arXiv:2401.15947v5. https://arxiv.org/abs/2401.15947v5
BibTeX
@misc{lin2024llava,
title = {{MoE-LLaVA: Mixture of Experts for Large Vision-Language Models}},
author = {Bin Lin and Zhenyu Tang and Yang Ye and Jinfa Huang and Junwu Zhang and Yatian Pang and Peng Jin and Munan Ning and Jiebo Luo and Li Yuan},
year = {2024},
eprint = {2401.15947},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2401.15947v5}
}