Deep Reinforcement Learning
Deep Reinforcement Learning
Introduction
Deep reinforcement learning (deep RL) combines reinforcement learning with deep neural networks, becoming one of the most exciting areas in control theory and machine learning over the past decade. This approach allows reinforcement learning algorithms to scale to high-dimensional state and action spaces by using neural networks as function approximators for policies, value functions, or quality functions.
Deep Policy Networks
The simplest way to embed a deep neural network into a reinforcement learner is through a deep policy network. The policy function π(s,a) gives the probability of taking action a given state s. The policy is parameterized by a neural network with weights θ:
Deep Policy Network: A neural network that takes the state s as input and outputs a probability distribution over actions, parameterized by weights θ. The goal is to optimize θ to maximize the cumulative future reward.
The policy πθ(a∣s) is a function of the state, often high-dimensional (e.g., pixel space).
The neural network outputs probabilities for each action; the agent samples actions based on these probabilities.
Optimization over θ is performed using gradient-based methods (e.g., backpropagation) on a loss function that involves the expected future reward.
A classic example is Pong from pixels (Andrej Karpathy's blog), where a deep policy network with ~150 lines of Python code learns to play Pong directly from raw pixel inputs. The network takes over a thousand pixels as input and outputs the probability of moving the paddle up or down.
Policy Gradient Optimization
Policy gradient methods provide a principled way to update policy parameters θ by computing the gradient of the expected cumulative reward with respect to θ. This is more general than neural networks — any parameterized policy can use this approach.
The expected cumulative future reward R(σ∣θ) for a policy πθ can be expressed using the asymptotic state distribution μθ(s) and the quality function Q(s,a):
μθ(s) is the long-term probability of being in state s under policy πθ.
Q(s,a) is the expected future reward from taking action a in state s.
To optimize θ, we compute the gradient ∇θR(θ):
This policy gradient is derived using the log-derivative trick:
Start with the expression for R(θ).
Compute gradient, noting that μθ(s) depends on θ (a subtle point often glossed over).
Rewrite using ∇θπθ(a∣s)=πθ(a∣s)∇θlogπθ(a∣s).
The result becomes an expectation over the policy of the quality function times the gradient of the log-policy.
The gradient signal ∇θlogπθ(a∣s)⋅Q(s,a) is easier to compute with backpropagation and provides the update direction for θ to increase the expected reward.
Deep Q Learning
Deep Q learning is one of the most successful and widely demonstrated deep RL methods. It uses a neural network to approximate the quality function Q(s,a), parameterized by weights θ.
Deep Q Learning: A neural network parameterizes the quality function Qθ(s,a), and the network is trained to minimize the temporal difference (TD) error.
The basic Q-learning update (from earlier lectures) is:
In deep Q learning, the loss function for the neural network is the mean squared TD error:
The network is trained using stochastic gradient descent and backpropagation.
This replaces storing Q values for every state-action pair, which is infeasible for large state spaces (e.g., chess has ~1080 states, Go even more).
The neural network acts as a function approximator, extracting low-dimensional features of the quality function.
Applications: DeepMind's Atari game playing is a landmark example. A convolutional neural network takes raw pixel input and learns to play games like Breakout, often discovering strategies that rival expert humans (e.g., drilling a hole in the wall to let the ball bounce behind blocks).
Architecture:
Convolutional layers process pixel space.
Fully connected layers map to joystick actions.
The network learns the optimal Q function through trial and error.
The approach achieved human-level control on many Atari games (those above a "human-level" threshold).
Dueling Deep Q Networks (DDQN)
A variation called dueling deep Q networks splits the quality function into two separate networks:
Value network V(s): estimates the value of being in state s.
Advantage network A(s,a): estimates the advantage of taking action a over other actions in state s.
The quality function is reconstructed as:
This decomposition is useful when the quality of different actions is very similar for a given state. The two networks are trained jointly — the value network tries to explain as much of Q as possible from the state alone, and the advantage network captures the marginal effect of each action. This can improve learning efficiency, especially in games where state differences are more informative than action differences.
Actor-Critic Methods
Actor-critic methods combine the strengths of policy-based and value-based reinforcement learning. They are older than deep RL but have been adapted successfully with neural networks.
Actor-Critic: Two learners — an actor learns a policy π, and a critic learns a value function V (or Q). The critic critiques the actor's policy, providing feedback to improve it.
Actor: A policy network that decides actions (policy-based learner).
Critic: A value network that estimates how good the current state/action is (value-based learner).
Actor-Critic Policy Gradient
A simple implementation uses the policy gradient from earlier, but the quality function Q is now provided by the critic. The actor updates its parameters θ using:
The critic learns Q(s,a) using temporal difference learning.
The actor uses the critic's Q estimate to compute the gradient and update its policy.
This mixes value-based information (from the critic) with policy optimization (from the actor).
Advantage Actor-Critic (A2C)
Using the dueling Q network idea, the critic can provide an advantage function A(s,a)=Q(s,a)−V(s), which reduces variance in the policy gradient. The advantage actor-critic method uses:
Actor: a deep policy network πθ(a∣s).
Critic: a deep dueling Q network that outputs V(s) and A(s,a).
The policy gradient update then uses the advantage instead of the raw Q:
This approach is more stable and converges faster than pure Q-learning or pure policy gradient because gradient-based updates are more efficient than model-free value iteration.
Deep Actor-Critic with DDQN Critic
A modern deep actor-critic architecture:
Critic: a deep dueling Q network (DDQN) that learns Q(s,a) using TD error.
Actor: a deep policy network updated with policy gradients, using the critic's Q as the quality estimate.
The critic is updated by minimizing the TD error (like deep Q learning), while the actor is updated using the policy gradient derived from the critic's output. This joint optimization allows the agent to learn both a value function and a policy simultaneously.
Deep Model Predictive Control (Mentioned)
A different flavor of deep RL is deep model predictive control (MPC). This approach uses classical optimal control (model predictive control) — which involves expensive online optimization with model forecasting — and then trains a neural network policy to mimic the optimal controller. The trained network can then make decisions rapidly without the computational overhead of online MPC. This area is a separate topic with ongoing research.
Summary
Approach | Core Idea | Key Algorithm |
|---|---|---|
Deep Policy Network | Neural network outputs action probabilities | Policy gradient with backprop |
Deep Q Learning | Neural network approximates Q(s,a) | Minimize TD error |
Dueling DQN | Split Q into V and A | Improved sample efficiency |
Actor-Critic | Separate policy (actor) and value (critic) | Joint update using policy gradient and TD learning |
Advantage Actor-Critic | Use advantage A=Q−V for policy gradient | A2C, A3C |
Deep reinforcement learning continues to evolve rapidly, with new architectures and algorithms appearing regularly. The combination of deep neural networks with reinforcement learning principles has enabled breakthroughs in game playing, robotics, and control.

Ask anything
We've read this whole study set, so questions about it get the best answers.