Skip to main content
As we have seen in MDP, DP algorithms use full width backups. For example, in the tree representation of the value iteration algorithm shown below, every successor state and action is considered and evaluated using the known transition (environment dynamics) and reward functions. DP value iteration backup tree DP bootstraps the vv and qq function estimation from full-width backups. This can be feasible for moderate size problems but even a single backup can be infeasible when we have very large state spaces. So we definitely need to develop approaches that allow agents to
  • optimally act in very large known MDPs or
  • optimally act when we don’t know the MDP functions.
In this chapter we outline prediction and control methods that are basic building blocks behind both cases. We develop agents that can act in an initially unknown environment and learn via their interactions with it, gradually improving their policy. In the reinforcement learning problem setting, agents do not know essential elements of the MDP that were assumed as given in the fully observed MDP. These are the transition function p(s′∣s,a)p(s' \mid s, a) and the reward function r(s,a)r(s, a) that are essential as we have seen previously to estimate the value function and optimize the policy. The only way an agent can get information about these missing functions is through its experiences (states, actions, and rewards) in the environment, that is, the sequences of tuples (St,At,Rt+1S_t, A_t, R_{t+1}). Model-based methods learn approximations of pp and rr from these tuples and then plan with them. Model-free methods skip the model: they estimate vπv_\pi or qπq_\pi directly from sampled transitions. In both cases the problem is still an MDP, and the concepts of the MDP chapter still apply.

Future value calculation

Two natural questions arise
  1. With what future states and actions we estimate the values,
  2. How we control / schedule the updates to the values such that we can converge in an optimal policy at some point.
To answer the first question we look at the options we have with respect to the depth and width of the backup trees as shown in Unified view of RL approaches Different approaches to solving known and unknown MDPs. Several if not all RL algorithms are sampling the state-action space and use shallow to deep backups. For the second question, recall the two steps of policy iteration from the MDP chapter. Policy evaluation makes the value function match the current policy, and policy improvement makes the policy greedy with respect to the current values. Policy iteration runs each step to completion before starting the other. Value iteration already showed that this is not required: it does a single sweep of evaluation between improvements. The steps can be interleaved even more finely, down to one state at a time. As long as every state keeps being updated, the values still converge to v∗v_* and the policy to an optimal one. Generalized policy iteration Policy evaluation and policy improvement can interact at any granularity, the result is still convergence to v∗v_* and π∗\pi_*. Generalized policy iteration (GPI) is the name for any scheme that alternates evaluation and improvement, at whatever granularity (Sutton & Barto, 2018). The two steps undo each other’s work. After an improvement step the values no longer describe the new policy, and after an evaluation step the policy is usually no longer greedy with respect to the new values. Only the pair (v∗,π∗)(v_*, \pi_*) satisfies both conditions at once, and repeated alternation moves toward it. GPI competing and cooperating processes Generalized policy iteration diagram. Policy evaluation and policy improvement are shown as arrows: they compete but also cooperate to reach the joint optimum. In policy iteration each arrow goes all the way to its line. In GPI an arrow can stop short, for example after one sampled update. Neither step aims at optimality directly, but together they reach it. Almost every algorithm in this chapter is an instance of GPI.

From GPI to modern RL algorithms

Three families of updates fit inside the GPI skeleton, and they differ along two orthogonal axes, width (full expectation vs. single sample) and depth (one step with bootstrapping vs. all the way to the end of the episode):
  • DP uses full backups: it sweeps every successor s′s' and weights by the known p(s′∣s,a)p(s' \mid s, a). Requires a model.
  • MC uses sample backups but waits for the episode to terminate and uses the actual return GtG_t. Model-free, unbiased, high variance.
  • TD uses sample backups and bootstraps: one step of real experience plus the current estimate of vv or qq at the next state. Model-free, biased, low variance.
Backup trees for DP, MC, and TD Backup trees contrasting DP (full width, one step), MC (sample width, full depth), and TD (sample width, one step). Update equation comparison Update equations: DP uses a weighted sum over all s′s', MC uses the full return GtG_t, TD uses a bootstrapped one-step target r+γv(s′)r + \gamma v(s').

Deep RL

To scale to large problems, we also need to develop approaches that can learn such functions efficiently both in terms of computation and space (memory). We will use DNNs to provide, in the form of approximations, the needed efficiency boost. Deep RL concept Deep Reinforcement Learning (DRL). DRL algorithms taxonomy and evolution DRL algorithms, taxonomy and evolution. In tabular DP, policy iteration and value iteration are two faces of the same algorithm, they both implement GPI and converge to the same v∗v_* and π∗\pi_*. In modern RL each of them gave rise to its own algorithmic lineage: Value-iteration lineage, value-based RL. Q-learning (Watkins, 1989) is value iteration with the model replaced by samples and a max over actions in the bootstrap target. DQN (Mnih et al., 2015) is Q-learning with a neural-network function approximator and a replay buffer. From there follow double / dueling / distributional / rainbow DQN, R2D2, Agent57, and the value-prediction core of MuZero, all tracing back to the value-iteration update. Policy-iteration lineage, policy-gradient and actor-critic RL. Policy gradient methods (REINFORCE, A2C/A3C, TRPO, PPO, IMPALA) implement the “policy improvement” half with gradient ascent on the expected return, in place of a greedy argmax. PPO is probably the most widely deployed modern RL algorithm today, it powers most of RLHF, robotics policies, and a lot of game-playing agents, and conceptually it is an approximate policy iteration: evaluate the current policy with rollouts, update with a clipped surrogate objective, repeat. Actor-critic methods like DDPG, TD3, and SAC literally implement GPI with neural-network policy and value heads, a critic trained with a TD bootstrap on the action the actor would take next (SAC uses a soft expectation over actions instead), and an actor improved by policy gradients. They inherit both lineages simultaneously.

Resources

These resources give a wider view of deep RL.
  1. Spinning Up in Deep RL. This is a must read for all computer scientists that are getting started in Deep RL.
  2. Foundations of Deep RL. This is a practical book on deep RL algorithms.
Key references: (Sutton & Barto, 2018; Mnih et al., 2015; Schulman et al., 2017)

References

  • Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A., Veness, J., et al. (2015). Human-level control through deep reinforcement learning. Nature. DOI
  • Schulman, J., Wolski, F., Dhariwal, P., Radford, A., Klimov, O. (2017). Proximal Policy Optimization Algorithms. arXiv [cs.LG]. Link
  • Sutton, R., Barto, A. (2018). Reinforcement Learning: An Introduction. Link

Found an error on this page? Report an issue.