Tabular Reinforcement Learning: Classical Methods

RSS

Tabular Reinforcement Learning represents the foundation of modern RL algorithms. These methods work with finite state and action spaces, storing value estimates in tables (hence “tabular”). Understanding these algorithms is essential before diving into function approximation and deep RL.

This series covers six fundamental algorithms, progressing from model-based to model-free approaches.


The Landscape of Tabular RL

                    Tabular RL Methods
                           │
           ┌───────────────┴───────────────┐
           │                               │
    Model-Based                      Model-Free
  (Requires P, R)                 (Learns from experience)
           │                               │
    ┌──────┴──────┐              ┌─────────┴─────────┐
    │             │              │                   │
  Value       Policy          Monte              Temporal
 Iteration   Iteration        Carlo              Difference
                                │                    │
                           First-Visit         ┌─────┴─────┐
                           MC Control          │           │
                                            On-Policy   Off-Policy
                                            (SARSA)    (Q-Learning)
                                                            │
                                                      Double Q-Learning

Dynamic Programming Methods

These methods require complete knowledge of the environment dynamics (transition probabilities and rewards). They solve the Bellman equations exactly.

Value Iteration

The Idea: Iteratively apply the Bellman optimality operator until the value function converges, then extract the optimal policy.

AspectDetails
TypeModel-based
UpdatesSynchronous sweeps over all states
Complexity$O(\|S\|^2\|A\|)$ per iteration
ConvergenceGuaranteed (contraction mapping)

When to use: When you have the full MDP model and can afford to iterate over all states.


Policy Iteration

The Idea: Alternate between (1) evaluating the current policy and (2) improving it greedily. Converges to optimality in finite steps.

AspectDetails
TypeModel-based
UpdatesPolicy evaluation + improvement cycles
ComplexityHigher per iteration, but fewer iterations
ConvergenceGuaranteed in at most $\|A\|^{\|S\|}$ iterations

When to use: When you need exact policy evaluation or have a small state space.


Monte Carlo Methods

Monte Carlo methods learn from complete episodes of experience. No model required—just sample trajectories.

On-Policy First-Visit Monte Carlo Control

The Idea: Run episodes using an $\varepsilon$-greedy policy, compute returns, and update Q-values based on first visits to state-action pairs.

AspectDetails
TypeModel-free, on-policy
UpdatesEnd of each episode
BiasNone (uses true returns)
VarianceHigh

When to use: Episodic tasks where you can wait for complete trajectories. Good for problems where bootstrapping introduces too much bias.


Temporal Difference Methods

TD methods combine the best of DP and MC: they learn from experience (like MC) but update estimates based on other estimates (bootstrapping, like DP).

SARSA

The Idea: Update Q-values using the TD error with the actual next action taken by the policy.

$$Q(s,a) \leftarrow Q(s,a) + \alpha \left[ r + \gamma Q(s',a') - Q(s,a) \right]$$
AspectDetails
TypeModel-free, on-policy
UpdatesEvery step
Learns$Q^{\pi_\varepsilon}$ (policy being followed)
NameState-Action-Reward-State-Action

When to use: When you want the learned policy to account for exploration. Safer in environments with cliffs or penalties.


Q-Learning

The Idea: Update Q-values using the maximum over next actions, regardless of the action actually taken.

$$Q(s,a) \leftarrow Q(s,a) + \alpha \left[ r + \gamma \max_{a'} Q(s',a') - Q(s,a) \right]$$
AspectDetails
TypeModel-free, off-policy
UpdatesEvery step
Learns$Q^*$ (optimal policy directly)
IssueMaximization bias

When to use: When you want to learn the optimal policy while exploring with a different behavior policy.


Double Q-Learning

The Idea: Use two Q-tables to decouple action selection from evaluation, eliminating maximization bias.

$$Q_1(s,a) \leftarrow Q_1(s,a) + \alpha \left[ r + \gamma Q_2(s', \arg\max_{a'} Q_1(s',a')) - Q_1(s,a) \right]$$
AspectDetails
TypeModel-free, off-policy
UpdatesEvery step (alternating Q-tables)
Learns$Q^*$ (with reduced bias)
AdvantageUnbiased value estimates

When to use: When Q-learning overestimates values (common in stochastic environments).


Quick Comparison

AlgorithmModelPolicyBiasVarianceUpdate Frequency
Value IterationRequired—NoneNoneSync sweeps
Policy IterationRequired—NoneNoneSync sweeps
MC ControlFreeOnNoneHighEpisode end
SARSAFreeOnBootstrapMediumEvery step
Q-LearningFreeOffBootstrap + MaxMediumEvery step
Double Q-LearningFreeOffBootstrapMediumEvery step

Learning Path

I recommend studying these algorithms in order:

  1. Value Iteration — Understand the Bellman optimality equation
  2. Policy Iteration — See how evaluation and improvement interact
  3. Monte Carlo Control — Transition to model-free learning
  4. SARSA — Learn bootstrapping and TD errors
  5. Q-Learning — Understand off-policy learning
  6. Double Q-Learning — Appreciate the subtleties of maximization bias

Each article includes:


Prerequisites

To get the most from this series, you should be comfortable with:


This series covers tabular methods. For function approximation and deep RL, see the Deep RL series.