Before you move a control in the demo, say what you expect to change.
Foundation reference
KTO: Alignment from Binary Feedback via Human-Aware Losses
KTO trains a language model on outputs labeled only as desirable or undesirable, rather than on paired comparisons. Ethayarajh et al. (2024) argue that such labels are cheaper and more plentiful than preference pairs.
Study guide
Where to start
Why is maximizing the likelihood of pairwise preferences, as DPO does, not the same as maximizing human utility?
How to study this pagePredict · Check · Generalize · Continue
Compare what the demo shows with the key equation and with the papers cited below.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
The newer notebook covers the same concept and has an interactive demo.
Why It Matters for Modern Models
- KTO trains a language model on outputs labeled only as desirable or undesirable, rather than on paired comparisons. Ethayarajh et al. (2024) argue that such labels are cheaper and more plentiful than preference pairs.
- Ethayarajh et al. (2024) report that KTO matches DPO even when up to 90% of the desirable examples are discarded, by reweighting the two classes with λ_D and λ_U.
- KTO, DPO and related losses can be compared as different implied models of human utility, so the choice of loss acts as an inductive bias (Ethayarajh et al., 2024).
- Because the sigmoid saturates, very easy, very hard or possibly mislabeled examples have little influence; the same property can make KTO underfit data that is hard but correct.
- Compared with DPO, KTO shows that pairwise preferences are not required: in the reported experiments, per-example binary labels with a suitable loss matched or exceeded DPO.
Questions to Think About
- What does the reference point z₀ do, and why does it stop the model from simply raising the likelihood of every desirable output?
- Why can saturating gradients make KTO more robust to noisy labels, and when does the same saturation cause underfitting?
- How much of alignment quality comes from the choice of objective rather than from the data, as KTO and binary classifier optimization (BCO) suggest?
- When is binary feedback (like or dislike) enough, and when are paired comparisons worth their extra cost?
Interactive Demo
Core Math
If you prefer intuition first, try the demo above, then come back for the math.
KTO aligns models using binary feedback (each output labelled desirable or undesirable) instead of pairwise comparisons. Its loss is built from a value function in the style of Kahneman and Tversky's prospect theory, and Ethayarajh et al. (2024) call losses of this kind human-aware losses (HALOs).
Implied reward (policy vs reference):
Reference point (baseline) as KL:
KTO loss with logistic value function:
where
In practice is estimated from mismatched pairs in the batch and is not backpropagated through.
Writing , the gradient carries a factor , which goes to zero when is large. Examples the model already finds very easy or very hard therefore contribute little; learning concentrates on examples near the reference point.