SandHouse
Pages

TL1 — RL Loss

For the initial model, reinforcement learning can use a standard actor-critic setup with GAE for advantage estimation and PPO for the policy update. The critic estimates

Vφ(Ct,QtV)

where QtV is a multi-headed learned query of the dense features of the same form as Qtπ. First define the one-step temporal-difference residual

δt=rt+γ(1−dt)Vφ(Ct+1,Qt+1V)−Vφ(Ct,QtV)

Instead of a plain n-step return, we estimate the advantage using Generalized Advantage Estimation

A^tGAE=∑l=0T−t−1(γλ)lδt+l

Here, λ∈[0,1] controls the bias-variance tradeoff. We then define the value target as

R^t=A^tGAE+Vφ(Ct,QtV)

Let the policy ratio be

rt(ϕ)=πϕ(At∣Ct,Qtπ)πϕold(At∣Ct,Qtπ)

The actor is trained with the PPO clipped objective

ℒactor=−min⁡(rt(ϕ)A^tGAE,clip(rt(ϕ),1−ϵ,1+ϵ)A^tGAE).

The critic minimizes the squared value error

ℒcritic=12(Vφ(Ct,QtV)−R^t)2

We also include an entropy term ℋ(π) to encourage exploration. The total reinforcement learning loss is

ℒRL=λAℒactor+λCℒcritic−λHℋ(π)