Basic Prerequisites: 02 · The MDP Framing and Deep Learning for Sequences.


1. Intuition & Practical Objective

Value-based RL learns how good each action is and then acts greedily. It never needs a model of the market: instead of predicting the next state’s probability (as value iteration does), it bootstraps - it uses its own current estimate of the value of the next state to improve the current estimate, watching only the realized reward and the realized next state. The celebrated update is Q-learning, and its deep version is DQN.

Practical objective: understand why Q-learning works (it is stochastic approximation of the Bellman optimality operator), when it is the right tool in trading (small, discrete action spaces - execution, sizing, regime switching), and why the finance setting stresses it to breaking (non-stationarity, tiny samples).

The key idea in one line: - move the estimate of the chosen action toward the observed reward plus the discounted best value you currently believe is reachable.


2. Mathematical Ground Truth & Derivations

2.1 Temporal-difference learning

The TD error is the surprise between the bootstrapped target and the current estimate. TD(0) nudges the value by :

TD is a stochastic approximation of the Bellman expectation backup; it converges to for a fixed policy under decaying step sizes (Robbins–Monro conditions ).

2.2 Q-learning and the max operator

Off-policy Q-learning (Watkins & Dayan 1992) approximates the optimality operator regardless of the behaviour policy:

The is what makes it off-policy (it learns about the greedy policy while behaving -greedily). For tabular Q-learning with -greedy exploration and decaying , with probability 1 (Watkins & Dayan). SARSA is the on-policy variant, using the actually taken next action instead of the max - safer under risk (it accounts for exploratory mistakes) but converges to a different, more conservative policy.

2.3 Why the max overestimates - and why that matters in finance

(Jensen). Because Q-learning maximizes over noisy estimates, it systematically overestimates values - the maximization bias. In trading, overestimation bias becomes over-trading: the agent believes actions are better than they are and acts when it should hold. Fixes: Double Q-learning (decouple action selection from evaluation), and its deep form Double DQN. This bias is first-principles, present in any maximization over noisy value estimates, and is a major reason naive RL agents trade too much.

2.4 DQN: value-based RL with function approximation

When the state space is large (continuous price features, portfolios), a table is impossible; DQN (Mnih et al. 2015) approximates with a neural network and stabilizes the divergence-prone “deadly triad” (function approximation + bootstrapping + off-policy) using two tricks:

  • Experience replay - store transitions in a buffer and sample minibatches, breaking temporal correlation.
  • Target network - a slowly-updated copy supplies the bootstrap target, freezing a moving goalpost.

Loss: .

Finance caveat: replay assumes stationarity - the same keeps its value across time. That assumption is precisely what markets violate, so replay buffers that span regimes silently mix incompatible data (05 · Failure Modes).


3. Computational Implementation - tabular Q-learning recovers exactly

The single most convincing demonstration: run Q-learning with no knowledge of or (only sampled transitions) on the liquidation MDP from the hub, and show it converges to the value-iteration solution. Stdlib only.

Q-learning, seeing only samples, reproduces the exact to and the exact greedy policy . This is the promise of value-based RL: learn the optimal control from experience, without a model. Note both hardcoded facts it needed - exploration that decays (otherwise it never visits and refines the good actions) and a step-size schedule that decays (otherwise the estimates never settle). Remove either and the result degrades; that sensitivity is the practical cost of being model-free.


4. Failure Modes & First-Principles Breakdowns

  1. Maximization bias → over-trading. The in Q-learning inflates values under noise (Jensen), so the learned policy acts too often. Use Double Q-learning / Double DQN. In a market with costs, “acting a little too often” is a direct, measurable P&L leak.
  2. Exploration is dangerous in trading. -greedy exploration executes real trades in production. Either explore only in simulation, or replace random exploration with safe exploration (small perturbations around a known-good baseline, e.g. TWAP).
  3. The deadly triad. Function approximation + bootstrapping + off-policy can diverge. DQN’s replay and target network are stability hacks, not proofs; the failure modes (semi-gradient divergence, Tsitsiklis & Van Roy) are real, especially with a non-stationary target.
  4. Replay assumes stationarity. A huge replay buffer mixes transitions from different regimes; the network learns an average that is optimal for none. Time-limited buffers or regime-stratified replay help but do not solve it.
  5. Sample inefficiency. Tabular Q-learning is cheap only because it is tiny. DQN needs – transitions; finance gives one path. The usual workaround - train in a simulator - imports the simulator’s biases wholesale (the sim-to-real gap, 05).
  6. Discrete-action limitation. Q-learning needs a over a finite action set. Continuous sizing / portfolio weights require either discretization (coarse, and the grid itself is a modelling error) or the policy-gradient methods of 04.

5. References

  • Sutton & Barto, Reinforcement Learning: An Introduction (2nd ed., 2018)
  • Watkins, Christopher & Dayan, Peter: “Q-learning” (Machine Learning 8, 1992)
  • van Hasselt, Hado; Guez, Arthur & Silver, David: “Deep Reinforcement Learning with Double Q-learning” (AAAI 2016)
  • Mnih, Volodymyr et al.: “Human-level Control through Deep Reinforcement Learning” (Nature 518, 2015)
  • Sutton, Richard S.: “Learning to Predict by the Methods of Temporal Differences” (Machine Learning 3, 1988)
  • Deng, Yue et al.: “Deep Direct Reinforcement Learning for Financial Signal Representation and Trading” (IEEE TNNLS, 2017)

6. Connected Graph Bridges