Reinforcement learning

rt=R(st,at)r_t = R(s_t, a_t) Reward r

rₜ is the reward received at step t; R(s, a) is the reward function that hands it out.

In ML papers

rtr_t is the reward: a single number the environment returns after an action, saying how good that step was. R(s,a)R(s, a) (sometimes R(s,a,s′)R(s, a, s') or r(s,a)r(s, a)) is the reward function that produces it. The agent's goal is to maximize the discounted sum of rewards, the Return G.

In RLHF, the reward comes from a learned reward model rϕ(x,y)r_\phi(x, y) that scores a response yy to a prompt xx, trained on human preference pairs. DPO (Rafailov et al. 2023) rewrites this reward in terms of the policy itself.

Other meanings, by context

How to type it

LaTeXShows
r_trtr_t
R(s, a) reward functionR(s,a)R(s, a)
r_\phi(x, y) a learned reward modelrϕ(x,y)r_\phi(x, y)

A worked example

r1=0, r2=0, r3=1r_1 = 0,\ r_2 = 0,\ r_3 = 1

In a game won at the third move, the only nonzero reward comes at the end.

Common confusions

Equations that use it

Related

Gt=∑k=0∞γkrt+k+1G_t = \sum_{k=0}^{\infty} \gamma^k r_{t+k+1}Return Gst,at,rt,st+1s_t, a_t, r_t, s_{t+1}State s and action aVπ(s)=Eπ[Gt∣st=s]V^\pi(s) = \mathbb{E}_\pi\left[G_t \mid s_t = s\right]Value function Vγ\gammaGamma

Decode this example →