Example. Return and advantage on a three-step episode [ftip-0037]

On a three-step episode, a discounted return and a baseline-relative advantage can be computed separately.

Take discount \(\gamma =1/2\). The return attached to the first action is \[ G_0=r_1+\gamma r_2+\gamma ^2 r_3 =0+\tfrac 12+\tfrac 14\cdot 2=1. \] If the declared baseline is \(V(s_0)=0.4\), then the corresponding advantage estimate is \(\widehat A_0=G_0-V(s_0)=0.6\).

The calculation instantiates the return and advantage in Definition [ftip-0030] and Definition [ftip-0032]. It illustrates one baseline choice. Low variance and correct attribution of terminal reward to an internal decision require additional assumptions or evidence.