What ORPO is
The usual recipe has two stages: SFT teaches a base model to answer, then preference tuning such as DPO teaches it which answers are better, against a frozen copy of the SFT model. ORPO (odds-ratio preference optimisation) does both in one loss, with no reference model and no separate SFT stage. It is SFT on the chosen answer plus a small penalty whenever the rejected answer looks as likely as the chosen one:
Hong et al. motivate it with an observation about SFT. Trained only on chosen answers, a model also raises the probability of rejected answers in the same style, because nothing in the loss tells them apart. A mild penalty on the disfavoured answers, they argue, is enough to steer SFT itself.
This page runs ten real updates of TRL's ORPOTrainer from the base SmolLM2-135M, with and a learning rate of , on the DPO tab's eight UltraFeedback pairs. The base model has no chat template, so the pairs use SmolLM2-135M-Instruct's, which shares its vocabulary; the Starting from the base model panel shows the prompt as the model reads it.
Odds, not probabilities
ORPO compares answers by their odds. Let be the answer's geometric-mean token probability, the exponential of its average token log-probability, so that answers of different lengths compare fairly. Then
The Odds, not probabilities table shows each answer's average log-probability, , the odds and the log odds, then the log odds ratio (chosen minus rejected) and the pair's term . That term is near 0 once the chosen answer's odds are clearly ahead, so a pair that is already ranked right stops pulling. While the rejected answer's odds are ahead, the term grows roughly linearly.
Differentiating, with :
The first factor fades as the chosen answer pulls ahead. The factor gives more weight to an answer the model already finds likely, chosen or rejected.
One loss, two terms
One loss, two terms splits the batch loss. The SFT term is the cross-entropy that TRL's ORPOTrainer averages over every token of the prompts and the chosen answers; the page also gives its value over the answers alone. Over the ten steps the SFT term falls from 4.880 to 3.674, and times the mean odds-ratio term from 0.077 to 0.056, so the total goes from 4.957 to 3.731. At the SFT term carries most of the loss: ORPO is fine-tuning with a preference penalty attached, and Both terms over 10 steps charts the two.
The penalty still does its job. The mean log odds ratio rises from 0.079 to 0.463, as Log odds ratio of every pair shows pair by pair, against a tick at step 0. Recomputed one sequence at a time, the loss matches TRL's log to .
What ten updates did
The token strips shade each answer's tokens by the change in log-probability since step 0, and the chart below them follows the selected pair's average log-probabilities. On average both answers become more likely: by the tenth step, as TRL logged it, the chosen answers' average log-probability per token had risen from −2.88 to −2.32 and the rejected ones' from −2.96 to −2.71. The SFT term teaches the template and the answer style to a model that has never seen them, which lifts both. The chosen answers, which the SFT term trains on directly and the odds-ratio term favours, rise faster. The greedy answer changed for 7 of the 8 prompts. The page warns that ten updates on eight pairs are far from a full ORPO run, which trains on a whole preference set for epochs.
Where ORPO came from
ORPO (Hong, Lee and Thorne, 2024) is one of several methods that drop DPO's reference model (see the DPO tab). SimPO (the SimPO tab) keeps a separate preference stage but uses the average log-probability directly as its reward. CPO pairs a reference-free preference term with an SFT loss, much as ORPO does. Hong et al. fine-tuned Phi-2, Llama-2 and Mistral with ORPO on UltraFeedback alone and report that they surpass larger state-of-the-art models on AlpacaEval 2.0, IFEval and MT-Bench. Because it needs no SFT stage and no reference copy, ORPO trains one model where DPO holds two, the policy and its reference.
Papers
- ORPO: Monolithic Preference Optimization without Reference Model Introduces ORPO: SFT plus an odds-ratio penalty between chosen and rejected answers, in one stage and with no reference model.
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model DPO, the reference-based preference loss ORPO replaces (see the DPO tab).
- UltraFeedback: Boosting Language Models with Scaled AI Feedback The source of the eight preference pairs this page trains on.
- SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model SmolLM2-135M, the base model ORPO starts from here, and the instruct model whose chat template the pairs use.
- Contrastive Preference Optimization: Pushing the Boundaries of LLM Performance in Machine Translation CPO: another reference-free preference loss combined with SFT, from the same period.