---
title: "Preference Tuning LLMs with Direct Preference Optimization Methods"
description: "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."
url: "https://swe.quest/articles/preference-tuning-llms-with-direct-preference-optimization-methods-6edec5434e6d7272"
canonical: "https://huggingface.co/blog/pref-tuning"
source: "Hugging Face"
published: "2024-01-18"
difficulty: "hard"
kind: "Research"
reading_minutes: 9
tags: ["model-training","llms","evals"]
---

# Preference Tuning LLMs with Direct Preference Optimization Methods

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-01-18, 9 min read, Research. Original: [https://huggingface.co/blog/pref-tuning](https://huggingface.co/blog/pref-tuning)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)

## Prerequisites

- LLM fine-tuning ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- RLHF basics ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- preference datasets

## Keywords

DPO, IPO, KTO, TRL, MT-Bench, alignment-handbook, Zephyr, OpenHermes-2.5-Mistral-7B

## Related posts

- [Fine-tune Llama 2 with DPO](https://swe.quest/articles/fine-tune-llama-2-with-dpo-68d2e917aae1caca.md): Hugging Face · 2023-08-08 · Hard · 7 min read · Model training, LLMs, Python
  Direct 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.
- [Fine-tuning open LLM judges to outperform GPT-5.2](https://swe.quest/articles/fine-tuning-open-llm-judges-to-outperform-gpt-5-2-fdf1c14f4206aa6b.md): Together AI · 2026-02-02 · Medium · 10 min read · Evaluation, Model training, LLMs
  DPO 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.
- [Vision Language Model Alignment in TRL ⚡️](https://swe.quest/articles/vision-language-model-alignment-in-trl-e64e05c10318c68f.md): Hugging Face · 2025-08-07 · Hard · 12 min read · Model training, LLMs, Computer vision, Python
  TRL adds vision language model support for several alignment methods.
- [Preference Optimization for Vision Language Models](https://swe.quest/articles/preference-optimization-for-vision-language-models-a84799e96613bf21.md): Hugging Face · 2024-07-10 · Hard · 11 min read · Model training, Computer vision, LLMs, Python
  TRL now supports direct preference optimization (DPO) for vision language models, trained on chosen/rejected answer pairs rather than fixed labels.
- [Theoretical Limits of Language Model Alignment](https://swe.quest/articles/theoretical-limits-of-language-model-alignment-e28a89a4657d0f90.md): Apple Machine Learning Research · 2026-11-12 · Hard · 1 min read · AI safety, Model training, LLMs
  The 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
