LongHalQA: Long-Context Hallucination Evaluation for MultiModal Large Language Models

October 13, 2024 · View on GitHub

图片名称

Installation

Please refer to instruction to install Lmms-Eval.

If you have already installed Lmms-Eval, you can copy the task repository "./lmms_eval/tasks/longhallqa" to the same location of your project("./lmms_eval/tasks/").

Run Evaluation

# Running Evaluation for specific MLLM and Task
python3 -m accelerate.commands.launch \
    --num_processes=1 \
    -m lmms_eval \
    --model /MODEL/NAME \
    --model_args pretrained=/PRETRAIN/CHECKPOINTS/PARAMETERS \
    --tasks longhalqa \
    --batch_size 1 \
    --log_samples \
    --log_samples_suffix /SAVE/SUFFIX \
    --output_path ./logs/

# An example code of running LLaVA1.5-7b on Hallucination Completion task on LongHallQA is as follows:
python3 -m accelerate.commands.launch \
    --num_processes=1 \
    -m lmms_eval \
    --model llava \
    --model_args pretrained="liuhaotian/llava-v1.5-7b" \
    --tasks longhalqa \
    --batch_size 1 \
    --log_samples \
    --log_samples_suffix llava_v15_7b_lhqa_completion \
    --output_path ./logs/

The evaluated MLLMs in LonghalQA include:

MLLMmodelmodel_args (pretrained=)
MiniCPM-V-2minicpm_v"openbmb/MiniCPM-V-2"
Qwen2-VL-2Bqwen2_vl""Qwen/Qwen2-VL-2B-Instruct"
Fuyufuyu"adept/fuyu-8b"
LLaVA-1.5-7bllava"liuhaotian/llava-v1.5-7b"
LLaVA-1.5-13bllava"liuhaotian/llava-v1.5-13b"
LLaVA-1.6-7bllava"liuhaotian/llava-v1.6-mistral-7b,conv_template=mistral_instruct"
Qwen-VL-Chatqwen_vl_chat"Qwen/Qwen-VL-Chat"
LLaVA-1.6-34bllava"liuhaotian/llava-v1.6-34b,conv_template=mistral_direct"
Qwen2-VL-72Bqwen2_vl"Qwen/Qwen2-VL-72B-Instruct"

The evaluated sub-items in LongHalQA are:

Hallucinaiton DiscriminationHallucination Completion
lhqa_discrim_object_binarylhqa_complete_description
lhqa_discrim_description_binarylhqa_complete_conversation
lhqa_discrim_conversation_binary
lhqa_discrim_description_choice
lhqa_discrim_conversation_choice

Acknowledgement

We fork and modify lmms-eval to employ LongHalQA. Thanks to this wonderful project.