<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>CONSISTENCY MODELS AS A RICH AND EFFICIENT POLICY CLASS FOR REINFORCEMENT LEARNING</title></titleStmt>
			<publicationStmt>
				<publisher>International Conference on Learning Representations</publisher>
				<date>05/07/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10560646</idno>
					<idno type="doi"></idno>
					
					<author>Zihan Ding</author><author>Chi Jin</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Score-based generative models like the diffusion model have been testified to beeffective in modeling multi-modal data from image generation to reinforcementlearning (RL). However, the inference process of diffusion model can be slow, whichhinders its usage in RL with iterative sampling. We propose to apply the consistencymodel as an efficient yet expressive policy representation, namely consistencypolicy, with an actor-critic style algorithm for three typical RL settings: offline,offline-to-online and online. For offline RL, we demonstrate the expressiveness ofgenerative models as policies from multi-modal data. For offline-to-online RL, theconsistency policy is shown to be more computational efficient than diffusion policy,with a comparable performance. For online RL, the consistency policy demonstratessignificant speedup and even higher average performances than the diffusion policy.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>Parameterized policy representation is an important component for policy-based deep reinforcement learning (DRL) <ref type="bibr">(Sutton &amp; Barto, 2018;</ref><ref type="bibr">Arulkumaran et al., 2017;</ref><ref type="bibr">Dong et al., 2020)</ref>. Prior works have developed a variety of policy parameterization methods. For discrete action space, existing policy parameterization includes Softmax action preferences <ref type="bibr">(Sutton &amp; Barto, 2018)</ref>, Gumbel-Softmax for categorical distributions <ref type="bibr">(Jang et al., 2016)</ref>, decision trees <ref type="bibr">(Frosst &amp; Hinton, 2017;</ref><ref type="bibr">Ding et al., 2020)</ref>, etc. For continuous action space, the most typical choice is unimodal Gaussian distribution. However, in practice the demonstration dataset often encompasses samples from a mixture of behavior policies. To capture the multi-modality in data distribution, Gaussian mixture model (GMM) <ref type="bibr">(Jacobs et al., 1991;</ref><ref type="bibr">Ren et al., 2021)</ref>, variational auto-encoders (VAE) <ref type="bibr">(Kingma &amp; Welling, 2013;</ref><ref type="bibr">Kumar et al., 2019)</ref>, denoising diffusion probabilistic model (DDPM) <ref type="bibr">(Ho et al., 2020;</ref><ref type="bibr">Song et al., 2020;</ref><ref type="bibr">Wang et al., 2022;</ref><ref type="bibr">Chi et al., 2023;</ref><ref type="bibr">Hansen-Estruch et al., 2023;</ref><ref type="bibr">Venkatraman et al., 2023</ref>) are adopted as policy representation.</p><p>The desiderata for policy representation in DRL includes: 1. The strong expressiveness of the function class is found to be critical for modeling multi-modal data distribution in offline RL <ref type="bibr">(Wang et al., 2022)</ref> or imitation learning (IL) <ref type="bibr">(Chi et al., 2023)</ref>; 2. Differentiability of the model is usually required for ease of optimization with stochastic gradient descent; 3. Computational and time efficiency for sampling can be essential for RL agents learning from interactions with environments. Previous works with action diffusion models (i.e., diffusion policy) testify the expressiveness of diffusion models for multi-modal action distributions <ref type="bibr">(Wang et al., 2022;</ref><ref type="bibr">Chi et al., 2023;</ref><ref type="bibr">Hansen-Estruch et al., 2023;</ref><ref type="bibr">Janner et al., 2022;</ref><ref type="bibr">Ajay et al., 2022)</ref>. Although GMM and VAE also capture multi-modality, diffusion models with large sampling steps are found to be more expressive for IL and offline RL scenarios <ref type="bibr">(Wang et al., 2022;</ref><ref type="bibr">Chi et al., 2023)</ref>. However, it is known that the diffusion model with progressive denoising over a large number of steps can lead to slow sampling speed. The action inference can be a critical bottleneck for online RL heavily depends on sampling from environments. A direct usage of diffusion policies for online settings with policy gradient for optimization requires backpropagating through the diffusion networks for the number of sampling steps, which is not scalable for its large time consumption and memory occupancy. Consistency models <ref type="bibr">(Song et al., 2023)</ref> based on probability flow ordinary differential equation (ODE) is proposed as a rescue with comparable performances as diffusion models but much less computational time, which allows few-step generation process thus significantly reduce the time consumption at inference stage.</p><p>Offline-to-online RL usually suffers from a catastrophic degraded performance at initial online training stage, due to the distribution shift of training samples. Previous research has studied online fine-tuning with offline data or pre-trained policies, including Hybrid Q learning <ref type="bibr">(Song et al., 2022)</ref>, <ref type="bibr">RLPD (Ball et al., 2023)</ref>, Cal-QL <ref type="bibr">(Nakamoto et al., 2023)</ref>, Action-free Guide <ref type="bibr">(Zhu et al., 2023)</ref>, Actor-Critic Alignment (ACA) <ref type="bibr">(Yu &amp; Zhang, 2023)</ref> and <ref type="bibr">Lee et al. (2022)</ref>.</p><p>Score-based Generative Model for RL. For policy representation in RL, recent work also uses Denoising Diffusion Probabilistic Models (DDPM) <ref type="bibr">(Ho et al., 2020;</ref><ref type="bibr">Song et al., 2020)</ref>, which we loosely refer to as the diffusion model (original diffusion model traces back to <ref type="bibr">Sohl-Dickstein et al. (2015)</ref>) in this paper, to capture the multi-modal distributions in offline dataset. Diffusion QL <ref type="bibr">(Wang et al., 2022)</ref> uses diffusion model for policy representation in the Q-learning+BC approach. Implicit Diffusion Q-learning (IDQL) <ref type="bibr">(Hansen-Estruch et al., 2023)</ref> is a variant of IQL using diffusion policy. Diffusion policies <ref type="bibr">(Chi et al., 2023)</ref> applies diffusion models for policy representation under imitation learning settings in robotics domain. Diffuser <ref type="bibr">(Janner et al., 2022)</ref> and Decision Diffuser <ref type="bibr">(Ajay et al., 2022)</ref> combines decision transformer architecture with diffusion models for model-based reinforcement learning from offline dataset. Diffusion policies are also used for goal-conditioned imitation learning <ref type="bibr">(Reuss et al., 2023)</ref> and human behavior imitation <ref type="bibr">(Pearce et al., 2023)</ref>. Q-guided Policy Optimization (QGPO) <ref type="bibr">(Lu et al., 2023)</ref> proposes a new formulation for intermediate guidance in diffusion sampling process. Latent Diffusion-Constrained Q-Learning (LDCQ) <ref type="bibr">(Venkatraman et al., 2023)</ref> proposes to apply latent diffusion model with a batch-constrained Q value to handle the stitching issue and the extrapolation errors for offline dataset.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">PRELIMINARIES</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">OFFLINE AND ONLINE RL</head><p>For RL, we define a Markov decision process (S,A,R,T ,&#961; 0 ,&#947;), where S is the state space, A is the action space, R(s,a) : S &#215;A &#8594; R is the reward function, T (s &#8242; |s,a) : S &#215;A &#8594; Pr(S) is the stochastic transition function, &#961; 0 (s 0 ) : S &#8594; Pr(S) is the initial state distribution, and &#947; &#8712; [0,1] is the discount factor for value estimation. A stochastic policy &#960;(a|s) : S &#8594; Pr(A) determines the action a &#8712; A for the agent to take given its current state s &#8712; S, and the optimization objective for the policy is its discounted cumulative reward: E &#960; [ &#8734; t=0 &#947; t r(s t ,a t )]. For offline RL, there exist a dataset D = {(s,a,r,s &#8242; ,done)} collected with some behavior policies &#960; b , and the current policy &#960; is set to be optimized with D. For online RL, the agent is allowed collect samples through interacting with the environment to compose an online training dataset D for optimizing its policy. We consider parameterized policy representation as &#960; &#952; .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">CONSISTENCY MODEL</head><p>The diffusion model <ref type="bibr">(Ho et al., 2020;</ref><ref type="bibr">Song et al., 2020)</ref> solves the multi-modal distribution matching problem with a stochastic differential equation (SDE), while the consistency model <ref type="bibr">(Song et al., 2023)</ref> solves an equivalent probability flow ordinary differential equation (ODE): dx&#964; d&#964; = -&#964; &#8711;logp &#964; (x) with p &#964; (x) = p data (x) &#8855; N (0,&#964; 2 I) for time period &#964; &#8712; [0,T ], where p data (x) is the data distribution. The reverse process along the solution trajectory {x &#964; } &#964; &#8712;[&#1013;,T ] of this ODE is the data generation process from initial random samples xT &#8764; N (0,T 2 I), with &#1013; as a small constant close to 0 for handling numerical problem at the boundary. For speeding up the sampling process from a diffusion model, consistency model shrinks the required number of sampling steps to a much smaller value than the diffusion model, without hurting the model generation performance much. Specifically, it approximates a parameterized consistency function f &#952; : (x &#964; ,&#964; ) &#8594; x &#1013; , which is defined as a map from the noisy sample x &#964; at step &#964; back to the original sample x &#1013; , instead of applying a step-by-step denoising function p &#952; (x &#964; -1 |x &#964; ) as the reverse diffusion process in diffusion model. The training and inference details of consistency model refer to Appendix B. For modeling the conditional distribution with condition variable c, the consistency function is changed to be f &#952; (c,x &#964; ,&#964; ), which is sightly different from original consistency model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">CONSISTENCY MODEL AS RL POLICY</head><p>The consistency model as policy representation in RL can be formulated in the following way. To map the consistency model to a policy in MDP, we set:</p><p>where p D (a|s) is the action-state conditional distribution from offline dataset D.</p><p>Consistency Action Inference. By setting the condition variable c as state s and generated variable x as action a, the consistency function f &#952; can be used for generating actions from states following the conditional distribution of the dataset, i.e., a behavior RL policy. The parameterized policy &#960; &#952; is defined implicitly in terms of f &#952; , with which an action a conditioned on state s can be generated following the Consistency Inference as Alg. 1 with predetermined {&#964; n |n &#8712; [N ]} sequence.</p><p>During the inference process, a trained consistency model f &#952; (s,&#226; &#964;n ,&#964; n ) iteratively predicts denoised samples from the noisy inputs &#226;&#964;n = a + &#964; 2 n -&#1013; 2 z along the probability flow ODE trajectory at step n &#8712; [N ], with Gaussian noise z &#8764; N (0,I). {&#964; n |n &#8712; [N ]} is a sub-sequence of time points on a certain time period [&#1013;,T ] with &#964; 1 = &#1013;,&#964; N = T . For inference, the sub-sequence is a linspace of [&#1013;,T ] with (N -1) sub-intervals. A single-step version of Consistency Inference can be achieved by just set {&#964; n |n = 0,1} = {&#1013;,T }. Notice that T here is the time horizon for denoising process in the consistency model instead of the episode length of the sample trajectory.</p><p>Consistency Behavior Cloning. With the offline dataset D, the conditional consistency model as policy can be trained with loss by adapting the original <ref type="bibr">(Song et al., 2023)</ref>:</p><p>where &#955;(</p><p>&#8226;) is a step-dependent weight function, a &#964;n = a+&#964; n z and d(&#8226;,&#8226;) is the distance metric. f &#952; &#8890; is exponential moving average of f &#952; for stabilizing the target estimation in training. In classical actor-critic algorithm, there exists the same delayed update of the policy network &#960; &#952; &#8890; (i.e., f &#952; &#8890; ) for estimating target Q-values, which is set to coincide with the target in estimating the consistency loss. The setting for &#964; n is detailed in Appendix B. Pseudo-code of Consistency BC refers to Alg. 2. Algorithm 1 Consistency Action Inference Input s,f &#952; ,N,{&#964; n</p><p>&#226; &#964;n ,&#964; n ) end for return a Algorithm 2 Consistency Behavior Cloning Input offline dataset D Initialize consistency policy &#960; &#952; , target &#952; &#8890; &#8592; &#952; for iterations k = 1,...,K do Update policy &#960; &#952; (with model f &#952; ) using loss L c (&#952;) as Eq. 2; Update target: &#952; &#8890; &#8592; &#945;&#952; &#8890; +(1-&#945;)&#952; end for Algorithm 3 Offline Consistency Actor-Critic Input offline dataset D Initialize consistency policy network &#960; &#952; , critic networks Q &#981;1 ,Q &#981;2 Initialize target network parameters: &#952; &#8890; &#8592; &#952;, &#981; &#8890; 1 &#8592; &#981; 1 ,&#981; &#8890; 2 &#8592; &#981; 2 for policy training iterations k = 1,...,K do Sample minibatch B = {(s,a,r,s &#8242; )} &#8838; D; % Q-value Update Update Q &#981;1 ,Q &#981;2 with Eq. 3; % Policy Update Update policy &#960; &#952; (with model f &#952; ) via Eq. 4; % Target Update Update target:</p><p>Consistency Actor-Critic. As as estimation of the state-action value of current policy, the parameterized Q &#981; (s,a) function can be learned with the double Q-learning loss <ref type="bibr">(Fujimoto et al., 2018)</ref> with batched data B &#8838; D:</p><p>for stabilizing training. The regularized policy &#960; &#952; on offline dataset is learned with a combination of policy gradient through maximizing the expected Q &#981; (s,a) function and a behavior cloning regularization with consistency loss L c (&#952;):</p><p>where L q (&#952;) = -E s&#8764;B,a&#8764;&#960; &#952; (s) Q &#981; (s,a)</p><p>(5) where a &#8764; &#960; &#952; (s) is action inference from the consistency policy as Alg.1. It can be noticed that the actions generated with N denoising steps will produce the policy gradients through the Q &#981; (s,a) in above equation, thus it also backpropagates through f &#952; for N times in the gradient descent procedure, which can lead to additional time consumption apart from the multi-step model inference. Therefore, reducing the denoising steps N can be critical for the speed of this type of models as RL policies. The consistency actor-critic (Consistency-AC) algorithm is provided in pseudo-code Alg. 3.</p><p>Loss Scaling. The consistency loss as Eq. 2 matches the denoised predictions from two consecutive timesteps &#964; n and &#964; n+1 . Due to the usage of N (k) schedule (detailed in Appendix B), their difference |&#964; n+1 -&#964; n | decreases as the training iteration k increases (thus N (k) also increases), which allows the consistency model to have a coarse-to-fine matching process across different time scales. This also leads to a decreasing loss value L(&#952;;k) as k increases from 1 to K since the predictions from smaller time intervals are easier to match. Actually, the loss L c (&#952;) changes drastically across several magnitudes within an epoch, which leads to severe imbalance with the second loss term L q (&#952;) in Eq. 4. The coefficient &#951; is a constant hyperparameter independent of k, so it cannot help to alleviate this issue. Although original consistency model applies &#955;(&#964; n ) &#8801; 1 for image generation, we empirically find that in offline RL this imbalance of two loss terms can hurt the effect of policy regularization in some tasks, as evidenced by ablation studies in Sec. 5.2. To solve this issue, we propose a k-dependent weighting mechanism to balance the values of two loss terms. This is found to improve the performances of this policy regularization method with consistency model on offline RL. Specifically, &#955;(&#8226;) in Eq. 2 is chosen to be:</p><p>where &#958; is set according to tasks (or absorbed in &#951;). The denominator captures the loss scale at iteration k conveniently.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">EXPERIMENTAL EVALUATION</head><p>To evaluate the expressiveness and computational efficiency of the proposed consistency policy and corresponding algorithms, we conduct experiments on four task suites (Gym, AntMaze, Adroit, Kitchen) in D4RL benchmarks under three canonical RL settings: offline (Sec. 5.1, Sec. 5.2), offline-to-online and online (Sec. 5.3). It is known that the D4RL offline dataset can exhibit multi-modality since the samples may be collected with a mixture of polices or along various sub-optimal trajectories, which makes the expressiveness of policy representation critical <ref type="bibr">(Fu et al., 2020;</ref><ref type="bibr">Wang et al., 2022)</ref>. For offline RL, the generative models as policies are evaluated with both behavior cloning (Consistency-BC, Diffusion-BC) and actor-critic type (Consistency-AC, Diffusion-QL) algorithms, in terms of both performances and computational time. The Diffusion-QL is also an actor-critic algorithm though with name QL. Variants of Consistency-AC are compared as ablation studies and the best performances are reported. For offlineto-online and online RL settings, the learning curves and final results are compared for different methods. For evaluation, each model is evaluated over 10 episodes for Gym tasks and 100 episodes for other tasks, following the settings in previous work <ref type="bibr">(Wang et al., 2022)</ref>. By default, the consistency policy applies the number of denoising steps N = 2 with a saturated performances on most of D4RL tasks, while diffusion policy uses N = 5 <ref type="bibr">(Wang et al., 2022)</ref>. Effects of different choices of N are discussed in Sec. 5.2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">OFFLINE RL: BEHAVIOR CLONING WITH EXPRESSIVE POLICY REPRESENTATION</head><p>Empirical finding 1: By behavior cloning alone (without any RL component), using an expressive policy representation with multi-modality like the consistency or diffusion model achieves performances comparable to many existing popular offline RL methods. Learning consistency policy requires much less computation than learning diffusion policy.</p><p>The proposed method Consistency-BC follows Alg. 2 with consistency policy for behavior cloning, and Diffusion-BC is by replacing the policy representation with a diffusion model and replace the policy loss with the diffusion model training loss L d (&#952;) as specified in paper <ref type="bibr">(Wang et al., 2022)</ref>. Results for classic BC with Gaussian policies and previous offline RL baselines, including AWAC <ref type="bibr">(Nair et al., 2020)</ref>, Diffuser <ref type="bibr">(Janner et al., 2022)</ref>, MoRel <ref type="bibr">(Kidambi et al., 2020)</ref>, Onestep RL <ref type="bibr">(Brandfonbrener et al., 2021)</ref>, TD3+BC <ref type="bibr">(Fujimoto &amp; Gu, 2021)</ref>, Decision Transformer (DT) <ref type="bibr">(Chen et al., 2021)</ref>, BCQ <ref type="bibr">(Fujimoto et al., 2019)</ref>, BEAR <ref type="bibr">(Kumar et al., 2019)</ref>, BRAC <ref type="bibr">(Wu et al., 2019)</ref> and REM <ref type="bibr">(Agarwal et al., 2020)</ref>, are adopted from previous paper <ref type="bibr">(Wang et al., 2022)</ref>. SAC <ref type="bibr">(Haarnoja et al., 2018)</ref> is the   Results from Tab. 1 show the advantage of using multi-modal policy representation for offline RL even only with the BC method. For reference purpose, the values in the brackets allow for online evaluation to achieve the best model selection from the set of trained models, which serve as the maximal possible values for the standard offline selection without leveraging online evaluation. Compared with vanilla BC using the Gaussian distribution for policies, Consistency-BC with multi-modality outperforms it on 14/20 tasks, and Diffusion-BC has better or equivalent performance as BC for 20/20 tasks. Through leveraging multi-modal representation in BC, the improvement of normalized scores averaged over tasks is significant, and this is mainly caused by the multi-modality within the offline dataset by mixing over policies. Moreover, compared with previous offline RL baselines, which do not just apply BC, the Consistency-BC and Diffusion-BC show comparable performances, and even superior performances for tasks like walker2d-medium-v2, hopper-medium-replay-v2, walker2dmedium-replay-v2, walker2d-medium-expert-v2 in Gym tasks, most of AntMaze, Adroit and Kitchen tasks. The consistency policy is slightly less expressive than the diffusion policy, which is within our expectation due to its heavy reduction on the sampling steps. However, the consistency policy shows higher computational efficiency than diffusion policy as compared in Fig. <ref type="figure">1</ref>, with an average reduction of 42.97% computational time across 20 tasks. Detailed computational time for each task is provided in Appendix C.2 Tab. 6.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">OFFLINE RL: CONSISTENCY ACTOR-CRITIC</head><p>Table 2: The performance of Consistency-AC and SOTA baselines on D4RL Gym, AntMaze, Adroit and Kitchen tasks for offline RL setting. For Consistency-AC and Diffusion-QL, each cell has two values: one for offline model selection and another (in brackets) for online model selection. The bold values are the highest among each row. Tasks CQL IQL X -QL ARQ IDQL-A Diffusion-QL Consistency-AC halfcheetah-m 44.0 47.4 48.3 45 &#177; 0.3 51.0 51.1 &#177; 0.5 (51.5 &#177; 0.3) 69.1 &#177; 0.7 (71.9 &#177; 0.8) hopper-m 58.5 66.3 74.2 61 &#177; 0.4 65.4 90.5 &#177; 4.6 (96.6 &#177; 3.4) 80.7 &#177;10.5 (99.7 &#177;2.3) walker2d-m 72.5 78.3 84.2 81 &#177; 0.7 82.5 87.0 &#177; 0.9 (87.3 &#177; 0.5) 83.1 &#177;0.3 (84.1 &#177;0.3) halfcheetah-mr 45.5 44.2 45.2 42 &#177; 0.3 45.9 47.8 &#177; 0.3 (48.3 &#177; 0.2) 58.7 &#177;3.9 (62.7 &#177;0.6) hopper-mr 95.0 94.7 100.7 81 &#177; 24.2 92.1 101.3 &#177; 0.6 (102.0 &#177; 0.4) 99.7 &#177; 0.5 (100.4 &#177; 0.6) walker2d-mr 77.2 73.9 82.2 66 &#177; 7.0 85.1 95.5 &#177; 1.5 (98.0 &#177; 0.5) 79.5 &#177; 3.6 (83.0 &#177; 1.5) halfcheetah-me 91.6 86.7 94.2 91 &#177; 0.7 95.9 96.8 &#177; 0.3 (97.2 &#177; 0.4) 84.3 &#177; 4.1 (89.2 &#177; 3.3) hopper-me 105.4 91.5 111.2 110 &#177; 0.9 108.6 111.1 &#177; 1.3 (112.3 &#177; 0.8) 100.4 &#177; 3.5 (106.0 &#177; 1.3) walker2d-me 108.8 109.6 112.7 109 &#177; 0.5 112.7 110.1 &#177; 0.3 (111.2 &#177; 0.9) 110.4 &#177; 0.7 (111.6 &#177; 0.7) Average 77.6 77.0 83.7 76.2 82.1 87.9 (89.3) 85.1 (89.8) antmaze-u 74.0 87.5 93.8 97 &#177; 0.8 94.0 93.4 &#177; 3.4 (96.0 &#177; 3.3) 75.8 &#177; 1.6 (85.6 &#177; 3.9) antmaze-ud 84.0 62.2 82.0 62 &#177; 12.1 80.2 66.2 &#177; 8.6 (84.0 &#177; 10.1) 77.6 &#177; 6.3 (82.4 &#177; 3.4) antmaze-mp 61.2 71.2 76.0 80 &#177; 8.3 84.5 76.6 &#177; 10.8 (79.8 &#177; 8.7) 56.8 &#177; 30.1 (71.6 &#177; 14.5) Average 73.1 73.6 83.9 79.7 86.2 78.7 (86.6) 70.1 (79.9) pen-human-v1 35.2 71.5 -45 &#177; 5.2 (v0) -72.8 &#177; 9.6 (75.7 &#177; 9.0) 63.4 &#177; 7.7 (67.9 &#177; 5.3) pen-cloned-v1 27.2 37.3 -50 &#177; 7.1 (v0) -57.3 &#177; 11.9 (60.8 &#177; 11.8) 50.1 &#177; 2.2 (53.7 &#177; 3.4) Average 31.2 54.4 -47.5 -65.1 (68.3) 56.8 (60.8) kitchen-c 43.8 62.5 82.4 37 &#177; 14.2 -84.0 &#177; 7.4 (84.5 &#177; 6.1) 51.9 &#177; 6.0 (67.6 &#177; 2.7) kitchen-p 49.8 46.3 73.7 50 &#177; 5.0 -60.5 &#177; 6.9 (63.7 &#177; 5.2) 38.2 &#177; 1.8 (39.8 &#177; 1.6) kitchen-m 51.0 51.0 62.5 39 &#177; 9.4 -62.6 &#177; 5.1 (66.6 &#177; 3.3) 45.8 &#177; 1.5 (46.7 &#177; 0.9) Average 48.2 53.3 72.9 42.0 -69.0 (71.6) 45.3 (51.4) Total Average 66.2 69.6 -67.4 -80.3 (83.2) 72.1 (77.9)</p><p>Empirical finding 2: Replacing diffusion model with consistency model in TD3-BC type algorithm for offline RL will lead to speed up of model training and inference, with slightly worse performances while still outperforming some other baselines.</p><p>For offline RL, the proposed method Consistency-AC follows Alg. 3 with consistency model for policy representation, and the consistency policy is embedded in an actor-critic algorithm with BC policy regularization to avoid generating out-of-distribution actions. Results for previous baselines, including CQL <ref type="bibr">(Kumar et al., 2020)</ref>, IQL <ref type="bibr">(Kostrikov et al., 2021)</ref>, X -QL <ref type="bibr">(Garg et al., 2023)</ref>, ARQ <ref type="bibr">(Goo &amp; Niekum, 2022)</ref>, IDQL-A (Hansen-Estruch et al., 2023) and Diffusion-QL (Wang et al., 2022) are adopted from results reported in corresponding papers. Detailed hyperparameters for Consistency-AC and Diffusion-QL refer to Appendix C.1. Results from Tab. 2 show the average normalized scores of different methods across five random seeds, with standard deviations reported for Diffusion-QL and Consistency-AC. The results in Tab. 2 are directly comparable with the results in Tab. 1 since they follow the same offline RL setting. Tab. 2 shows that although Consistency-AC achieves a slightly lower average score (72.1) than Diffusion-QL (80.3), it outperforms the other baselines in most of the tasks, like Gym and Adroit.</p><p>The AntMaze tasks are found to be hard for the Consistency-AC method, we conjecture that this is potentially caused by the sparse reward signals (as evidenced by Appendix A Fig. <ref type="figure">5</ref>) in dataset, which makes the difficulty of Q-learning become more of a bottleneck than modeling the multi-modal distributions with behavior cloning. The conservativeness of the Q-value estimation might be important but orthogonal to the proposed consistency policy. Considering the reduction of denoising steps in the training and inference stages of Consistency-AC, it can be regarded as a trade-off between the computational efficiency and the approximation accuracy of multi-modal distribution, which will be discussed as following.</p><p>Method N Training Time (s per epoch) Inference Time (ms per sample) Avg. Norm Score Diffusion-QL 50 206.44&#177;16.70 30.65&#177;2.10 -20 108.65&#177;2.85 13.04&#177;0.90 109.2&#177;1.1 (111.1&#177;1.9) 10 76.54&#177;10.74 6.87&#177;0.55 108.6&#177;0.6 (112.5&#177;0.2) 5 57.06&#177;19.16 3.76&#177;0.29 108.2&#177;5.6 (112.3&#177;0.2) 2 31.59&#177;10.32 1.96&#177;0.10 53.6&#177;16.6 (103.5&#177;10.0) 1 30.23&#177;8.75 1.37&#177;0.09 2.8&#177;1.5 (13.1&#177;12.5) Consistency-AC 50 150.84&#177;31.02 26.50&#177;1.92 -20 76.22&#177;9.92 11.12&#177;0.77 101.3&#177;6.3 (107.3&#177;0.2) 10 54.04&#177;4.43 5.95&#177;0.44 98.4&#177;4.3 (107.1&#177;4.0) 5 40.79&#177;2.79 3.39&#177;0.29 101.4&#177;4.7 (110.1&#177;1.6) 2 31.94&#177;1.55 1.84&#177;0.21 102.4&#177;3.0 (106.2&#177;1.6) 1 28.51&#177;1.78 1.23&#177;0.11 6.2&#177;5.4 (19.1&#177;9.3)</p><p>Table 3: Comparison of computational time for two methods with different denoising steps N on the task hopper-medium-expert-v2. The gray lines apply default N values for two models. Saturates with smaller N (=2) Larger time gap while yielding a slightly better performance (1.057&#215;). The "-" in the table with N = 50 indicates a missing value of the average score due to exceeding the limited time (72 hours) for the job. Moreover, as shown in Fig. 2, Consistency-AC has better scaling laws than Diffusion-QL for both training and inference in time consumption with increasing N , which is further testified by the linear fitting results in Appendix. C.2 Fig. 6. Ablation Studies. Hansen-Estruch et al. (2023) proposes to use residual networks with layer normalization for network parameterization in diffusion policy, namely LN-Resnet, which is also tested for consistency policy in our experiments. As an ablation study, we compare different variants of Consistency-AC for offline RL setting, including (1) Consistency-BC by setting &#951; = 0 and without using loss scaling (&#955;(&#964; n ) &#8801; 1 in Eq. 2); (2) only without loss scaling; (3) the standard setting with multi-layer perceptrons (MLP) networks for the parameterization of f &#952; ; (4) the LN-Resnet parameterization of f &#952; . These variants can be regarded as various hyperparameters or training settings for the proposed Consistency-AC algorithm, and the reported results in Tab. 2 are the best choices among these variants. The comparison results for four variants across four task domains are summarized in Fig. 3. Detailed results for this ablation study are shown in Appendix C.3. We find that LN-Resnet does not consistently improve over MLP across tasks for the consistency model but benefits mainly for the Adroit tasks.</p><p>Without loss scaling, the performance degrades significantly (by 37.8% on average) for most tasks, although for some specific tasks (e.g., AntMaze) it may improve the performance a bit without loss scaling. For most tasks except for AntMaze, Consistency-BC cannot achieve the best performances and the Q-learning loss L q (&#952;) (as Eq. 5) with proper scaling helps to further improve the scores.</p><p>Figure <ref type="figure">3</ref>: Comparison of variants of Consistency-AC across tasks in offline RL setting. 5.3 OFFLINE-TO-ONLINE AND ONLINE RL Empirical finding 3: Consistency policy has a close but slightly worse performance than diffusion policy for offline-to-online RL, but a significant improvement of computational efficiency.</p><p>For online RL, we consider both online learning from scratch and the offline-to-online setting with the model trained on offline dataset as an initialization for online fine-tuning. As discussed in previous Sec. 5.2, the offline model can be selected in either an online or offline manner, respectively by model evaluation with or without online experience. Both types of models are used for initializing the policy and value models at the beginning of online fine-tuning. For online fine-tuning, it follows the standard actor-critic algorithm, that the Q value is updated with Eq. 3 using online data, and the policy is updated with the Q-learning loss L q (&#952;) only as Eq. 5. The algorithms use &#1013;-greedy for exploration with a decaying schedule. Pseudo-codes for offline-to-online and online Consistency-AC are provided in Appendix D.1. Hyperparameters for training refer to Appendix D.2. Tab. 4 summarizes the quantitative results for average scores achieved with Consistency-AC and Diffusion-QL across five random seeds for two settings over 9 Gym tasks, as well as offline-to-online baseline methods SAC, AWAC and ACA <ref type="bibr">(Yu &amp; Zhang, 2023)</ref>. Both the Consistency-AC and Diffusion-QL are pre-trained on the offline dataset for 2000 epochs. Each model is trained for one million steps for online fine-tuning or learning from scratch. The results for SAC, AWAC and ACA are adopted from the paper <ref type="bibr">(Yu &amp; Zhang, 2023)</ref> with each model fine-tuned for 100k online steps. Each cell has two values: one for offline model selection as initialization and another (in brackets) for online model selection as initialization. The normalized scores are slightly lower for Consistency-AC compared with Diffusion-QL in offline-to-online settings, but higher in online RL from scratch. On average, the two methods achieve lower values in online setting than the offline-to-online setting, which testifies the improvement of learning efficiency by initializing with pre-trained generative policy models. However, since the training is set to have a fixed overall timesteps and using the same learning rate 1 &#215; 10 -5 , the purely online models do not converge to its optimal performances yet. The learning rate is chosen for the fine-tuning setting, and the purpose is not to show online RL can achieve scores higher than 100 with sufficient training but to compare with the offline-to-online setting, for demonstrating the effectiveness of initialized models with offline pre-training.</p><p>Empirical finding 4: Consistency policy could outperform diffusion policy for online RL setting mostly in computational efficiency and sometimes in sample efficiency, especially for hard tasks.  For most tasks, the consistency policy has comparable performances with the diffusion policy and a significantly shorter time to finish the entire online training. The offline-to-online methods are usually more sample efficient than the online methods except for three hopper tasks, which are relatively easy to learn a good policy. For the online setting, the consistency policies demonstrate significantly more efficient learning than the diffusion policies, especially for more complex tasks like halfcheetah. Consistency policies show a sharper score-increasing slope for 8/9 tasks than the diffusion policies. Our conjecture is that the expressiveness of a model is more essential in offline setting than online setting. For a deterministic optimal policy in MDP, overly expressive policy models like diffusion may hinder the convergence in online setting by being too explorative. For offline-to-online setting, this advantage is less obvious presumably due to the lower initial performances of consistency policies from the offline pre-training. We refer to Appendix D.3 Tab. 9 and Fig. <ref type="figure">7</ref> for more analysis of the training time for two methods.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">CONCLUSION</head><p>The consistency model as a RL policy strikes a balance between the computational efficiency and the modeling accuracy of multi-modal distribution on offline RL dataset, and achieves comparable performances with the diffusion policies but significant speedup in three typical RL settings. The proposed Consistency-AC algorithm leverages a novel policy representation with policy regularization for offline RL, orthogonal to other offline RL techniques. Future directions include combining the consistency policy with other techniques like conservative Q-value estimation for offline RL, better alignment and initialization from offline to online fine-tuning, advanced exploration methods for online RL, etc. Scaling up the task complexity, where more sampling steps are required for the generative models, will reveal a greater potential for consistency policy to show its benefits in retaining expressiveness while reducing the computational cost.</p><p>C.2 COMPUTATIONAL TIME Overall Training Time. Tab. 6 shows the comparison of Diffusion-BC and Consistency-BC in terms of the computational time during training for D4RL Gym, AntMaze, Adroit and Kitchen tasks. Each result is averaged over five random seeds with standard deviations reported. Since different environments are trained for various numbers of total epochs, the comparison is based on per-epoch time consumption. The two methods use the same batch size and number of iterations within each epoch, as well as the same network architecture.   Consistency-AC algorithm. The average scores for five random seeds over D4RL Gym, AntMaze, Adroit and Kitchen are shown in Tab. 7. Table 7: The performance of Consistency-AC variants on D4RL Gym, AntMaze, Adroit and Kitchen tasks for offline RL setting. Each cell has two values: one for offline model selection and another (in brackets) for online model selection. Each result is averaged over five random seeds with standard deviations reported.  D.4 MORE RESULTS Table 10: Comparison of scores (unnormalized, maximum over epochs) for methods in offline-to-online and online RL settings.    </p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>https://github.com/quantumiracle/Consistency Model For Reinforcement Learning</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1"><p>Our experiments use constants &#1013; = 0.002,T = 80;&#961; = 7;s0 = 2,s1 = 150 following<ref type="bibr">Song et al. (2023)</ref> </p></note>
		</body>
		</text>
</TEI>
