School of Computer Science and Technology, Harbin Institute of Technology, Shenzhen
*Equal contribution
†Corresponding author
The Thirty-eighth Annual Conference on Neural Information Processing Systems (NeurIPS 2024)
- [12/2024] Code and checkpoints are released.
- [09/2024] Project page released!
- [09/2024] MoME has been accepted by NeurIPS 2024!
- [07/2024] Arxiv paper released.
This is the github repository of MoME: Mixture of Multimodal Experts for Generalist Multimodal Large Language Models. In this work, we propose a mixture of multimodal experts (MoME) to mitigate task interference and obtain a generalist MLLM.
Our MoME is composed of two key components, a mixture of vision experts (MoVE) and a mixture of language experts (MoLE). MoVE can adaptively modulate the features transformed from various vision encoders, and has a strong compatibility in transformation architecture. MoLE incorporates sparsely gated experts into LLMs to achieve painless improvements with roughly unchanged inference costs.
The architecture of the proposed MoME model:
git clone https://github.com/JiuTian-VL/MoME.git
cd MoMEconda create -n mome python=3.12
conda activate mome
pip install -r requirements.txtPlease download all the required checkpoints by running the download_ckpt.py script.
python download_ckpt.pyThe required checkpoints will be downloaded to the ./checkpoints directory from huggingface.
We provide a training script and instruction to perform stage 1 and stage 2 training.
- Download dataset from huggingface
- Download images and organized them in one folder:
Please download the following datasets:
- Training images
coco-2014coco-2017flickr30Kgqaiconqaureader-instruction-1.0
After downloading, place all these folders under a single directory.
For example:
/path/to/image_folder/
├── coco/images/train2014/COCO_train2014_*.jpg
├── coco_2017/train2017/*.jpg
├── flickr30K/images/flickr30k-images/*.jpg
├── gqa/images/*.jpg
├── iconqa/iconqa_data/iconqa/train/choose_txt/**/image.png
└── ureader-instruction-1.0/images/*.jpg
In config files (e.g. configs/train_mome_stage1.yaml and configs/train_mome_stage2.yaml), update the vis_root path and dataset paths:
train_datasets:
- ann_path: "/path/to/MoME-data-train/General_data.json"
vis_root: "/path/to/image_folder"
sample_ratio: 1
- ann_path: "/path/to/MoME-data-train/REC_data.json"
vis_root: "/path/to/image_folder"
sample_ratio: 1
- ann_path: "/path/to/MoME-data-train/REG_data.json"
vis_root: "/path/to/image_folder"
sample_ratio: 1
- ann_path: "/path/to/MoME-data-train/Doc_data.json"
vis_root: "/path/to/image_folder"
sample_ratio: 1- Run multi‑GPU training for stage 1:
cd MoME
bash scripts/train_stage1.sh
- Update the checkpoint path of
stage 1inconfigs/train_mome_stage2.yaml
model:
ckpt: "outputs/mome_stage1/your_job_id/checkpoint_0.pth"- Run multi‑GPU training for stage 2:
cd MoME
bash scripts/train_stage2.sh
We provide an inference example in playground.ipynb, which includes a minimal example of how to use the MoME model for inference.
A gradio demo used for model testing and router visualization is also provided in demo_mome.py. You can start the demo by running the following command:
python demo_mome.pyWe collected 24 datasets and categorized them into four groups for instruction-tuning and evaluation:
Here we list the multitasking performance comparison of MoME and baselines. Please refer to our paper for more details.
If you find this work useful for your research, please kindly cite our paper:
@inproceedings{shen2024mome,
title={MoME: Mixture of Multimodal Experts for Generalist Multimodal Large Language Models},
author={Shen, Leyang and Chen, Gongwei and Shao, Rui and Guan, Weili and Nie, Liqiang},
booktitle={Advances in neural information processing systems},
year={2024}
}





