Papers
Topics
Authors
Recent
Search
2000 character limit reached

Q-Learning

Updated 20 August 2026
  • Q-learning is a model-free, off-policy reinforcement-learning algorithm that estimates optimal action values from sampled rewards and successor states without modeling transitions, supporting applications such as robotics, game playing, and control.
  • Its temporal-difference update combines immediate reward with the discounted maximum successor value, and it converges almost surely in finite discounted MDPs when rewards are bounded, all state–action pairs are visited infinitely often, and Robbins–Monro step sizes are used.
  • Modern extensions address maximization bias, large or continuous spaces, and exploration through Double Q-learning, ensembles, smoothing, nearest-neighbor methods, amortized action search, posterior sampling, and structured value factorization.

Q-learning is a model-free, off-policy reinforcement-learning algorithm that estimates the optimal action-value function through temporal-difference updates. Given a state–action pair, an observed reward, and a successor state, it updates the estimate toward a target formed from the immediate reward plus the discounted maximum estimated value at the successor state. In a discounted Markov decision process, the optimal action-value function is the fixed point of the Bellman optimality operator. Q-learning is consequently a stochastic-approximation method for solving Bellman optimality equations without explicitly estimating the transition kernel. Its central mechanisms are bootstrapping, asynchronous state–action updates, and an exploration–exploitation policy.

1. Formal framework and Bellman optimality

A discounted Markov decision process can be represented as

M=(S,A,P,R,γ),\mathcal M=(\mathcal S,\mathcal A,P,R,\gamma),

where S\mathcal S is the state space, A\mathcal A is the action space, P(ss,a)P(s'\mid s,a) is the transition kernel, R(s,a,s)R(s,a,s') is the reward function, and γ[0,1)\gamma\in[0,1) is the discount factor. For a policy π\pi, the action-value function is

Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].

The optimal action-value function is

Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).

It satisfies the Bellman optimality equation

Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].

Equivalently, the Bellman optimality operator S\mathcal S0 is

S\mathcal S1

For finite state and action spaces with bounded rewards, S\mathcal S2 is a S\mathcal S3-contraction in the supremum norm:

S\mathcal S4

Consequently, it has a unique fixed point, S\mathcal S5. An optimal greedy policy is obtained from

S\mathcal S6

The contraction property supplies the dynamic-programming basis for Q-learning. The algorithm does not calculate S\mathcal S7 exactly; it observes a sampled transition and uses a stochastic target whose conditional expectation corresponds to the Bellman operator. An elementary proof based on an action-replay process establishes almost-sure convergence for finite discounted MDPs under bounded rewards, infinite visitation of every state–action pair, and Robbins–Monro step-size conditions (Regehr et al., 2021).

2. Temporal-difference update and exploration

At time S\mathcal S8, Q-learning observes S\mathcal S9, selects A\mathcal A0, receives A\mathcal A1, and observes A\mathcal A2. Only the visited state–action entry is updated:

A\mathcal A3

The temporal-difference target is

A\mathcal A4

and the temporal-difference error is

A\mathcal A5

The update can therefore be written as

A\mathcal A6

For terminal successor states, the continuation term is normally omitted. The learning rate A\mathcal A7 controls the influence of new observations. In the classical convergence setting, each state–action pair must be visited infinitely often and its step sizes must satisfy

A\mathcal A8

The conditions are imposed along the visitation subsequence for each pair; a globally indexed schedule can fail when some coordinates are visited sparsely (Regehr et al., 2021).

Q-learning is off-policy because the action generating the transition need not be the action used in the target. The behavior policy may be A\mathcal A9-greedy:

P(ss,a)P(s'\mid s,a)0

The behavior policy supplies data, whereas the maximum in the target represents the greedy policy being evaluated. Sufficient exploration remains necessary: off-policy learning does not make unvisited state–action pairs identifiable.

Alternative exploration and target mechanisms retain this separation in different ways. Smoothed Q-learning replaces the maximum in the target with an action-weighted average that gradually concentrates on maximizing actions, while retaining off-policy learning and almost-sure convergence under finite-MDP assumptions (Barber, 2023). Q-learning with posterior sampling instead draws Gaussian samples of Q-values and selects the action with the largest sample, obtaining Thompson-sampling-style exploration and a tabular episodic regret bound of P(ss,a)P(s'\mid s,a)1 (Agrawal et al., 1 Jun 2025).

3. Convergence, approximation, and data requirements

The classical almost-sure convergence result assumes a finite MDP, bounded rewards, P(ss,a)P(s'\mid s,a)2, correct conditional sampling from the transition kernel, infinite visitation of every state–action pair, and Robbins–Monro step sizes. Under these conditions,

P(ss,a)P(s'\mid s,a)3

“Almost surely” means that convergence fails only on a set of trajectories having probability zero. It is an asymptotic statement and does not provide a finite-time convergence rate, a fixed stopping time, or an exploration guarantee.

The proof through action-replay processes constructs an auxiliary MDP whose optimal values are exactly the Q-learning iterates. The effective rewards and transition probabilities of this auxiliary process converge to the true reward and transition laws through Robbins–Monro averaging. Old samples lose influence through products of factors of the form P(ss,a)P(s'\mid s,a)4, while the Bellman contraction controls the remaining error. This yields a direct proof without invoking a general asynchronous stochastic-approximation theorem (Regehr et al., 2021).

Classical tabular assumptions become restrictive when states or actions are continuous or very large. Nearest Neighbor Q-Learning (NNQL) addresses continuous state spaces by maintaining values on a finite P(ss,a)P(s'\mid s,a)5-net and extending them through nearest-neighbor regression. Under Lipschitz rewards and transition densities, compact state space, finite actions, and a finite covering time P(ss,a)P(s'\mid s,a)6 for the behavior trajectory, NNQL obtains an accuracy-dependent trajectory complexity

P(ss,a)P(s'\mid s,a)7

where P(ss,a)P(s'\mid s,a)8 is evaluated at a resolution proportional to P(ss,a)P(s'\mid s,a)9. For well-behaved R(s,a,s)R(s,a,s')0-dimensional state spaces with sufficiently exploratory behavior, the covering time scales as R(s,a,s)R(s,a,s')1, yielding

R(s,a,s)R(s,a,s')2

A lower bound of

R(s,a,s)R(s,a,s')3

shows that the dimension-dependent rate is nearly unavoidable in the stated nonparametric setting (Shah et al., 2018).

Other approximations alter the representation while retaining the Q-learning target. Online random forests replace the Q-table or neural network with one online regression forest per discrete action, combined with experience replay, temporal knowledge weighting, and expanding forests. In the reported OpenAI Gym experiments, the method outperformed the stated DQN baselines in Blackjack and Inverted Pendulum but did not solve Lunar Lander; its Python implementation was approximately 100 times slower than the PyTorch DQN (Min et al., 2022).

4. Bias, smoothing, and multi-estimator corrections

Maximization bias

The maximum in the target is nonlinear. If estimated action values are noisy,

R(s,a,s)R(s,a,s')4

with zero-mean errors, then

R(s,a,s)R(s,a,s')5

Thus, action selection and evaluation with the same noisy estimator produce systematic overestimation. The effect is stronger with many actions, high reward or transition variance, and similar action values. Overestimated targets are bootstrapped into earlier state–action values.

Double Q-learning separates action selection from evaluation using two estimators. When updating R(s,a,s)R(s,a,s')6, an action is selected using R(s,a,s)R(s,a,s')7 and evaluated using R(s,a,s)R(s,a,s')8:

R(s,a,s)R(s,a,s')9

γ[0,1)\gamma\in[0,1)0

This reduces positive maximization bias but can produce underestimation because the independently evaluated action may be suboptimal.

Self-correcting Q-learning uses the current and previous Q-tables to modify only action selection:

γ[0,1)\gamma\in[0,1)1

The selected action is

γ[0,1)\gamma\in[0,1)2

but evaluation uses the current estimate:

γ[0,1)\gamma\in[0,1)3

Under finite-MDP, finite-variance, Robbins–Monro, and finite-γ[0,1)\gamma\in[0,1)4 assumptions, the method converges almost surely to γ[0,1)\gamma\in[0,1)5. Its tabular experiments report reduced overestimation in high-variance environments and faster learning than Double Q-learning in low-variance settings (Zhu et al., 2020).

Ensemble Bootstrapped Q-Learning (EBQL) generalizes Double Q-learning to γ[0,1)\gamma\in[0,1)6 estimators. When updating ensemble member γ[0,1)\gamma\in[0,1)7, it selects the action using γ[0,1)\gamma\in[0,1)8 and evaluates it using the average of the other members:

γ[0,1)\gamma\in[0,1)9

π\pi0

The update is

π\pi1

EBQL remains pessimistic in the idealized independent-estimator analysis but reduces evaluation variance and can improve mean-squared error relative to the equal split used by Double Q-learning (Peer et al., 2021).

Smoothed and two-step targets

Smoothed Q-learning replaces the hard maximum by

π\pi2

where π\pi3 is a probability distribution over actions. The update becomes

π\pi4

Because the weighted average is no larger than the maximum, the update suppresses the tendency of a single noisy high estimate to dominate. Softmax and clipped-max schedules are used to make π\pi5 increasingly concentrated on maximizing actions. Vanishing smoothing is required for convergence to π\pi6; fixed smoothing generally defines a different averaged Bellman operator (Barber, 2023).

Two-Step Q-Learning adds a discounted second transition without importance sampling:

π\pi7

The coefficient π\pi8 is bounded, decreases monotonically to zero, and satisfies

π\pi9

The additional transition therefore accelerates early information propagation while becoming asymptotically negligible. Under finite communicating MDPs, bounded rewards, persistent visitation, and Robbins–Monro step sizes, the iterates converge almost surely to Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].0 (Vijesh et al., 2024).

5. Scaling to complex state and action spaces

Q-learning’s basic target is simple in finite action spaces but becomes computationally difficult when actions are continuous, hybrid, or structured. Amortized Q-learning (AQL) replaces exhaustive maximization with a learned proposal distribution. At a state Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].1, it samples uniformly distributed candidates and proposal-distribution candidates, then selects

Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].2

The proposal is trained toward the best sampled action, with entropy regularization to reduce premature collapse. The target becomes

Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].3

For structured action spaces with Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].4 components and Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].5 choices per component, exhaustive enumeration requires Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].6 candidates, whereas AQL evaluates a sampled candidate set whose size is independent of the full Cartesian-product cardinality. It supports discrete, continuous, and hybrid action spaces, although continuous-action convergence is not formally established in the cited work (Wiele et al., 2020).

Decoupled Q-Networks (DecQN) address continuous control through bang-bang or bang-off-bang action discretization and value decomposition. With Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].7 action dimensions, each local utility is Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].8 and the joint critic is

Qπ(s,a)=Eπ[k=0γkrt+k+1  |  st=s,at=a].Q^\pi(s,a)= \mathbb E_\pi\left[ \sum_{k=0}^{\infty}\gamma^k r_{t+k+1} \;\middle|\; s_t=s,a_t=a \right].9

The additive structure factorizes joint maximization:

Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).0

This changes the maximization complexity from Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).1 to Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).2. The method uses a shared global state representation, target networks, double Q-learning, prioritized replay, and multi-step returns. Its reported experiments include control tasks with up to 38 action dimensions and show competitive performance with actor–critic methods, although the factorization cannot represent arbitrary nonadditive action interactions (Seyde et al., 2022).

Q-learning can also be embedded in meta-reinforcement learning. Meta-Q-Learning (MQL) conditions critics and policies on a recurrent trajectory context,

Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).3

so that

Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).4

can represent task-dependent values. MQL uses multi-task training, TD3-based off-policy learning, and test-time adaptation from new-task data plus propensity-weighted replay transitions from meta-training. The context encoder, rather than a task label, supplies information about the latent task (Fakoor et al., 2019).

For continuous-state problems, nearest-neighbor regression provides a nonparametric alternative; for high-dimensional structured actions, amortized candidate generation and factorized critics avoid exhaustive enumeration. These methods exchange the tabular representation for regularity assumptions, learned representations, or structural decompositions.

6. Model-based, heuristic, and emerging extensions

Q-learning is fundamentally model-free, but several methods augment it with explicit models or external information. Recursive Backwards Q-Learning (RBQL) is designed for deterministic episodic environments. It records transitions,

Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).5

and, after reaching a terminal state, traverses the learned graph backward. For a known deterministic transition, it applies

Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).6

Because successors are evaluated before their predecessors, a single backward traversal can propagate terminal information through the known portion of the graph. In maze experiments, RBQL required substantially fewer steps than regular Q-learning, with the reported episode-24 Q-learning-to-RBQL ratios increasing from Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).7 on Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).8 mazes to Q(s,a)=supπQπ(s,a).Q^*(s,a)=\sup_\pi Q^\pi(s,a).9 on Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].0 mazes (Diekhoff et al., 2024).

Lookahead-Bounded Q-Learning (LBQL) uses known transition structure and sampled exogenous disturbances to construct information-relaxation upper and lower bounds. The current Q-function serves as a dual-feasible penalty, and the Q-learning iterate is projected into the interval defined by stochastic approximations of those bounds. Under finite-state, finite-action, bounded-reward, visitation, and step-size assumptions, the projected Q-values and the bounds converge almost surely to Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].1 (Shar et al., 2020).

Neural-Network-Driven Reward Prediction Q-Learning (NDR-QL) uses a supervised CNN path-prediction model to provide two priors: a narrow guideline distribution and a broader connected region distribution. The guideline generates a dense reward field,

Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].2

while the region prediction biases Q-table initialization through an adaptive connected mask. The Q-learning update itself remains unchanged. In downscaled robot path-planning experiments, the paper reports a Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].3 improvement in convergence speed over baseline Q-learning and generally shorter, less variable paths, although the approach remains dependent on prediction quality and was evaluated primarily on simulated or dataset-based grid environments (Ji et al., 2024).

Other extensions focus on exploration and uncertainty. PSQL samples Gaussian Q-value posteriors for Thompson-sampling-style action selection. Its analyzed tabular episodic regret is

Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].4

near the lower bound Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].5 in its dependence on Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].6, Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].7, and Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].8, though with an additional factor of Q(s,a)=E[rt+1+γmaxaQ(st+1,a)st=s,at=a].Q^*(s,a) = \mathbb E\left[ r_{t+1} + \gamma\max_{a'}Q^*(s_{t+1},a') \mid s_t=s,a_t=a \right].9 (Agrawal et al., 1 Jun 2025). MinMaxMin Q-learning extends ensemble-based continuous-control actor–critic methods by adding disagreement among Q-networks to the target and replay priority. For an ensemble S\mathcal S00, disagreement is

S\mathcal S01

The method adds a batch-level disagreement bonus to a conservative target and uses disagreement-based prioritized replay. Reported MuJoCo and Bullet experiments show improved performance over DDPG, TD3, and TD7, but no convergence theorem is provided and excessive disagreement can itself produce overestimation (Soffair et al., 2024).

7. Scope, limitations, and significance

Q-learning’s main theoretical guarantees concern finite tabular MDPs with bounded rewards, discount factor below one, sufficient visitation, and diminishing step sizes. They do not directly extend to neural-network function approximation, replay buffers, target networks, continuous spaces, or arbitrary off-policy distributions. In particular, DQN-style systems retain the Q-learning target but no longer inherit the classical table-based contraction and coordinate-wise stochastic-approximation proof (Regehr et al., 2021).

The principal technical difficulties are:

  • Exploration coverage: unvisited state–action pairs cannot be estimated, and behavior-policy quality enters continuous-state guarantees through covering time or visitation probabilities.
  • Maximization bias: noisy maxima create overestimation, motivating Double Q-learning, self-correcting estimators, ensembles, smoothing, and disagreement-based methods.
  • Approximation error: discretization, nearest-neighbor interpolation, neural representation, random forests, and value factorization introduce errors not present in the tabular setting.
  • Computational maximization: continuous and combinatorial action spaces make direct S\mathcal S02 expensive or impossible.
  • Bootstrapping instability: errors in successor values enter current targets and may be repeatedly propagated.
  • Model mismatch: model-based and heuristic variants can accelerate learning in structured environments but depend on deterministic transitions, accurate models, or reliable external predictions.
  • Finite-time performance: almost-sure convergence does not specify how many interactions are required to attain a given accuracy or policy quality.

The continuing significance of Q-learning lies in the modularity of its Bellman target. The same update principle supports tabular stochastic approximation, continuous-state nearest-neighbor regression, ensembles and bias correction, posterior sampling, amortized action maximization, model-based backward propagation, and neural heuristic guidance. These extensions differ substantially in assumptions and guarantees, but they retain the central computational pattern:

S\mathcal S03

Q-learning is therefore not a single implementation but a family of value-based methods organized around off-policy Bellman optimality. Its classical form is mathematically tractable and asymptotically convergent under strong conditions; its modern variants address the resulting limitations through structured approximation, uncertainty estimation, bias control, planning, and scalable maximization.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Q-Learning.