5.2.8 · D1Deep & Advanced RL

Foundations — Advantage Actor-Critic (A2C - A3C)

2,053 words9 min readBack to topic

This page assumes nothing. If the parent note Advantage Actor-Critic (A2C - A3C) used a symbol, we build it here from a picture first. Read top to bottom; each block earns the next.


0 · The stage: what a reinforcement-learning problem even is

Before any symbol, picture the world as a loop of four things repeating forever:

  • State — a snapshot of the world right now. Picture the chessboard as it currently sits, or a robot's current position. It is "everything you'd need to know to decide what to do next."
  • Action — the move you pick from this state. Picture an arrow you choose to follow out of the current square.
  • Reward — a single number the world hands you after an action. Picture a little scoreboard blipping "+2" or "−1". Good = big positive, bad = negative.
  • Next state (also written ) — where you land after acting. The board after your move.

Why we need this: every symbol later is defined on this loop. is just the tick counter — a subscript means "the value of at tick ." No mystery.


1 · The policy — the player

Picture a spinner whose slices are the possible actions; a state that makes "shoot" look great gives "shoot" a fat slice.

  • The subscript (Greek "theta") is the bag of tunable numbers (the neural-network weights) that shape the spinner. Learning = slowly turning the dials so good actions get fatter slices.
  • Because it outputs probabilities, every slice is and they sum to 1:

Why probabilities and not one fixed action? Because early on we don't know what's best, so the player must explore — try things — and probabilities let it. This "sum to 1" fact is the exact hinge of the baseline proof in the parent note, so hold onto it.

This is the same you first met in REINFORCE and the Policy Gradient Theorem.


2 · Return — adding up the future, discounted

One reward isn't enough — a move that scores now might ruin you later. So we care about the whole future from this moment on.

Why discount at all? Two reasons. (1) Money/points now beat money later. (2) Without shrinking, an infinite loop would sum to infinity — keeps the total a finite, comparable number. The bars in the figure show each reward already faded by its ; the return is their total height.

is exactly the noisy signal REINFORCE uses — and the noise is the problem A2C fixes.


3 · Expectation — "average over the randomness"

The world is random: the spinner picks different actions, the environment may hand different rewards. So is a random number — run the same start twice, get two answers.

The subscript says what is random: means "average over actions drawn from the policy ." The symbol reads "is drawn from."

Why we need it: we can't optimise a random number directly, so every objective is written as an expectation — the average outcome — which is a fixed target to push up.


4 · Value and action-value — the coach's two guesses

Now the two guesses at the heart of A2C.

The difference is the whole point:

  • looks at the state (before choosing) — the flat baseline "how good is here."
  • looks at a state–action pair (after committing to ) — the height of one specific branch.

The subscript in (Greek "phi") is the critic network's own bag of weights — the coach also learns, separately from the actor's .

Why subtract instead of using alone? Because "this state is worth 100" tells you nothing about which action to pick if every action is worth ~100. Subtracting centres the numbers around zero, so only the relative choice remains. That centring is exactly what slashes the noise — the Bias-Variance Tradeoff lever.


5 · The gradient and the log — how the player learns

Why this tool and not another? We want to make good outcomes more likely. "Which way should I nudge every dial to raise the score fastest?" is answered by exactly one object — the gradient. Learning = repeatedly stepping a little way along (this is gradient ascent).

Put it together and the parent's central update reads in plain words: Direction times goodness. Good action → step that way; bad action → step the other way.


6 · Bootstrapping & the TD error — guessing from a guess

Waiting for the full return is slow and noisy. Instead, replace "the rest of the future" with the coach's own guess . This is bootstrapping — improving a guess using another guess.

This is the engine of Temporal-Difference Learning, and stacking many smoothly gives Generalized Advantage Estimation (GAE). The hat in just means "our estimate of ," not the true value.

Why bootstrap? It lets you learn every step instead of waiting for the episode to end, and it trades a little bias for a big drop in variance — the dial the parent's n-step section turns.


Prerequisite map

State action reward loop

Policy pi outputs action probs

Return G discounted future reward

Expectation E average over randomness

Value V and Q the coach guesses

Advantage A equals Q minus V

Gradient nabla and log update rule

TD error delta bootstrap surprise

A2C update actor plus critic

Each arrow is a "you need the left before the right." A2C sits at the bottom because it needs all of it: the loop to act in, the policy to nudge, values to compare against, the gradient to step, and the TD error to estimate advantage cheaply.


Equipment checklist

Test yourself — cover the right side and answer aloud.

State
A full snapshot of the world right now — everything needed to decide the next action.
Action
A move chosen from the current state.
Reward
The single number the world hands back after an action; bigger = better.
Trajectory
The whole sequence of states, actions, and rewards over an episode.
Policy
Probability of choosing action given state ; are its tunable weights.
Why must ?
The action probabilities from any state form a complete distribution — one action will happen.
Discount
How much future rewards are shrunk; a reward steps away is worth of a now-reward.
Return
The discounted sum of all rewards from tick onward, .
Expectation
The probability-weighted average value of a random quantity.
State value
Expected return from state following the policy — "how good is being here."
Action value
Expected return from after taking the specific action .
Advantage
— how much better this action was than the state's average.
Gradient
The direction to nudge that most increases the objective.
Why in the update?
The log-derivative trick pulls the gradient out of the expectation, making it trainable.
TD error
— the one-step surprise, which also estimates the advantage.