Lecture 23: Exploration and Skill Learning
What if want an RL agent to recover diverse behavior without any reward function? In other words, the problem is inducing an agent to prepare for an unknown future goal.
Information Theory Recap
Some Useful Identities
RL Information Theoretic Quantities
For RL exploration, we are concerned about a few values from information theory. In particular, we may be concerned with the state marginal entropy of policy , i.e. . We are also especially interested in a quantity known as empowerment,
which essentially measures the influence of the action on determining the next state .
Learning Skills with Empowerment
We'd like to learn some policy where it depends on the specific skill , i.e. can be treated as an index into a set of skills. Each skill should do something different—visit different state space regions—such that they sufficiently cover the state space.
As one might expect, we can treat this as a multitask RL problem, where each skill has its own reward function.
However, as aforementioned, we do not know a priori what sort of tasks we want to learn, and therefore what the reward function for each skill should look like. Instead, we use a reward function that changes over the course of training. Essentially, each skill's reward function will encourage it to visit states that are unlikely for other skills . We do this by defining the reward function as
where is a discriminator model trained to predict the skill being executed given an environment state. Notably, there is a connection between optimizing this objective and mutual information
The first term is determined by the prior (i.e. maximized by uniform prior over ), while the second term is affected by ; in particular, the entropy of is minimized when it is easy to predict the skill from a given state. In other words, the above objective maximized , the mutual information between the skills and states.
Reaching Goals with Empowerment
These skills, while promoting diverse trajectories, may not really help with realizing RL goals. What if, instead of conditioning on an arbitrary skill index , we conditioned on a goal state that the agent should reach?
For now, we'll keep the same reward function design.
If we consider the same mutual information equation
The second term is again minimized by maximizing ; however, the first term is a bit less clear. We don't necessarily know all the valid states beforehand—for instance, consider an RL task training on image states. If we just maximize entropy over random images, practically all of these aren't going to be valid states. This is, notably, less of an RL problem and more of a general ML problem.
In practice, other rewards are used, e.g. or .
Example: Skew-Fit
Skew-Fit is an old algorithm (Skew-Fit: State-Covering Self-Supervised Reinforcement Learning, Dalal et al.) that is inspired by such ideas.
- Propose goal .
- Attempt to reach goal using .
- Use data to update .
- Use data to update .
This procedure doesn't quite work, unfortunately, because the replay buffer is used to train , and this method directly exacerbates the imbalances/bias in the training distribution dataset. For instance, if there are two possible goals that are additionally orthogonal, and the training distribution favors one goal in the training set, the RL agent will be trained to be biased towards taking actions for this goal.
Thus, we need to somehow rebalance the training set to reduce its bias. The trick is to use a weighted MLE estimator instead of the standard MLE estimator
where for . This increases the entropy . Note that this does not erroneously encourage invalid states, since it only increases the weight of states from the training set, which are valid.