Diffusion Actor-Critic: Formulating Constrained Policy Iteration as Diffusion Noise Regression for Offline Reinforcement Learning

## Abstract

Abstract In offline reinforcement learning (RL), it is necessary to manage out-of-distribution actions to prevent overestimation of value functions. Policy-regularized methods address this problem by constraining the target policy to stay close to the behavior policy. Although several approaches suggest representing the behavior policy as an expressive diffusion model to boost performance, it remains unclear how to regularize the target policy given a diffusion-modeled behavior sampler. In this paper, we propose Diffusion Actor-Critic (DAC) that formulates the Kullback-Leibler (KL) constraint policy iteration as a diffusion noise regression problem, enabling direct representation of target policies as diffusion models. Our approach follows the actor-critic learning paradigm that we alternatively train a diffusion-modeled target policy and a critic network. The actor training loss includes a soft Q-guidance term from the Q-gradient. The soft Q-guidance grounds on the theoretical solution of the KL constraint policy iteration, which prevents the learned policy from taking out-of-distribution actions. For critic training, we train a Q-ensemble to stabilize the estimation of Q-gradient. Additionally, DAC employs lower confidence bound (LCB) to address the overestimation and underestimation of value targets due to function approximation error. Our approach is evaluated on the D4RL benchmarks and outperforms the state-of-the-art in almost all environments. Code is available at github.com/Fang-Lin93/DAC .

## 1 Introduction

Offline reinforcement learning (RL) aims at learning effective policies from previously collected data, without the need for online interactions with the environment []. It holds promise to implement RL algorithm to real-world applications, where online interactions are risky, expensive or even impossible. However, learning entirely from the offline data brings a new challenge. The prior data, such as human demonstration, is often sub-optimal and covers only a small part of samples compared to the entire state-action space. Learning policies beyond the level of behavior policy demands querying the value function of actions which are often not observed in the dataset. Despite off-policy RL algorithms could be directly applied to the offline data, those out-of-distribution (OOD) actions exacerbate the bootstrapping error of value function estimation, typically causing overestimation of action-values and leading to poor performance [].

To alleviate the problem of overestimation on OOD actions, prior research of policy-regularized algorithm suggests to regularize the learned policy by limiting its deviation from the behavior policy. These methods generally regularize the learned policy by adding a behavior cloning term to the loss function [, , ] or training a behavior sampler to assist in evaluating the Q-learning target [, , , , ]. However, due to the intricacy of the behavior distribution, these methods require sufficient model representative capacity and an appropriate regularization scheme to prevent sampling OOD actions and achieve strong performance [].

With the emergence of diffusion models [, ], recent advances on policy-regularized algorithms suggest modeling the behavior policies using high-expressive diffusion models [, , , ]. However, there are several limitations with the current implementations of diffusion models in offline RL. Some methods use the diffusion model as a behavior sampler for subsequent action generation [, ]. Those methods require generating lots of action candidates to choose from, which hinders the real-world applications for the slow inference process. Diffusion Q-learning [] trains a biased diffusion model to aid in the estimation of the Q-learning target. Nevertheless, the biased diffusion model no longer prevents from sampling OOD actions (Figure 1), and the back-propagation of gradients through the denoising process makes the training process time-consuming. Additionally, another drawback of modeling behavior policies as diffusion models is the inability of the diffusion models to explicitly estimate density values. Techniques that rely on access to density functions are not directly applicable given a diffusion-modeled behavior policy [, ]. Furthermore, it remains unclear how to regularize policies to stay close to a diffusion-modeled behavior that is both theoretically sound and effective in practical performance.

In this paper, we propose Diffusion Actor-Critic (DAC) to address the offline RL problem by training a diffusion-modeled target policy. We focus on the optimization problem of constrained policy iteration [, , , ], where the target policy is trained to maximize the estimated Q-function while fulfilling the KL constraint of the data distribution. We derive that the optimization problem can be formulated as a diffusion noise regression problem, eliminating the need for explicit density estimation of either the behavior policy or the target policy. The resulting noise prediction target involves a soft Q-guidance term that adjusts the Q-gradient guidance according to the noise scales, which distinguishes it from both the guided sampling with return prompts [, ] and methods where the Q-gradient is applied to the denoised action samples []. DAC follows the actor-critic learning paradigm, where we alternatively train a diffusion-modeled target policy and an action-value model. During the actor learning step, we train policy model by regressing on a target diffusion noise in a supervised manner. For the critic learning, we employ the lower confidence bound (LCB) of a Q-ensemble to stabilize the estimation of Q-gradients under function approximation error. This approach prevents the detrimental over-pessimistic bias of taking the ensemble minimum as used in the previous research [, , ]. Experiments demonstrate that the LCB target balances the overestimation and underestimation of the value target, leading to improved performance.

In conclusion, our main contributions are:

- •
Introducing DAC, a new offline RL algorithm that directly generates the target policy using diffusion models. The high-expressiveness of diffusion models is able to capture not only the multimodality of behavior polices, but also the complexity of target polices as well. Moreover, modeling the target policy directly as a diffusion model avoids the need for subsequent re-sampling of actions, resulting in reduced inference time and greater practicality for real-world applications.
- •
Proposing the soft Q-guidance that analytically solves the KL constraint policy iteration using diffusion models, without the need for explicit density estimation of either the behavior policy or the target policy. The necessity for constraint satisfaction in target policies modeled through diffusion is not only crucial for theoretical comprehension but also guarantees that the generated policy refrains from taking OOD actions.
- •
We demonstrate the effectiveness of DAC on the D4RL benchmarks and observe that it outperforms nearly all prior methods by a significant margin, thereby establishing a new state-of-the-art baseline.

## 2 Preliminaries

Figure: Figure 1: Comparison of generated policies on 2-dimensional bandit using different Q-gradient guidance. We compare soft Q-guidance (magenta) against hard Q-guidance (blue) that eliminates the noise scaling factor and denoised Q-guidance [] (brown) on 2-D bandit example. The dots are behavior policies, which are colored based on the reward value. The dashed level curves represent the estimated Q-value field using DAC algorithm. Soft Q-guidance are capable of generating high-reward actions while remaining within the behavior support, whereas the actions generated using hard Q-guidance are evidently concentrated on OOD regions. Meanwhile, the denoised Q-guidance generates actions that are significantly distant from the support domain, primarily concentrated in the bottom right corner. This happens because the generated actions are severely influenced by the estimated gradient field. Additionally, we observe that soft Q-guidance captures the multi-modality of target policies as shown in the second plot. Experimental details can be found in Appendix B.5.
Refer to caption: x1.png

We consider the RL problem formulated as an infinite horizon discounted Markov Decision Process (MDP), which is defined as a tuple $(\mathcal{S},\mathcal{A},\mathcal{T},d_{0},r,\gamma)$ [] with state space $\mathcal{S}$, action space $\mathcal{A}$, transition probabilities $\mathcal{T}(\mathbf{s}^{\prime}|\mathbf{s},\mathbf{a})$, initial state distribution $\mathbf{s}_{0}\sim d_{0}$, reward function $r(\mathbf{s},\mathbf{a})$, and discount factor $\gamma\in(0,1)$. The goal of RL is to train a policy $\pi(\mathbf{a}|\mathbf{s}):\mathcal{A}\times\mathcal{S}\to[0,1]$ that maximizes the expected return: $J(\pi):=\mathbb{E}_{\pi,\mathcal{T},d_{0}}[\sum_{t=0}^{\infty}\gamma^{t}r(
\mathbf{s}_{t},\mathbf{a}_{t})]$. We also define the discounted state visitation distribution $d^{\pi}(\mathbf{s}):=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}p_{\pi}(\mathbf{s}
_{t}=\mathbf{s})$. Then the RL objective $J(\pi)$ has an equivalent form as maximizing the expected per-state-action rewards: $\tilde{J}(\pi)=\mathbb{E}_{\mathbf{s}\sim d^{\pi},\mathbf{a}\sim\pi(\cdot|
\mathbf{s})}[r(\mathbf{s},\mathbf{a})]$ []. In offline RL, the agent has only access to a static dataset $\mathcal{D}$, which is collected by a potentially unknown behavior policy $\pi_{\beta}$, without the permission to fetch new data from the environment.

Constrained policy iteration. Let $Q^{\pi}:\mathcal{S}\times\mathcal{A}\to\mathbb{R}$ be the Q-function of the policy $\pi$, which is defined by $Q^{\pi}(\mathbf{s},\mathbf{a})=\mathbb{E}_{\pi,\mathcal{T}}[\sum_{t=0}^{\infty
}\gamma^{t}r(\mathbf{s}_{t},\mathbf{a}_{t})|\mathbf{s}_{0}=\mathbf{s},\mathbf{
a}_{0}=\mathbf{a}]$. In a standard policy iteration paradigm at iteration $k$, the algorithm iterates between improving the policy $\pi_{k}$ and estimating the Q-function $Q^{\pi_{k}}$ via Bellman backups []. Estimating $Q^{\pi_{k}}$ in the offline setting may request OOD actions that are not observed in the dataset, resulting in an accumulation of bootstrapping errors. To address this issue, off-policy evaluation algorithms [, , , , , ] propose to explicitly regularize the policy improvement step, leading to the constrained optimization problem:

$$ $\displaystyle\pi_{k+1}=\arg\max_{\pi}$ $\displaystyle\,\mathbb{E}_{\mathbf{s}\sim d^{\pi_{k}}}[\mathbb{E}_{\mathbf{a} \sim\pi(\cdot|\mathbf{s})}Q^{\pi_{k}}(\mathbf{s},\mathbf{a})]$ (1) s.t. $\displaystyle\,D(\pi,\pi_{\beta})\leq\epsilon_{b}.$ $$

Commonly used constraints for $D$ are members from $f$-divergence family, such as KL-divergence and $\chi^{2}$-divergence and total-variation distance [, , , ]. In this paper we consider $D$ being the expected state-wise (reverse) KL-divergence: $D(\pi,\pi_{\beta})=\mathbb{E}_{\mathbf{s}\sim d^{\pi}}D_{\text{KL}}(\pi(\cdot|
\mathbf{s})||\pi_{\beta}(\cdot|\mathbf{s}))$. However, the complicated dependency of $d^{\pi_{k}}$ on $\pi_{k}$ makes it difficult to directly solve the KL constraint optimization problem (1) in offline RL. A typical approach for addressing this issue involves substituting the on-policy distribution $d^{\pi_{k}}$ with the off-policy dataset $\mathcal{D}$ [, ], resulting in the surrogate objective:

$$ $\displaystyle\pi_{k+1}=\arg\max_{\pi}$ $\displaystyle\,\mathbb{E}_{\mathbf{s}\sim\mathcal{D}}[\mathbb{E}_{\mathbf{a} \sim\pi(\cdot|\mathbf{s})}Q^{\pi_{k}}(\mathbf{s},\mathbf{a})]$ (2) s.t. $\displaystyle\,\mathbb{E}_{\mathbf{s}\sim\mathcal{D}}[D_{\text{KL}}(\pi(\cdot| \mathbf{s})||\pi_{\beta}(\cdot|\mathbf{s}))]\leq\epsilon_{b},$ $$

where $\epsilon_{b}$ is a pre-defined hyperparameter to control the strength of the constraint.

Diffusion models. Diffusion models [, , ] are generative models that assumes latent varibles following a Markovian noising and denoising process. The forward noising process $\{\mathbf{x}_{0:T}\}$ gradually adds Gaussian noise to the data $\mathbf{x}_{0}\sim p(\mathbf{x}_{0})$ with a pre-defined noise schedule $\{\beta_{1:T}\}$:

$$ $q(\mathbf{x}_{1:T}|\mathbf{x}_{0})=\prod_{t=0}^{T}q(\mathbf{x}_{t}|\mathbf{x}_ {t-1}),\;q(\mathbf{x}_{t}|\mathbf{x}_{t-1}):=\mathcal{N}(\mathbf{x}_{t};\sqrt{ 1-\beta_{t}}\mathbf{x}_{t-1},\beta_{t}\mathbf{I}).$ (3) $$

The joint distribution in (3) yields an analytic form of the marginal distribution

$$ $q_{t}(\mathbf{x}_{t}|\mathbf{x}_{0})=\mathcal{N}(\mathbf{x}_{t};\sqrt{\bar{ \alpha}_{t}}\mathbf{x}_{0},(1-\bar{\alpha}_{t})\mathbf{I})\text{ for all }t\in \{1,...,T\},$ (4) $$

using the notation $\alpha_{t}:=1-\beta_{t}$ and $\bar{\alpha}_{t}:=\prod_{s=1}^{t}\alpha_{s}$. Given $\mathbf{x}_{0}$, the noisy sample $\mathbf{x}_{t}$ can be easily obtained through the re-parameterization trick:

$$ $\mathbf{x}_{t}=\sqrt{\bar{\alpha}_{t}}\mathbf{x}_{0}+\sqrt{1-\bar{\alpha}_{t}} \boldsymbol{\epsilon},\;\boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0}, \mathbf{I}).$ (5) $$

DDPMs [] construct a parameterized model $p_{\theta}(\mathbf{x}_{t-1}|\mathbf{x}_{t})=\mathcal{N}(\mathbf{x}_{t-1};
\boldsymbol{\mu}_{\theta}(\mathbf{x}_{t},t),\boldsymbol{\Sigma}_{\theta}(
\mathbf{x}_{t},t))$ to reverse the diffusion process: $p_{\theta}(\mathbf{x}_{0:T})=\mathcal{N}(\mathbf{x}_{T};\mathbf{0},\mathbf{I})
\prod_{t=1}^{T}p_{\theta}(\mathbf{x}_{t-1}|\mathbf{x}_{t})$. The practical implementation involves directly predicting the Gaussian noise $\boldsymbol{\epsilon}$ in (5) using a neural network $\boldsymbol{\epsilon}_{\theta}(x_{t},t)$ to minimize the original evidence lower bound loss:

$$ $\mathcal{L}(\theta)=\mathbb{E}_{\mathbf{x}_{0}\sim p(\mathbf{x}_{0}),t\sim \text{Unif}(1,T),\boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I})}| |\boldsymbol{\epsilon}-\boldsymbol{\epsilon}_{\theta}(\sqrt{\bar{\alpha}_{t}} \mathbf{x}_{0}+\sqrt{1-\bar{\alpha}_{t}}\boldsymbol{\epsilon},t)||^{2}.$ (6) $$

A natural approach to employing diffusion models in behavior cloning involves replacing the noise predictor with a state-conditional model $\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)$ that generates actions $\mathbf{x}_{0}\in\mathcal{A}$ based on state $\mathbf{s}$.

Score-based models. The key idea of score-based generative models [, , ] is to estimate the (Stein) score function, which is defined as the gradient of the log-likelihood $\nabla_{\mathbf{x}}\log p(\mathbf{x})$. Like diffusion models, score-based models perturb the data with a sequence of Gaussian noise and train a deep neural network $s_{\theta}(\mathbf{x}_{t},t)$ to estimate the score $\nabla_{\mathbf{x}_{t}}\log p(\mathbf{x}_{t})$ for noisy samples $\mathbf{x}_{t}\sim\mathcal{N}(\mathbf{x}_{t};\mathbf{x}_{0},\sigma_{t}^{2}
\mathbf{I})$ on different noise levels $t=1,2,...,T$. The objective of explicit score matching [] is given by:

$$ $\mathbb{E}_{x_{0}\sim p,x_{t}\sim\mathcal{N}(\mathbf{x}_{t};\mathbf{x}_{0}, \sigma_{t}^{2}\mathbf{I}),t\sim\text{Unif}(1,T)}[\lambda(t)||\nabla_{\mathbf{x }}\log p(\mathbf{x})-s_{\theta}(\mathbf{x}_{t},t)||^{2}],$ (7) $$

where $\lambda(t)>0$ is a positive weighting function. Once the estimated score functions have been trained, samples are generated using score-based sampling techniques, such as Langevin dynamics [] and stochastic differential equations [].

## 3 Diffusion Actor-Critic

In this section, we introduce the Diffusion Actor-Critic (DAC) framework that models the target policy directly as a diffusion model, eliminating the need for density estimation of either the behavior policy or the target policy. Initially, we formulate the KL constraint policy optimization as a diffusion noise regression problem, which yields a soft Q-guidance term for the noise prediction process that enables the learning of the target policy in a supervised manner. Additionally, we introduce Q-ensemble to stabilize the Q-gradient estimation, which utilizes LCB to mitigate the over-pessimistic estimation associated with taking the ensemble minimum in prior research.

### 3.1 Policy improvement through soft Q-guidance

The problem of behavior constraint policy iteration (2) has closed form solution $\pi^{*}$ [, , ] by utilizing the Lagrangian multiplier:

$$ $\pi^{*}(\mathbf{a}|\mathbf{s})=\frac{1}{Z(\mathbf{s})}\pi_{\beta}(\mathbf{a}| \mathbf{s})\exp\big{(}\frac{1}{\eta}Q^{\pi_{k}}(\mathbf{s},\mathbf{a})\big{)},$ (8) $$

where $\eta>0$ is a Lagrangian multiplier and $Z(\mathbf{s})$ is a state-conditional partition function. Obtaining the closed form solution of $\pi^{*}$ directly from (8) is challenging as it requires estimation of the density function of the behavior policy $\pi_{\beta}$ and the partition function $Z(\mathbf{s})$. Prior methods [, , ] suggest addressing this issue by projecting $\pi^{*}$ onto a parameterized policy $\pi_{\theta}$ using KL-divergence:

$$ $\arg\min_{\theta}\mathbb{E}_{\mathbf{s}\sim\mathcal{D}}[D_{KL}(\pi^{*}(\cdot| \mathbf{s})||\pi_{\theta}(\cdot|\mathbf{s}))],$ (9) $$

resulting in the policy update algorithm:

$$ $\theta_{k+1}=\arg\max_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{ D}}[\log\pi_{\theta}(\mathbf{a}|\mathbf{s})\exp\big{(}\frac{1}{\eta}Q^{\pi_{k} }(\mathbf{s},\mathbf{a})\big{)}].$ (10) $$

Although (10) eliminates the necessity for estimating the partition function $Z(\mathbf{s})$ and the behavior policy $\pi_{\beta}$, it needs explicit modeling of the density function of the target policy $\pi_{\theta}$. Such requirement for $\pi_{\theta}$ makes it unfeasible to directly use diffusion generative models due to the unavailability of density function estimation. Prior methods employ Gaussian policies to estimate $\pi_{\theta}$ [, ], which limits the expressiveness of the target policy. To address these issues, we rewrite (8) using score functions:

$$ $\nabla_{\mathbf{a}}\log\pi^{*}(\mathbf{a}|\mathbf{s})=\nabla_{\mathbf{a}}\log \pi_{\beta}(\mathbf{a}|\mathbf{s})+\frac{1}{\eta}\nabla_{\mathbf{a}}Q^{\pi_{k} }(\mathbf{s},\mathbf{a}),\;\mathbf{a}\in\mathcal{A},$ (11) $$

where the action space $\mathcal{A}$ is usually a compact set in $\mathbb{R}^{d}$ for $d$-dimensional actions. It seems that the target score function $\nabla_{\mathbf{a}}\log\pi^{*}(\mathbf{a}|\mathbf{s})$ can be trained by regression on the right-hand-side. However, since $\pi_{\beta}$ is unknown, we do not have explicit regression target $\nabla_{\mathbf{a}}\log\pi_{\beta}(\mathbf{a}|\mathbf{s})$.
Drawing inspiration from explicit score matching with finite samples [], we smoothly extend the policy functions and the value function defined in $\mathcal{A}$ to the extended action space $\mathbb{R}^{d}$. Then we consider (11) of the optimal score functions to hold for noisy perturbations of the observation set:

$$ $\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})=\nabla_{ \mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}|\mathbf{s})+\frac{1}{\eta}\nabla_{ \mathbf{x}_{t}}Q^{\pi_{k}}(\mathbf{s},\mathbf{x}_{t}),\;\mathbf{x}_{t}\in \mathbb{R}^{d},$ (12) $$

where $p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})=\int q_{t}(\mathbf{x}_{t}|\mathbf{a})\pi^
{*}(\mathbf{a}|\mathbf{s})d\mathbf{a}$ and $p_{t}(\mathbf{x}_{t}|\mathbf{s})=\int q_{t}(\mathbf{x}_{t}|\mathbf{a})\pi_{
\beta}(\mathbf{a}|\mathbf{s})d\mathbf{a}$ are noise distributions. The noisy perturbation $\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})$ is defined in (4) with $\mathbf{x}_{0}=\mathbf{a}$. When the perturbation is small, i.e. $q_{t}(\mathbf{x}_{t}|\mathbf{a})\approx\delta(\mathbf{x}_{t}-\mathbf{a})$, then $p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})\approx\pi^{*}(\mathbf{a}|\mathbf{s})$ and $p_{t}(\mathbf{x}_{t}|\mathbf{s})\approx\pi_{\beta}(\mathbf{a}|\mathbf{s})$, which recovers the relationship between score functions within the action space $\mathcal{A}$ as described in (11). Tackling the score function of noise distribution is favorable, since $\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})$ itself serves as a means of generating $\pi^{*}$ using diffusion models, without the need for score-based sampling methods such as Langevin dynamics, as described in the following theorem.

###### Theorem 1 .

Let $\boldsymbol{\epsilon}^{*}(\mathbf{x}_{t},\mathbf{s},t):=-\sqrt{1-\bar{\alpha}_
{t}}\,\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})$. Then $\boldsymbol{\epsilon}^{*}(\mathbf{x}_{t},\mathbf{s},t)$ is a Gaussian noise predictor which defines a diffusion model for generating $\pi^{*}$.

Although $\boldsymbol{\epsilon}^{*}(\mathbf{x}_{t},\mathbf{s},t)$ determines the diffusion model that directly generates the target policy, the form of the target noise $\boldsymbol{\epsilon}^{*}(\mathbf{x}_{t},\mathbf{s},t)$ necessitates the estimation of the noisy score function of the behavior policy $\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}|\mathbf{s})$ by (12), which is typically not accessible. To tackle this problem, we investigate the learning objective when utilizing function approximators. Specifically, we project the target noise $\boldsymbol{\epsilon}^{*}(\mathbf{x}_{t},\mathbf{s},t)$ onto a parameterized conditional noise model $\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)$ via $L^{2}$-loss, following the standard training objective of diffusion models:

$$ $\arg\min_{\theta}\mathbb{E}_{\mathbf{s}\sim\mathcal{D},\mathbf{a}\sim\pi^{*}, \mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a}),t}||\boldsymbol{\epsilon}_ {\theta}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{\epsilon}^{*}(\mathbf{x}_{t} ,\mathbf{s},t)||^{2}.$ (13) $$

To eliminate the need for sampling from the unknown target policy $\pi^{*}$, we approximate the expectation through $\mathbf{a}\sim\pi^{*}$ by the behavior data $\mathbf{a}\sim\mathcal{D}$, resulting in the surrogate objective:

$$ $\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{D},\mathbf{x} _{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a}),t}||\boldsymbol{\epsilon}_{\theta}( \mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{\epsilon}^{*}(\mathbf{x}_{t},\mathbf{ s},t)||^{2}.$ (14) $$

Such learning objective has an equivalent form which is easy to optimize.

###### Theorem 2 .

Training parameters $\theta$ according to (14) is equivalent to optimize the following objective:

$$ $\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{D}, \boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I}),t}||\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{\epsilon}+\frac{1} {\eta}\sqrt{1-\bar{\alpha}_{t}}\,\nabla_{\mathbf{x}_{t}}Q^{\pi_{k}}(\mathbf{s} ,\mathbf{x}_{t})||^{2},$ (15) $$

where $\mathbf{x}_{t}=\sqrt{\bar{\alpha}_{t}}\mathbf{a}+\sqrt{1-\bar{\alpha}_{t}}
\boldsymbol{\epsilon}$.

The learning objective (15) defines a noise regression problem that approximates the solution of the KL constraint policy iteration (2) within the diffusion model framework, without requiring the estimation of densities for either the behavior policy or the target policy. We refer the last term in the noise target as the soft Q diffusion guidance or simply soft Q-guidance. Within the soft Q-guidance, the Q-gradient is weighted by the noise scale $\sqrt{1-\bar{\alpha}_{t}}$. In a typical diffusion model, the noise scale $\sqrt{1-\bar{\alpha}_{t}}\to 0$ as $t\to 0$ during the denoising process. This suggests that soft Q-guidance encourages the exploration of high-reward regions in the initial steps of the denoising process, and then gradually fades the guidance strength as the denoising step approaches the final output. In comparison to the “hard Q-guidance” that eliminates the noise scaling factor or guidance on denoised actions [], soft Q-guidance produces high-fidelity actions that closely resemble the behavior policies, thereby preventing the sampling of out-of-distribution (OOD) actions (as shown in Figure 1).

To connect the learning objective (15) with policy-regularized methods, we rearrange the terms in (15) and incorporate a constant into $\eta$, resulting in the following actor learning loss:

$$ $\mathcal{L}_{A}(\theta)=\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{D}, \boldsymbol{\epsilon},t}\big{[}\eta||\boldsymbol{\epsilon}_{\theta}(\mathbf{x} _{t},\mathbf{s},t)-\boldsymbol{\epsilon}||^{2}+\sqrt{1-\bar{\alpha}_{t}}\, \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{ \mathbf{x}_{t}}Q^{\pi_{k}}(\mathbf{s},\mathbf{x}_{t})\big{]},$ (16) $$

where the dot ($\cdot$) implies inner product. The Lagrangian multiplier $\eta$ determines the trade-off between the behavior cloning and the policy improvement. As $\eta\to\infty$, the noise prediction loss (16) reduces to behavior cloning using a parameterized conditional diffusion model, as used in the recent research [, , ]. The second term involves a inner product between the predicted noise and the Q-gradient, promoting the acquired denoising directions to align with the estimated Q-gradient field.

###### Theorem 1 .

###### Theorem 2 .

### 3.2 Policy evaluation via Q-ensemble

Figure: Algorithm 1 Diffusion Actor-Critic Training

During the policy evaluation at the $k$-th iteration, we estimate the Q-function for the policy $\pi_{\theta_{k}}$. To enhance the stability of the Q-gradient estimation used in the soft Q-guidance, we train an ensemble of $H$ parameterized Q-networks $Q_{\phi_{k}^{h}}$ and target Q-networks $Q_{\bar{\phi}_{k}^{h}}$, where the target Q parameters $\bar{\phi}_{k}^{h}$ are obtained through taking exponential moving averages of parameters $\phi_{k}^{h}$. In general, policy evaluation can be achieved via training the Bellman backup:

$$ $\phi_{k}^{h}\leftarrow\arg\min_{\phi^{h}}\mathbb{E}_{(\mathbf{s},\mathbf{a},r, \mathbf{s}^{\prime})\sim\mathcal{D},\mathbf{a}^{\prime}\sim\pi_{\theta_{k}}} \big{[}r+\gamma Q_{\bar{\phi}_{k-1}^{h}}(\mathbf{s}^{\prime},\mathbf{a}^{ \prime})-Q_{\phi^{h}}(\mathbf{s},\mathbf{a})\big{]}^{2},h\in\{1,2,...,H\}.$ (17) $$

Updating Q-networks directly through (17) with function approximation can lead to overestimation bias and unsuccessful learning. Recent methods that account for offline policy evaluation typically address this problem by using pessimistic targets, such as the minimum: $\min_{h}[Q_{\bar{\phi}_{k}^{h}}]$ [, , ] or convex combination: $\rho\min_{h}[Q_{\bar{\phi}_{k}^{h}}]+(1-\rho)\max_{h}[Q_{\bar{\phi}_{k}^{h}}],
(0\leq\rho\leq 1)$ [, ]. The minimum operator penalizes states of high variances, leading to over-pessimistic actions. The convex combination only cares for the extreme values, resulting in loss of details of the Q-value distribution in the ensembles.
To incorporate information of Q-value distribution in a simple manner without being over-pessimistic, our approach utilizes the lower confidence bound (LCB) of Q-ensembles [], resulting in the following critic learning loss:

$$ $\displaystyle\mathcal{L}_{C}(\phi^{h})=$ $\displaystyle\mathbb{E}_{(\mathbf{s},\mathbf{a},r,\mathbf{s}^{\prime})\sim \mathcal{D},\mathbf{a}^{\prime}\sim\pi_{\theta_{k}}}\big{[}r+\gamma Q_{\text{ LCB}}(\mathbf{s}^{\prime},\mathbf{a}^{\prime})-Q_{\phi^{h}}(\mathbf{s},\mathbf {a})\big{]}^{2},$ (18) $\displaystyle Q_{\text{LCB}}(\mathbf{s}^{\prime},\mathbf{a}^{\prime})=\, \mathbb{E}_{h}[Q_{\bar{\phi}_{k}^{h}}(\mathbf{s}^{\prime},\mathbf{a}^{\prime}) ]-\rho\sqrt{\text{Var}_{h}[Q_{\bar{\phi}_{k}^{h}}(\mathbf{s}^{\prime},\mathbf{ a}^{\prime})]},$ $$

where $\rho\geq 0$ is a hyperparameter that determines the level of pessimism, and $\mathbb{E}_{h}[\cdot]$ and $\text{Var}_{h}[\cdot]$ are empirical mean and variance operators over the $H$ ensembles.

Rather than employing $Q_{\text{LCB}}$ for policy gradient updates as done in [], we utilize average Q-value estimation to guide the policy improvement. Once the Q-functions are trained, the Q-gradient in the soft Q-guidance can be estimated by the ensemble’s average of target Q-networks:

$$ $\nabla_{\mathbf{x}_{t}}Q^{\pi_{k}}(\mathbf{s},\mathbf{x}_{t})\approx\frac{1}{ HC}\sum_{h=1}^{H}\nabla_{\mathbf{x}_{t}}Q_{\bar{\phi}_{k}^{h}}(\mathbf{s}, \mathbf{x}_{t}),$ (19) $$

where $C=\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{D}}|Q_{\bar{\phi}_{k}^{h}}(
\mathbf{s},\mathbf{a})|$ is an estimated scaling constant that eliminates the influence of varying Q-value scales in different environments.

### 3.3 Policy extraction

We denote $\pi_{\theta}(\mathbf{a}|\mathbf{s})$ as the trained diffusion policy through denoisng process using noise predictor $\epsilon_{\theta}(\mathbf{x}_{t},\mathbf{s},t)$. While $\pi_{\theta}(\mathbf{a}|\mathbf{s})$ is capable of generating the target policy, we aim to reduce the uncertainty of the denoising process during the evaluation phase. To achieve this, we sample a small batch of $N_{a}$ actions and select the action with the highest Q-ensemble mean value, resulting in better performance:

$$ $\pi(\mathbf{s})={\arg\max}_{\mathbf{a}_{1},...,\mathbf{a}_{N_{a}}\sim\pi_{ \theta}(\cdot|\mathbf{s})}\mathbb{E}_{h}[Q_{\bar{\phi}_{k}^{h}}(\mathbf{s}, \mathbf{a})].$ (20) $$

This approach is commonly employed in methods where a stochastic actor is trained for critic learning, and a deterministic policy is implemented during evaluation [, ]. Since $\pi_{\theta}(\mathbf{a}|\mathbf{s})$ is trained as a target policy, the sampling number $N_{a}$ can be relatively small. Through our experiments, we find that DAC can achieve superior performance with $N_{a}=10$. In comparison, SfBC [], Diffusion Q-learning [] and IDQL [] use $N_{a}=32$, $N_{a}=50$ and $N_{a}=128$, respectively.

Algorithm summary. We summarize the full algorithm of DAC for offline RL in Algorithm 1. In practical implementation, DAC balances the behavior cloning and policy improvement by controlling $\eta$ to be either fixed or learnable through dual gradient ascent. If $\eta$ is learnable, DAC trains $\eta$ to ensure that $||\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{
\epsilon}||^{2}\leq b$ for a given threshold value $b>0$. During each gradient step, the parameters of target networks ${\phi}^{h}$ and $\bar{\theta}$ are updated by taking exponential moving averages (EMA) of the training networks $\phi^{h}$ and $\theta$ respectively.

## 4 Related work

Offline RL. Recent research addressing offline RL problems often use value-based algorithms based on Q-learning or actor-critic learning []. To tackle the issue of overestimation of the Q-learning target, explicit policy-regularization methods typically train a biased behavior sampler to generate actions that maximize the Q-function while remaining within the support of the behavior policy. Among these approaches, BCQ [] learns a conditional-VAE [] to aid in sampling Q-learning targets; BEAR [] employs maximum mean discrepancy (MMD) to restrict the learned policy to the behavior dataset. Moreover, BRAC [] is based on actor-critic learning framework and explores various regularization methods as value penalties; TD3+BC [] adds a behavior cloning term to regularize the learned policy in a supervised manner. Additionally, some methods implicitly regularize the policy by training pessimistic value-functions or using in-sample estimation. CQL [] learns conservative Q-values on OOD actions. IQL [] and IDQL [] use asymmetric loss functions to approximate the maximal Q-value target via in-sample data. IVR [] also employs in-sample learning while within the framework of behavior-regularized MDP problem, resulting in two implicit Q-learning objectives. Extreme Q-learning [] avoids sampling OOD actions by using Gumbel regression to model the maximal Q-values. Our method conducts policy-regularization by focusing on KL-regularized policy iteration [, , ], which regularizes the policy improvement step to fulfill the KL-divergence constraint, preventing the bootstrapping error of estimating Bellman targets.

Diffusion models for offline RL. Recent studies that utilize diffusion models for offline RL can be broadly categorized into two types: those that model entire trajectories and those that generate behavior policies. Diffuser [] trains a diffusion model as a trajectory planner. The policies are generated through guided-sampling with return prompts, similar to methods that modeling trajectories using Transformer [, ]. Diffusion Q-learning [] employs a diffusion model as a biased behavior sampler, incorporating an additional loss to promote the denoised actions to achieve maximal Q-values. IDQL [] and SfBC [] use diffusion models to generate behavior policies. The target policies are extracted by re-sampling from diffusion-generated actions. While we also train a policy sampler as in previous studies, we directly utilize our trained diffusion model as the target policy in the actor-critic paradigm, rather than using it as a behavior sampler to estimate Q-learning targets.

## 5 Experiments

In this section, we empirically demonstrate the effectiveness of our proposed DAC algorithm on D4RL benchmarks []. We also conduct ablation studies to analyze the two key components of DAC that contribute to superior performance: soft Q-guidance and LCB of Q-ensembles as value targets. Further experimental details and results can be found in Appendix B and Appendix C, respectively.

### 5.1 Comparisons on offline RL benchmarks

We compare our approach against an extensive collection of baselines that solve offline RL using various methods. For explicit policy-regularization methods, we consider TD3+BC [] and AWAC []. We also include one-step RL (Onestep-RL) [], which conducts a single step actor-critic learning. For value-constraint methods, we compare against Conservative Q-learning (CQL) []. For in-sample estimation of maximal value targets, we include Implicit Q-learning (IQL) [], Implicit Value Regularization (IVR) [] and Extreme Q-learning (EQL) []. Additionally, we compare our approach to methods that utilize diffusion models in their framework. In this category, we compare against Diffuser [], SfBC [], Diffusion Q-learning (DQL) [] and IDQL []. Specifically, we present the results of “IDQL-A” variant [] for IDQL, which permits tuning of any amount of hyperparameters and exhibits strong performance. For the baselines, we report the best results from their own paper or tables in the recent papers [, , ]. The results are shown in Table 1.

Drawing from the experimental results, DAC outperforms prior methods by a significant margin across nearly all tasks. DAC significantly enhances the overall score on locomotion tasks, with an average increase of over 5% compared to the best performance in prior studies. Notably, for “medium” tasks, where the dataset contains numerous sub-optimal trajectories, DAC consistently achieves improvements of over 10%. The antmaze domain presents a greater challenge due to the sparsity of rewards and the prevalence of sub-optimal trajectories. Consequently, algorithms must possess strong capabilities in stitching together sub-optimal subsequences to achieve high scores []. It is evident that DAC outperforms or achieves competitive outcomes on antmaze tasks, with an almost perfect mean score ($\approx 100$) on the “antmaze-umaze” task. In the case of the most demanding “large” tasks, DAC performs comparably to previous methods, with the exception of IDQL-A, which consistently showcases superior performance. One potential explanation for this difference could be that we do not tune the rewards by subtracting a negative number, as is done in previous studies [, , , ]. This setting exacerbates the impact of reward sparsity in more intricate “large” environments, leading to slower convergence.

It is worth mentioning that we report the performance after convergence, which imposes a stronger requirement for evaluation, as it necessitates the model training to demonstrate the capability of convergence, rather than relying on early stopping selection []. These requirements hold significant importance for ensuring robust deployment in real-world applications. We direct readers to Appendix B for more detailed information.

**Table 1: Average normalized scores of DAC compared to other baselines. We use the following abbreviations: “m” for “medium”; “r” for “replay”; “e” for “expert”; “u” for “umaze”; “div” for “diverse” and “l” for “large”. We highlight in boldface the numbers within 5% of the maximal scores in each task. Furthermore, we also underline the highest scores achieved by prior methods.**
| Dataset | TD3+BC | AWAC | Onestep-RL | CQL | IQL | IVR | EQL | Diffuser | SfBC | DQL | IDQL-A | DAC (ours) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| halfcheetah-m | 48.3 | 43.5 | 48.4 | 44.0 | 47.4 | 48.3 | 48.3 | 44.2 | 45.9 | 51.1 | 51.0 | 59.1 $\pm$ 0.4 |
| hopper-m | 59.3 | 57.0 | 59.6 | 58.5 | 66.3 | 75.5 | 74.2 | 58.5 | 57.1 | 90.5 | 65.4 | 101.2 $\pm$ 2.0 |
| walker2d-m | 83.7 | 72.4 | 81.8 | 72.5 | 78.3 | 84.2 | 84.2 | 79.7 | 77.9 | 87.0 | 82.5 | 96.8 $\pm$ 3.6 |
| halfcheetah-m-r | 44.6 | 40.5 | 38.1 | 45.5 | 44.2 | 44.8 | 45.2 | 42.2 | 37.1 | 47.8 | 45.9 | 55.0 $\pm$ 0.2 |
| hopper-m-r | 60.9 | 37.2 | 97.5 | 95.0 | 94.7 | 99.7 | 100.7 | 96.8 | 86.2 | 101.3 | 92.1 | 103.1 $\pm$ 0.3 |
| walker2d-m-r | 81.8 | 27.0 | 49.5 | 77.2 | 73.9 | 81.2 | 82.2 | 61.2 | 65.1 | 95.5 | 85.1 | 96.8 $\pm$ 1.0 |
| halfcheetah-m-e | 90.7 | 42.8 | 93.4 | 91.6 | 86.7 | 94.0 | 94.2 | 79.8 | 92.6 | 96.8 | 95.9 | 99.1 $\pm$ 0.9 |
| hopper-m-e | 98.0 | 55.8 | 103.3 | 105.4 | 91.5 | 111.8 | 111.2 | 107.2 | 108.6 | 111.1 | 108.6 | 111.7 $\pm$ 1.0 |
| walker2d-m-e | 110.1 | 74.5 | 113.0 | 108.8 | 109.6 | 110.2 | 112.7 | 108.4 | 109.8 | 110.1 | 112.7 | 113.6 $\pm$ 3.5 |
| locomotion-v2 total | 677.4 | 450.7 | 684.6 | 698.5 | 749.7 | 749.7 | 752.9 | 678.0 | 680.3 | 791.2 | 739.2 | 836.4 |
| antmaze-u | 78.6 | 56.7 | 64.3 | 74.0 | 87.5 | 93.2 | 93.8 | - | 92.0 | 93.4 | 94.0 | 99.5 $\pm$ 0.9 |
| antmaze-u-div | 71.4 | 49.3 | 60.7 | 84.0 | 62.2 | 74.0 | 82.0 | - | 85.3 | 66.2 | 80.2 | 85.0 $\pm$ 7.9 |
| antmaze-m-play | 10.6 | 0.0 | 0.3 | 61.2 | 71.2 | 80.2 | 76.0 | - | 81.3 | 76.6 | 84.2 | 85.8 $\pm$ 5.5 |
| antmaze-m-div | 3.0 | 0.7 | 0.0 | 53.7 | 70.0 | 79.1 | 73.6 | - | 82.0 | 78.6 | 84.8 | 84.0 $\pm$ 6.2 |
| antmaze-l-play | 0.2 | 0.0 | 0.0 | 15.8 | 39.6 | 53.2 | 46.5 | - | 59.3 | 46.4 | 63.5 | 50.3 $\pm$ 8.6 |
| antmaze-l-div | 0.0 | 1.0 | 0.0 | 14.9 | 47.5 | 52.3 | 49.0 | - | 45.5 | 56.6 | 67.9 | 55.3 $\pm$ 10.3 |
| antmaze-v0 total | 168.3 | 107.7 | 125.3 | 303.6 | 378.0 | 432.0 | 420.9 | - | 445.4 | 417.8 | 474.6 | 459.9 |

### 5.2 Q-gradient guidance

To demonstrate the effectiveness of soft Q-guidance, we compare DAC to two variants: one that utilizes hard Q-guidance by eliminating the noise scaling factor, and another that employs denoised Q-guidance by conducting guidance with denoised actions. Figure 1 presents an illustration on a 2-D bandit example. In addition, we showcase the efficacy of soft Q-guidance by comparing the performance of various Q-gradient guidance on locomotion tasks, as depicted in Figure 2. DAC with soft Q-guidance achieves the highest performance in nearly all tasks. The hard Q-guidance also performs well when the behavior dataset comprises an adequate number of optimal demonstrations. However, when confronted with tasks that involve numerous sub-optimal trajectories, the hard Q-guidance falls behind in comparison to the soft Q-guidance. Furthermore, the denoised Q-guidance often struggles to generate in-distribution actions and frequently fails. Nevertheless, denoised Q-guidance yields the highest score on “halfcheetah-medium” task, which could be attributed to the fact that such task is more tolerant to OOD actions.

Figure: Figure 2: Ablation study on Q-gradient guidance. We compare soft Q-guidance (soft) with hard Q-guidance (hard) and the denoised Q-guidance (denoised) on locomotion tasks.
Refer to caption: x2.png

### 5.3 Pessimistic value targets

To demonstrate the importance of the LCB target in balancing the overestimation and underestimation of value targets, we compare a variant of DAC on locomotion tasks, wherein the LCB target is replaced by the ensemble minimum (min). The results are shown in Table 2. It is noteworthy that the variants of DAC without the LCB target also achieve competitive performance compared to prior research in many tasks. Additional results of training curves can be found in Appendix C.

**Table 2: Ensemble Q-target ablation. We compare LCB target against the minimum target (min). We also involve the best scores of the prior methods (SOTA) from Table 1 for comparison.**
| Q-Target | walker2d | hopper | halfcheetah |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| m | m-r | m-e | m | m-r | m-e | m | m-r | m-e |  |
| SOTA | 87.0 | 95.5 | 113.0 | 90.5 | 101.3 | 111.2 | 51.1 | 47.8 | 96.8 |
| Min | 83.9 $\pm$ 0.22 | 66.3 $\pm$ 9.7 | 110.0 $\pm$ 0.2 | 100.8 $\pm$ 0.9 | 102.9 $\pm$ 0.4 | 111.3 $\pm$ 0.1 | 49.3 $\pm$ 0.3 | 43.1 $\pm$ 0.2 | 43.2 $\pm$ 0.1 |
| LCB (Ours) | 96.8 $\pm$ 3.6 | 96.8 $\pm$ 1.0 | 113.6 $\pm$ 3.5 | 101.2 $\pm$ 2.0 | 103.1 $\pm$ 0.3 | 111.7 $\pm$ 1.0 | 59.1 $\pm$ 0.4 | 55.0 $\pm$ 0.2 | 99.1 $\pm$ 0.9 |

## 6 Conclusion

In this paper, we propose the Diffusion Actor-Critic framework, which theoretically formulates the KL constraint policy iteration as a diffusion noise regression problem. The resulting policy improvement loss incorporates a soft Q-guidance term that adjusts the strength of Q-gradient guidance based on the noise scales. This approach promotes the generation of high-reward actions while staying within the behavior support. Moreover, we utilize LCB of Q-ensemble to address the issue of
overestimation and underestimation of Q-value targets. We evaluate our algorithm on D4RL benchmarks and compare it against various baselines, demonstrating its superior performance across almost all tasks.

## Appendix A Proofs of Theoretical Results

###### Lemma 1 .

Let $\boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I})$ be a standard Gaussian noise, and $\mathbf{x}_{t}=\sqrt{\bar{\alpha}_{t}}\mathbf{a}+\sqrt{1-\bar{\alpha}_{t}}
\boldsymbol{\epsilon}$ be the noise perturbation of the action $\mathbf{a}$ defined in (4). Then the denoising score function $\nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})$ maintains the property:

$$ $\nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})=-\frac{ \boldsymbol{\epsilon}}{\sqrt{1-\bar{\alpha}_{t}}},$ (21) $$

###### Proof.

Since $q_{t}(\mathbf{x}_{t}|\mathbf{x}_{0})=\mathcal{N}(\mathbf{x}_{t};\sqrt{\bar{
\alpha}_{t}}\mathbf{x}_{0},(1-\bar{\alpha}_{t})\mathbf{I})$, the density of noise distribution has the closed form:

$$ $q_{t}(\mathbf{x}_{t}|\mathbf{a})\propto\exp{[-\frac{(\mathbf{x}_{t}-\sqrt{\bar {\alpha}_{t}}\mathbf{a})^{2}}{2(1-\bar{\alpha}_{t})}]}.$ (22) $$

Therefore, we have

$$ $\displaystyle\nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})$ $\displaystyle=-\frac{\mathbf{x}_{t}-\sqrt{\bar{\alpha}_{t}}\mathbf{a}}{1-\bar{ \alpha}_{t}}=-\frac{\sqrt{1-\bar{\alpha}_{t}}\boldsymbol{\epsilon}}{1-\bar{ \alpha}_{t}}$ (23) $\displaystyle=-\frac{\boldsymbol{\epsilon}}{\sqrt{1-\bar{\alpha}_{t}}}.$ $$

∎

###### Lemma 1 .

###### Proof.

### A.1 Proof of Theorem 1

###### Proof.

Let $\boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I})$ be a standard Gaussian noise. Consider the diffusion process $q_{t}(\mathbf{x}_{t}|\mathbf{a})$ defined in (4) using reparameterization trick. Then $\boldsymbol{\epsilon}^{*}$ solves the noisy score matching objective:

$$ $\boldsymbol{\epsilon}^{*}=\arg\min_{\tilde{\boldsymbol{\epsilon}}}\mathbb{E}_{ \mathbf{a}\sim\pi^{*},t,\mathbf{x}_{t}\sim q_{t}(\cdot|\mathbf{a})}[\frac{1}{2 }||\tilde{\boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)+\sqrt{1-\bar{ \alpha}_{t}}\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})|| ^{2}].$ (24) $$

We can rewrite the objective to obtain:

$$ $\boldsymbol{\epsilon}^{*}=\arg\min_{\tilde{\boldsymbol{\epsilon}}}\mathbb{E}_{ \mathbf{a}\sim\pi^{*},t,\mathbf{x}_{t}\sim q_{t}(\cdot|\mathbf{a}),}[\frac{1}{ 2}||\tilde{\boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)||^{2}+\tilde{ \boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot\sqrt{1-\bar{\alpha}_{ t}}\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})]+C_{1}.$ (25) $$

Consider the second term:

$$ $\displaystyle\mathbb{E}_{\mathbf{x}_{t}\sim p^{*}_{t}(\cdot|\mathbf{s})}$ $\displaystyle[\tilde{\boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot \sqrt{1-\bar{\alpha}_{t}}\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}| \mathbf{s})]$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}p^{*}_{t}(\mathbf{ x}_{t}|\mathbf{s})\tilde{\boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t) \cdot\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})d\mathbf{ x}_{t}$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}\tilde{\boldsymbol {\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{\mathbf{x}_{t}}p_{t}^{*}( \mathbf{x}_{t}|\mathbf{s})d\mathbf{x}_{t}$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}\tilde{\boldsymbol {\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{\mathbf{x}_{t}}\int_{ \mathbf{a}}q_{t}(\mathbf{x}_{t}|\mathbf{a})\pi^{*}(\mathbf{a}|\mathbf{s})d \mathbf{a}d\mathbf{x}_{t}$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}\tilde{\boldsymbol {\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot\int_{\mathbf{a}}q_{t}(\mathbf{x} _{t}|\mathbf{a})\nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a}) \pi^{*}(\mathbf{a}|\mathbf{s})d\mathbf{a}d\mathbf{x}_{t}$ $\displaystyle=\int_{\mathbf{x}_{t}}\int_{\mathbf{a}}\tilde{\boldsymbol{ \epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot\sqrt{1-\bar{\alpha}_{t}}\nabla_{ \mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})q_{t}(\mathbf{x}_{t}| \mathbf{a})\pi^{*}(\mathbf{a}|\mathbf{s})d\mathbf{a}d\mathbf{x}_{t}$ $\displaystyle=\mathbb{E}_{\mathbf{a}\sim\pi^{*},\mathbf{x}_{t}\sim q_{t}(\cdot |\mathbf{a})}[\tilde{\boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot \sqrt{1-\bar{\alpha}_{t}}\nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}| \mathbf{a})].$ $$

Thus we obtain:

$$ $\displaystyle\boldsymbol{\epsilon}^{*}$ $\displaystyle=\arg\min_{\tilde{\boldsymbol{\epsilon}}}\mathbb{E}_{\mathbf{a} \sim\pi^{*},t,\mathbf{x}_{t}\sim q_{t}(\cdot|\mathbf{a})}[\frac{1}{2}||\tilde{ \boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)||^{2}+\tilde{\boldsymbol{ \epsilon}}(\mathbf{x}_{t},\mathbf{s},t)\cdot\sqrt{1-\bar{\alpha}_{t}}\nabla_{ \mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})]+C_{1}$ $\displaystyle=\arg\min_{\tilde{\boldsymbol{\epsilon}}}\mathbb{E}_{\mathbf{a} \sim\pi^{*},t,\mathbf{x}_{t}\sim q_{t}(\cdot|\mathbf{a})}[\frac{1}{2}||\tilde{ \boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)+\sqrt{1-\bar{\alpha}_{t}} \nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})||^{2}]+C_{1}-C_{2}$ $\displaystyle=\arg\min_{\tilde{\boldsymbol{\epsilon}}}\mathbb{E}_{\mathbf{a} \sim\pi^{*},t,\mathbf{x}_{t}\sim q_{t}(\cdot|\mathbf{a})}[\frac{1}{2}||\tilde{ \boldsymbol{\epsilon}}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{\epsilon}||^{2 }]+C_{1}-C_{2}.\text{ (by Lemma \ref{lemma:dsm})}$ $$

Here $C_{1}$ and $C_{2}$ are constants independent of $\tilde{\boldsymbol{\epsilon}}$, which completes the proof.
∎

###### Proof.

### A.2 Proof of Theorem 2

###### Proof.

Let the diffusion process $q_{t}(\mathbf{x}_{t}|\mathbf{a})$ be defined in (4) using reparameterization trick by sampling standard Gaussian noise $\boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I})$. We rewrite the training objective:

$$ $\displaystyle\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{ D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{ \epsilon}^{*}(\mathbf{x}_{t},\mathbf{s},t)||^{2}]$ $\displaystyle=\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal {D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)+\sqrt{1-\bar{ \alpha}_{t}}\nabla_{\mathbf{x}_{t}}\log p_{t}^{*}(\mathbf{x}_{t}|\mathbf{s})|| ^{2}]$ $\displaystyle=\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal {D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)+\sqrt{1-\bar{ \alpha}_{t}}\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}|\mathbf{s})$ $\displaystyle\hskip 142.26378pt+\frac{1}{\eta}\nabla_{\mathbf{x}_{t}}Q^{\pi^{k }}(\mathbf{x}_{t},\mathbf{s})||^{2}]$ $\displaystyle=\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal {D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)||^{2}+\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\sqrt{1-\bar{\alpha}_{t}} \nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}|\mathbf{s})$ $\displaystyle\hskip 142.26378pt+\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t}, \mathbf{s},t)\cdot\frac{1}{\eta}\nabla_{\mathbf{x}_{t}}Q^{\pi^{k}}(\mathbf{x}_ {t},\mathbf{s})]+C_{1}$ $$

Similar to the proof of Theorem 1, we can rewrite the second term to obtain:

$$ $\displaystyle\mathbb{E}_{t,\mathbf{x}_{t}\sim p_{t}(\cdot|\mathbf{s})}$ $\displaystyle[\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot \sqrt{1-\bar{\alpha}_{t}}\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}| \mathbf{s})]$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}p_{t}(\mathbf{x}_{ t}|\mathbf{s})\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)( \mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_ {t}|\mathbf{s})d\mathbf{x}_{t}$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{\mathbf{x}_{t}}p_{ t}(\mathbf{x}_{t}|\mathbf{s})d\mathbf{x}_{t}$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{\mathbf{x}_{t}} \int_{\mathbf{a}}q_{t}(\mathbf{x}_{t}|\mathbf{a})\pi_{\beta}(\mathbf{a}| \mathbf{s})d\mathbf{a}d\mathbf{x}_{t}$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\int_{\mathbf{a}}q_{t}( \mathbf{x}_{t}|\mathbf{a})\nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}| \mathbf{a})\pi_{\beta}(\mathbf{a}|\mathbf{s})d\mathbf{a}d\mathbf{x}_{t}$ $\displaystyle=\sqrt{1-\bar{\alpha}_{t}}\int_{\mathbf{x}_{t}}\int_{\mathbf{a}} \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{ \mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})q_{t}(\mathbf{x}_{t}| \mathbf{a})\pi_{\beta}(\mathbf{a}|\mathbf{s})d\mathbf{a}d\mathbf{x}_{t}$ $\displaystyle=\mathbb{E}_{\mathbf{a}\sim\pi_{\beta},t,\mathbf{x}_{t}\sim q_{t} (\cdot|\mathbf{a})}[\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t )\cdot\sqrt{1-\bar{\alpha}_{t}}\nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t }|\mathbf{a})]$ $\displaystyle=\mathbb{E}_{\mathbf{a}\sim\pi_{\beta},t,\mathbf{x}_{t}\sim q_{t} (\cdot|\mathbf{a})}[-\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s}, t)\cdot\boldsymbol{\epsilon}]\text{ (by Lemma \ref{lemma:dsm})}.$ $$

Therefore, we have:

$$ $\displaystyle\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{ D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{ \epsilon}^{*}(\mathbf{x}_{t},\mathbf{s},t)||^{2}]$ $\displaystyle=\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal {D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)||^{2}+\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\sqrt{1-\bar{\alpha}_{t}} \nabla_{\mathbf{x}_{t}}\log q_{t}(\mathbf{x}_{t}|\mathbf{a})$ $\displaystyle\hskip 142.26378pt+\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t}, \mathbf{s},t)\cdot\frac{1}{\eta}\nabla_{\mathbf{x}_{t}}Q^{\pi^{k}}(\mathbf{x}_ {t},\mathbf{s})]+C_{1}$ $\displaystyle=\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal {D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)||^{2}-\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\boldsymbol{\epsilon}$ $\displaystyle\hskip 142.26378pt+\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t}, \mathbf{s},t)\cdot\frac{1}{\eta}\nabla_{\mathbf{x}_{t}}Q^{\pi^{k}}(\mathbf{x}_ {t},\mathbf{s})]+C_{1}$ $\displaystyle=\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal {D},t,\mathbf{x}_{t}\sim q_{t}(\mathbf{x}_{t}|\mathbf{a})}[\frac{1}{2}|| \boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{ \epsilon}+\frac{1}{\eta}\nabla_{\mathbf{x}_{t}}Q^{\pi^{k}}(\mathbf{x}_{t}, \mathbf{s})||^{2}]+C_{1}-C_{2}$ $\displaystyle=\arg\min_{\theta}\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal {D},t,\boldsymbol{\epsilon}\sim\mathcal{N}(\mathbf{0},\mathbf{I})}[\frac{1}{2} ||\boldsymbol{\epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{ \epsilon}+\frac{1}{\eta}\nabla_{\mathbf{x}_{t}}Q^{\pi^{k}}(\mathbf{x}_{t}, \mathbf{s})||^{2}]+C_{1}-C_{2},$ $$

where $\mathbf{x}_{t}=\sqrt{\bar{\alpha}_{t}}\mathbf{a}+\sqrt{1-\bar{\alpha}_{t}}
\boldsymbol{\epsilon}$ is given by the reparameterization trick. $C_{1}$ and $C_{2}$ are constants independent of $\boldsymbol{\epsilon}_{\theta}$, which completes the proof.

∎

###### Proof.

## Appendix B Experimental Details

We train our algorithm for 2 million gradient steps in order to ensure model convergence. For each environment, we carry out 8 independent training processes, with each process evaluating performance using 10 different seeds at intervals of 10,000 gradient steps. This leads to a total of 80 rollouts for each evaluation. We report the average score of evaluations in the last 50,000 gradient steps without any early-stopping selection, which fairly reflects the true performance after convergence. We perform our experiments on two GeForce RTX 4090 GPUs, with each experiment taking approximately 4 hours to complete, including both the training and evaluation processes. Our code implementation is built upon the jaxrl [] code base.

### B.1 Network Architecture

We employ simple 3 layer MLP with hidden dimension of 256 and Mish [] activation for both the actor and critic networks. To enhance training stability, we implement target networks for both actor and critic, which track the exponential moving average (EMA) of the training networks. Specifically, we initialize the target networks $\boldsymbol{\epsilon}_{\bar{\theta}}$ and $Q_{\bar{\phi}^{h}_{k}}$ with the same seed as training networks $\boldsymbol{\epsilon}_{\theta}$ and $Q_{\bar{\phi}^{h}_{k}}$ respectively. We update the target actor network $\boldsymbol{\epsilon}_{\bar{\theta}}$ every 5 gradient steps while update the target critic networks $Q_{\bar{\phi}^{h}_{k}}$ after each gradient step to further ensure training stability.

### B.2 Hyperparameters

We maintain consistent hyperparameter settings for the diffusion models and networks across all tasks. The hyperparameter settings are as follows:

**Table 3: Hyperparameters for all networks and tasks.**
| Hyperparameter | Value |
| --- | --- |
| T (Diffusion Steps) | 5 |
| $\beta_{t}$ (Noise Schedule) | Variance Preserving [] |
| H (Ensemble Size) | 10 |
| B (Batch Size) | 256 |
| Learning Rates (for all networks) | 3e-4, 1e-3 (antmaze-large) |
| Learning Rate Decay | Cosine [] |
| Optimizer | Adam [] |
| $\eta_{\text{init}}$ (Initial Behavior Cloning Strength) | [0.1, 1] |
| $\alpha_{\eta}$ (for Dual Gradient Ascent) | 0.001 |
| $\alpha_{\text{ema}}$ (EMA Learning Rate) | 5e-3 |
| $N_{a}$ (Number of sampled actions for evaluation) | 10 |
| $b$ (Behavior Cloning Threshold) | [0.05, 1] |
| $\rho$ (Pessimistic factor) | [0, 2] |

Regarding the pessimistic factor $\rho$, we empirically find that selecting the smallest possible value for $\rho$ without causing an explosion in Q-value estimation yields good outcomes, as the learned target policy already avoids sampling OOD actions. This makes the tuning of $\rho$ to be relatively straightforward. In terms of policy-regularization, DAC controls the trade-off between behavior cloning and policy improvement using either a constant $\eta\equiv\eta_{\text{init}}$ or learnable $\eta$ by setting $b$ for dual gradient ascent (Algorithm 1). For locomotion tasks, we employ dual gradient ascent which dynamically adjust $\eta$ to fulfil the policy constraint. As for antmaze tasks, we choose constant $\eta\equiv\eta_{\text{init}}$ during the training process. Moreover, since different tasks involve varying action dimensions, we choose different hyperparameters for each task. We consider values of $\eta_{\text{init}}\in[0.1,1]$, $b\in[0.05,1]$ and $\rho\in[0,2]$. We summarize the hyperparameter settings for the reported results in Table 4.

**Table 4: Hyperparameters settings for tasks.**
| Tasks | $\boldsymbol{b}$ | $\boldsymbol{\eta}$ | $\boldsymbol{\rho}$ | Regularization Type |
| --- | --- | --- | --- | --- |
| hopper-medium-v2 | 1 | - | 1.5 | Learnable |
| hopper-medium-replay-v2 | 1 | - | 1.5 | Learnable |
| hopper-medium-expert-v2 | 0.05 | - | 1.5 | Learnable |
| walker2d-medium-v2 | 1 | - | 1 | Learnable |
| walker2d-medium-replay-v2 | 1 | - | 1 | Learnable |
| walker2d-medium-expert-v2 | 1 | - | 1 | Learnable |
| halfcheetah-medium-v2 | 1 | - | 0 | Learnable |
| halfcheetah-medium-replay-v2 | 1 | - | 0 | Learnable |
| halfcheetah-medium-expert-v2 | 0.1 | - | 0 | Learnable |
| antmaze-umaze-v0 | - | 0.1 | 1 | Constant |
| antmaze-umaze-diverse-v0 | - | 0.1 | 1 | Constant |
| antmaze-medium-play-v0 | - | 0.1 | 1 | Constant |
| antmaze-medium-diverse-v0 | - | 0.1 | 1 | Constant |
| antmaze-large-play-v0 | - | 0.1 | 1.1 | Constant |
| antmaze-large-diverse-v0 | - | 0.1 | 1 | Constant |

### B.3 Value Target Estimation

For the critic learning, we need to sample $\mathbf{a}^{\prime}\sim\pi_{\theta_{k}}(\cdot|\mathbf{s}^{\prime})$ to estimate the value target in (18). To enhance the training stability, we samples 10 actions from $\pi_{\theta_{k}}(\cdot|\mathbf{s}^{\prime})$ through denoising process. As for locomotion tasks, we calculate the average value $\mathbb{E}_{\mathbf{a}^{\prime}}[Q_{\bar{\phi}_{k}^{h}}(\mathbf{s}^{\prime},
\mathbf{a}^{\prime})]$ over the sampled actions to estimate the target Q-value. While for antmaze tasks, we use the maximum $\max_{\mathbf{a}^{\prime}}[Q_{\bar{\phi}_{k}^{h}}(\mathbf{s}^{\prime},\mathbf{
a}^{\prime})]$ to address the problem of reward sparsity, which is consistent with previous research [].

### B.4 Q-gradient Guidance

To fairly assess the performances of different Q-guidance, as shown in the 2D-bandit example (Figure 1) and an ablation study in Section 5.2, we modify the actor learning loss of DAC while keeping all the remaining settings the same. In the case of soft Q-guidance, we use the original loss of actor learning for DAC (16). For the hard Q-guidance, we modify (16) to remove the noise scale factor:

$$ $\mathcal{L}_{\text{hard}}(\theta)=\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim \mathcal{D},\boldsymbol{\epsilon},t}\big{[}\eta||\boldsymbol{\epsilon}_{\theta }(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{\epsilon}||^{2}+\boldsymbol{ \epsilon}_{\theta}(\mathbf{x}_{t},\mathbf{s},t)\cdot\nabla_{\mathbf{x}_{t}}Q^{ \pi_{k}}(\mathbf{s},\mathbf{x}_{t})\big{]}.$ (26) $$

Regarding the denoised Q-guidance used in Diffusion Q-learning [], we use the following denoised Q-guidance loss:

$$ $\mathcal{L}_{\text{denoised}}(\theta)=\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim \mathcal{D},\boldsymbol{\epsilon},t}\big{[}\eta||\boldsymbol{\epsilon}_{\theta }(\mathbf{x}_{t},\mathbf{s},t)-\boldsymbol{\epsilon}||^{2}+\mathbb{E}_{\mathbf {x}_{0}\sim\pi_{\theta}}[Q^{\pi_{k}}(\mathbf{s},\mathbf{x}_{0})]\big{]},$ (27) $$

where the denoised action $\mathbf{x}_{0}$ is obtained through denoising process used in DDPM, and the gradient $\partial\mathcal{L}_{\text{hard}}(\theta)/\partial\theta$ will be back-propagated through the denoising process. All the Q-functions are re-scaled by an estimated constant $\frac{1}{\mathbb{E}_{(\mathbf{s},\mathbf{a})\sim\mathcal{D}}|Q^{\pi_{k}}(
\mathbf{s},\mathbf{a})|}$ to remove the influence of different Q-value scales.

### B.5 2-D Bandit Example

For the 2-D bandit example (Figure 1), we generate 400 sub-optimal behavior actions by drawing samples from patterns with Gaussian noises. The reward values for each action are determined by the distances between action points and $(0.4,-0.4)$, i.e., $r\sim-\sqrt{(x-0.4)^{2}+(y+0.4)^{2}}+\mathcal{N}(\mathbf{0},0.5\mathbf{I})$. Therefore, the majority of actions are sub-optimal and the estimated gradient field will tend to promote the generation of out-of-distribution (OOD) actions. However, given that the true reward values associated with OOD actions are agnostic to the learner, a well-performing policy learned through offline RL should not deviate significantly from the behavior support. This highlights the superiority of DAC in this protocol. To reproduce the results presented in Figure 1, we train 20,000 gradient steps with a batch size of 128, a learning rate of 1e-3, a diffusion step $T=50$, and behavior cloning threshold $b=1.3$ for all the methods.

### B.6 Reward Tuning

We adhere to the reward tuning conventions for locomotion tasks in the previous research [], which is defined as:

$$ $\tilde{r}=1000\times\frac{r}{\text{maximal trajectory return}-\text{minimal trajectory return}}.$ (28) $$

As for antmaze task, it faces the challenge of sparse rewards, with the agent receiving a reward of 1 upon reaching the goal and 0 otherwise. Previous methods typically subtracts a negative constants (such as -1) from the rewards to tackle the issue of reward sparsity [, ]. However, we empirically find that DAC performs well for most tasks without the need for such reward tuning technique. In our experiments, we simply employ the same tuning method (28) as the one used for locomotion tasks, which in fact scales the rewards by 1,000 for antmaze environments. This tuning method does not effectively tackle the problem of sparse rewards, which could potentially result in the inferior performance of DAC on the “large” antmaze tasks.

## Appendix C Additional Experimental Results

### C.1 Scores of Q-guidance Ablation

We compare the performances of DAC variants that replace the soft Q-guidance by the hard Q-guidance or the denoised Q-guidance on locomotion tasks in Figure 2. The average normalized scores are shown in Table 5.

**Table 5: Q-guidance ablation. We compare soft Q-guidance against hard Q-guidance and denoised Q-guidance while maintaining the remaining settings the same. Additionally, we report the best scores from prior research (SOTA) in Table 1 for comparison, with the average scores surpassing prior methods highlighted in boldface. The denoised Q-guidance often fails due to severe OOD issues. However, denoised Q-guidance achieves positive performance on the “halfcheetah-medium-v2” task, which could be attributed to the greater tolerance of these tasks towards OOD actions.**
| Q-Target | walker2d | hopper | halfcheetah |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| m | m-r | m-e | m | m-r | m-e | m | m-r | m-e |  |
| SOTA | 87.0 | 95.5 | 113.0 | 90.5 | 101.3 | 111.2 | 51.1 | 47.8 | 96.8 |
| Denoised | 8.4 $\pm$ 2.2 | 95.4 $\pm$ 7.5 | 5.9 $\pm$ 1.0 | 17.8 $\pm$ 8.2 | 105 $\pm$ 1.0 | 49.5 $\pm$ 1.4 | 71.9 $\pm$ 1.9 | 56.7 $\pm$ 5.3 | 1.76 $\pm$ 1.0 |
| Hard | 85.2 $\pm$ 16.1 | 96.9 $\pm$ 0.5 | 110.4 $\pm$ 6.3 | 103.1 $\pm$ 0.2 | 103.8 $\pm$ 0.3 | 110.2 $\pm$ 2.4 | 59.5 $\pm$ 0.5 | 55.3 $\pm$ 0.4 | 94.6 $\pm$ 0.9 |
| LCB (Ours) | 96.8 $\pm$ 3.6 | 96.8 $\pm$ 1.0 | 113.6 $\pm$ 3.5 | 101.2 $\pm$ 2.0 | 113.1 $\pm$ 0.3 | 111.7 $\pm$ 1.0 | 59.1 $\pm$ 0.4 | 55.0 $\pm$ 0.2 | 99.1 $\pm$ 0.9 |

### C.2 Training Curves

We show the training curves for ablation study on various value targets (Table 2) in Figure 3. We also involve the training curves on antmaze tasks in Figure 4.

Figure: Figure 3: Value target ablation. We compare the LCB target against the target using ensemble minimum on locomotion tasks.
Refer to caption: x3.png

Figure: Figure 4: Training curves for antmaze tasks.
Refer to caption: x4.png

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 2
questions: See weaknesses.
soundness: 3
strengths: Overall the paper is well-written, making readers quickly capture the core idea. There are several advantages of this paper:

1. DAC directly models the target policy as a diffusion model, which is an innovation in the field of offline reinforcement learning.

2. Soft Q guidance adjusts the intensity of Q gradients according to noise scale, encouraging the generation of high-return actions while staying within the behavior support range. This approach effectively prevents actions outside the sampled distribution, enhancing the stability and performance of the algorithm.
summary: This paper integrates the advantage-weighted regression and diffusion model for offline reinforcement learning. This paper introduces the Diffusion Actor-Critic (DAC) framework, which theoretically formulates KL-constrained policy iteration as a diffusion noise regression problem. The experimental results demonstrate the advantages of DAC in terms of performance and stability. However, several concerns are as follows.
weaknesses: 1. The notation of this paper is complicated. 

2. The translation between Equations 13 and 14 probably is not acceptable. How could you replace the target policy with the offline dataset? Do you mean behavior policy?

3. The design of Q-ensemble makes the results unconvincing. The Q-ensemble methods can solve the offline RL without any extra regularization. Given the design of the Q-ensemble, it's ambiguous whether the improvement comes from the proposed diffusion policy-constrained iteration or the Q-ensemble. The ablation of Fig. 4 seems to approve this. The baseline methods, such as DQL, should add a Q-ensemble to compare what makes it fairer. 

4. Although the paper emphasizes the importance of the LCB objective in stabilizing Q-value estimation, it lacks a deeper analysis of the impact of different pessimism factors, ρ.

5. Insufficient comparison of offline RL, including but not limited to:

[1] RORL: Robust Offline Reinforcement Learning via Conservative Smoothing.

[2] Offline RL with No OOD Actions: In-Sample Learning via Implicit Value Regularization.

Several previous methods using constrained policy learning for offline RL should be discussed at least:

[3] Behavior proximal policy optimization

[4] An Implicit Trust Region Approach to Behavior Regularized Offline Reinforcement Learning

[5] Uni-o4: Unifying online and offline deep reinforcement learning with multi-step on-policy optimization

---

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: - Soft Q-guidance relies on the accurate estimation of Q-values. If Q-values are overly optimistic or pessimistic, how does this affect the generated final policy? Have you considered the propagation of such uncertainty in the learning process? If the weight adjustment for soft Q-guidance is improper, could it lead to an over-reliance on Q-values in the generated policy, potentially resulting in overfitting?

- Soft Q-guidance performs well in handling tasks, but that hard Q-guidance significantly deteriorates in performance when facing a large number of sub-optimal trajectories. Have you considered combining different guidance strategies to enhance the robustness of the algorithm? Specifically, have you evaluated the introduction of additional regularization methods in specific tasks to prevent the policy from overly relying on sub-optimal trajectories, thereby enhancing the model's stability and generalization ability?

- In the antmaze task, the author noted that sparse rewards have a certain impact on the algorithm's performance. In this regard, have you designed more effective reward mechanisms or exploration strategies to address the challenges posed by sparse rewards? In practical applications, if the algorithm encounters sparse rewards, what measures do you anticipate taking to adjust the DAC algorithm to ensure it can still effectively learn and optimize the policy?

- The authors mentioned using a lower confidence bound to counteract overly pessimistic estimates. Could this lead to a systematic bias in the Q-values? How significant is this bias in different task settings?

- How does the $\eta$ parameter in the objective function influence the optimization process? In certain scenarios, the choice of $\eta$ might lead to oscillations or divergence of the algorithm. Is there a need for a sensitivity analysis regarding this choice? If gradient vanishing issues arise, particularly when the update frequency of the target policy is high, how should this potential problem be addressed?
soundness: 3
strengths: Originality:

The DAC framework which combines diffusion models with policy optimization in reinforcement learning is novel. By introducing soft Q-guidance, the paper effectively overcomes the problem of overestimating Q-values in offline learning, enhancing the stability of policy improvement. This approach offers a new direction for future research.

Significance:

The authors conduct extensive experiments on D4RL benchmarks, covering a variety of tasks with results that are clear and convincing. The experimental results is strong

Clarity:

The paper is clearly written with illustrative examples
summary: This paper presents the Diffusion Actor-Critic (DAC) framework, aimed at addressing key challenges in offline reinforcement learning, particularly in policy optimization and high-reward action generation. By innovatively transforming the KL-constrained policy iteration problem into a diffusion noise regression problem, DAC introduces a soft Q-guidance mechanism. Through comparative experiments, DAC demonstrates superior performance over existing methods on multiple D4RL benchmark tasks, especially when handling datasets containing a large number of suboptimal trajectories. The experimental results indicate that DAC not only exhibits stable convergence but also surpasses other methods in overall scores, showcasing its potential in the field of offline reinforcement learning.
weaknesses: The authors should consider evaluate DAC in more offline reinforcement learning tasks, particularly in real-world application areas such as robotic control and atari games. And It would be better to provide specific choice of hyperparameter configuration

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: How does DAC's generalization performance hold up in larger-scale real-world applications, such as autonomous driving or industrial robotics? Is there a plan to further test the scalability of this method?

Does the trade-off in soft Q guidance choice show differences in performance across various environments? Can the specific effects of different weight parameters on model performance be further explored?
soundness: 3
strengths: Innovativeness: Introduces a new algorithm DAC and proposes the soft Q guidance, addressing several challenges in offline reinforcement learning.

Experimental Performance: Demonstrates outstanding performance in D4RL benchmark tests, especially surpassing current state-of-the-art algorithms in locomotion and antmaze tasks.

Theoretical Support: Provides clear theoretical justification by rigorously transforming the KL constrained policy iteration problem into a diffusion noise regression problem.
summary: This paper presents Diffusion Actor-Critic (DAC), a novel offline reinforcement learning algorithm designed to directly generate target policies using diffusion models. DAC formalizes the policy iteration problem with Kullback-Leibler (KL) constraints as a diffusion noise regression problem, achieving policy constraints through soft Q guidance, thus avoiding the generation of actions outside the offline data distribution. The paper demonstrates the outstanding performance of DAC in D4RL benchmark tests, surpassing current state-of-the-art methods in nearly all environments, while showing stable convergence and robust performance.
weaknesses: Lack of presentation: structure of the article is chaotic, failing to highlight key points, which creates some difficulty in reading.

Scope of Application: Although DAC performs well on standard benchmarks, its generalization ability in large-scale or complex real-world tasks has not been fully validated.

The advantages of Soft Q-guidance are not sufficiently pronounced compared to other methods.

---

confidence: 4
contribution: 2
initial_rating: 6
presentation: 3
questions: - line244 or so, did you experiment with estimating entropy in the EDP?
- Why haven't you done experiments with Adroit Tasks and Kitchen Tasks and compared them with the latest algorithms? (It's not enough in the appendix, it's perfectly fine to put it in the body of the text for comparison)
- In Equation 15, the Q-function is well-trained only within the original data distribution. However, the distribution of $x_t$ tends to be more random and can significantly diverge from the dataset distribution. How can we ensure that the Q-function's gradients with respect to $x_t$ remain accurate and avoid substantial extrapolation errors?
soundness: 3
strengths: - The paper incorporates diffusion models into constrained policy iteration by using score functions, addressing the issue of the untraceable KL divergence in diffusion policies. 

- The paper also presents extensive experiments and thorough ablation studies, demonstrating the effectiveness and robustness of DAC.

- DAC captures the multimodality of policies using diffusion model.
summary: The paper proposes DAC, an offline reinforcement learning algorithm that uses diffusion models to manage out-of-distribution actions and prevent the overestimation of value functions. DAC formulates the KL-constrained policy iteration as a diffusion noise regression problem, enabling the direct representation of target policies as diffusion models. The approach includes soft Q-guidance for actor training and a Q-ensemble for critic training, stabilizing Q-gradient estimation. DAC outperforms state-of-the-art methods on the D4RL benchmarks, demonstrating its effectiveness across various environments.
weaknesses: - There are some 2024 papers missing in the offline RL summaries (existing citations are 2023 at best), and accordingly I would like to see your results against them in the experimental section eg. AlignIQL: Policy Alignment in Implicit Q-Learning through Constrained Optimization (He et al.), Diffusion Policies creating a Trust Region for Offline Reinforcement Learning (Chen et al.). 

- Recently, there is also a lot of work combining online RL and diffusion modelling, and I think a brief summary is also very necessary. Let me name a few famous works, you can add a paragraph to summarise eg. Policy Representation via Diffusion Probability Model for Reinforcement Learning(Yang et al.), Learning a Diffusion Model Policy from Rewards via Q-Score Matching(Psenka et al.), Diffusion Actor-Critic with Entropy Regulator(Wang et al.).

- I don't seem to have seen you perform ablation experiments for LCB, as well as ablation experiments for diffusion step size. Especially with the ablation experiments for LCB, I'd like to see the proportionality of the improvement in performance of LCB for your final performance compared to the improvement in performance of your proposed method.

- Experiments including $\rho$ were not analysed for sensitivity.

Meta-review: Diffusion Actor-Critic: Formulating Constrained Policy Iteration as Diffusion Noise Regression for Offline Reinforcement Learning 

Summary: The paper introduces Diffusion Actor-Critic (DAC), a new offline reinforcement learning algorithm that utilizes diffusion models to generate target policies. DAC addresses challenges in offline RL by formulating constrained policy iteration as a diffusion noise regression problem, integrating a soft Q-guidance mechanism to ensure the policy remains within behavior support and avoids out-of-distribution (OOD) actions. Unlike prior diffusion-based methods, DAC does not require explicit density estimation, simplifying the training process. Leveraging a Q-ensemble with a lower confidence bound (LCB) for critic learning, DAC enhances stability and prevents overestimation. Experimental evaluations on the D4RL benchmark demonstrate that DAC outperforms existing methods.

Comments: We have received 4 expert reviews, with scores 6, 6, 6,8, and the average score is 6.50. 

Reviewers gave positive comments about many aspects of this paper. More than one reviewer commented that  DAC's use of diffusion models to directly model target policies and integrate soft Q-guidance is innovative. Reviewers also commented on the technically grounded approach and analysis.  The experiments are extensive and they show superior performance of DAC. Reviewers appreciated the clear presentation and the insightful discussions. 

The reviewers have also provided some comments to strengthen the paper. One major comment is the need for additional comparison with recent works that combine diffusion models and RL. The reviewers have also asked for additional experiments and ablation studies. I am glad to see that the authors have partially addressed these comments during the rebuttal process. I recommend the authors to make the changes to their manuscript according to these comments.

Decision: Accept (Poster)