Seyed Masoud Hosseini · Overview · Study log · Weekly summaries · Ideas · Search · Transcript · RSS feed

Deep Reinforcement Learning · Lecture 37 of 99 · 18:48

Lecture 9, Part 2: Bounding the State Distribution Mismatch

CS 285: Lecture 9, Part 2 on YouTube

Study guide

What this lecture covers

This part closes the gap left at the end of Part 1 of Lecture 9: the proof that maximizing advantage under the old policy's state distribution approximates the true RL objective requires the old and new policies' state distributions to be close. The lecture proves this for both deterministic and stochastic policies, then bounds how much the resulting objective can differ from the true objective.

This continues directly from the previous part's derivation connecting policy gradient to policy iteration, and its result (a bound scaling with the total variation divergence between policies) motivates the constrained policy gradient methods introduced next.

Key ideas

  • Goal: show that the state marginal p_theta(s_t) is close to p_theta'(s_t) whenever the policies pi_theta and pi_theta' are close, so it's valid to substitute one for the other.
  • Deterministic case: if the new policy has at most epsilon probability of deviating from the old one at each step, the state distribution splits into a "no mistake" branch (weight (1 - epsilon)^t, matching the old policy's distribution) and an unknown "mistake" branch, mirroring the imitation-learning bound from earlier in the course.
  • Total variation bound: using (1 - epsilon)^t >= 1 - epsilon*t, the divergence between the two state distributions is bounded by 2 * epsilon * t.
  • Stochastic case: a coupling lemma extends the same style of argument to stochastic policies, showing that if pi_theta and pi_theta' have total variation divergence at most epsilon, they take the same action with probability at least 1 - epsilon, giving the same 2 * epsilon * t bound on state marginals.
  • From states to objective values: bounding the divergence of state distributions lets you bound the difference between expectations of any bounded function f(s_t) under the two distributions, with an error term of 2 * epsilon * t * max(f).
  • Applying it to the RL objective: applied to the importance-weighted advantage, this shows the tractable objective is a lower bound on the true RL objective improvement, off by an error term of order epsilon * T * R_max (or epsilon * R_max / (1 - gamma) in the infinite-horizon case).
  • Practical implication: as long as the new policy stays close enough to the old one (small epsilon), maximizing the tractable importance-weighted advantage objective is guaranteed to improve the true RL objective.

Walkthrough

Setting up the state-distribution bound (0:18)

The lecture restates the goal from Part 1: show p_theta(s_t) stays close to p_theta'(s_t) when pi_theta and pi_theta' are close, so that the importance-weighted advantage objective, differentiable to give exactly the policy gradient, approximates the true improvement in the RL objective.

Bounding the mismatch for deterministic and stochastic policies (1:23)

For a deterministic old policy, the new policy's state distribution at time t splits into a term where every action so far matched the old policy (probability (1 - epsilon)^t, same state distribution as the old policy) and an unconstrained "mistake" term, exactly paralleling the earlier imitation-learning bound. This gives a total variation bound of 2 * epsilon * t between the state marginals. The lecture then generalizes to stochastic policies using a coupling lemma from the trust region policy optimization paper: if two distributions have total variation divergence epsilon, a joint distribution exists under which they agree with probability at least 1 - epsilon, yielding the same style of bound.

Bounding the objective value (10:51)

The lecture extends the state-marginal bound to expectations of an arbitrary bounded function, showing that the expected value under the new policy's states is bounded below by the expected value under the old policy's states minus an error term proportional to epsilon, t, and the function's maximum value. Applying this to the importance-weighted advantage objective, and noting that an advantage is bounded by the horizon times the maximum reward, shows the constant in the error term is order T * R_max (or R_max / (1 - gamma) for infinite horizon with discounting). The conclusion is that maximizing the tractable, differentiable objective under the old policy's states is guaranteed to improve the true RL objective, provided the new and old policies stay close enough that epsilon is small.

Before you watch

  • Watch Part 1 of Lecture 9, which sets up the claim this part proves and introduces the importance-weighted advantage objective.
  • Recall the imitation learning bound on compounding errors from earlier in the course, since the deterministic-policy proof here follows the same structure.

Check your understanding

  1. Why does the deterministic-policy proof split the new policy's state distribution into a "no mistake" and a "mistake" term?
  2. What does the coupling lemma let you conclude about two stochastic policies whose total variation divergence is bounded by epsilon?
  3. How does bounding the state marginal difference translate into a bound on the difference between the two policies' objective values?
  4. What does this derivation imply about how large a policy update should be allowed to be?

Vocabulary

bound (verb)
To set a limit on how large or small something can be.
We bound how far the two state distributions can differ.
state marginal (phrase)
The probability distribution over which states a policy visits.
The state marginal of the new policy should stay close to the old one.
deviate (verb)
To move away from an expected path or behavior.
The new policy may deviate from the old one at each step.
branch (noun)
One possible path or outcome that a process can follow.
The proof splits into a no-mistake branch and a mistake branch.
total variation (phrase)
A measure of how different two probability distributions are.
Total variation divergence bounds the gap between the state distributions.
divergence (noun)
A measure of how much two things differ from each other.
Small divergence between policies keeps the bound tight.
coupling lemma (phrase)
A mathematical tool that links two random variables so they agree with high probability.
The coupling lemma extends the bound to stochastic policies.
stochastic (adjective)
Involving randomness rather than a fixed, certain outcome.
Stochastic policies choose actions with some randomness.
bounded function (phrase)
A function whose output never goes above or below certain limits.
The argument works for any bounded function of state.
lower bound (phrase)
A guaranteed minimum value that something cannot go below.
The tractable objective is a lower bound on the true improvement.
horizon (noun)
The number of time steps considered in a task.
The error term grows with the horizon length.
infinite-horizon (adjective)
Referring to a task that continues indefinitely rather than ending at a fixed time.
The infinite-horizon case uses a discount factor instead of a fixed T.
practical implication (phrase)
What a result actually means for real use.
The practical implication is that updates must stay small.
imitation learning (phrase)
Training an agent to copy demonstrated behavior.
This proof follows the same structure as imitation learning bounds.
compounding error (phrase)
Mistakes that build on each other and grow larger over time.
Compounding error was covered earlier in the imitation learning bound.
differentiable (adjective)
Able to have its slope or gradient calculated.
The importance-weighted objective is differentiable.
guarantee (noun)
A firm promise that a result will hold.
Small epsilon gives a guarantee of improvement.
generalize (verb)
To extend an idea so it covers more cases.
The lecture generalizes the bound to stochastic policies.
joint distribution (phrase)
A probability distribution describing two variables together.
The coupling lemma builds a joint distribution of two policies.
paralleling (verb)
Closely matching or following the same pattern as something else.
The deterministic proof is paralleling the imitation-learning bound.

Chapters

← Lecture 9, Part 1: Why Does Policy Gradient Work? · Lecture 9, Part 3: Constraining Policy Gradient with KL Divergence →