Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Amortized Action Optimization

The previous chapter showed how fitted Q-iteration handles large state spaces through function approximation. FQI maintains a unified structure across batch and online settings: a replay buffer Bt\mathcal{B}_t inducing empirical distribution P^Bt\hat{P}_{\mathcal{B}_t}, a target map TqT_q derived from the Bellman operator, a loss function \ell, and an optimization budget. Algorithms differ in how they instantiate these components (buffer evolution, hard vs soft Bellman, update frequency), but all follow the same template.

However, this framework breaks down when the action space becomes large or continuous. Computing Bellman targets requires evaluating maxaAq(s,a;θ)\max_{a' \in \mathcal{A}} q(s',a';\boldsymbol{\theta}) for each next state ss'. When actions are continuous (ARm\mathcal{A} \subset \mathbb{R}^m), this maximization requires solving a nonlinear program at every target computation. For a replay buffer with millions of transitions, this becomes computationally prohibitive.

Can the repeated maximization be replaced by a learned state-to-action map? Amortization invests computation during training so that action selection requires only a forward pass at execution time.

The strategies we examine are:

  1. Explicit optimization (Section 2): Solve the maximization numerically for a subset of states, accepting the computational cost for exact solutions.

  2. Policy network amortization: Learn a deterministic policy network πw\pi_{\boldsymbol{w}} that approximates argmaxaq(s,a;θ)\arg\max_a q(s,a;\boldsymbol{\theta}), enabling fast action selection via a single forward pass. NFQCA, DDPG, and TD3 instantiate this route.

Each approach represents a different point in the computation-accuracy trade-off, and all fit within the FQI template by modifying how targets are computed.

Explicit Optimization

What is the computational cost of solving the continuous-action maximization directly for every fitted-Q target?

Recall that in fitted Q methods, the main idea is to compute the Bellman operator only at a subset of all states, relying on function approximation to generalize to the remaining states. At each step of the successive approximation loop, we build a dataset of input state-action pairs mapped to their corresponding optimality operator evaluations:

Dn={((s,a),(Lq)(s,a;θn))(s,a)B}\mathcal{D}_n = \{((s, a), (\Bellman q)(s, a; \boldsymbol{\theta}_n)) \mid (s,a) \in \mathcal{B}\}

This dataset is then fed to our function approximator (neural network, random forest, linear model) to obtain the next set of parameters:

θn+1fit(Dn)\boldsymbol{\theta}_{n+1} \leftarrow \texttt{fit}(\mathcal{D}_n)

While this strategy allows us to handle very large or even infinite (continuous) state spaces, it still requires maximizing over actions (maxaA\max_{a \in \mathcal{A}}) during the dataset creation when computing the operator L\Bellman for each basepoint. This maximization becomes computationally expensive for large action spaces. We can address this by adding another level of optimization: for each sample added to our regression dataset, we employ numerical optimization methods to find actions that maximize the Bellman operator for the given state.

The above pseudocode introduces a generic maximize\texttt{maximize} routine which represents any numerical optimization method that searches for an action maximizing the given function. This approach is versatile and can be adapted to different types of action spaces. For continuous action spaces, we can employ standard nonlinear optimization methods like gradient descent or L-BFGS (e.g., using scipy.optimize.minimize). For large discrete action spaces, we can use integer programming solvers - linear integer programming if the Q-function approximator is linear in actions, or mixed-integer nonlinear programming (MINLP) solvers for nonlinear Q-functions. The choice of solver depends on the structure of our Q-function approximator and the constraints on our action space.

While explicit optimization provides exact solutions, it becomes computationally expensive when we need to compute targets for millions of transitions in a replay buffer. Can we avoid solving an optimization problem at every decision? The answer is amortization.

Amortized Optimization Approach

Can expensive action searches performed during training supervise a map that returns actions cheaply at deployment time?

This process is computationally intensive. We can “amortize” some of this computation by replacing the explicit optimization for each sample with a direct mapping that gives us an approximate maximizer directly. For Q-functions, recall that the operator is given by:

(Lq)(s,a)=r(s,a)+γp(dss,a)maxaA(s)q(s,a)(\Bellman q)(s,a) = r(s,a) + \gamma \int p(ds'|s,a)\max_{a' \in \mathcal{A}(s')} q(s', a')

If qq^* is the optimal state-action value function, then v(s)=maxaq(s,a)v^*(s) = \max_a q^*(s,a), and we can derive the optimal policy directly by computing the decision rule:

π(s)=argmaxaA(s)q(s,a)\pi^\star(s) = \arg\max_{a \in \mathcal{A}(s)} q^\star(s,a)

Since qq^* is a fixed point of L\Bellman, we can write:

q(s,a)=(Lq)(s,a)=r(s,a)+γp(dss,a)maxaA(s)q(s,a)=r(s,a)+γp(dss,a)q(s,π(s))\begin{align*} q^\star(s,a) &= (\Bellman q^*)(s,a) \\ &= r(s,a) + \gamma \int p(ds'|s,a) \max_{a' \in \mathcal{A}(s')} q^\star(s', a') \\ &= r(s,a) + \gamma \int p(ds'|s,a) q^\star(s', \pi^\star(s')) \end{align*}

Note that π\pi^\star is implemented by our maximize\texttt{maximize} numerical solver in the procedure above. A practical strategy would be to collect these maximizer values at each step and use them to train a function approximator that directly predicts these solutions. Due to computational constraints, we might want to compute these exact maximizer values only for a subset of states, based on some computational budget, and use the fitted decision rule to generalize to the remaining states. This leads to the following amortized version:

Note that the policy πw\pi_{\boldsymbol{w}} is being trained on a dataset Dπ\mathcal{D}_\pi containing optimal actions computed with respect to an evolving Q-function. Specifically, at iteration nn, we collect pairs (s,as)(s', a^*_{s'}) where as=argmaxaq(s,a;θn)a^*_{s'} = \arg\max_a q(s', a; \boldsymbol{\theta}_n). However, after updating to θn+1\boldsymbol{\theta}_{n+1}, these actions may no longer be optimal with respect to the new Q-function.

A natural approach to handle this staleness would be to maintain only the most recent optimization data. We could modify our procedure to keep a sliding window of KK iterations, where at iteration nn, we only use data from iterations max(0,nK)\max(0, n-K) to nn. This would be implemented by augmenting each entry in Dπ\mathcal{D}_\pi with a timestamp:

Dπ(n)={(s,as,t)t{nK,,n}}\mathcal{D}_\pi^{(n)} = \{(s', a^*_{s'}, t) \mid t \in \{n-K,\ldots,n\}\}

where tt indicates the iteration at which the optimal action was computed. When fitting the policy network, we would then only use data points that are at most KK iterations old:

wn+1fit({(s,as)(s,as,t)Dπ(n),nKtn})\boldsymbol{w}_{n+1} \leftarrow \texttt{fit}(\{(s', a^*_{s'}) \mid (s', a^*_{s'}, t) \in \mathcal{D}_\pi^{(n)}, n-K \leq t \leq n\})

This introduces a trade-off between using more data (larger KK) versus using more recent, accurate data (smaller KK). The choice of KK would depend on how quickly the Q-function evolves and the computational budget available for computing exact optimal actions.

The main limitation of this approach, beyond the out-of-distribution drift, is that it requires computing exact optimal actions via the solver for states in Bopt\mathcal{B}_{\text{opt}}. Can we reduce or eliminate this computational expense? As the policy improves at selecting actions, we can bootstrap from these increasingly better choices. Continuously amortizing these improving actions over time creates a virtuous cycle of self-improvement toward the optimal policy. However, this bootstrapping process requires careful management: moving too quickly can destabilize training.

Deterministic Parametrized Policies

Which function class can represent a direct state-to-action map for continuous control?

In this section, we consider deterministic parametrized policies of the form πw(s)\pi_{\boldsymbol{w}}(s) which directly output an action given a state. This approach differs from stochastic policies that output probability distributions over actions, making it particularly suitable for continuous control problems where the optimal policy is often deterministic. Fitted Q-value methods can be naturally extended to simultaneously learn both the Q-function and such a deterministic policy.

The Amortization Problem for Continuous Actions

Which objective makes the parameterized actor approximate the maximizing action of the current critic across a state distribution?

When actions are continuous, aRda \in \mathbb{R}^d, extracting a greedy policy from a Q-function becomes computationally expensive. Consider a robot arm control task where the action is a dd-dimensional torque vector. To act greedily given Q-function q(s,a;θ)q(s,a; \boldsymbol{\theta}), we must solve:

π(s)=argmaxaAq(s,a;θ),\pi(s) = \arg\max_{a \in \mathcal{A}} q(s, a; \boldsymbol{\theta}),

where ARd\mathcal{A} \subset \mathbb{R}^d is a continuous set (often a box or polytope). This requires running an optimization algorithm at every time step. For neural network Q-functions, this means solving a nonlinear program whose objective involves forward passes through the network.

After training converges, the agent must select actions in real-time during deployment. Running interior-point methods or gradient-based optimizers at every decision creates unacceptable latency, especially in high-frequency control where decisions occur at 100Hz or faster.

The solution is to amortize the optimization cost by learning a separate policy network πw(s)\pi_{\boldsymbol{w}}(s) that directly outputs actions. During training, we optimize w\boldsymbol{w} so that πw(s)argmaxaq(s,a;θ)\pi_{\boldsymbol{w}}(s) \approx \arg\max_a q(s,a; \boldsymbol{\theta}) for states we encounter. At deployment, action selection reduces to a single forward pass through the policy network: a=πw(s)a = \pi_{\boldsymbol{w}}(s). The computational cost of optimization is paid during training (where time is less constrained) rather than at inference.

This introduces a second approximation beyond the Q-function. We now have two function approximators: a critic q(s,a;θ)q(s,a; \boldsymbol{\theta}) that estimates values, and an actor πw(s)\pi_{\boldsymbol{w}}(s) that selects actions. The critic is trained using Bellman targets as in standard fitted Q-iteration. The actor is trained to maximize the critic:

ww+αEs[wq(s,πw(s);θ)],\boldsymbol{w} \leftarrow \boldsymbol{w} + \alpha \mathbb{E}_s \left[\nabla_{\boldsymbol{w}} q(s, \pi_{\boldsymbol{w}}(s); \boldsymbol{\theta})\right],

where the expectation is over states in the dataset or replay buffer. This gradient ascent pushes the actor toward actions that the critic considers valuable. By the chain rule, this equals (aq(s,a;θ)a=πw(s))(wπw(s))(\nabla_a q(s,a; \boldsymbol{\theta})|_{a=\pi_{\boldsymbol{w}}(s)}) \cdot (\nabla_{\boldsymbol{w}} \pi_{\boldsymbol{w}}(s)), which can be efficiently computed via backpropagation through the composition of the two networks.

Neural Fitted Q-Iteration for Continuous Actions (NFQCA)

How does a fitted-Q batch algorithm change when an actor supplies each continuous maximizing action in the Bellman target?

NFQCA Hafner & Riedmiller, 2011 extends the NFQI template from the previous chapter to handle continuous action spaces by replacing the maxaq(s,a;θ)\max_{a'} q(s',a'; \boldsymbol{\theta}) operator in the Bellman target with a parameterized policy πw(s)\pi_{\boldsymbol{w}}(s'). This transforms fitted Q-iteration into an actor-critic method: the critic q(s,a;θ)q(s,a; \boldsymbol{\theta}) evaluates state-action pairs via the standard regression step, while the actor πw(s)\pi_{\boldsymbol{w}}(s) provides actions by directly maximizing the learned Q-function.

The algorithm retains the two-level structure of NFQI: an outer loop performs approximate value iteration by computing Bellman targets, and an inner loop fits the Q-function to those targets. NFQCA adds a third component (policy improvement) that updates w\boldsymbol{w} to maximize the Q-function over states sampled from the dataset.

From Discrete to Continuous Actions

Recall from the FQI chapter that NFQI computes Bellman targets using the hard max:

ys,a=r+γmaxaAq(s,a;θn)y_{s,a} = r + \gamma \max_{a' \in \mathcal{A}} q(s',a'; \boldsymbol{\theta}_n)

When A\mathcal{A} is finite and small, this max is computed by enumeration. When A\mathcal{A} is continuous or high-dimensional, enumeration is intractable. NFQCA replaces the max with a parameterized policy that approximately solves the maximization:

ys,a=r+γq(s,πwn(s);θn)y_{s,a} = r + \gamma q(s', \pi_{\boldsymbol{w}_n}(s'); \boldsymbol{\theta}_n)

The policy πw(s)\pi_{\boldsymbol{w}}(s) acts as an amortized optimizer: instead of solving argmaxaq(s,a)\arg\max_{a'} q(s',a') from scratch at each state ss' during target computation, we train a neural network to output near-optimal actions directly. The term “amortized” refers to spreading the cost of optimization across training: we pay once to learn πw\pi_{\boldsymbol{w}}, then reuse it for all future target computations.

To train the policy, we maximize the expected Q-value under the distribution of states in the dataset. If we had access to the optimal Q-function qq^*, we would solve:

maxwEsP^D[q(s,πw(s))]\max_{\boldsymbol{w}} \mathbb{E}_{s \sim \hat{P}_{\mathcal{D}}}[q^*(s, \pi_{\boldsymbol{w}}(s))]

where P^D\hat{P}_{\mathcal{D}} is the empirical distribution over states induced by the offline dataset D\mathcal{D}. In practice, we use the current Q-function approximation q(s,a;θn+1)q(s,a; \boldsymbol{\theta}_{n+1}) after it has been fitted to the latest targets. The expectation is approximated by the sample average over states appearing in D\mathcal{D}:

maxw1D(s,a,r,s)Dq(s,πw(s);θn+1)\max_{\boldsymbol{w}} \frac{1}{|\mathcal{D}|} \sum_{(s,a,r,s') \in \mathcal{D}} q(s, \pi_{\boldsymbol{w}}(s); \boldsymbol{\theta}_{n+1})

This policy improvement step runs after the Q-function has been updated, using the newly-fitted critic to guide the actor toward higher-value actions. Both the Q-function fitting and policy improvement use gradient-based optimization on the respective objectives.

The algorithm structure mirrors NFQI (Algorithm 1 in the FQI chapter) with two extensions. First, target computation (line 7-8) replaces the discrete max with a policy network call πwn(s)\pi_{\boldsymbol{w}_n}(s'), making the Bellman operator tractable for continuous actions. Second, after fitting the Q-function (line 11), we add a policy improvement step (line 13) that updates w\boldsymbol{w} to maximize the Q-function evaluated at policy-generated actions over states in the dataset.

Both fit operations use gradient descent with warm starting, consistent with the NFQI template. The Q-function minimizes squared Bellman error using targets computed with the current policy. The policy maximizes the Q-function via gradient ascent on the composition q(s,πw(s);θn+1)q(s, \pi_{\boldsymbol{w}}(s); \boldsymbol{\theta}_{n+1}), which is differentiable end-to-end when both networks are differentiable. The gradient with respect to w\boldsymbol{w} is:

wq(s,πw(s);θ)=aq(s,a;θ)a=πw(s)wπw(s)\nabla_{\boldsymbol{w}} q(s, \pi_{\boldsymbol{w}}(s); \boldsymbol{\theta}) = \nabla_a q(s, a; \boldsymbol{\theta})\Big|_{a=\pi_{\boldsymbol{w}}(s)} \cdot \nabla_{\boldsymbol{w}} \pi_{\boldsymbol{w}}(s)

computed via the chain rule (backpropagation through the actor into the critic). Modern automatic differentiation libraries handle this composition automatically.

Deep Deterministic Policy Gradient (DDPG)

How can the batch actor-critic construction collect new transitions and update both networks online?

We now extend NFQCA to the online setting with evolving replay buffers, mirroring how DQN extended NFQI in the FQI chapter. Just as DQN allowed Bt\mathcal{B}_t and P^Bt\hat{P}_{\mathcal{B}_t} to evolve during learning instead of using a fixed offline dataset, DDPG Lillicrap et al., 2015 collects new transitions during training and stores them in a circular replay buffer.

Like DQN, DDPG uses the flattened FQI structure with target networks. But where DQN maintains a single target network θtarget\boldsymbol{\theta}_{\text{target}} for the Q-function, DDPG maintains two target networks: one for the critic θtarget\boldsymbol{\theta}_{\text{target}} and one for the actor wtarget\boldsymbol{w}_{\text{target}}. Both are updated periodically (every KK steps) to mark outer-iteration boundaries, following the same nested-to-flattened transformation shown for DQN.

The online network now plays a triple role in DDPG: (1) the parameters being actively trained (θt\boldsymbol{\theta}_t for critic, wt\boldsymbol{w}_t for actor), (2) the policy used to collect new data, and (3) the gradient source for policy improvement. The target networks serve only one purpose: computing stable Bellman targets.

Exploration via Action Noise

Since the policy πw(s)\pi_{\boldsymbol{w}}(s) is deterministic, exploration requires adding noise to actions during data collection:

a=πwt(s)+ηta = \pi_{\boldsymbol{w}_t}(s) + \eta_t

where ηt\eta_t is exploration noise. The original DDPG paper used an Ornstein-Uhlenbeck (OU) process, which generates temporally correlated noise through the discretized stochastic differential equation:

ηt+1=ηt+θ(μηt)Δt+σΔtϵt,ϵtN(0,1)\eta_{t+1} = \eta_t + \theta(\mu - \eta_t)\Delta t + \sigma\sqrt{\Delta t}\epsilon_t, \quad \epsilon_t \sim \mathcal{N}(0,1)

where μ\mu is the long-term mean (typically 0), θ\theta controls the strength of mean reversion, σ\sigma scales the random fluctuations, and Δt\Delta t is the time step. The term θ(μηt)Δt\theta(\mu - \eta_t)\Delta t acts like damped motion through a viscous fluid: when ηt\eta_t deviates from μ\mu, this force pulls it back smoothly without oscillation. The random term σΔtϵt\sigma\sqrt{\Delta t}\epsilon_t adds perturbations, creating noise that wanders but is gently pulled back toward μ\mu. This temporal correlation produces smoother exploration trajectories than independent Gaussian noise.

However, later work (including TD3, discussed below) found that simple uncorrelated Gaussian noise ηtN(0,σ2)\eta_t \sim \mathcal{N}(0, \sigma^2) works equally well and is easier to tune. The exploration mechanism is orthogonal to the core algorithmic structure.

The algorithm structure parallels DQN (Algorithm 5 in the FQI chapter) with the continuous-action extensions from NFQCA. Lines 1-5 initialize both networks and their targets, following the same pattern as DQN but with an additional actor network. Line 3 uses the online actor with exploration noise for data collection, replacing DQN’s ε\varepsilon-greedy selection. Line 7 computes targets using both target networks: the actor target πwtarget(si)\pi_{\boldsymbol{w}_{\text{target}}}(s'_i) selects the next action, the critic target q(;θtarget)q(\cdot; \boldsymbol{\theta}_{\text{target}}) evaluates it. This replaces the maxa\max_{a'} operator in DQN. Lines 8-9 update both networks: critic via TD error minimization, actor via policy gradient through the updated critic. Line 10 performs periodic hard updates every KK steps, marking outer-iteration boundaries.

The policy gradient in line 9 uses the chain rule to backpropagate through the actor-critic composition:

wq(s,πw(s);θ)=aq(s,a;θ)a=πw(s)wπw(s)\nabla_{\boldsymbol{w}} q(s, \pi_{\boldsymbol{w}}(s); \boldsymbol{\theta}) = \nabla_a q(s,a; \boldsymbol{\theta})\Big|_{a=\pi_{\boldsymbol{w}}(s)} \cdot \nabla_{\boldsymbol{w}} \pi_{\boldsymbol{w}}(s)

This is identical to the NFQCA gradient, but now computed on mini-batches sampled from an evolving replay buffer rather than a fixed offline dataset. The critic gradient aq(s,a;θ)\nabla_a q(s,a; \boldsymbol{\theta}) at the policy-generated action provides the direction of steepest ascent in Q-value space, weighted by how sensitive the policy output is to its parameters via wπw(s)\nabla_{\boldsymbol{w}} \pi_{\boldsymbol{w}}(s).

Twin Delayed Deep Deterministic Policy Gradient (TD3)

Which critic and target modifications prevent a deterministic actor from exploiting narrow errors in one learned Q-function?

DDPG inherits the overestimation bias from DQN’s use of the max operator in Bellman targets. TD3 Fujimoto et al., 2018 addresses this through three modifications to the DDPG template, following similar principles to Double DQN but adapted for continuous actions and taking a more conservative approach.

Twin Q-Networks and the Minimum Operator

Recall from the Monte Carlo chapter that overestimation arises when we use the same noisy estimate both to select which action looks best and to evaluate that action. Double Q-learning breaks this coupling by maintaining two independent estimators with noise terms εa(1)\varepsilon^{(1)}_a and εa(2)\varepsilon^{(2)}_a:

a=argmaxa{r(s,a)+γμ^N(1)(s,a)},Y=r(s,a)+γμ^N(2)(s,a).a^\star = \arg\max_{a} \left\{r(s,a) + \gamma \hat{\mu}^{(1)}_N(s,a)\right\}, \quad Y = r(s,a^\star) + \gamma \hat{\mu}^{(2)}_N(s,a^\star).

When ε(1)\varepsilon^{(1)} and ε(2)\varepsilon^{(2)} are independent, the tower property of conditional expectation gives E[εa(2)a]=E[εa(2)]=0\mathbb{E}[\varepsilon^{(2)}_{a^\star} \mid a^\star] = \mathbb{E}[\varepsilon^{(2)}_{a^\star}] = 0 because aa^\star (determined by ε(1)\varepsilon^{(1)}) is independent of ε(2)\varepsilon^{(2)}. This eliminates evaluation bias: we no longer use the same positive noise that selected an action to also inflate its value. By conditioning on the selected action and then taking expectations over the independent evaluation noise, the bias in the evaluation term vanishes.

Double DQN (Algorithm 6) implements this principle in the discrete action setting by using the online network θt\boldsymbol{\theta}_t for selection (aiargmaxaq(si,a;θt)a^*_i \leftarrow \arg\max_{a'} q(s_i',a'; \boldsymbol{\theta}_t)) and the target network θtarget\boldsymbol{\theta}_{\text{target}} for evaluation (yiri+γq(si,ai;θtarget)y_i \leftarrow r_i + \gamma q(s_i',a^*_i; \boldsymbol{\theta}_{\text{target}})). Since these networks experience different training noise, their errors are approximately independent, achieving the independence condition needed to eliminate evaluation bias. However, selection bias remains: the argmax still picks actions that received positive noise in the selection network, so Eε(1)[μ(s,a)]maxaμ(s,a)\mathbb{E}_{\varepsilon^{(1)}}[\mu(s,a^\star)] \ge \max_a \mu(s,a).

TD3 takes a more conservative approach. Instead of decoupling selection from evaluation, TD3 maintains twin Q-networks qA(s,a;θA)q^A(s,a; \boldsymbol{\theta}^A) and qB(s,a;θB)q^B(s,a; \boldsymbol{\theta}^B) trained on the same data with different random initializations. When computing targets, TD3 uses the target policy πwtarget(s)\pi_{\boldsymbol{w}_{\text{target}}}(s') to select actions (no maximization over a discrete set), then takes the minimum of the two Q-networks’ evaluations:

yi=ri+γmin(qA(si,a~i;θtargetA),qB(si,a~i;θtargetB))y_i = r_i + \gamma \min\left(q^A(s'_i, \tilde{a}_i; \boldsymbol{\theta}^A_{\text{target}}), q^B(s'_i, \tilde{a}_i; \boldsymbol{\theta}^B_{\text{target}})\right)

where a~i=πwtarget(si)\tilde{a}_i = \pi_{\boldsymbol{w}_{\text{target}}}(s'_i). This minimum operation provides a pessimistic estimate: if the two Q-networks have independent errors qA(s,a)=q(s,a)+εAq^A(s',a) = q^*(s',a) + \varepsilon^A and qB(s,a)=q(s,a)+εBq^B(s',a) = q^*(s',a) + \varepsilon^B, then E[min(qA,qB)]q(s,a)\mathbb{E}[\min(q^A, q^B)] \le q^*(s',a), producing systematic underestimation rather than overestimation.

The connection to the conditional independence framework is subtle but important. While Double DQN uses independence to eliminate bias in expectation (one network selects, another evaluates), TD3 uses independence to construct a deliberate lower bound. Both approaches rely on maintaining two Q-functions with partially decorrelated errors, achieved through different initializations and stochastic gradients during training, but they aggregate these functions differently. Double DQN’s decoupling targets unbiased estimation by breaking the correlation between selection and evaluation noise. TD3’s minimum operation targets robust estimation by taking the most pessimistic view when the two networks disagree.

This trade-off between bias and robustness is deliberate. In actor-critic methods, the policy gradient pushes toward actions with high Q-values. Overestimation is particularly harmful because it can lead the policy to exploit erroneous high-value regions. Underestimation is generally safer: the policy may ignore some good actions, but it will not be misled into pursuing actions that only appear valuable due to approximation error. The minimum operation implements a “trust the pessimist” principle that complements the policy optimization objective.

TD3 also introduces two additional modifications beyond the clipped double Q-learning. First, target policy smoothing adds clipped noise to the target policy’s actions when computing targets: a~=πwtarget(s)+clip(ε,c,c)\tilde{a} = \pi_{\boldsymbol{w}_{\text{target}}}(s') + \text{clip}(\varepsilon, -c, c). This regularization prevents the policy from exploiting narrow peaks in the Q-function approximation error by averaging over nearby actions. Second, delayed policy updates change the actor update frequency: the actor updates every dd steps instead of every step. This reduces per-update error by letting the critics converge before the actor adapts to them.

TD3 also replaces DDPG’s hard target updates with exponential moving average (EMA) updates, following the smooth update scheme from Algorithm 4 in the FQI chapter. Instead of copying θtargetθt\boldsymbol{\theta}_{\text{target}} \leftarrow \boldsymbol{\theta}_t every KK steps, EMA smoothly tracks the online network: θtargetτθt+(1τ)θtarget\boldsymbol{\theta}_{\text{target}} \leftarrow \tau \boldsymbol{\theta}_t + (1-\tau)\boldsymbol{\theta}_{\text{target}} at every update. For small τ[0.001,0.01]\tau \in [0.001, 0.01], the target lags behind the online network by roughly 1/τ1/\tau steps, providing smoother learning dynamics.

The algorithm structure parallels Double DQN but with continuous actions. Lines 8.1-8.2 implement clipped double Q-learning: smoothing adds noise to target actions (preventing exploitation of Q-function artifacts), and the min operation (highlighted in blue) provides pessimistic value estimates. Both critics update toward the same shared target (lines 10-11), but their different initializations and stochastic gradient noise keep their errors partially decorrelated, following the same principle underlying Double DQN’s independence assumption. Line 13 gates policy updates to every dd steps (typically d=2d=2), and lines 13.2-13.4 use EMA updates following Algorithm 4.

TD3 simplifies exploration by replacing DDPG’s Ornstein-Uhlenbeck process with uncorrelated Gaussian noise εN(0,σexplore2)\varepsilon \sim \mathcal{N}(0, \sigma_{\text{explore}}^2) (line 5.3). This eliminates the need to tune multiple OU parameters while providing equally effective exploration.

Summary and Outlook

Continuous actions turn the maximization inside each fitted Q target into a nonlinear optimization problem. NFQCA learns an actor to amortize that search; DDPG carries the same actor-critic structure online; TD3 adds twin critics, target smoothing, and delayed actor updates to reduce exploitation of critic error.

The actor updates above differentiate through a learned critic. Which gradient estimators remain available when actions or trajectories themselves are random? Gradient estimation for stochastic objectives separates score-function and reparameterization estimators before they are used for policy learning.

Self-checks

Solution to Exercise 1

The actor replaces solving argmaxaq(s,a)\arg\max_a q(s,a) anew at every state with one learned forward mapping from state to action.

References
  1. Hafner, R., & Riedmiller, M. (2011). Reinforcement learning in feedback control: Challenges and benchmarks from technical process control. Machine Learning, 84(1–2), 137–169. 10.1007/s10994-011-5235-x
  2. Lillicrap, T. P., Hunt, J. J., Pritzel, A., Heess, N., Erez, T., Tassa, Y., Silver, D., & Wierstra, D. (2015). Continuous Control with Deep Reinforcement Learning. arXiv Preprint arXiv:1509.02971.
  3. Fujimoto, S., Hoof, H., & Meger, D. (2018). Addressing Function Approximation Error in Actor-Critic Methods. International Conference on Machine Learning (ICML), 1587–1596.