通过精细元素矫正人类反馈的行为对齐来朝着值得信赖的MLLM
该存储库托管RLHF-V的代码,数据和模型权重,RLHF-V是一个新颖的框架,该框架通过细粒度的校正人类反馈来对齐多模式大语言模型(MLLMS)行为。
我们通过要求人类注释者纠正模型响应中的幻觉片段来收集细粒度的矫正反馈数据,可以更好地相信所需的行为。从高数据效率中受益,我们在8个A100 GPU中只需要1小时才能将基本模型的幻觉速度降低34.8%。具体而言,我们对松饼进行实验,松饼是一种在图像理解和推理方面具有强大能力的MLLM,该MLLM在UNIMM-CHAT上接受了训练。
拜访我们的?项目页面和?纸探索更多!而且不要错过尝试我们的互动演示!
我们介绍RLHF-V-DATASET,它是由细分细分级人类校正构建的人类偏好数据集。实际上,我们总共获得了1.4K注释的数据,其中包括一套详细的描述说明和提问说明。
我们在拥抱脸上释放RLHF-V型号的权重。
我们还提供SFT权重,这是VQAV2数据集上的Finetuning松饼后的模型检查点。
cd RLHF-V
git clone https://github.com/thunlp/muffin
cd Muffin
# Creating conda environment
conda create -n muffin python=3.10
conda activate muffin
# Installing dependencies
pip install -e .
# Install specific version of transformers to make sure you can reproduce the experimental results in our papers
git clone --recursive [email protected]:huggingface/transformers.git
cd transformers
git checkout a92e0ad2e20ef4ce28410b5e05c5d63a5a304e65
pip install .
cd ..如果需要进行培训,请安装其他软件包。
git clone --recursive https://github.com/Dao-AILab/flash-attention.git
cd flash-attention
# Note: Uncomment the following line if you have CUDA version <= 11.4
# git checkout ad11394
MAX_JOBS=8 python setup.py install
cd ..要运行对象Halbench评估,您还需要以下包:
jsonlines
nltk==3.8.1
spacy==3.7.0
# Download and install "en_core_web_trf" for spacy
# The wheel version we use can be downloaded from
# https://github.com/explosion/spacy-models/releases/tag/en_core_web_trf-3.7.2
# run pip install en_core_web_trf-3.7.2-py3-none-any.whl 运行以下脚本以生成,评估和总结LLAVA基准的结果:
# cd RLHF-V
bash ./script/eval/eval_muffin_llavabench.sh ./RLHF-V_weight ./results/RLHF-V {YOUR_OPENAI_API_KEY}对象HALBENCH的评估取决于COCO2014数据集的标题和分割注释。请首先从可可数据集的官方网站下载COCO2014数据集。
mkdir coco2014
cd coco2014
wget http://images.cocodataset.org/annotations/annotations_trainval2014.zip
unzip annotations_trainval2014.zip请替换{YOUR_COCO2014_ANNOTATION_DIR}用CoCO2014注释目录(例如./coco2014/annotations coco2014/annotations)的路径,然后用有效的OpenAi api-key替换{YOUR_OPENAI_API_KEY} 。
# cd RLHF-V
bash ./script/eval_muffin_objhal.sh ./RLHF-V_weight ./results/RLHF-V {YOUR_COCO2014_ANNOTATION_DIR} {YOUR_OPENAI_API_KEY}请在此处下载MMHAL评估数据,然后将文件保存在eval/data中。
# cd RLHF-V
bash ./script/eval_muffin_mmhal.sh ./RLHF-V_weight ./results/RLHF-V {YOUR_OPENAI_API_KEY}请按照安装部分中的说明进行准备,以准备培训环境。并确保升级到Muffin的最新代码基础:
cd Muffin
git pull
pip install -e .
请下载我们的SFT型号检查点,然后将其保存到Muffin/RLHF-V_SFT_weight 。
请确保升级到Muffin的最新代码库。安装松饼环境后,您可以按以下方式训练模型。该脚本将自动从HuggingFace下载我们的开源培训数据,通过我们的SFT模型生成日志,并进行DDPO培训:
cd Muffin
ref_model=./RLHF-V_SFT_weight
bash ./script/train/run_RLHFV.sh
./RLHFV_checkpoints/dpo_exp
master
RLHFV
1.1
$ref_model
./RLHF-V-Dataset
RLHFV_SFT
2160
360
0.1
False
True用法和许可声明:数据,代码和检查点仅用于研究使用和许可。他们还仅限于遵循骆驼,维库纳和聊天GPT的许可协议的使用。该数据集由NC 4.0(仅允许非商业用途)为CC,并且不应在研究目的之外使用使用数据集进行培训的模型。
如果您发现我们的型号/代码/数据/纸张有帮助,请考虑引用我们的论文并出演我们
@article { yu2023rlhf ,
title = { Rlhf-v: Towards trustworthy mllms via behavior alignment from fine-grained correctional human feedback } ,
author = { Yu, Tianyu and Yao, Yuan and Zhang, Haoye and He, Taiwen and Han, Yifeng and Cui, Ganqu and Hu, Jinyi and Liu, Zhiyuan and Zheng, Hai-Tao and Sun, Maosong and others } ,
journal = { arXiv preprint arXiv:2312.00849 } ,
year = { 2023 }
}
@article { yu2024rlaifv ,
title = { RLAIF-V: Aligning MLLMs through Open-Source AI Feedback for Super GPT-4V Trustworthiness } ,
author = { Yu, Tianyu and Zhang, Haoye and Yao, Yuan and Dang, Yunkai and Chen, Da and Lu, Xiaoman and Cui, Ganqu and He, Taiwen and Liu, Zhiyuan and Chua, Tat-Seng and Sun, Maosong } ,
journal = { arXiv preprint arXiv:2405.17220 } ,
year = { 2024 } ,
}