5.2.5 · D5Deep & Advanced RL
Question bank — Policy gradient methods
This bank assumes the parent note's build-up: the objective , the Log-derivative trick, reward-to-go , and baselines. If a symbol here feels unfamiliar, re-read the parent first — nothing new is introduced, only stress-tested.
True or false — justify
The policy gradient is zero because contains no .
False — shapes , the distribution we sample trajectories from. The gradient flows through via , so nudging changes which rewards are likely even though reward values are fixed by the environment.
Policy gradient methods need a model of the transition dynamics .
False — dynamics appear in but carry no , so and they drop out. Only survives, which is exactly why PG is model-free.
Subtracting a baseline makes the gradient estimate biased.
False — , so subtracting it changes nothing in expectation. It only lowers variance.
For we should run gradient descent, like every other ML loss.
False — is expected return we want to maximize, so we do gradient ascent (), or equivalently descend on .
REINFORCE and Q-learning both ultimately learn a value function.
False — Q-learning learns and acts greedily; REINFORCE learns the policy parameters directly and never requires a value function (though a learned baseline can help). See Value-based methods (Q-learning) for the contrast.
Reward-to-go changes the expected gradient compared to using full .
False — dropping past rewards is unbiased because an action at time has zero expected correlation with rewards before (causality). The expectation is unchanged; only the variance drops.
A deterministic policy can be optimal, so stochastic policies are just a training convenience.
False in general — under partial observability or in games like rock-paper-scissors, the optimal policy is genuinely stochastic. A greedy value policy cannot represent that; a stochastic can.
The advantage baseline is chosen because it makes the estimator unbiased.
False — any action-independent is already unbiased. is chosen because it best centres the returns around zero, minimizing variance; unbiasedness is not the reason.
Spot the error
", keep all three."
The first two groups are zero ( and have no ), so only the policy term remains: .
"The baseline should depend on the action taken, , so it can rate each action."
If depends on it no longer factors out of the expectation and the estimator becomes biased. The baseline must be action-independent, ; the advantage is where the action-rating happens.
"To reduce variance, just scale every weight by a small constant ."
Scaling by a constant biases the gradient direction's magnitude and is not variance reduction — you'd need to compensate. Real reduction comes from causality and a well-chosen baseline, which shrink weight magnitude without changing the expectation.
" for softmax is ."
It is : . Using would push probability the wrong way for the sampled action.
"Since the log-derivative trick gives an expectation, one sampled trajectory gives the exact gradient."
One sample is an unbiased but noisy estimate. You average over trajectories; the single-sample estimate has high variance, which is the whole motivation for Variance reduction in Monte Carlo tricks.
"Advantage ."
Sign flipped — , "how much better than average this action is." With the wrong sign you'd reinforce bad actions.
Why questions
Why does the Log-derivative trick use specifically and not some other transform?
Because produces exactly the factor needed to rewrite as , turning a gradient-of-a-density into a plain expectation you can sample. No other elementary function gives that self-cancelling structure.
Why can policy gradients handle continuous action spaces where Q-learning struggles?
Q-learning needs , which is intractable over an infinite action set. PG parameterizes and samples directly (e.g. a Gaussian), so no maximization over actions is ever required.
Why is smooth (gradient) policy improvement often more stable than greedy value updates?
Small changes give small changes in , so behaviour drifts gently. Greedy value updates can flip the whole policy from a tiny change, causing oscillation.
Why does subtracting the mean return already help even before a state-dependent ?
When all returns are large and positive (e.g. ), every action is pushed up hard and the informative differences drown in noise. Centring by the mean turns them into , isolating the signal — same expectation, far less variance.
Why is a better baseline than a global constant?
A constant only removes a per-batch offset. removes the state-specific offset, so high-value states don't inflate every weight there; this is the seed of Actor-Critic methods and links to the Advantage function.
Why do we still call it "the score function" estimator?
is the score function of the policy distribution; the whole estimator weights scores by returns, hence Score function estimator is a synonym for the REINFORCE gradient.
Edge cases
What happens to the update if the sampled action already has probability ?
The score shrinks toward zero (e.g. ), so the update naturally saturates — a near-certain action can't be reinforced much further, preventing runaway probabilities.
What if every trajectory in the batch has the same return ?
The gradient becomes , whose expectation is — no learning signal, because nothing distinguishes good from bad. A baseline that equals makes this explicit: all advantages are zero.
What if the return is negative for the sampled action?
The weight is negative, so the update decreases of those actions — bad choices are made less likely. Sign of the return, not just its size, drives direction.
What if in the reward-to-go ?
Only the immediate reward survives; each action is credited solely by its instantaneous reward. This is myopic — fine when rewards are dense, poor when they're delayed.
At an optimum , is the policy gradient necessarily zero?
At a local optimum, in expectation, but sampled estimates are still noisy and nonzero. Convergence means the expected update vanishes, not that any single batch update does — another reason large step sizes destabilize, motivating Trust Region and PPO.
Can two very different values give the same policy and hence the same ?
Yes — networks are over-parameterized, so has flat directions where moves but (and the gradient) don't change. The gradient is zero along those directions, which is harmless.
What does the gradient do at a state the policy visits with near-zero probability?
That state rarely appears in sampled trajectories, so it receives almost no gradient signal — a coverage/exploration problem, not a formula problem. Poorly-visited states learn slowly, which is why exploration and Generalized Advantage Estimation-style credit assignment matter.
Connections
- Parent: Policy gradient methods and its Hinglish version.
- Mechanism: Log-derivative trick · Score function estimator.
- Variance: Variance reduction in Monte Carlo · Advantage function · Generalized Advantage Estimation.
- Algorithms: REINFORCE algorithm · Actor-Critic methods · Trust Region and PPO.
- Contrast: Value-based methods (Q-learning).