Key RL Algorithms: Q-Learning vs DQN vs Policy Gradients

A general deep RL schematic: A neural network learns a policy, that selects an action given a current state. The policy is learnt from rewards resulting from interactions with the environment. 
Title: A general deep RL schematic
Source: Mau-Luen Tham on ResearchGate

Introduction

Let’s first talk about the core RL loop:

act → get reward → update → repeat.

Now the natural question is:

What exactly do we update?

Most RL algorithms have different answers to that one question. Below are three big families you’ll hear everywhere.

One picture to keep in your head

Imagine an agent playing a game. At each moment it must decide: what should I do next?

There are three common strategies:

  1. Learn a score for each action and pick the biggest score (value-based).
  2. Do the same, but use a neural network to compute scores from complex inputs (deep value-based).
  3. Learn the decision rule directly (policy-based), and tune it to get more reward.

1) Q-Learning: a “score table” for actions

What it learns:

A function $Q(s,a)$: “If I’m in state (s) and take action (a), how good is that in the long run?”

In a small world (like our toy grid), you can literally store these scores in a table: one row per state, one column per action.

How it learns (idea, not heavy math):

After a step $(s,a,r,s’)$, Q-learning nudges its old score toward:

reward I just got + best score I can get next

That’s the famous update from Watkins & Dayan’s original paper. (Springer article: Q-Learning by Watkins & Dayan)

Why it’s great for beginners:

  • Extremely clear mental model: try actions, update scores, pick better actions next time.
  • Works well in small discrete environments (gridworlds, simple games).

Where it struggles:

  • Real problems often have huge states (images, sensor streams). You can’t keep a table that big.
  • Even with hand-designed features, combining Q-learning with function approximation can become tricky and unstable – one reason deep RL needed extra engineering.

2) DQN: Q-learning, but the “table” becomes a neural network

What it learns:

Still (Q(s,a)). Same goal. Same basic idea.

What changes:

Instead of a table, you use a neural network $(Q_\theta(s,a))$ that takes a state (maybe pixels) and outputs scores for each action.

This was the breakthrough that let agents learn directly from high-dimensional inputs (famously Atari).

Why DQN needed extra tricks:

When you train a neural network, the target you’re trying to match is itself built from your current network’s predictions. That can create a feedback loop: the learner “chases its own moving target.”

Two widely taught stabilizers are:

  • Experience replay: store past transitions and train on a random mix, rather than only the most recent experiences. This reduces the “everything is correlated” problem. Replay ideas appeared clearly in early neural-network RL work, and DQN made them mainstream.
  • Target networks: use a slowly updated copy of the network to compute the “best next” value, so the target doesn’t change too violently step to step.

When DQN is a good fit:

  • Discrete actions (left/right/jump, buy/sell/hold, etc.).
  • Big, messy observations (images, large feature vectors)

Common drawbacks:

  • Needs lots of data (many interactions).
  • Sensitive to reward design and hyperparameters.

3) Policy Gradients: learn the “decision rule” directly

Value-based methods learn scores, then choose the best action. Policy-gradient methods skip the score-table idea and learn the policy itself:

$$[ \pi_\theta(a\mid s) \quad \text{(probability of choosing action } a \text{ in state } s\text{)} ]$$

Core intuition:

If an action led to good outcomes, make it more likely next time. If it led to bad outcomes, make it less likely.

This idea appears in classic work like REINFORCE (Williams, 1992)

Why policy gradients matter:

  • They naturally handle continuous actions (like steering angles, robot torques), where “max over [discrete] actions” is awkward.
  • They naturally produce stochastic policies (sometimes randomness is useful or necessary).

The price you pay:

Policy-gradient estimates can be noisy (high variance), so learning can be slow unless you use variance reduction.

Actor-Critic: the common “best of both”

A very popular compromise is actor-critic:

  • The actor is the policy (\pi_\theta) (what to do).
  • The critic estimates value (how good things are) to provide a better learning signal.

This framework is a major strand of the current popular literature as of time of writing. (NeurIPS Papers)

A quick “when to use what” guide

If actions are discrete and the world is small/simple:

If actions are discrete but observations are huge (images, lots of sensors):

If actions are continuous (robotics/control) or you want a stochastic policy:

The main takeaway

All three approaches are trying to solve the same problem – get more long-term reward – but they choose different things to learn:

  • Q-learning (policy-free): learns a lookup table of action scores.
  • DQN (policy-free): learns action scores with a neural network.
  • Policy gradients (policy-based): learns the action-choosing rule directly.

If you remember that, you can understand most RL papers at a high level.

Videos:

  • This video provides a wide overview of methods used for model-based and model-free reinforcement learning, including Q-learning. (Runtime: 21 mins 36 secs)
YouTube video
Reinforcement Learning Methods by Steve Brunton
  • This video discusses methods used in deep reinforcement learning, covering deep Q-learning, as well as deep Q-learning, actor-critic methods, deep policy networks, and policy gradient optimization algorithms. (Runtime: 24 mins 49 secs)
YouTube video
Deep Reinforcement Learning Methods by Steve Brunton

References

  • Watkins, C. J. C. H., & Dayan, P. (1992). Q-learning. Machine Learning. (Springer)
  • Mnih, V., et al. (2015). Human-level control through deep reinforcement learning. Nature. (Nature)
  • Mnih, V., et al. (2013). Playing Atari with Deep Reinforcement Learning. arXiv:1312.5602. (arXiv)
  • Lin, L.-J. (1992). Self-improving reactive agents… Machine Learning (experience replay and related ideas). (Springer)
  • Williams, R. J. (1992). Simple statistical gradient-following algorithms… Machine Learning (REINFORCE). (Springer)
  • Sutton, R. S., McAllester, D., Singh, S., & Mansour, Y. (1999). Policy Gradient Methods… NeurIPS. (NeurIPS Papers)
  • Konda, V. R., & Tsitsiklis, J. N. (1999). Actor-Critic Algorithms. NeurIPS. (NeurIPS Papers)
  1. Introduction to Reinforcement Learning: A Beginner’s Guide
  2. What does ‘policy’ in Reinforcement Learning mean?
  3. What are the Advantages and Disadvantages of Reinforcement Learning?

Author: Sam M, Brown University

Author

Help us improve this post by suggesting in comments below:

– modifications to the text, and infographics
– video resources that offer clear explanations for this question
– code snippets and case studies relevant to this concept
– online blogs, and research publications that are a “must read” on this topic

Leave the first comment

Partner Ad
Find out all the ways that you can
Contribute