Intuition The one core idea
We cannot write down a formula for "a good answer", but a human can point to the better of two answers. Reward modeling turns that pointing into a learned scoring function — a number the machine attaches to any answer — so that the answer humans prefer always gets the higher number.
This page assumes nothing . Every symbol in the parent note — r θ , σ , Δ , E , log , KL , even the little ≻ — is built here from the ground up, in the order you need to meet them. If a symbol scared you in the parent note, it will not after this.
Reward modeling has exactly four "nouns". Meet them first as pictures, then we'll name them.
Definition The four nouns
Prompt x — the question or instruction given to the AI ("Write a birthday card").
Response y — an answer the AI produced for that prompt.
A pair of responses y w and y l — two answers to the same prompt, where a human decided one is better.
A score — a single number saying "how good is this answer".
Everything else on this page is just notation for these four things, or machinery for turning "human picked y w " into "make the score of y w bigger".
Intuition What a subscript
is
A subscript is a tiny label hanging off a letter, like a name tag. y w is not "y times w " — it is "the y that is the w inner". The little w is a word ("winner"), squashed small.
Symbol
Read it as
Picture
x
"the prompt"
the question box
y
"a response"
one answer bubble
y w
"the winner response"
the answer the human chose
y l
"the loser response"
the answer the human rejected
Why the topic needs this: the whole dataset is triples ( x , y w , y l ) — "for this prompt, this beat that". No winner/loser distinction, no way to learn preference.
≻ means "is preferred to"
y w ≻ y l reads "y w is preferred to y l " . It is a comparison arrow for quality , exactly like > is for numbers — but here it compares whole answers, not numbers.
≻ is just > ."
Why it feels right: it looks like a fancy greater-than.
The fix: > compares two numbers (5 > 3 ). ≻ compares two things a human judged (y w ≻ y l ). Our job is exactly to build a number that lets us replace ≻ with an honest > .
This is the star of the show. Let's dismantle it piece by piece.
Definition What a function is
A function is a machine: put something in, get exactly one thing out. Write f ( input ) = output . Here the machine eats a prompt-and-answer pair and spits out one number .
r θ ( x , y )
r — the letter for reward (the score).
( x , y ) — the two inputs: the prompt x and a response y . Both go in together.
the subscript θ — the Greek letter theta . It stands for all the tunable knobs (the parameters ) inside the machine. Turning the knobs changes what scores come out.
So r θ ( x , y ) = "the score my machine (with its current knob settings θ ) gives to answer y for prompt x ."
θ is written as a subscript
We put θ below r to say "this reward function depends on the knobs, and we are going to learn those knobs from data." Training = searching for the θ that makes the machine agree with humans.
∈ R — "is a real number"
The parent writes r θ ( x , y ) ∈ R . The symbol ∈ means "belongs to", and R (a blackboard-bold R) is the set of all ordinary numbers on the number line — positive, negative, fractions, zero, everything. So the phrase just means: the output is one plain number , and it may be negative. Nothing exotic.
Why the topic needs this: the reward model is literally this function. Learning to score = learning the knobs θ .
Before the loss, we need to convert "the winner scored Δ more than the loser" into "the chance a human picks the winner". That converter is σ .
A probability is a number between 0 and 1 : 0 = never happens, 1 = certain, 0.5 = coin flip. We want the chance a human prefers the winner.
Definition The sigmoid function
σ
σ ( z ) = 1 + e − z 1
σ (Greek "sigma") is just a name for this S-shaped machine.
e is a fixed number, about 2.718 , the "natural growth" constant. e − z means "e raised to minus z ".
What it does: takes any number z (from − ∞ to + ∞ ) and squashes it into the open interval ( 0 , 1 ) .
this machine and not a straight line?
We need something that (1) always lands in [ 0 , 1 ] so it's a valid probability, (2) rises smoothly, and (3) is symmetric — being ahead by 2 should feel as confident as being behind by 2 feels doubtful. Look at the S-curve: at z = 0 it passes through exactly 0.5 (a tie → coin flip); big positive z → near 1 (winner almost surely chosen); big negative z → near 0 . A straight line would shoot past 1 and below 0 — nonsense as a probability. That is why the sigmoid, not a line.
This σ is the exact same curve used in Logistic regression ; a reward model's loss is a logistic loss on the score difference.
Δ (Greek "delta") means "the difference"
The parent sets Δ = r w − r l , where r w = r θ ( x , y w ) and r l = r θ ( x , y l ) .
Δ > 0 : winner scored higher → model is right .
Δ < 0 : loser scored higher → model is wrong .
Δ = 0 : exact tie → model is undecided, σ ( 0 ) = 0.5 .
Intuition Why only the difference, never the raw scores?
σ ( r w − r l ) contains only r w − r l . If you add the same constant c to both scores, the difference is unchanged, so the probability is unchanged. This is the reason the parent insists "absolute reward is meaningless — only relative reward, per prompt." The picture: slide both scores up the number line together and their gap doesn't move.
log ( p ) answers: "what power do I raise the base to, to get p ?" In ML the base is e (natural log). Key facts you only need visually:
log ( 1 ) = 0 (certain outcome → zero surprise).
log ( small p ) → − ∞ (rare outcome → huge surprise).
log of a product = sum of log s (so many examples add up nicely).
− log of the probability?
We want a loss : a number that is small when the model is right and large when it's wrong . The model's own probability of the correct choice is σ ( Δ ) . Feeding that into − log gives: prob near 1 → loss near 0 (great, nothing to fix); prob near 0 → loss shoots up (terrible, fix hard). That flipped, exploding shape is precisely the punishment schedule we want. That is why − log σ ( Δ ) is the loss.
E
E ( x , y w , y l ) [ ⋯ ] reads "the average of ⋯ over all preference examples in the data." The subscript names what we average over. It is nothing more than "add the loss for every example and divide by how many there are."
Why the topic needs it: one example is noisy; we train on the average loss across the whole dataset so the knobs θ fit the general pattern, not one lucky pair.
These appear only in the usage stage (feeding the RM into RLHF via PPO ). Meet them lightly so the parent's final equation isn't a wall of Greek.
π
π (Greek "pi", not the number) is the policy : the AI's rule for choosing responses. π ϕ is the policy with its own knobs ϕ (Greek "phi"). π ref is a frozen reference copy we compare against.
KL ( π ϕ ∥ π ref ) is a number measuring how far the new policy has drifted from the reference. 0 = identical; bigger = more different. Think of it as a rubber band: pull too far and it tugs back. Full detail lives in KL divergence .
β — the leash tightness
β (Greek "beta") is a dial: how strongly the KL rubber band pulls. Big β = stay very close to the reference; small β = roam free.
Intuition Why any leash at all?
The reward model r θ is a proxy , not truth. Chase it too hard and the policy finds answers the RM loves but humans hate — Goodhart's law / reward hacking. The KL leash keeps the policy in the region where the RM was trained and is trustworthy. (This exact tug-of-war is what DPO Direct Preference Optimization later folds into a single loss.)
Function r_theta scores a response
Preference pair y_w beats y_l
Difference Delta = r_w minus r_l
Sigmoid squashes Delta into a probability
Bradley-Terry preference model
Minus log makes small-when-right loss
Pairwise reward-model loss
Expectation averages over all data
Use r_theta with a KL leash in RLHF
Read it top to bottom: the four nouns (top) build the score, the score builds the difference, the difference plus sigmoid builds a probability, − log plus averaging build the loss, and the trained reward finally drives the policy under a leash.
Worked example Sigmoid of a small difference
Let Δ = 1.5 . Then σ ( 1.5 ) = 1 + e − 1.5 1 . Since e − 1.5 ≈ 0.2231 , we get σ ( 1.5 ) ≈ 1.2231 1 ≈ 0.8176 .
Reading it: the model thinks there's an ≈ 82% chance a human picks the winner — confident and correct.
Worked example The reflection identity in numbers
σ ( − 1.5 ) = 1 − σ ( 1.5 ) ≈ 1 − 0.8176 = 0.1824 . And directly 1 + e 1.5 1 = 1 + 4.4817 1 ≈ 0.1824 . They match — proving σ ( − z ) = 1 − σ ( z ) .
Worked example The loss for a confident-correct pair
With Δ = 1.5 : loss = − log σ ( 1.5 ) = − log ( 0.8176 ) ≈ 0.2014 . Small loss for a correct call — exactly what a loss should do.
θ and ϕ are the same knobs."
Why it feels right: both are Greek subscripts for parameters.
The fix: θ = the reward model's knobs (learned once, then frozen ). ϕ = the policy's knobs (learned later against the frozen reward). Two separate machines, two separate knob sets.
e − z means multiply e by − z ."
Why it feels right: they're written side by side.
The fix: e − z is e raised to the power − z (repeated growth), not a product. At z = 0 it's e 0 = 1 ; growing z shrinks e − z toward 0 , which is why σ climbs toward 1 .
Self-test: cover the right side and answer each. If any stumps you, reread its section above.
What does the subscript w in y w stand for, and is it multiplication? It means "winner" (the preferred response); it is a label, not multiplication.
What single object does r θ ( x , y ) output? One real number — the score of response y for prompt x , given the current knobs θ .
What does ∈ R tell you about that output? It is an ordinary real number and may be negative.
What is the sigmoid σ ( z ) and what range does it output? σ ( z ) = 1/ ( 1 + e − z ) ; it squashes any number into the interval ( 0 , 1 ) .
Why is a sigmoid used instead of a straight line to make a probability? A line would leave [ 0 , 1 ] ; the sigmoid always stays a valid probability, is symmetric, and gives 0.5 at a tie.
What does Δ equal and what does its sign mean? Δ = r w − r l ; positive means the model ranks the winner higher (right), negative means wrong.
State the reflection identity of the sigmoid. σ ( − z ) = 1 − σ ( z ) .
Why take − log of the correct-choice probability? To build a loss that is near zero when the model is confident-correct and explodes when it is wrong.
What does E ( x , y w , y l ) [ ⋅ ] do? Averages the quantity over all preference examples in the dataset.
What is the difference between θ and ϕ ? θ = reward-model knobs (frozen after training); ϕ = policy knobs (trained later against the reward).
In one line, what does the KL term with β do in RLHF? It leashes the policy near a frozen reference so it can't exploit regions where the reward model is wrong.
Recall One-breath summary of the foundations
Four nouns (prompt x , response y , winner y w , loser y l ) → one scoring machine r θ with knobs θ → a difference Δ = r w − r l → squash it with σ into "chance the human picks the winner" → punish with − log → average with E → that is the reward-model loss. Later, use the frozen r θ to steer a policy π ϕ , held on a KL leash of strength β .