1. Home
  2. Explore
  3. Computer Science
  4. Reinforcement Learning Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Reinforcement Learning Overview

Reinforcement Learning: Organization of Approaches

The Reinforcement Learning Problem

In reinforcement learning, an agent interacts with an environment through a set of actions. Actions may be discrete (e.g., moves in chess) or continuous (e.g., torques applied by a robot arm). The agent observes the state of the system at each time step and uses that information to select actions. Its goal is to maximize cumulative future rewards.

The reward structure can be sparse — in many games (chess, Go, backgammon), the agent receives no feedback until the game ends (win/loss). This delayed-reward problem makes reinforcement learning challenging and mirrors real-world learning (e.g., training an animal with intermediate rewards).

The agent's control strategy is called the policy, denoted π\piπ. Formally, π(a∣s)\pi(a|s)π(a∣s) is the probability of taking action aaa when in state sss. Policies can be deterministic (always choose a specific action) or probabilistic (sample actions based on probabilities). The environment is typically modeled as a probabilistic process, so the policy is also expressed probabilistically.

The Value Function

For a given policy π\piπ, the value function Vπ(s)V^\pi(s)Vπ(s) measures the expected discounted future reward from state sss:

Vπ(s)=E[∑t=0∞γtrt  |  s0=s,π]V^\pi(s) = \mathbb{E}\left[ \sum_{t=0}^{\infty} \gamma^t r_t \;\middle|\; s_0 = s, \pi \right]Vπ(s)=E[∑t=0∞​γtrt​∣s0​=s,π]

where γ∈[0,1]\gamma \in [0,1]γ∈[0,1] is a discount factor (future rewards are less valuable, similar to economic utility functions). The value function tells the agent how good it is to be in a particular state under the current policy.

The goal of reinforcement learning is to learn, through trial and error (experience), the optimal policy π∗\pi^*π∗ that maximizes the value function for every state:

π∗=arg⁡max⁡πVπ(s)∀s\pi^* = \arg\max_{\pi} V^\pi(s) \quad \forall sπ∗=argmaxπ​Vπ(s)∀s

This is easy to state but extremely hard to solve. Even moderately complex problems (e.g., checkers) have astronomically large state spaces — the number of possible chess board configurations exceeds 108010^{80}1080. The value function cannot be enumerated; it must be approximated.

Key Nomenclature

  • Policy (π\piπ): Rules the agent uses to decide actions.

  • Value function (VπV^\piVπ): Expected discounted future reward from a state under π\piπ.

  • Quality function (Qπ(s,a)Q^\pi(s,a)Qπ(s,a)): Value of taking action aaa in state sss and then following π\piπ thereafter. Can be used to derive both optimal policy and value function.


Organizing the Landscape of Reinforcement Learning

Reinforcement learning draws from multiple fields — optimization theory, optimal control (Bellman's equation, HJB equation), neuroscience, behavioral science (Pavlov's dog), and modern deep learning. The major division among algorithms depends on what the agent knows about its environment.

Model-Based vs. Model-Free Reinforcement Learning

Model-based RL: The agent has (or learns) a model of the environment, such as a Markov Decision Process (MDP) with known transition probabilities or differential equations describing system dynamics.

Model-free RL: The agent does not have a model; it learns directly from interaction and experience.

Model-Based RL: Dynamic Programming and Optimal Control

If the environment is a Markov Decision Process (MDP), the transition probability P(s′ ∣ s,a)P(s' \,|\, s, a)P(s′∣s,a) is known — it depends only on the current state and action, not on history. Two powerful techniques use dynamic programming based on Bellman optimality:

  • Policy Iteration: Start with an initial policy, evaluate its value function, then improve the policy by acting greedily with respect to the value function. Repeat until convergence.

  • Value Iteration: Iteratively update the value function using the Bellman optimality equation, then extract the optimal policy.

For deterministic continuous control problems (e.g., robots, self-driving cars), the environment is often described by nonlinear differential equations

x˙=f(x,u)\dot{x} = f(x, u)x˙=f(x,u)

where xxx is the state and uuu is the control input. The optimal nonlinear control problem is solved using the Hamilton-Jacobi-Bellman (HJB) equation, again relying on Bellman optimality and dynamic programming.

Advantages of Model-Based RL:

  • Mathematically elegant and well-studied.

  • Efficient when a good model exists.

Limitations:

  • Dynamic programming essentially involves brute-force search over state and action spaces.

  • Not scalable to high-dimensional systems (typically limited to systems with fewer than ~100 dimensions; nonlinear fluid flows may have millions).

Model-Free RL: Gradient-Free vs. Gradient-Based

Most real-world problems lack a known model (e.g., playing chess — the opponent is unknown). Model-free RL approximates dynamic programming without a model, learning from trial and error.

The major divide within model-free RL is between gradient-free and gradient-based methods.

Gradient-Free Methods

When the policy cannot be differentiated (e.g., in games, you cannot compute the gradient of a game outcome with respect to policy parameters), we use gradient-free methods. These rely on sampling and experience replay.

Within gradient-free methods, an important distinction exists:

  • On-Policy Learning: The agent always uses its current best policy to interact with the environment and gather experience. It plays "optimally" every game, even if the policy is suboptimal. This approach is more conservative.

    • Example algorithm: SARSA (State-Action-Reward-State-Action). Many variants exist using temporal difference (TD) learning or Monte Carlo (MC) methods.

  • Off-Policy Learning: The agent can learn from experiences generated by a different policy — even random moves or suboptimal play. This allows learning from past data or from watching others (imitation learning).

    • Example algorithm: Q-Learning. The agent learns the quality function Q(s,a)Q(s,a)Q(s,a) directly, which implicitly defines the optimal policy and value: π∗(s)=arg⁡max⁡aQ(s,a)\pi^*(s) = \arg\max_a Q(s,a)π∗(s)=argmaxa​Q(s,a) and V∗(s)=max⁡aQ(s,a)V^*(s) = \max_a Q(s,a)V∗(s)=maxa​Q(s,a).

Q-Learning is the most widely used approach in modern machine learning reinforcement learning. It does not require a model and can incorporate off-policy data, accelerating convergence.

Key Contrast: On-Policy vs. Off-Policy

On-Policy (SARSA)

Off-Policy (Q-Learning)

Always uses current best policy for interaction

Can learn from any data (exploratory, suboptimal)

More conservative; may avoid risky exploration

Tends to converge faster

Requires fresh experience from current policy

Can reuse past experience (experience replay)

Gradient-Based Methods

If the policy is parameterized by a vector θ\thetaθ (e.g., weights of a neural network), and the reward or value function is differentiable with respect to θ\thetaθ, then policy gradient methods can be used. These directly compute gradients of a performance objective and apply steepest descent or Newton steps to update θ\thetaθ.

Advantages: Much faster than gradient-free methods when gradients are available. Utilizes powerful optimization tools (auto-diff, backpropagation).

Disadvantages: Requires a differentiable policy (not always possible, e.g., discrete actions may need special treatment).


Deep Reinforcement Learning

Over the past decade, the combination of reinforcement learning with deep neural networks has led to spectacular breakthroughs (Atari games, AlphaGo, robotics). Deep neural networks provide flexible, high-capacity representations for any component of the RL framework:

Component

Deep Network Representation

Model (environment)

Deep neural network to approximate transition dynamics (deep model-based RL)

Value function V(s)V(s)V(s)

Deep network (e.g., DQN) to approximate value

Quality function Q(s,a)Q(s,a)Q(s,a)

Deep Q-Network (DQN) – the classic deep RL approach

Policy π(a∣s)\pi(a|s)π(a∣s)

Deep policy network (policy gradient)

Actor-Critic

Two networks: one for policy (actor), one for value (critic)

Deep Model Predictive Control (MPC) is closely related: it solves optimal nonlinear control online and distills the controller into a policy network.

Actor-Critic methods existed long before deep learning but have been revitalized by deep neural networks. The actor learns the policy, the critic learns the value function, and both can be updated using gradient information.


Practical Guidance for Choosing an Algorithm

  • If you have an accurate model of the environment: Use dynamic programming (policy/value iteration for MDPs; HJB for continuous control).

  • If you have no model:

    • Can you compute gradients? Yes → Use gradient-based methods (policy gradient, actor-critic, deep policy networks). Much faster.

    • No gradients available: Use gradient-free methods:

      • On-policy (SARSA): Conservative, safe exploration.

      • Off-policy (Q-learning): Faster convergence, can use past data.

  • For high-dimensional or complex problems: Use deep neural networks to represent any of the above components (deep Q-networks, deep policy networks, deep actor-critic).

This organization is a mile-high view — a rough sketch of the main divides, not exhaustive. The following lectures will dive deep into each branch:

  1. Model-based: Policy iteration and value iteration for MDPs.

  2. Model-free gradient-free: SARSA and Q-learning (on-policy and off-policy).

  3. Temporal difference learning (connections to neuroscience).

  4. Optimal nonlinear control with the Hamilton-Jacobi-Bellman equation.

  5. Policy gradient optimization.

  6. Deep reinforcement learning methods throughout.

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent