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

Deep Reinforcement Learning · Lecture 84 of 99 · 8:21

Lecture 20: Inverse Reinforcement Learning, Part 3

CS 285: Lecture 20, Inverse Reinforcement Learning, Part 3 on YouTube

Study guide

What this lecture covers

Maximum entropy inverse RL, as derived earlier in this lecture, needs known dynamics and a small discrete state-action space so it can compute exact forward and backward messages. This part addresses what breaks in realistic, high-dimensional problems and builds up the fixes step by step: sampling instead of enumerating, a "lazy" policy that is only partially optimized between reward updates, and an importance-sampling correction that keeps the resulting gradient estimate unbiased.

After watching, you can explain why naive maximum entropy IRL does not scale, and describe how the guided cost learning algorithm combines these ideas into a practical, deep-learning-compatible IRL method.

Key ideas

  • Scalability problems: exact maximum entropy IRL needs the soft optimal policy solved in an inner loop and requires enumerating all state-action pairs, both infeasible with unknown dynamics or large/continuous spaces.
  • Sampling-based gradient: with unknown dynamics, the reward gradient's two expectations can be estimated by sampling trajectories from the expert and from the current soft-optimal policy, rather than exact enumeration.
  • The scaling problem: fully re-optimizing the policy to convergence at every reward gradient step is too expensive.
  • Lazy policy optimization: only partially improving the policy at each reward update reduces cost, but produces a biased gradient estimate because the policy samples no longer come from the true soft-optimal distribution.
  • Importance sampling correction: weighting each sampled trajectory by w_j, proportional to the exponential of its current reward divided by its probability under the partially optimized policy, corrects the bias; weights approach 1 as the policy improves.
  • Guided cost learning: alternates between updating the reward with the importance-weighted gradient and updating the policy with a maximum-entropy policy gradient, producing both a learned reward and a usable policy.

Walkthrough

Why exact maximum entropy IRL doesn't scale (0:11)

The lecture recaps what the earlier maximum entropy algorithm requires: solving for the soft optimal policy inside the training loop and normalizing over all state-action tuples. Both become infeasible once dynamics are unknown or the state-action space is large or continuous, motivating a search for tractable approximations.

From exact enumeration to sampling (1:01)

The reward gradient is still a difference between an expectation over expert trajectories and one over the current soft-optimal policy. The first term is estimated directly from expert demonstrations. For the second, the lecture proposes learning a soft optimal policy with any max-entropy RL algorithm (such as soft Q-learning) and sampling trajectories from it, but notes this requires solving the forward RL problem to convergence at every single gradient step on the reward.

Lazy policy optimization and importance sampling (3:24)

To avoid re-solving the policy from scratch each time, the policy is only improved a little between reward updates. This introduces bias, which is corrected with importance weights derived from the ratio of the exponentiated current reward to the trajectory's probability under the partially optimized policy. As reward updates continue, the policy converges toward the target distribution and the importance weights approach one, so this correction stays valid throughout training.

Guided cost learning (5:32)

These pieces combine into guided cost learning, the first deep IRL algorithm shown to scale to high-dimensional state-action spaces. It alternates: sample trajectories from the current policy, use those samples plus expert demonstrations to update the reward via the importance-weighted gradient, then update the policy with a maximum-entropy policy gradient using the new reward. The lecture closes with an example from Finn et al., where a real robot learns to pour into a cup from demonstrations, having to visually locate the cup rather than replay a fixed motion.

Before you watch

  • Review the maximum entropy IRL derivation from the earlier part of this lecture, since this part builds directly on its gradient expression.
  • Recall importance-weighted policy gradients from earlier in the course, since the correction here follows the same pattern.

Check your understanding

  1. Why does exact maximum entropy IRL fail to scale to unknown dynamics or large state-action spaces?
  2. What bias is introduced by only partially optimizing the policy between reward updates, and how is it corrected?
  3. What happens to the importance weights as the policy gets closer to the soft optimal policy for the current reward?
  4. What are the two alternating updates performed in the guided cost learning algorithm?

Vocabulary

enumerate (verb)
To list every single item one by one.
The exact method needs to enumerate all state-action pairs.
inner loop (noun)
A repeated step nested inside a larger repeated process.
Solving the policy in the inner loop is expensive.
lazy (adjective)
Doing only the minimum work needed right now, delaying the rest.
Lazy policy optimization only partially improves the policy each time.
bias (noun)
A systematic difference between an estimate and the true value.
Partial optimization introduces bias into the gradient.
importance sampling (noun)
A technique for correcting estimates when samples come from a different distribution than intended.
Importance sampling corrects for using a partially optimized policy.
importance weight (noun)
A number used to rescale a sample so it fairly represents the target distribution.
Each trajectory gets an importance weight based on its reward.
guided cost learning (noun)
A practical inverse RL algorithm that alternates updating the reward and the policy.
Guided cost learning scales maximum entropy IRL to deep learning.
alternate (verb)
To take turns doing two different things repeatedly.
The algorithm alternates between updating the reward and the policy.
scale to (phrase)
To be able to handle a much larger or more complex version of a problem.
Guided cost learning is shown to scale to high-dimensional spaces.
naive (adjective)
Simple and direct, without accounting for practical problems.
Naive maximum entropy IRL does not scale to large problems.
infeasible (adjective)
Not possible to do in practice.
Exact enumeration is infeasible with continuous state spaces.
high-dimensional (adjective)
Having very many variables or degrees of freedom.
Guided cost learning scales to high-dimensional state-action spaces.
converge (verb)
To gradually settle toward a fixed value or solution.
Fully re-optimizing the policy to convergence is too expensive.
tractable (adjective)
Simple enough to compute or handle in practice.
The lecture searches for tractable approximations to exact IRL.
approximation (noun)
A result that is close to, but not exactly, the true value.
Sampling and lazy optimization are practical approximations.
ratio (noun)
The result of dividing one quantity by another.
The importance weight is a ratio of two probabilities.
unbiased (adjective)
Not systematically wrong in one direction; correct on average.
Importance sampling keeps the gradient estimate unbiased.
biased (adjective)
Systematically wrong in a particular direction.
Lazy policy optimization produces a biased gradient estimate.
locate (verb)
To find the exact position of something.
The robot has to visually locate the cup before pouring.
visually (adverb)
By means of sight or visual information.
The robot must visually locate the cup rather than replay a fixed motion.
practical (adjective)
Useful and workable in real situations, not just in theory.
Guided cost learning is a practical, deep-learning-compatible method.
correction (noun)
An adjustment made to fix an error.
The importance sampling correction removes the bias.
expensive (adjective)
Costly in time or computation.
Re-solving the policy at every gradient step is too expensive.
motivate (verb)
To give a reason for doing something.
The scaling problems motivate a search for approximations.
step by step (phrase)
Done gradually, one small stage at a time.
The lecture builds up the fixes step by step.

Chapters

← Lecture 20: Inverse Reinforcement Learning, Part 2 · Lecture 20: Inverse Reinforcement Learning, Part 4 →