Resources/Model training/Training methods

Metric

Preference accuracy

Preference accuracy is the share of pairs for which the model now gives the preferred answer a higher implicit reward than the non-preferred one, relative to where it started. It begins near 50% and rises as the preference is learned.

Chapter 73 min read4 references

What it is

Some trainers report, next to the DPO loss, a number usually called preference accuracy (Hugging Face TRL logs it as rewards/accuracies). For each pair it asks a yes-or-no question: does the model now rank the preferred answer above the non-preferred one, once each is compared with the reference model? The reported value is the share of pairs where the answer is yes.

How it is computed

Recall DPO's implicit reward: β times the log of how much more likely the trained model finds an answer than the reference does. Each pair has two, one per side, and the margin is the chosen reward minus the rejected one.

Per pair, then averaged
margin   = reward(chosen) − reward(rejected)
correct  = margin > 0
accuracy = (pairs with margin > 0) ÷ (all pairs)

At the very first step the trained model equals the reference, so every margin is exactly 0. In the first updates the margins are tiny and nearly random in sign, so accuracy hovers around 50%: a coin flip. As training proceeds the margins spread out, and if the pairs are teaching something, most of them move to the right of zero.

WRONG WAYRIGHT WAYStep 0all 20 pairs: margin 0After trainingaccuracy = 16 ÷ 20 = 80%
Each dot is one pair, placed by its implicit reward margin (preferred minus non-preferred, relative to the reference). At the start every margin is 0. After training, the share of dots right of zero is the preference accuracy: here 16 of 20, or 80%.
Ten pairs, two numbers
  1. After one epoch, ten pairs have margins of 0.9, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, −0.1 and −0.3.
  2. Eight are above zero, so preference accuracy is 8 ÷ 10 = 80%.
  3. The average margin is 2.65 ÷ 10 = 0.265: positive, but modest.
  4. Now picture a run where all ten margins are 0.02. Accuracy is 100%, yet the loss is still 0.68: every pair is ranked right by a whisker. Accuracy counts winners; the loss and the margin say by how much.

Reading it with the loss

AccuracyLossReading
About 50%About 0.69Nothing learned yet, or the pairs are too subtle for the model to separate.
Rising steadilyFalling steadilyThe healthy pattern: the model is learning the preference.
100% earlyNear 0The pairs are easy, or memorised. Check their variety and difficulty; consider fewer epochs or a higher β.
HighStill near 0.6Pairs ranked right, but by tiny margins: the model has barely moved.
Below 50%Above 0.69The model is learning the opposite. Check for swapped labels.

Expect the curve to be jumpy. Accuracy is often logged per batch, and a batch of 8 pairs can only score 0%, 12.5%, 25% and so on, so single readings swing widely. Look at the trend over many steps, or at the per-epoch value, rather than any one point. With very few pairs overall, a handful of pairs flipping sign moves the number a lot without meaning much.

What it does not measure

Preference accuracy is computed on your pairs, whose answers were already written. It never looks at what the model writes now. A 2024 study measured a related number (whether a model gives the better answer the higher likelihood outright, without a reference) and found that most state-of-the-art preference-tuned models do so less than 60% of the time on common preference datasets, partly because DPO struggles to fix even mild ranking errors the starting model already made. A high number on your training pairs shows the run worked mechanically; it is not a measure of answer quality.

If accuracy is also reported on held-back pairs, that number is more informative than the training one, because it shows whether the preference carries over to pairs the model was not trained on. The final word still belongs to an evaluation in which the model writes its own answers.

Common mistakes

  • Reading 100% training accuracy as success. With few or easy pairs it is expected, and can mean memorising.
  • Reading accuracy without the loss or margin: right by a whisker and right by a mile both count as correct.
  • Comparing accuracy across datasets. Harder, subtler pairs naturally give lower numbers.
  • Treating it as an evaluation. It never looks at answers the model writes.

References and further reading

External sources open in a new tab.

  1. 01DPO TrainerHugging Face TRL docs · huggingface.coDefines rewards/accuracies and rewards/margins as logged during DPO training.
  2. 02Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafailov et al., 2023 · arXiv · arxiv.orgWhere the implicit reward behind this metric comes from.
  3. 03Preference Learning Algorithms Do Not Learn Preference RankingsChen et al., 2024 · arXiv · arxiv.orgHow often preference-tuned models actually rank the better answer higher, and why DPO rarely fixes existing ranking errors.
  4. 04Zephyr: Direct Distillation of LM AlignmentTunstall et al., 2023 · arXiv · arxiv.orgPerfect training accuracy after one DPO epoch, and what it did and did not mean for the final model.

Turn weeks of expert work into minutes

See how Scalata fits your team, your data, and your controls.

Contact Sales