DIAR: Diffusion-model-guided Implicit
Q-learning with Adaptive Revaluation
Abstract
We propose a novel offline reinforcement learning (offline RL) approach, introducing the Diffusion-model-guided Implicit Q-learning with Adaptive Revaluation (DIAR) framework. We address two key challenges in offline RL: out-of-distribution samples and long-horizon problems. We leverage diffusion models to learn state-action sequence distributions and incorporate value functions for more balanced and adaptive decision-making. DIAR introduces an Adaptive Revaluation mechanism that dynamically adjusts decision lengths by comparing current and future state values, enabling flexible long-term decision-making. Furthermore, we address Q-value overestimation by combining Q-network learning with a value function guided by a diffusion model. The diffusion model generates diverse latent trajectories, enhancing policy robustness and generalization. As demonstrated in tasks like Maze2D, AntMaze, and Kitchen, DIAR consistently outperforms state-of-the-art algorithms in long-horizon, sparse-reward environments.
1 Introduction
Offline reinforcement learning (offline RL) is a type of reinforcement learning where the agent learns a policy from pre-collected datasets, rather than collecting data through direct interactions with the environment (Fujimoto et al., 2019). Since offline RL does not involve learning in the real environment, it avoids safety-related issues. Additionally, offline RL can efficiently leverage the collected data, making it particularly useful when data collection is expensive or time-consuming. However, offline RL relies on the given dataset, so the learned policy may be inefficient or misdirected if the data is poor quality or biased. Furthermore, a distributional shift may arise during the process of learning from offline data (Levine et al., 2020), leading to degraded performance in the true environment.
To overcome the limitations of offline RL, existing research have been made to address these issues by leveraging diffusion models, a type of generative model (Janner et al., 2022). Incorporating diffusion models allows for learning the overall distribution of the state and action spaces, allowing decisions to be made based on this knowledge. Methods such as Diffuser (Janner et al., 2022) and Decision Diffuser (DD) (Ajay et al., 2023) use diffusion models to predict decisions not autoregressively one step at a time, but instead by inferring the entire decision for the length of the horizon at once, achieving strong performance in long-horizon tasks. Additionally, methods like LDCQ (Venkatraman et al., 2024) propose using latent diffusion models to learn the Q-function, allowing the Q-function to make more appropriate predictions for out-of-distribution state-actions.
Recent studies of diffusion-based offline RL methods, often bypass the use of the Q-function or rely on other offline Q-learning methods (Janner et al., 2022; Ajay et al., 2023). However, recent research has proposed a novel approach that does not avoid the Q-function but instead leverages diffusion models to assist in Q-learning (Wang et al., 2023; Venkatraman et al., 2024). This approach enables handling a wide range of Q-values for diverse states and actions. We found that the performance could be further enhanced if it effectively handles cases where the out-of-distribution data generated by the diffusion model.
Therefore, we propose Diffusion-model-guided Implicit Q-learning with Adaptive Revaluation (DIAR), which integrates the value function into the training and decision process. This approach provides more objective assessment of the current state, enabling the Q-function to achieve a balance between long-horizon decision-making and step-by-step refinement. In the training process, the Q-function and value function alternates between learning from the dataset and samples generated by the diffusion model, allowing it to adapt to a wide variety of scenarios. Additionally, if the value of the current state is higher than the value after executing the action sequence, the agent can explore new action sequences.
DIAR consistently outperforms existing offline RL algorithms, especially in environments that involve complex route planning and long-horizon state-action pairs like Figure 2. Additionally, as shown in Figure 1, DIAR achieves state-of-the-art performance in environments such as Maze2D, AntMaze, and Kitchen (Fu et al., 2020). This research highlights the potential of diffusion models to enhance both policy abstraction and adaptability in offline RL, with significant implications for real-world applications in robotics and autonomous systems.
2 Related Work
2.1 Offline Reinforcement Learning
Offline reinforcement learning (offline RL), also referred to as batch reinforcement learning, has gained significant attention in recent years due to its potential in learning effective policies from pre-collected datasets without further interaction with the environment. This paradigm is particularly useful in real-world applications where exploration can be costly or dangerous, such as healthcare, robotics (Kalashnikov et al., 2018), and autonomous driving.
One of the primary challenges in offline RL is the issue of out-of-distribution actions (Kumar et al., 2019), where a learned policy selects actions not well represented in the offline dataset. To address this, several works have introduced behavior regularization techniques that constrain the policy to remain close to the behavior policy seen in the offline data. Among these, Conservative Q-learning (CQL) introduces a conservative Q-function that underestimates the value of out-of-distribution actions, reducing the likelihood of the learned policy selecting potentially harmful actions (Kumar et al., 2020). By minimizing the overestimation of value functions, CQL facilitates more reliable policy learning from offline data. Another notable approach is Implicit Q-learning (IQL), which implicitly regularizes the learned Q-function by keeping it close to the empirical value of the actions observed in the dataset (Kostrikov et al., 2022). This prevents the over-optimization of Q-values for actions that are rarely or never observed in the offline dataset. Additionally, Batch-Constrained Q-learning (BCQ) imposes direct limitations on the learned policy to prevent deviations from the actions observed in the offline dataset (Fujimoto et al., 2019). BCQ introduces a constraint that ensures the learned policy selects actions similar to the behavior policy, thus avoiding the exploitation of inaccurate Q-value estimates for unseen actions.
2.2 Diffusion-based Planning in Offline RL
Diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) have shown remarkable performance in fields such as image inpainting (Lugmayr et al., 2022) and image generation (Ramesh et al., 2022; Saharia et al., 2022). Recent research has extended the application of diffusion models beyond image domains to address classical trajectory optimization challenges in offline RL. One prominent model, Diffuser (Janner et al., 2022), directly learns trajectory distributions and generates tailored trajectories based on situational demands. By prioritizing trajectory accuracy over single-step precision, Diffuser mitigates compounding errors and adapts to novel tasks or goals unseen during training. Additionally, Decision Diffuser (DD) was introduced, which predicts the next state using a state diffusion model and leverages inverse dynamics for decision-making (Ajay et al., 2023). Furthermore, a method called Latent Diffusion-Constrained Q-learning (LDCQ) has been proposed, which combines latent diffusion models with Q-learning to reduce extrapolation errors (Venkatraman et al., 2024). Emerging methods also focus on learning interpretable skills from visual and language inputs and applying conditional planning via diffusion models (Liang et al., 2024). Approaches that generate goal-divergent trajectories using Gaussian noise and facilitate reverse training through denoising processes have also been explored (Jain & Ravanbakhsh, 2023).
3 Preliminary: Latent Diffusion Reinforcement Learning
To train the Q-network, a diffusion model that has trained based on latent representations is required. The first step is to learn how to represent an action-state sequence of length H as a latent vector using -Variational Autoencoder (-VAE) (Pertsch et al., 2021). The second step is to train the diffusion model using the latent vectors generated by the encoder of the -VAE. This allows the diffusion model to learn the latent space corresponding to the action-state sequence. Subsequently, the Q-network is trained using the latent vectors generated by the diffusion model.
Latent representation by -VAE
The -VAE plays three key roles in the initial stage of our model training. First, the encoder must effectively represent the action-state sequence from the dataset into a latent vector . Second, the distribution of generated by the -VAE must be conditioned by the state prior . This is learned by minimizing the KL-divergence between the latent vector generated by the encoder and the one generated by the state prior. The formation of the latent vector is controlled by adjusting the value, which determines the weight of KL-divergence. Lastly, the policy decoder of the -VAE must be able to accurately decode actions when given the current state and latent vector as inputs. These three objectives are combined to train the -VAE by maximizing the evidence lower bound (ELBO) (Kingma & Welling, 2014) as shown in Eq. 1.
(1) |
Training latent vector with a diffusion model
The latent diffusion model (LDM) effectively learns latent representations, focusing on the latent space instead of the original data samples (Rombach et al., 2022). The model minimizes a loss function that predict the initial latent generated by the VAE encoder , rather than noise as in traditional diffusion models. -length trajectory segments are sampled from dataset and paired with initial states and latent variables . The focus lies on modeling the prior to capture the distribution of latent given the state . A conditional latent diffusion model is utilized and refined with a time-dependent denoising function to reconstruct through the denoising step . Consequently, the LDM is trained by minimizing the loss function as given in Eq. 2.
(2) |
Q-network by latent representation
To train the Q-network, Eq. 3 reduces extrapolation errors by restricting policy updates to the empirical distribution of the offline dataset (Venkatraman et al., 2024). Prioritizing trajectory accuracy over single-step precision allows the model to mitigate compounding errors and remain adaptable to novel tasks or goals unseen during training. Furthermore, the integration of temporal abstraction and latent space modeling notably enhances the mechanisms underlying credit assignment and improves the effectiveness of policy optimization.
(3) |
The latent vector generated by the diffusion model is utilized in the training of the Q-function. The Q-function learns the relation between the and like Eq. 3, which are based on the initial state and latent vector pairs present in the dataset, and the generated by the diffusion model. denotes the sum of rewards with discount factor . This enables the model to adapt to new tasks or goals that were not observed in the offline data. Furthermore, the integration of temporal abstraction and latent space modeling significantly enhances the mechanism of credit assignment, thereby improving the effectiveness of policy optimization. According to Eq. 3, the trained Q-function is used such that, as shown in Eq. 4, when a state is given, the decision is made by selecting the action that has the highest Q-value.
(4) |
4 Proposed Method
Using diffusion models to address long-horizon tasks typically involves training over the full trajectory length (Janner et al., 2022). This approach differs from autoregressive methods that focus on selecting the best action at each step, as it learns the entire action sequence over the horizon. This allows the model to learn long sequences of decisions at once and generate a large number of actions in a single pass. However, predicting decisions over the entire horizon may not always lead to the optimal outcome, as it does not select the best action at each step.
Additionally, there is a well-known problem of overestimating the Q-value when training a Q-network (Hasselt et al., 2016; 2018; Fu et al., 2019; Kumar et al., 2019; Agarwal et al., 2020). This occurs when certain actions, appearing intermittently, are assigned a high value. In these cases, the state may not actually hold high value, but the Q-value becomes “lucky” and inflated. Therefore, it is essential to ensure that the Q-network does not overestimate and can correctly assess the value based on the current state.
To resolve both of these issues, we propose Diffusion-model-guided Implicit Q-learning with Adaptive Revaluation (DIAR), introducing a value function to assess the value of each situation. Unlike the Q-network, which learns the value of both state and action, the state-value function learns only the value of the state. By introducing constraints from the value function, we can train a more balanced Q-network and, during the decision-making phase, make more optimal predictions with the help of the value function.
4.1 Diffusion-model-guided Q-learning Framework
The value-network with parameter evaluates the value of the current state , and the Q-network with parameter evaluates the value of the current state and action . Additionally, by combining value-network learning with Q-network learning, constraints can be applied to the Q-network, resulting in more balanced training. Furthermore, instead of merely relying on the dataset for value-network and Q-network learning, we incorporate latent vectors generated by the diffusion model. This reduces extrapolation error for new decisions not encountered in the dataset, allowing for more accurate value estimation.
The training of the value-network should aim to reduce the difference between the Q-value and the state-value. Therefore, it is crucial to include the difference between and in the loss function. To achieve this, rather than simply using MSE loss, we apply weights to make the data distribution more flexible and to respond more sensitively to differences. We use an asymmetric weighted loss function that multiplies the weights of variables by an expectile factor , as shown in Eq. 5. In the next step, is used as the difference between the Q-value and the state-value for loss calculation.
(5) |
By using an asymmetrically weighted loss function, the value-network is trained to reduce the difference between the Q-value and the state-value. We set to a value greater than 0.5 and apply Eq. 6 to assign more weight when the difference between the Q-value and the value is large. Additionally, instead of using latent vector encoded from the dataset, we use latent vectors generated by the diffusion model to guide the learning of a more generalized Q-network.
(6) |
After the loss for the value-network is calculated, the loss for the Q-network is computed. The loss in Eq. 7 is not based on the Q-network alone but is learned based on the current value and reward, ensuring balance with the value network. The value-network learning, using latent vectors generated by the diffusion model, allows it to handle diverse trajectories, while the Q-network is trained on data pairs from the dataset, learning the Q-value of state-latent vector pairs based on existing trajectories. Q-network and value-network training processes form a complementary relationship.
(7) |
To ensure stable Deep Q-network training and prevent Q-value overestimation, we employed the Clipped Double Q-learning method (Fujimoto et al., 2018). Additionally, we used a prioritized replay buffer , where the Q-network is trained based on the priority of the samples (Schaul et al., 2016). stores , which are generated from the offline dataset. The state, action, and reward are taken from the offline dataset, and the latent vector is encoded by . The encoded latent vector , along with the current state , is used to guide the MLP model through the diffusion model to learn the Q-value. The Q-network and value-network are trained alternately, maintaining a complementary relationship through their respective loss functions. The value-network’s loss is calculated based on the difference between the Q-value and the state-value, which is adjusted by the expectile factor . The Q-network’s loss is computed using the Bellman equation with the reward and value, where the effect of distant timesteps is controlled by the discount factor . The calculated Q-network loss is updated in the model via backpropagation, and the target Q-network is gradually updated based on the update rate . The detailed process can be found in Algorithm 1.
4.2 Adaptive Revaluation in Policy Execution
DIAR method reforms a decision if the value of the current state is higher than the value of the state after making a decision over the horizon length . We refer to this process as Adaptive Revaluation. Using the value-network , if the current state’s value is greater than , the value after making a decision for steps, the method generates a new latent vector from the current state and continues the decision-making process. When predicting over the horizon length, there may be cases where taking a different action midway through the horizon would be more optimal. In such cases, the value-network checks this, and if the condition is met, a new latent vector is generated.
Adaptive Revaluation uses the difference in value to examine whether the agent’s predicted decision is optimal. Since the current state can be obtained directly from the environment, it is easy to compute the value of the current state . Whether the current trajectory is optimal can be determined using a state decoder . By inputting the current state and latent vector into the state decoder, the future state can be predicted. This predicted is passed into the value-network to estimate its future value . By comparing these two values, if the current value is higher, the agent generates new latent vectors and selects the one with the highest . The detailed Adaptive Revaluation algorithm is shown in Appendix B.
4.3 Theoretical Analysis of DIAR
In this section, we prove that in the case of sparse rewards, when the current timestep , if the value of the current state is higher than the value of the future state , there is a more ideal trajectory than the current trajectory. An ideal trajectory is defined as one where, for all states at timestep , the discount factor ensures that . This means that for an agent performing actions toward a goal, the value of each state in the trajectory increases monotonically.
Now, consider an assumption about an ideal trajectory: for any timesteps with , we assume that for and from the dataset . Furthermore, since the state is not the goal and we are in a sparse reward setting, . If we write the Bellman equation for the value function, it results in Eq. 8.
(8) |
Eq. 8 represents the value function when there is a difference of one timestep. The value function can be computed using the reward received from the action taken in the current state and the value of the next state . Therefore, by iterating Eq. 8 to express the timesteps from to , we obtain Eq. 9.
(9) |
Since the current environment is sparse in rewards, no reward is given if the goal is not reached. Therefore, in Eq. 9, all reward terms are zero. By substituting the reward as zero and reorganizing Eq. 9, we can derive Eq. 10.
(10) |
Since the magnitude of is , the term is always less than or equal to . This contradicts the initial assumption, indicating that the assumption is incorrect. Therefore, for any ideal trajectory, all value functions must follow a monotonically increasing function. In other words, if the trajectory predicted by the agent is an ideal trajectory, the value after making a decision over the horizon must always be greater than the current value . If the current value is greater than the future value , then this trajectory is not an ideal trajectory. Consequently, generating a new latent vector from the current state to search for an optimal decision is a better approach.
5 Experiments
We compare the performance of our model with other models under various conditions and environments. We focus on goal-based tasks in environments with long-horizons and sparse rewards. For offline RL, we use the Maze2D, AntMaze, and Kitchen datasets to test the strengths of our model in long-horizon sparse reward settings (Fu et al., 2020). These environments feature very long trajectories in their datasets, and rewards are only given upon reaching the goal, making them highly suitable for evaluating our model. We also compare the performance improvements achieved when using Adaptive Revaluation, analyzing whether it allows for reconsideration of decisions when incorrect ones are made and enables the generation of the correct trajectory. Furthermore, to ensure more accurate performance measurements, all scores are averaged over 100 runs and repeated 5 times, with the mean and standard deviation reported.
5.1 Performance on Offline RL Benchmarks
In this section, we compare the performance of our model in offline RL. To evaluate our model, we compare it against various state-of-the-art models. These include behavior cloning (BC), which imitates the dataset, and offline RL methods based on Q-learning, such as IQL (Kostrikov et al., 2022) and IDQL (Hansen-Estruch et al., 2023). We also compare our model with DT (Chen et al., 2021), which uses the transformer architecture employed in LLMs, and methods that use diffusion models, such as Diffuser (Janner et al., 2022), DD (Ajay et al., 2023), and LDCQ (Venkatraman et al., 2024). Through these comparisons with various algorithms, we conduct a quantitative performance evaluation of our model.
Dataset | BC | IQL | DT | IDQL | Diffuser | DD | LDCQ | DIAR |
---|---|---|---|---|---|---|---|---|
maze2d-umaze-v1 | 3.8 | 47.4 | 27.3 | 57.9 | 113.5 | - | 134.2 | 141.84.3 |
maze2d-medium-v1 | 30.3 | 34.9 | 32.1 | 89.5 | 121.5 | - | 125.3 | 139.23.5 |
maze2d-large-v1 | 5.0 | 58.6 | 18.1 | 90.1 | 123.0 | - | 150.1 | 200.33.4 |
antmaze-umaze-diverse-v2 | 45.6 | 62.2 | 54.0 | 62.0 | - | - | 81.4 | 88.81.5 |
antmaze-medium-diverse-v2 | 0.0 | 70.0 | 0.0 | 83.5 | 45.5 | 24.6 | 68.9 | 68.26.7 |
antmaze-large-diverse-v2 | 0.0 | 47.5 | 0.0 | 56.4 | 22.0 | 7.5 | 57.7 | 60.62.4 |
kitchen-complete-v0 | 65.0 | 62.5 | - | - | - | - | 62.5 | 68.82.1 |
kitchen-partial-v0 | 38.0 | 46.3 | 42.0 | - | - | 57.0 | 67.8 | 63.30.9 |
kitchen-mixed-v0 | 51.5 | 51.0 | 50.7 | - | - | 65.0 | 62.3 | 60.81.4 |
Datasets like Maze2D and AntMaze require the agent to learn how to navigate from a random starting point to a random location. Simply mimicking the dataset is insufficient for achieving good performance. The agent must learn what constitutes a good decision and how to make the best judgments throughout the trajectory. Additionally, the ability to stitch together multiple paths through trajectory combinations is essential. In particular, the AntMaze dataset involves a complex state space and requires learning and understanding high-dimensional policies. We observed that our method DIAR, consistently demonstrated strong performance in these challenging tasks, where high-dimensional abstraction and reasoning are critical. For more demonstrations, please refer to the Appendix F.
5.2 Impact of Adaptive Revaluation
In this section, we analyze the impact of Adaptive Revaluation. We directly compare the cases where Adaptive Revaluation is used and not used in our model. The test is conducted on long-horizon sparse reward tasks, where rewards are sparse. For overall training, an expectile value of was used, with for Maze2D and for AntMaze and Kitchen. Other training settings were generally the same, and detailed configurations can be found in the Appendix A.
When Adaptive Revaluation is used, it checks whether a better decision might exist according to the value function and discovers a better latent vector to re-create the trajectory. If the value of the current state is higher than the value of a future state, it indicates that a better trajectory might exist than the currently selected decision. This enables the agent to choose a more accurate abstraction and form a more optimal trajectory based on it. The improvement in decision-making with Adaptive Revaluation can be observed in Table 2, which shows how much the agent’s decisions improve when using this method.
Dataset | DIAR w/o AR | DIAR w/ AR |
---|---|---|
maze2d-umaze-v1 | 135.6 | 141.84.3 |
maze2d-medium-v1 | 138.2 | 139.23.5 |
maze2d-large-v1 | 193.5 | 200.33.4 |
antmaze-umaze-diverse-v2 | 88.81.5 | 85.42.6 |
antmaze-medium-diverse-v2 | 68.26.7 | 67.43.4 |
antmaze-large-diverse-v2 | 56.04.6 | 60.62.4 |
kitchen-complete-v0 | 68.82.1 | 63.83.0 |
kitchen-partial-v0 | 63.30.9 | 63.02.5 |
kitchen-mixed-v0 | 60.00.7 | 60.81.4 |
5.3 Comparison with Skill Latent Models
We further compare our model with other reinforcement learning methods that use skill latents. For the D4RL tasks, we selected methods that use generative models to learn skills and make decisions based on them. As performance baselines, we chose the VAE-based methods OPAL111To compare its effect on implicit learning, we refer to the results from Yang et al. (2023). (Ajay et al., 2021) and PLAS (Zhou et al., 2020), as well as Flow2Control (Yang et al., 2023), which utilizes normalizing flows. The performance comparison is shown in Table 3.
Dataset | BC | PLAS | IQL+OPAL | Flow2Control | DIAR |
---|---|---|---|---|---|
maze2d-umaze-v1 | 3.8 | 57.0 | - | - | 141.84.3 |
maze2d-medium-v1 | 30.3 | 36.5 | - | - | 139.23.5 |
maze2d-large-v1 | 5.0 | 122.7 | - | - | 200.33.4 |
antmaze-umaze-diverse-v2 | 45.6 | 45.3 | 70.2 | 81.6 | 88.81.5 |
antmaze-medium-diverse-v2 | 0.0 | 0.7 | 42.8 | 83.7 | 68.26.6 |
antmaze-large-diverse-v2 | 0.0 | 0.0 | 52.4 | 52.8 | 60.62.4 |
kitchen-complete-v0 | 65.0 | 34.8 | 11.5 | 75.0 | 68.82.1 |
kitchen-partial-v0 | 38.0 | 43.9 | 72.5 | 74.9 | 63.30.9 |
kitchen-mixed-v0 | 51.5 | 40.8 | 65.7 | 69.2 | 60.81.4 |
6 Conclusion
In this study, we proposed Diffusion-model-guided Implicit Q-learning with Adaptive Revaluation (DIAR), which leverages diffusion models to improve abstraction capabilities and train more adaptive agents in offline RL. First, we introduced an Adaptive Revaluation algorithm based on the value function, which allows for long-horizon predictions while enabling the agent to flexibly revise its decisions to discover more optimal ones. Second, we propose an Diffusion-model-guided Implicit Q-learning. Offline RL faces the limitation of difficulty in evaluating out-of-distribution state-action pairs, as it learns from a fixed dataset. By leveraging the diffusion model, a generative model, we balance the learning of the value function and Q-function to cover a broader range of cases. By combining these two methods, we achieved state-of-the-art performance in long-horizon sparse reward tasks such as Maze2D, AntMaze, and Kitchen. Our approach is particularly strong in long-horizon sparse reward situations, where it is challenging to assess the current value. Additionally, a key advantage of our method is that it performs well without requiring extensive hyper-parameter tuning for each task. We believe that the latent diffusion model holds significant strengths in offline RL and has high potential for applications in various fields such as robotics.
References
- Agarwal et al. (2020) Rishabh Agarwal, Dale Schuurmans, and Mohammad Norouzi. An Optimistic Perspective on Offline Reinforcement Learning. In ICML, 2020.
- Ajay et al. (2021) Anurag Ajay, Aviral Kumar, Pulkit Agrawal, Sergey Levine, and Ofir Nachum. OPAL: Offline Primitive Discovery for Accelerating Offline Reinforcement Learning. In ICLR, 2021.
- Ajay et al. (2023) Anurag Ajay, Yilun Du, Abhi Gupta, Joshua Tenenbaum, Tommi Jaakkola, and Pulkit Agrawal. Is Conditional Generative Modeling All You Need for Decision-Making? In ICLR, 2023.
- Chen et al. (2021) Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Misha Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision Transformer: Reinforcement Learning via Sequence Modeling. In NeurIPS, 2021.
- Fu et al. (2019) Justin Fu, Aviral Kumar, Matthew Soh, and Sergey Levine. Diagnosing Bottlenecks in Deep Q-learning Algorithms. In arXiv:1902.10250, 2019.
- Fu et al. (2020) Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4RL: Datasets for Deep Data-Driven Reinforcement Learning. arXiv:2004.07219, 2020.
- Fujimoto et al. (2018) Scott Fujimoto, Herke van Hoof, and David Meger. Addressing Function Approximation Error in Actor-Critic Methods. In ICML, 2018.
- Fujimoto et al. (2019) Scott Fujimoto, David Meger, and Doina Precup. Off-Policy Deep Reinforcement Learning without Exploration. In ICML, 2019.
- Hansen-Estruch et al. (2023) Philippe Hansen-Estruch, Ilya Kostrikov, Michael Janner, Jakub Grudzien Kuba, and Sergey Levine. IDQL: Implicit Q-Learning as an Actor-Critic Method with Diffusion Policies. In arXiv:2304.10573, 2023.
- Hasselt et al. (2016) Hado van Hasselt, Arthur Guez, and David Silver. Deep Reinforcement Learning with Double Q-learning. In AAAI, 2016.
- Hasselt et al. (2018) Hado van Hasselt, Yotam Doron, Florian Strub, Matteo Hessel, Nicolas Sonnerat, and Joseph Modayil. Deep Reinforcement Learning and the Deadly Triad. In arXiv:1812.02648, 2018.
- Ho et al. (2020) Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising Diffusion Probabilistic Models. In NeurIPS, 2020.
- Jain & Ravanbakhsh (2023) Vineet Jain and Siamak Ravanbakhsh. Learning to Reach Goals via Diffusion. arXiv:2310.02505, 2023.
- Janner et al. (2022) Michael Janner, Yilun Du, Joshua B Tenenbaum, and Sergey Levine. Planning with Diffusion for Flexible Behavior Synthesis. In ICML, 2022.
- Kalashnikov et al. (2018) Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, and Sergey Levine. QT-Opt: Scalable Deep Reinforcement Learning for Vision-Based Robotic Manipulation. In CoRL, 2018.
- Kingma & Welling (2014) Diederik P Kingma and Max Welling. Auto-Encoding Variational Bayes. In ICLR, 2014.
- Kostrikov et al. (2022) Ilya Kostrikov, Ashvin Nair, and Sergey Levine. Offline Reinforcement Learning with Implicit Q-Learning. In ICLR, 2022.
- Kumar et al. (2019) Aviral Kumar, Justin Fu, George Tucker, and Sergey Levine. Stabilizing Off-Policy Q-Learning via Bootstrapping Error Reduction. In NeurIPS, 2019.
- Kumar et al. (2020) Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative Q-Learning for Offline Reinforcement Learning. In NeurIPS, 2020.
- Levine et al. (2020) Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline Reinforcement Learning: Tutorial, Review, and Perspectives on Open Problems. arXiv:2005.01643, 2020.
- Liang et al. (2024) Zhixuan Liang, Yao Mu, Hengbo Ma, Masayoshi Tomizuka, Mingyu Ding, and Ping Luo. SkillDiffuser: Interpretable Hierarchical Planning via Skill Abstractions in Diffusion-Based Task Execution. In CVPR, 2024.
- Lugmayr et al. (2022) Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. RePaint: Inpainting using Denoising Diffusion Probabilistic Models. In CVPR, 2022.
- Pertsch et al. (2021) Karl Pertsch, Youngwoon Lee, and Joseph Lim. Accelerating Reinforcement Learning with Learned Skill Priors. In CoRL, 2021.
- Ramesh et al. (2022) Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical Text-Conditional Image Generation with CLIP Latents. In NeurIPS, 2022.
- Rombach et al. (2022) Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-Resolution Image Synthesis with Latent Diffusion Models. In CVPR, 2022.
- Saharia et al. (2022) Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J Fleet, and Mohammad Norouzi. Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding. In NeurIPS, 2022.
- Schaul et al. (2016) Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized Experience Replay. In ICLR, 2016.
- Sohl-Dickstein et al. (2015) Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep Unsupervised Learning using Nonequilibrium Thermodynamics. In ICML, 2015.
- Venkatraman et al. (2024) Siddarth Venkatraman, Shivesh Khaitan, Ravi Tej Akella, John Dolan, Jeff Schneider, and Glen Berseth. Reasoning with Latent Diffusion in Offline Reinforcement Learning. In ICLR, 2024.
- Wang et al. (2023) Zhendong Wang, Jonathan J Hunt, and Mingyuan Zhou. Diffusion Policies as an Expressive Policy Class for Offline Reinforcement Learning. In ICLR, 2023.
- Yang et al. (2023) Yiqin Yang, Hao Hu, Wenzhe Li, Siyuan Li, Jun Yang, Qianchuan Zhao, and Chongjie Zhang. Flow to Control: Offline Reinforcement Learning with Lossless Primitive Discovery. In AAAI, 2023.
- Zhou et al. (2020) Wenxuan Zhou, Sujay Bajracharya, and David Held. PLAS: Latent Action Space for Offline Reinforcement Learning. In CoRL, 2020.
Appendix A Experiments Details
DIAR consists of three main components: the -VAE for learning latent skills, the latent diffusion model for learning distributions through latent vectors, and the Q-function, which learns the value of state-latent vector pairs and selects the best latent. These three models are trained sequentially, and when learning the same task, the earlier models can be reused. Detailed model settings and hyperparameters are discussed in the next section. For more detailed code implementation and process, you can refer directly to the code on GitHub.
A.1 -Variational Autoencoder
The -VAE consists of an encoder, policy decoder, state prior, and state decoder. The encoder uses two stacked bidirectional GRUs. The output of the GRU is used to compute the mean and standard deviation. Each GRU output is passed through an MLP to calculate the mean and standard deviation, which are then used to compute the latent vector. This latent vector is used by the state prior, state decoder, and policy decoder. The policy decoder takes the latent vector and the current state as input to predict the current action. The state decoder takes the latent vector and the current state to predict the future state. Lastly, the state prior learns the distribution of the latent vector for the current state, ensuring that the latent vector generated by the encoder is trained similarly through KL divergence.
In Maze2D, is used; in AntMaze and Kitchen, is used. The diffusion model for the diffusion prior used in -VAE training employs a transformer architecture. This model differs from the latent diffusion model discussed in the next section, and they are trained independently. Training the -VAE for too many epochs can lead to overfitting of the latent vector, which can negatively impact the next stage.
Hyperparameter | Value |
---|---|
Learning rate | 5e-5 |
Batch size | 128 |
Epochs | 100 |
Latent dimension | 16 |
0.1 | |
Diffusion prior steps | 200 |
Optimizer | Adam |
A.2 Latent Diffusion Model
The generative model plays the role of learning the distribution of the latent vector for the current state. The current state and latent vector are concatenated and then re-encoded for use. The architecture of the diffusion model follows a U-Net structure, where the dimensionality decreases and then increases, with each block consisting of residual blocks. Unlike the traditional approach of predicting noise , the diffusion model is trained to directly predict the latent vector . This process is constrained by Min-SNR-. Overall, the diffusion model operates similarly to the DDPM method.
Hyperparameter | Value |
---|---|
Learning rate | 1e-4 |
Batch size | 128 |
Epochs | 450 |
Diffusion steps | 500 |
Drop probability | 0.1 |
Min-SNR () | 5 |
Optimizer | Adam |
A.3 Q-learning
In our approach, we utilize both a Q-network and a Value network. The Q-network follows the DDQN method, employing two networks that learn slowly according to the update ratio. The Value network uses a single network. Both the Q-network and the Value network are structured with repeated MLP layers. The Q-network encodes the state into a 256-dimensional vector and the latent vector into a 128-dimensional vector. These two vectors are concatenated and passed through additional MLP layers to compute the final Q-value. The Value network only encodes the state into a 256-dimensional vector, which is then used to compute the value. Between the linear layers, GELU activation functions and LayerNorm are applied. In this way, both the Q-network and Value network are implicitly trained under the guidance of the diffusion model.
Hyperparameter | Value |
---|---|
Learning rate | 5e-4 |
Batch size | 128 |
Discount factor () | 0.995 |
Target network update rate | 0.995 |
PER buffer | 0.7 |
PER buffer | |
Number of latent samples | 500 |
Expectile () | 0.9 |
extra steps | 5 |
Scheduler | StepLR |
Scheduler step | 50 |
Scheduler | 0.3 |
Optimizer | Adam |
Appendix B DIAR Policy Execution Details
We provide a detailed explanation of how DIAR performs policy execution. It primarily selects the latent with the highest Q-value. However, if the current state value is higher than the future state value , it triggers another search for a new latent. DIAR repeats this process until it either reaches the goal or the maximum step is reached.
Appendix C Training Process for -VAE
This section details the process by which the -VAE is trained. The -VAE consists of four models: the skill latent encoder, policy decoder, state decoder, and state prior. These four components are trained simultaneously. Additionally, a diffusion prior is trained alongside to guide the -VAE in generating appropriate latent vectors. The detailed process can be found in Algorithm 3.
Appendix D Training Process for Latent Diffusion Model
This section also provides an in-depth explanation of how the latent diffusion model is trained. The goal of the latent diffusion model is to learn the distribution of latent vectors generated by the -VAE. The latent diffusion model is trained by first converting the offline dataset into latent vectors using the encoder of the -VAE, and then learning from these latent vectors. The detailed process can be found in Algorithm 4.
Appendix E Diffusion Probabilistic Models
Diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) function as latent variable generative models, formally expressed through the equation . Here, denote the sequence of latent variables, integral to the model’s capacity to assimilate and recreate the intricate distributions characteristic of high-dimensional data types like images and audio. In these models, the forward process methodically introduces Gaussian noise into the data, adhering to a predetermined variance schedule delineated by . This step-by-step addition of noise outlines the approximate posterior within a structured mathematical formulation, which is specified as follows:
(11) |
The iterative denoising process, also known as the reverse process, enables sample generation from Gaussian noised data, denoted as . This process is modeled using a Markov chain, where each step involves generating the sample of the subsequent stage from the sample of the previous stage based on conditional probabilities. The joint distribution of the model, , can be represented as follows:
(12) |
In the Diffusion Probabilistic Model, training is conducted via a reverse process that meticulously reconstructs the original data from noise. This methodological framework allows the Diffusion model to exhibit considerable flexibility and potent performance capabilities. Recent studies have further demonstrated that applying the diffusion process within a latent space created by an autoencoder enhances fidelity and diversity in tasks such as image inpainting and class-conditional image synthesis. This advancement underscores the effectiveness of latent space methodologies in refining the capabilities of diffusion models for complex generative tasks (Rombach et al., 2022). In light of this, the application of conditions and guidance to the latent space enable diffusion models to function effectively and to exhibit strong generalization capabilities.
Appendix F Qualitative Demonstration through Maze2D Results
Following the main section, we report more results in the Maze2D environments. We qualitatively demonstrate that DIAR consistently generates favorable trajectories.