Hugging Face reposted this
The bleeding-edge alignment technique DPO for vision language models is now available in Hugging Face TRL along with LoRA/QLoRA ⚡️ Links and more in comments 🔖 DPO is a popular cutting-edge alignment technique for language models. TLDR; a (preference) model is trained using a dataset of inputs and chosen and rejected outputs, and this model generates scores for each input. the main model is fine-tuned using the scores. Essentially DPO in vision language models is pretty similar, since vision language models are models that take in images projected to text embedding space, it's just input tokens output tokens. Quentin Gallouédec implemented support for Idefics2, Llava 1.5, and PaliGemma in TRL. 👏 as of now, VLM processors are quite non-standard, only difference is due to processor and chat templates themselves, you can implement it very easily (see his PR in links) Thanks to TRL's support for PEFT and bitsandbytes you can also try QLoRA and LoRA fine-tuning (which comes in blog post) 😏 Please try the scripts, share your models and let us know how it goes!
Thank you very much
Great news! ORPO seems as a natural next step
Great stuff
open-sourceress at 🤗 | Google Developer Expert in Machine Learning, MSc Candidate in Data Science
2mo📝 Blog post: https://huggingface.co/blog/dpo_vlms ✨ Space to compare DPO vs normal IDEFICS2-8B https://huggingface.co/spaces/HuggingFaceH4/compare_idefics-8b-dpo 📑 PR https://github.com/huggingface/trl/pull/1797/files