Preference Tuning LLMs with Direct Preference Optimization Methods
An empirical comparison of three RL-free preference alignment methods (DPO, IPO and KTO) on two SFT'd 7B models, Zephyr-7b-beta-sft and OpenHermes-2.5-Mistral-7B, sweeping β from 0.01 to 0.9 with TRL's DPOTrainer and scoring the results on MT-Bench. After a fix to TRL's IPO implementation, which now averages rather than sums log-likelihoods, DPO and IPO perform comparably and both beat KTO in the paired-preference setting. The best β varies sharply by model and algorithm: 0.01 works best for Zephyr, while OpenHermes favours 0.6, 0.3 and 0.01. That makes β tuning essential. KTO remains attractive because it only needs thumbs-up/down labels rather than paired preferences, and configs and sweep scripts are published in the alignment-handbook.
Related posts
- Fine-tune Llama 2 with DPO
Hugging Face hardMasterDirect Preference Optimization (DPO) replaces the reward-model and RL steps of RLHF with a simple binary cross-entropy loss over preference pairs, using a frozen reference model to provide an implicit reward. With TRL's DPOTrainer, data is formatted as prompt/chosen/rejected triples and training is controlled by a beta temperature, typically 0.1 to 0.5. The walkthrough fine-tunes Llama 2 7B on the stack-exchange preference dataset: first SFT with QLoRA (4-bit NF4 plus LoRA adapters), then DPO using the SFT model as both policy and reference. Progress is monitored with logged reward metrics (chosen, rejected, accuracies, margins), where margins should grow and accuracies should approach 1.0.
- Fine-tuning open LLM judges to outperform GPT-5.2
Together AI mediumAdeptDPO fine-tuning open-weight LLM judges on RewardBench 2 preference data lets them match or beat GPT-5.2 at agreeing with human preference labels. GPT-OSS 120B was trained with LoRA on 5,407 preference pairs built from ~1,500 examples (beta 0.1, LR 5e-6, 3 epochs, ~1.5 hours) and rose from 57.91% to 62.63% accuracy, against GPT-5.2's 61.62%, at about 15x lower cost and 14x higher throughput. Qwen3 235B already beat GPT-5.2 at baseline (62.63%) but dropped slightly to 61.28% after DPO. Category analysis shows Safety and Factuality are easy for judges while Focus and precise instruction following remain hard, and high tie counts point to positional bias.
- Vision Language Model Alignment in TRL ⚡️
Hugging Face hardMasterTRL adds vision language model support for several alignment methods. New are Mixed Preference Optimization (MPO), Group Relative Policy Optimization (GRPO) and its sequence-level variant GSPO, alongside multimodal RLOO, Online DPO and native SFTTrainer support. MPO is implemented in DPOTrainer as a weighted combination of DPO sigmoid, BCO and SFT losses, which the MPO paper reports gives a 6.2-point MathVista gain. GRPO uses custom format and accuracy reward functions. GSPO is enabled through GRPOConfig with sequence-level importance sampling, which is mainly useful for MoE models. Code snippets show each trainer config, and a vibe-check comparison on Qwen2.5-VL-3B shows the GRPO and GSPO runs reaching the correct geometry answer where the base and MPO models do not.
- Preference Optimization for Vision Language Models
Hugging Face hardMasterTRL now supports direct preference optimization (DPO) for vision language models, trained on chosen/rejected answer pairs rather than fixed labels. A walkthrough fine-tunes Idefics2-8b on the RLAIF-V dataset, formatting image-plus-question prompts with the processor's chat template. Full float32 DPO training would need about 160 GB (policy, reference model, gradients, AdamW states), but bfloat16 plus LoRA cuts trainable parameters to 55M and memory to roughly 32 GB. Batch size 2 with 32 gradient accumulation steps and gradient checkpointing fits activations, and training is judged by rising accuracy and reward margin.
- Theoretical Limits of Language Model Alignment
Apple Machine Learning Research hardMasterThe maximum expected reward gain achievable under a fixed KL-divergence budget in KL-regularized language model alignment has a closed form governed by a Jeffreys divergence term, not the √KL used in prior analyses. Rewritten as a covariance under the base model, it gives an estimator that predicts achievable alignment gains from base model samples alone. With proxy rewards, the gap from ideal alignment (reward hacking) grows with reward error and with smaller KL penalties, and reward ensembling provably mitigates it. On safety and summarization tasks, best-of-N comes close to the theoretical KL–reward frontier while PPO and GRPO fall well short, which suggests better algorithms are needed to reach optimal alignment without high inference costs.