This is the official repo for the paper: "MLLM Is a Strong Reranker: Advancing Multimodal Retrieval-augmented Generation via Knowledge-enhanced Reranking and Noise-injected Training".

The required libraries for running RagVL can be found in requirements.txt. We recommend following LLaVA to configure your environment.
Before running RagVL, please:
Download from Google Drive for datasets and checkpoints.
Download from WebQA and MultimodalQA for image files.
Unzip the file. Place the checkpoints/ and datasets/ into RagVL/.
Place the tasks/ into RagVL/finetune/.
Place the MMQA_imgs/ and train_img/ into RagVL/finetune/tasks/.
Place the val_image/ into RagVL/datasets/.
| Models | Global Batch Size | Epochs |
|---|---|---|
| LLaVA-v1.5-13B | 16 | 2 (WebQA) / 1 (others) |
| Qwen-VL-Chat | 16 | 2 (WebQA) / 1 (others) |
| mPLUG-Owl2 | 16 | 2 (WebQA) / 1 (others) |
| InternVL2-1B | 16 | 1 |
| InternVL2-2B | 16 | 1 |
| Models | Global Batch Size | Epochs |
|---|---|---|
| LLaVA-v1.5-13B | 16 | 2 (WebQA) / 3 (MMQA) |
| InternVL2-1B | 16 | 1 |
| InternVL2-2B | 16 | 1 |
Except for the above two hyperparameters, the others follow the default settings from different models.
To finetune LLaVA-v1.5-13B, Qwen-VL-Chat, and mPLUG-Owl2, find the corresponding finetune script in RagVL/finetune/scripts/.
To finetune InternVL2-1B and InternVL2-2B, find the corresponding finetune script in RagVL/internvl_chat/shell/internvl2.0/2nd_finetune.
To evaluate RagVL on WebQA / MultimodalQA, you can employ the following command:
python webqa_pipeline.py \ # same arguments on mmqa_pipeline.py
--reranker_model caption_lora \ # select the reranker
--generator_model noise_injected_lora \ # select the generator
--filter 0 \ # select the adaptive threshold
--clip_topk 20 \ # we first retrieve 20 candidates by default
To evaluate the oracle settings on WebQA / MultimodalQA, you can employ the following command:
python webqa_oracle.py \ # same arguments on mmqa_oracle.py
If you are interested or inspired by this work, you can cite us by:
@article{chen2024mllm,
title={MLLM Is a Strong Reranker: Advancing Multimodal Retrieval-augmented Generation via Knowledge-enhanced Reranking and Noise-injected Training},
author={Chen, Zhanpeng and Xu, Chengjin and Qi, Yiyan and Guo, Jian},
journal={arXiv preprint arXiv:2407.21439},
year={2024}
}
39 commits
Python
93.9%
Shell
4.8%
This is the official repo for the paper: "MLLM Is a Strong Reranker: Advancing Multimodal Retrieval-augmented Generation via Knowledge-enhanced Reranking and Noise-injected Training".

The required libraries for running RagVL can be found in requirements.txt. We recommend following LLaVA to configure your environment.
Before running RagVL, please:
Download from Google Drive for datasets and checkpoints.
Download from WebQA and MultimodalQA for image files.
Unzip the file. Place the checkpoints/ and datasets/ into RagVL/.
Place the tasks/ into RagVL/finetune/.
Place the MMQA_imgs/ and train_img/ into RagVL/finetune/tasks/.
Place the val_image/ into RagVL/datasets/.
| Models | Global Batch Size | Epochs |
|---|---|---|
| LLaVA-v1.5-13B | 16 | 2 (WebQA) / 1 (others) |
| Qwen-VL-Chat | 16 | 2 (WebQA) / 1 (others) |
| mPLUG-Owl2 | 16 | 2 (WebQA) / 1 (others) |
| InternVL2-1B | 16 | 1 |
| InternVL2-2B | 16 | 1 |
| Models | Global Batch Size | Epochs |
|---|---|---|
| LLaVA-v1.5-13B | 16 | 2 (WebQA) / 3 (MMQA) |
| InternVL2-1B | 16 | 1 |
| InternVL2-2B | 16 | 1 |
Except for the above two hyperparameters, the others follow the default settings from different models.
To finetune LLaVA-v1.5-13B, Qwen-VL-Chat, and mPLUG-Owl2, find the corresponding finetune script in RagVL/finetune/scripts/.
To finetune InternVL2-1B and InternVL2-2B, find the corresponding finetune script in RagVL/internvl_chat/shell/internvl2.0/2nd_finetune.
To evaluate RagVL on WebQA / MultimodalQA, you can employ the following command:
python webqa_pipeline.py \ # same arguments on mmqa_pipeline.py
--reranker_model caption_lora \ # select the reranker
--generator_model noise_injected_lora \ # select the generator
--filter 0 \ # select the adaptive threshold
--clip_topk 20 \ # we first retrieve 20 candidates by default
To evaluate the oracle settings on WebQA / MultimodalQA, you can employ the following command:
python webqa_oracle.py \ # same arguments on mmqa_oracle.py
If you are interested or inspired by this work, you can cite us by:
@article{chen2024mllm,
title={MLLM Is a Strong Reranker: Advancing Multimodal Retrieval-augmented Generation via Knowledge-enhanced Reranking and Noise-injected Training},
author={Chen, Zhanpeng and Xu, Chengjin and Qi, Yiyan and Guo, Jian},
journal={arXiv preprint arXiv:2407.21439},
year={2024}
}
39 commits
Python
93.9%
Shell
4.8%