TL;DR
Aligning a language model means training it to produce answers people like. The usual methods need pairs: for one prompt, which of two answers is better. KTO (Ethayarajh and colleagues, 2024) needs only a label on each single answer, desirable or undesirable. It scores each answer with a value function borrowed from Prospect Theory, which weighs losses more heavily than gains. The paper reports that KTO matches or exceeds DPO on the same underlying data at scales from 1 billion to 30 billion parameters, and that it still works when the desirable and undesirable answers are very unequal in number.
Builds on: Prospect Theory, DPO · Leads to: none yet in this graph
Why it mattered
The paper changes what kind of feedback an alignment method needs. Methods such as RLHF and DPO were built on preference pairs, which the authors call relatively scarce and expensive to collect. KTO shows that a binary label per answer can produce a model as good as one trained on pairs. On the paper's Zephyr experiment, the KTO model scores 53.5 on GSM8K, a grade-school maths benchmark, against 40.0 for the DPO model trained on the same data. The paper's main claim is that thumbs-up and thumbs-down data are more plentiful and cheaper than comparisons, so this makes alignment easier to scale.
The paper also gives a theory of why DPO works. It argues that DPO and PPO-based methods contain some of the biases of prospect theory in their loss functions, and it names the family of losses that do this human-aware losses (HALOs). KTO is the member of this family that uses the value function from prospect theory directly.
The problem
Before KTO, the standard path had three stages. A pretrained model is first fine-tuned on examples of good answers, which is called supervised fine-tuning (SFT). Then either a Reward Model is trained on preference pairs and used in reinforcement learning, as in RLHF, or DPO is applied to the pairs directly. Both need comparisons: the model is shown two answers to the same prompt and told which one people chose.
Comparisons are expensive, because a person must read two answers and judge between them. Binary labels are cheaper, but the standard methods cannot use them well, and when a dataset has many more good answers than bad ones (or the reverse), the pairing structure breaks down. The question the paper asks is whether a method can learn from the single labels directly, and whether it can do this without losing quality. The answer it proposes is to model human utility the way prospect theory does, with a reference point and an asymmetric response to gains and losses, and to use that utility as the training objective.
How it works
Take one prompt with two answers, both labelled by a person. Answer is labelled desirable, and answer is labelled undesirable. The model is being trained from a reference model . Use and so the numbers stay simple. The paper's default is .
- Score each answer against the reference. For the desirable answer, the model's log-probability minus the reference's gives . For the undesirable answer, . Check: positive means the model has become more likely to produce that answer than the reference was.
- Set the reference point. is the KL divergence between the model and the reference over possible answers, a measure of how far the whole output distribution has moved. In this example . Check: is one number shared by all answers for this prompt, and it is not trained through.
- Measure the gap from the reference point. For the desirable answer, the gap is . For the undesirable answer, the gap, measured in the other direction, is . Check: both gaps are positive when the answer is moving the right way.
- Turn the gap into value with a saturating curve. Apply the sigmoid, which flattens for large gaps. The desirable answer gets . The undesirable answer gets . Check: each value is between 0 and 1, and each is multiplied by its weight , which is 1 here.
- Turn value into loss. The loss for each answer is , where is the value from step 4 and is a constant that keeps the loss non-negative. The desirable answer's loss is . The undesirable answer's loss is . Check: the loss is lower when the value is higher.
- Update the model. Training pushes the model's log-probability up for the desirable answer and down for the undesirable one, with a size that depends on how far that answer is from the reference point. Check: the update moves in the direction that raises the desirable answer's value and lowers the undesirable one's.
flowchart LR A["Labelled answer y, desirable or undesirable"] --> R["r = log(pi / pi_ref)"] Z["Reference point z0 = KL from reference"] --> G["Gap z = r - z0, signed by label"] R --> G G --> S["Sigmoid value v, weighted by lambda"] S --> L["Loss = lambda - v"]
The curve that step 4 uses is the sigmoid, which is smooth and bounded. The desirable answer's value rises with the gap, and the undesirable answer's value rises as the gap moves the other way:
- desirable: sigma(z)
- undesirable: 1 - sigma(z)
The math
For a dataset of prompts and single answers, each with a binary label, the KTO loss is , where
and or according to the label.
Here is the sigmoid, controls how fast the value saturates, and the values set how strongly each label counts. The symbol is the KL divergence, a measure of how far the model's whole output distribution has moved from the reference, which the paper calls the reference point. The paper does not backpropagate through , so it acts as a fixed offset that controls saturation.
Steps 1 and 2 in symbols: the log-ratio and the reference point
is the log of the ratio of the two probabilities. It is positive when the model gives more probability than the reference does. In the example, for the desirable answer, so the model has moved toward it. is an average over all answers, not a single number per answer, which is why the paper calls it a reference point rather than a baseline for one answer.
Steps 3 and 4 in symbols: the gap and the value
For a desirable answer the gap is , and the value is . For an undesirable answer the gap is , and the value is . In the example with , and . Both values are below 1, which is the saturation the definition is built for.
Steps 5 and 6 in symbols: the loss and its gradient
The loss for one labelled answer is . Its gradient with respect to the model parameters is
where for a desirable answer and for an undesirable one. The factor is the slope of the sigmoid at the current gap. It is largest near zero and small when the value has saturated. So an answer that is already far from the reference point gets a small update.
Choosing the weights
The paper recommends setting and so that , where and count the desirable and undesirable examples. If there are ten times as many undesirable examples as desirable ones, with , the rule gives .
Set , and . A desirable answer has , meaning the model gives it the same probability as the reference.
- The gap is .
- The value is .
- The loss is .
Interpretation: when the model has not moved, the loss for a desirable answer is 0.5, the midpoint. Training will push up and lower this loss.
Suppose a dataset has desirable and undesirable examples. The paper's rule asks for . Take .
- The ratio is .
- To keep the ratio at least 1, .
- To keep it at most 1.5, .
- Choose . The ratio is , which is inside the interval.
Interpretation: the single desirable example is weighted 12 times as heavily as an undesirable one, so the rare good answers are not drowned out by the many bad ones. This is the setting the paper uses to handle unequal data.
Results
Against DPO on the same data. The paper's Figure 3 compares SFT+KTO with SFT+DPO at scales from 1B to 30B parameters and finds them competitive, with KTO alone better than DPO alone for the Llama models at 7B, 13B and 30B. The gap is reported as significant at 7B and 30B. Among the Pythia models there is no significant difference, which the authors read as a sign that a minimum model size is needed for the difference to appear.
Zephyr-β-SFT on UltraFeedback (Table 2, top). The paper trains for one epoch on the UltraFeedback preference data. KTO scores 58.6 on MMLU, 53.5 on GSM8K, 30.9 on HumanEval and 52.6 on BBH. DPO scores 58.2, 40.0, 30.1 and 44.1. Even when KTO sees only one of the two answers per prompt, it scores 58.0, 50.0, 30.7 and 49.9, which still beats DPO on the same prompts, despite halving the number of examples.
The paper aligns Mistral-7B on OpenAssistant. Each score is a win rate against the SFT target.
- Unaligned Mistral-7B: 0.525.
- Mistral-7B with DPO on paired data: 0.600.
- Mistral-7B with KTO on one answer per prompt, which cuts the training data by 72%: 0.631.
- Mistral-7B-Instruct, the official tuned model: 0.621.
- The difference between KTO on one answer per prompt and DPO is , or 3.1 points.
Interpretation: with less than a third of the data in the paired form, the KTO model still wins more often than the DPO model, and it also beats the official instruction-tuned model in the paper's setting.
Try it: on Zephyr (Table 2), KTO scores 53.5 on GSM8K and DPO scores 40.0. How many points higher is KTO? Answer: points.
The design choices matter (Table 2, middle). Removing the reference point costs 3.6 points on BBH and 4.0 on GSM8K. Replacing the asymmetric curve with a concave one, as DPO does, costs 9.4 points on BBH and 11.0 on GSM8K. A risk-neutral identity value collapses BBH performance to 6.1.
Limits. The paper finds no single loss that is best everywhere; the right one depends on the inductive biases a task needs. The loss-aversion weights trade off against each other: should follow the data imbalance, and a poor choice reduces performance on some tasks. A memory-saving variant that drops the reference model works, but is more sensitive to and trails standard KTO. The authors recommend KTO when feedback is binary or the classes are unbalanced, and say that the choice is less clear when the data already comes as preference pairs.
Reading guide
- Abstract and Section 1 (Introduction): the claim that alignment methods carry prospect-theory biases, and the headline results. Needs Prospect Theory.
- Section 2 (Background): the three training stages and the RLHF and DPO objectives. Needs Reward Model, Kullback–Leibler Divergence and DPO.
- Section 3.1 (Prospect Theory): the value function and its parameters and from the original experiments. Needs Prospect Theory and Loss Aversion.
- Sections 3.2 and 3.3 (HALOs): the family of losses and the comparison with non-HALO methods. Needs Bradley–Terry Model for the pairwise preference model.
- Section 4.1 (Derivation): the KTO loss, step by step as in this lesson. Needs Sigmoid Function and Kullback–Leibler Divergence.
- Sections 4.2 and 4.3 (Hyperparameters and Experiments): the choice of , and , and the tables. Needs the worked examples above.
- Sections 4.4 and 4.5 (Theory and when to use which): the explanation of why KTO matches DPO, and the guidance on choosing between them.
Check yourself
QuestionRecall: what does KTO need from its training data, compared with DPO?Show answer
KTO needs one binary label on each answer, desirable or undesirable. DPO needs pairs in which one answer is preferred over another for the same prompt.
QuestionWith , , and , what is the loss for a desirable answer?Show answer
The gap is . The value is . The loss is .
QuestionWhy does the paper set so that lies between 1 and 1.5 when the data is unbalanced?Show answer
Without the weights, the many examples of the more common label would dominate training and the rarer label would be ignored. Setting the weights to match the counts makes each label contribute in proportion to its importance, which the paper finds works best in its experiments.
QuestionA team has 50,000 thumbs-up and thumbs-down labels, but no pairs. Which method should they try first, and why?Show answer
KTO, because it needs only single labels. DPO would require the team to build pairs for the same prompts, which the data does not contain. The paper's results suggest KTO can match DPO on comparable data, so it is a reasonable first choice.
QuestionApplied scenario: a team removes the reference point from KTO to save a step. What should they expect?Show answer
A drop in performance. The paper's ablation removes and finds a 3.6-point drop on BBH and a 4.0-point drop on GSM8K, so the reference point is worth keeping unless the memory saving is essential.