Home

Awesome

HA-DPO (Hallucination-aware Direct Preference Optimization) <a href='https://arxiv.org/pdf/2311.16839.pdf'><img src='https://img.shields.io/badge/Paper-Arxiv-red'></a>

Shanghai Artificial Intelligence Laboratory

[Paper] [Data(huggingface)] [Data(opendatalab)] [Models]

Introduction

We propose HA-DPO (Hallucination-aware Direct Preference Optimization), which eliminates LVLM hallucination using GPT-4 generated positive-negative data based on DPO (Direct Preference Optimization).

<img width="100%" src="overview.png" alt="overview"></a>

This repo provides:

Demo

Online demo will be available soon!

https://github.com/JulioZhao97/HA-DPO-video/assets/40555727/b35879ba-ab2a-4e9e-93d8-0e3b47e8a7e9

Getting Started

  1. create a new conda environment
conda create -n hadpo python==3.9
  1. install requirements
conda activate hadpo
pip install -e .

Data Preparation

For data preparation, please refer to data preparation.

Model Training and Evaluation

For model training and evaluation, please refer to docs in following:

MiniGPT-4LLaVA-1.5InstructBLIP
docdocdoc

SHR Evaluation

For SHR Evaluation, please refer to SHR Evaluation.

Main Results

MiniGPT-4-Llama2-7B

<details> <summary> SHR results </summary>
ModelHA-DPOSHR
MiniGPT-4-Llama2-7B:heavy_multiplication_x:47.3
MiniGPT-4-Llama2-7B:heavy_check_mark:44.4
</details> <details> <summary> POPE results </summary>

POPE Random

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
MiniGPT-4-Llama2-7B:heavy_multiplication_x:51.1350.5799.8067.1398.66
MiniGPT-4-Llama2-7B:heavy_check_mark:86.1392.8178.3384.9642.20

POPE Popular

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
MiniGPT-4-Llama2-7B:heavy_multiplication_x:51.4650.7499.5367.7298.06
MiniGPT-4-Llama2-7B:heavy_check_mark:79.5080.2078.3379.2548.83

POPE Adversarial

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
MiniGPT-4-Llama2-7B:heavy_multiplication_x:51.2650.6499.6667.1698.40
MiniGPT-4-Llama2-7B:heavy_check_mark:75.6674.3678.3376.2952.66
</details>

InstructBLIP-13B

<details> <summary> SHR results </summary>
ModelHA-DPOSHR
InstructBLIP-13B:heavy_multiplication_x:51.2
InstructBLIP-13B:heavy_check_mark:49.1
</details> <details> <summary> POPE results </summary>

POPE Random

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
InstructBLIP-13B:heavy_multiplication_x:88.7085.0393.9389.2655.23
InstructBLIP-13B:heavy_check_mark:89.8393.0786.0689.4346.23

POPE Popular

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
InstructBLIP-13B:heavy_multiplication_x:81.3675.0693.9383.4462.56
InstructBLIP-13B:heavy_check_mark:85.7685.5586.0685.8050.03

POPE Adversarial

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
InstructBLIP-13B:heavy_multiplication_x:74.5067.6493.9378.6469.43
InstructBLIP-13B:heavy_check_mark:80.7077.7286.0681.6855.36
</details>

LLaVA-1.5-7B

<details> <summary> SHR results </summary>
ModelHA-DPOSHR
LLaVA-1.5:heavy_multiplication_x:36.7
LLaVA-1.5:heavy_check_mark:34.0
</details> <details> <summary> POPE results </summary>

POPE Random

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
LLaVA-1.5:heavy_multiplication_x:89.6088.7790.6689.7051.06
LLaVA-1.5:heavy_check_mark:90.5392.9987.6690.2547.13

POPE Popular

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
LLaVA-1.5:heavy_multiplication_x:86.2083.2390.6686.7954.46
LLaVA-1.5:heavy_check_mark:87.9088.0787.6687.8149.76

POPE Adversarial

ModelHA-DPOAccuracyPrecisionRecallF1 ScoreYes Ratio (%)
LLaVA-1.5:heavy_multiplication_x:79.7674.4390.6681.7560.90
LLaVA-1.5:heavy_check_mark:81.4677.9987.6682.5456.20
</details>

Acknowledgement

Paper and Citing HA-DPO

You can find more details in our paper.

If you're using HA-DPO in your research or applications, please cite using this BibTeX:

@misc{zhao2023hallucinations,
      title={Beyond Hallucinations: Enhancing LVLMs through Hallucination-Aware Direct Preference Optimization}, 
      author={Zhiyuan Zhao and Bin Wang and Linke Ouyang and Xiaoyi Dong and Jiaqi Wang and Conghui He},
      year={2023},
      eprint={2311.16839},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Contact us

If you have any questions, comments or suggestions, please do not hesitate to contact us at zhaozhiyuan@pjlab.org.cn and wangbin@pjlab.org.cn.

License

Apache License 2.0