Papers · Reinforcement learning and alignment · 2023
Direct Preference Optimization: Your Language Model is Secretly a Reward Model
The notation of the DPO paper, explained: its 33 displayed equations, then every symbol it uses, grouped by category and shown the way the paper writes it.
Reading this paper
DPO: fine-tune a language model on human preferences directly, with a classification-style loss, instead of training a reward model and running reinforcement learning.
is the model being trained and the frozen starting model. reads "for prompt , the answer (the winner) is preferred to (the loser)". sets how far may move from , is the logistic sigmoid, and is a normalizing constant that cancels out, which is the trick that makes the method work.
Read from arXiv's HTML version: 33 displayed equations and 101 pieces of inline math. 40 symbols and constructs from the catalog.
The paper's displayed equations
Open any of them in the decoder for a symbol-by-symbol reading.
- (1)Decode →
- (2)Decode →
- (3)Decode →
- (4)Decode →
- (5)Decode →
- (6)Decode →
- (7)Decode →
- Decode →
- (8)Decode →
- (9)Decode →
- (10)Decode →
- (11)Decode →
- (12)Decode →
- Decode →
- Decode →
- (13)Decode →
- (14)Decode →
- (15)Decode →
- (16)Decode →
- (17)Decode →
- Decode →
- (18)Decode →
- (19)Decode →
- (20)Decode →
- (21)Decode →
- (22)Decode →
- Decode →
- Decode →
- Decode →
- Decode →
- Decode →
- Decode →
- Decode →
Famous equations in this paper
Symbols, by category
Most used first. The examples are written as the paper writes them.
Notation conventions
- , ,
Italic letters (variables) 818 uses
A plain italic letter is a variable; conventions say what kind (x input, y target, W weights…).
- , ,
Subscript (index or label) 321 uses
A subscript picks an element (xᵢ), a time step (h_t), a named copy (W_q), or the parameters (p_θ).
- , ,
Star (optimal) 49 uses
As a superscript, the optimal value: θ* is the best θ. Between two terms, convolution.
Dataset (𝒟) 24 uses
The dataset: usually N input-label pairs.
- , ,
Superscript in parentheses 13 uses
An index in a superscript: x⁽ⁱ⁾ is the i-th training example, W⁽ˡ⁾ the weights of layer l. Not a power.
- ,
Superscript (power or label) 12 uses
Usually a power (x² = x·x), but a capital or a word up there is often just a label (W^Q).
Loss (ℒ) 10 uses
The loss: the number training tries to make small. Also written L, J(θ) or ℓ.
Dots (ellipsis) 8 uses
“And so on”: continue the pattern.
Underbrace and overbrace 6 uses
A horizontal brace under or over part of a formula labels that part. It adds no math.
Hat (estimate) 5 uses
A hat marks an estimate or prediction: ŷ is the model’s guess for y.
Greek letters
Pi 225 uses
A policy π(a | s) in reinforcement learning, or the constant 3.14159…
Beta 99 uses
Usually a decay rate (Adam’s β₁, β₂), a shift parameter in normalization, or a weight on a loss term.
Theta 50 uses
The model’s parameters: all of its weights and biases, as one collection.
Tau 26 uses
A temperature that sharpens or flattens a softmax; in RL, a trajectory.
Phi 15 uses
The parameters of a second model (often the encoder q_φ), or a feature map φ(x).
Sigma (lowercase) 15 uses
Either the sigmoid function σ(z) = 1/(1+e⁻ᶻ) or a standard deviation. The context decides.
Alpha 2 uses
Often a learning rate or step size; also attention weights αᵢⱼ or a mixing weight.
Vectors and matrices
Q, K, V (query, key, value) 27 uses
In attention: queries Q, keys K and values V, each a matrix with one row per token.
Succeeds / PSD order 6 uses
For matrices, A ⪰ 0 means positive semidefinite; for outputs, y_w ≻ y_l means y_w is preferred.
- ,
Centre dot 2 uses
A dot product between vectors, plain multiplication between numbers, or an empty slot f(·).
Calculus and gradients
- , ,
Prime 28 uses
Either a derivative, f′(x), or simply "another one": x′ is a second sample, s′ the next state.
Nabla (gradient) 10 uses
The gradient: the vector of partial derivatives. ∇_θ L is how the loss changes with each parameter.
Probability and statistics
- ,
Given (conditional bar) 178 uses
“Given”: p(y | x) is the probability of y given that x is known.
Logarithm 69 uses
A logarithm, almost always the natural log (base e) in ML papers.
Exponential 50 uses
The exponential function eˣ, with e ≈ 2.718. Always positive.
Distributed as (tilde) 26 uses
“Is drawn from” or “is distributed as”: x ~ p means x is a sample from the distribution p.
- , ,
Expectation 22 uses
The expected value: the average of what is inside, weighted by the probabilities in the subscript.
Probability p(x) 16 uses
A probability or probability density; p is usually the true or model distribution, q an approximation.
- , ,
KL divergence 8 uses
How different distribution q is from p. Zero when they match; not symmetric.
Semicolon (parameterized by) 8 uses
In p(x; θ), the semicolon separates the variable x from fixed parameters θ.
Functions and operators
- , ,
Fraction 89 uses
Division: the top divided by the bottom.
- ,
Summation 18 uses
Add up the expression for every value of the index, from the bottom limit to the top.
- , ,
Max and min 9 uses
The largest (or smallest) value, over the arguments or over the range in the subscript.
Product 7 uses
Multiply the expression for every value of the index.
- ,
Arrow (maps to) 2 uses
Maps to (f: X → Y), tends to (x → 0), or implies (⇒).
Argmax 1 use
The input that makes the function largest, not the largest value itself.
Sets, shapes and definitions
- , ,
Set braces 8 uses
A set: a collection of items. {x | condition} is every x that satisfies the condition.
- ,
Inequalities 7 uses
Less than / greater than (or equal). ≪ means “much smaller than”.
Element of 5 uses
“Is in” or “belongs to”: x ∈ S says x is a member of the set S.
Not equal 1 use
The two sides are different.
1 thing the catalog has no entry for yet
-
D5
Formulas from arXiv's HTML version of the paper, © their authors; the explanations are this site's. Title and authors as arXiv lists them.
More reinforcement learning and alignment papers
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models (GRPO, 2024)
- Trust Region Policy Optimization (TRPO, 2015)
- High-Dimensional Continuous Control Using Generalized Advantage Estimation (GAE, 2015)
- Continuous control with deep reinforcement learning (DDPG, 2015)
- Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor (SAC, 2018)