Notation

One set of symbols for the whole course, from gridworlds to GRPO. When a paper uses different letters, the chapter says so.

Classic RL (Parts I–II)

SymbolMeaning
tt, TTTime step; final step of an episode (horizon)
st∈Ss_t \in \mathcal{S}State at time tt; S\mathcal{S} is the set of states
at∈Aa_t \in \mathcal{A}Action at time tt; A\mathcal{A} is the set of actions
rtr_tReward received after taking ata_t in sts_t
P(s′∣s,a)P(s' \mid s, a)Transition probability: chance of landing in s′s'
r(s,a)r(s, a)Expected reward for taking aa in ss
γ∈[0,1]\gamma \in [0, 1]Discount factor
Gt=∑k=0T−t−1γkrt+kG_t = \sum_{k=0}^{T-t-1} \gamma^k r_{t+k}Return: discounted sum of rewards from tt on
τ=(s0,a0,r0,s1,… )\tau = (s_0, a_0, r_0, s_1, \dots)A trajectory (episode)
π(a∣s)\pi(a \mid s)Policy: probability of action aa in state ss
πθ\pi_\thetaA policy with parameters θ\theta (e.g. a neural network)
Vπ(s)=Eπ[Gt∣st=s]V^\pi(s) = \mathbb{E}_\pi[G_t \mid s_t = s]State-value function
Qπ(s,a)=Eπ[Gt∣st=s,at=a]Q^\pi(s, a) = \mathbb{E}_\pi[G_t \mid s_t = s, a_t = a]Action-value function
Aπ(s,a)=Qπ(s,a)−Vπ(s)A^\pi(s, a) = Q^\pi(s, a) - V^\pi(s)Advantage: how much better aa is than average
V∗,Q∗,π∗V^*, Q^*, \pi^*Optimal value functions and an optimal policy
δt=rt+γV(st+1)−V(st)\delta_t = r_t + \gamma V(s_{t+1}) - V(s_t)TD error
α\alphaStep size (learning rate)
ϵ\epsilonExploration rate in ε-greedy; also the clip range in PPO/GRPO (context makes it clear)
λ\lambdaTrace / GAE parameter
J(θ)=Eτ∼πθ[G0]J(\theta) = \mathbb{E}_{\tau \sim \pi_\theta}[G_0]Objective: expected return of the policy
ρt(θ)=πθ(at∣st)πθold(at∣st)\rho_t(\theta) = \dfrac{\pi_\theta(a_t \mid s_t)}{\pi_{\theta_\text{old}}(a_t \mid s_t)}Importance ratio (PPO’s paper calls it rt(θ)r_t(\theta); we use ρ\rho to avoid a clash with reward)
A^t\hat{A}_tAn estimate of the advantage at step tt

Bandits (Chapter 2)

SymbolMeaning
KKNumber of arms
q∗(a)q_*(a)True mean reward of arm aa
Qt(a)Q_t(a)Our estimate of q∗(a)q_*(a) at time tt
Nt(a)N_t(a)Times arm aa was pulled before time tt
RegretT=T max⁡aq∗(a)−∑t=1Tq∗(at)\text{Regret}_T = T\,\max_a q_*(a) - \sum_{t=1}^{T} q_*(a_t)Reward lost by not always pulling the best arm

RL for LLMs (Part III)

SymbolMeaning
x∼Dx \sim \mathcal{D}A prompt drawn from the prompt dataset
y=(y1,…,y∣y∣)y = (y_1, \dots, y_{\lvert y\rvert})A response: a sequence of tokens
y<ty_{<t}The tokens before position tt
πθ(y∣x)=∏tπθ(yt∣x,y<t)\pi_\theta(y \mid x) = \prod_{t} \pi_\theta(y_t \mid x, y_{<t})The language model as a policy over tokens
πref\pi_\text{ref}Frozen reference model (usually the SFT model)
r(x,y)r(x, y)Reward for the whole response; rϕr_\phi if it is a learned reward model with parameters ϕ\phi
β\betaKL penalty coefficient (strength of the leash to πref\pi_\text{ref})
KL(πθ ∥ πref)\mathrm{KL}(\pi_\theta \,\Vert\, \pi_\text{ref})KL divergence from the reference model
(x,yw,yl)(x, y_w, y_l)A preference pair: ywy_w preferred (“won”) over yly_l (“lost”)
σ(z)=1/(1+e−z)\sigma(z) = 1/(1+e^{-z})Logistic sigmoid
GGGroup size: number of responses sampled per prompt (GRPO)
y(i)y^{(i)}, i=1..Gi = 1..GThe ii-th sampled response for a prompt; yt(i)y^{(i)}_t is its tt-th token
r(i)r^{(i)}Reward of response y(i)y^{(i)}
A^(i)\hat{A}^{(i)}Advantage of response y(i)y^{(i)}, e.g. (r(i)−mean)/std(r^{(i)} - \text{mean}) / \text{std} in GRPO