通過精細元素矯正人類反饋的行為對齊來朝著值得信賴的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 } ,
}