5.2.8 · D3Deep & Advanced RL

Worked examples — Advantage Actor-Critic (A2C - A3C)

2,279 words10 min readBack to topic

This is the "grind through every case" companion to the parent A2C/A3C note. There we derived that the TD error is the advantage estimate: Here we make sure you never meet a case you haven't seen: positive/negative/zero advantage, terminal states, and , the -step dial, GAE smoothing, entropy, and an exam twist.


The scenario matrix

Every A2C advantage computation falls into one of these cells. The examples below are each tagged with the cell they cover.

Cell What makes it special Covered by
C1 Positive advantage reality beat the critic, Ex 1
C2 Negative advantage reality was worse, Ex 2
C3 Zero advantage critic was exactly right, Ex 3
C4 Terminal state no next state, so Ex 4
C5 extremes (myopic) and (undiscounted) Ex 5
C6 -step dial use real rewards then bootstrap Ex 6
C7 GAE blend smoothly mix all via Ex 7
C8 Entropy + loss sign full actor loss with the bonus Ex 8
C9 Word problem real story maps onto numbers Ex 9
C10 Exam twist stop-gradient / on-policy trap Ex 10
Figure — Advantage Actor-Critic (A2C - A3C)

The picture above is the mental model for every cell: a number line where the critic's prediction sits at zero, and is the signed distance of reality from it.


Worked examples


How the cases connect

positive

zero

negative

yes

compute delta = r + gamma V next - V now

sign of delta

reinforce action

no policy change

discourage action

is next state terminal

set V next to zero

horizon dial: one step vs n step vs GAE

Active recall

Recall

When , what does the actor do? ::: Nothing — the gradient ; the critic already predicted perfectly. What do you plug in for at a terminal state? ::: Zero — there is no future after the episode ends. With , the advantage reduces to what? ::: (only the immediate reward, no bootstrap). Why treat the critic target as a constant (stop-gradient)? ::: So the network predicts the target instead of moving it down to trivially shrink the loss. GAE decay factor per step? ::: — it exponentially down-weights later TD errors.