Model-Based Diffusion for Trajectory Optimization

Recent advances in diffusion models have demonstrated their strong capabilities in generating high-fidelity samples from complex distributions through an iterative refinement process. Despite the empirical success of diffusion models in motion planning and control, the model-free nature of these methods does not leverage readily available model information and limits their generalization to new scenarios beyond the training data (e.g., new robots with different dynamics). In this work, we introduce Model-Based Diffusion (MBD), an optimization approach using the diffusion process to solve trajectory optimization (TO) problems without data. The key idea is to explicitly compute the score function by leveraging the model information in TO problems, which is why we refer to our approach as model-based diffusion. Moreover, although MBD does not require external data, it can be naturally integrated with data of diverse qualities to steer the diffusion process. We also reveal that MBD has interesting connections to sampling-based optimization. Empirical evaluations show that MBD outperforms state-of-the-art reinforcement learning and sampling-based TO methods in challenging contact-rich tasks. Additionally, MBD's ability to integrate with data enhances its versatility and practical applicability, even with imperfect and infeasible data (e.g., partial-state demonstrations for high-dimensional humanoids), beyond the scope of standard diffusion models.

Paper

References (68)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer p88D5/10 · confidence 2/52024-07-06

Summary

The paper proposed MBO, a novel method to solve trajectory optimization problems with diffusion models. MBD formulates the optimization problem as a sampling problem and estimates the score function using the dynamic model.

Strengths

- The motivation of the paper is valid. In the trajectory optimization problem, we already know the underlying dynamics of the environment. Therefore, it is natural to utilize such information when we use diffusion models to solve trajectory optimization problems. - The problem statement is clearly written and easy to follow, even for readers who are not familiar with the topic. - Experiment results demonstrate that MBD outperforms prior methods in various domains.

Weaknesses

- In the introduction, the authors claimed that existing diffusion-based approaches often require high-quality demonstration data. However, I cannot find any evidence of experiment results supporting this claim in the manuscript. Diffusion-based planners are not in the baselines of the experiments, and there are several model-free diffusion-based methods that can efficiently generate dynamically feasible and high-rewarding trajectories in RL fields. Could authors validate the reason why model-free diffusion planners are not included in the baselines? - The authors also claimed that one of the advantages of model-based diffusion over model-free diffusion is its generalization ability (e.g., generalization to new tasks). However, I cannot find empirical evidence for this claim. Could the authors elaborate more on this claim?

Questions

There are some minor questions for better understanding. - For model-free diffusion, we need to train the score function estimator through the data. In model-based diffusion, which part should be parametrized by the neural network and trained with the data? - MBD is compared with the baselines, including zeroth-order optimization and RL algorithms. Is there any other recently proposed method for trajectory optimization? - For data-augmented MBD, there are also several works that utilize model-free diffusion models to augment data given sub-optimal offline datasets. They claim that through stitching ability, model-free diffusion can also generate novel trajectories [1, 2]. Could authors validate empirically that MBD is more powerful compared to model-free diffusion models given partial and dynamically infeasible datasets? [1] Ajay, Anurag, et al. "Is Conditional Generative Modeling all you need for Decision Making?." The Eleventh International Conference on Learning Representations. [2] Li, Guanghe, et al. "DiffStitch: Boosting Offline Reinforcement Learning with Diffusion-based Trajectory Stitching." Forty-first International Conference on Machine Learning.

Rating

5

Confidence

2

Soundness

3

Presentation

3

Contribution

3

Limitations

- Please see the weaknesses and questions above.

Authorsrebuttal2024-08-13

Thanks for the feedback!

We appreciate the reviewer's suggestion to empirically demonstrate the generalizability of MBD to various dynamics and cost functions. As shown in Sec.5 of the paper, we have conducted extensive experiments, which suggest that MBD, as a **Trajectory Optimization solver** (aka planning, a very important problem in decision making and RL), inherently adapts to **ANY** given model and cost function. Alongside with its model-based nature as a Trajectory Optimization, we hope it's sufficient to showcast its capacity to handle diverse dynamics and costs. However, we would like to seek further clarification on reviewer's specific concerns regarding the generalization abilities of MBD. If there are particular aspects or additional experiments you believe would more effectively demonstrate this capability, we would be delighted to explore these avenues to address your concerns.

Reviewer YGTC5/10 · confidence 3/52024-07-12

Summary

This work introduces model-based diffusion (MBD) to solve trajectory optimization (TO) problems without relying on data. The key idea is to explicitly compute the score function by leveraging the model information in TO problems. This paper also shows that MBD has interesting connections to sampling-based optimization. The empirical evaluations demonstrate that MBD outperforms state-of-the-art TO methods.

Strengths

- The model-based diffusion framework enables an effective trajectory planner. - This algorithm shows good performance on various tasks compared to other state-of-the-art algorithms.

Weaknesses

- The theoretical derivation and notation in the methodology are quite confusing and hard to follow. - The comparison to some simple baseline of RL, such as PPO, cannot demonstrate the real advantages. - In line 137 and equation $(3)$, there may be an incorrect formula: $$ p_{i|i-1}(\cdot, Y^{(i-1)}) \sim \mathcal{N}(\sqrt{\alpha_i}Y^{(i-1)},1-\alpha_iI) $$ and $$ p_{i|0}(\cdot, Y^{(0)}) \sim \mathcal{N}(\sqrt{\overline{\alpha}_i}Y^{(0)},1-\overline{\alpha}_iI) $$ - In equation $(8)$, there may be an incorrect formula: $$ \phi_i(Y^{(0)})\propto\cdots\propto\mathcal{N}(Y^{(0)}-\frac{Y^{(i)}}{\sqrt{\overline{\alpha}_i}},\frac{I}{\overline{\alpha}_i}-I) $$ - In all algorithms, it is evident that the calculation step can be simplified: $Y^{(i-1)} \leftarrow \frac{1}{\sqrt{\alpha_i}}(Y^{(i)}-Y^{(i)}+\sqrt{\overline{\alpha}_i}\overline{Y}^{(0)}(\mathcal{Y}^{(i)})) = \frac{\sqrt{\overline{\alpha}_i}}{\sqrt{\alpha_i}}\overline{Y}^{(0)}(\mathcal{Y}^{(i)})=\sqrt{\overline{\alpha}_{i-1}}\overline{Y}^{(0)}(\mathcal{Y}^{(i)})$ Note that this coefficient $\sqrt{\overline{\alpha}_{i-1}}$ is canceled at the first step. Also, note that in equations $(9b)$, $(10d)$, and $(13)$, it is a weighted average of the samples from $\mathcal{Y}^{(i)}$. It may be clearer if the calculation steps are more simplified and easy to understand. - In Table 3, the computational times of the CEM and MC-MBD algorithms are close. I'm wondering if this table includes the computation time for environment interaction. It might be fairer to compare just the computation times for the algorithms.

Questions

Please refer to the Weaknesses.

Rating

5

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

Limitations are not discussed in the manuscript.

Reviewer YGTC2024-08-13

Thanks for your response. However, I still have some concerns about the comparison baselines. PPO and SAC can provide some reference for the performance, but they are not strong baselines. Recent model-free RL methods such as DIPO [1], QSM [2] show much better performance compared to PPO and SAC. Besides, since this method is model-based Diffusion, why not compare it to model-based RL baselines, such as Dream-v3 [3], TD-MPC2 [4]. [1] Long Yang, et al, Policy Representation via Diffusion Probability Model for Reinforcement Learning, arXiv:2305.13122. [2] Michael Psenka, et al, Learning a Diffusion Model Policy from Rewards via Q-Score Matching, ICML 2024. [3] D Hafner, et al, Mastering Diverse Domains through World Models, arXiv:2301.04104. [4] Nicklas Hansen, et al, TD-MPC2: Scalable, Robust World Models for Continuous Control, ICLR 2024.

Authorsrebuttal2024-08-13

Thanks for the feedback!

Thanks for the suggestion. Fistly, comparing with MBRL, our setting centers on Trajectory Optimization, which assume model is available. In contrast, model-based RL baselines like Dream-v3 and TD-MPC2 are designed to concurrently learn the model and the policy. Therefore, a direct comparison is not entirely appropriate as it isn’t an apples-to-apples situation. However, examining the optimizer of TD-MPC2[4], one can observe that the planner module used for solving optimization tasks with learned dynamics is MPPI, which we also employ as a baseline across all our environments. In fact, MBD could be regarded as a subroutine within model-based RL algorithms, capable of optimizing the trajectory given a model. We believe this integration offers a promising avenue for future research. Secondly, comparing with more advanced MFRL, we think PPO and SAC are still representative baselines for the asymptotic performance. Specifically, DIPO and QSM demonstrate better sample efficiency and multi-modal representation compared with PPO and SAC, but since we train RL util converge, we only focus on asymptotic performance, both of which does not show significant improvement over PPO/SAC. If we are proposing a diffusion-based RL algorithm, we would definitely compare with the diffusion-based RL algorithm like DIPO and QSM. However, since MBD is a trajectory optimization algorithm, we believe our choice of PPO and SAC as the aymptotic performance reference would be enough to demonstrate the effectiveness of our method, especially given the fact that there are no existing TO algorithm can solve those task well. If you have any further suggestions or concerns, please let us know. We appreciate your feedback!

Reviewer YGTC2024-08-14

Thanks for the clarification. I will raise my score.

Reviewer X3LL5/10 · confidence 4/52024-07-13

Summary

This paper presents Model Based Diffusion (MBD), a novel approach to trajectory optimization that leverages a diffusion process. Unlike traditional diffusion models where denoising networks are trained on data using a score matching loss, MBD directly computes the score function for a given target distribution. Specifically, for a trajectory optimization problem, the unnormalized target distribution is formulated as a product of three terms: an optimality term that depends on the cost function, a dynamical feasibility term, and a constraint satisfaction term. The authors demonstrate that in each iteration of the reverse diffusion process, the score function can be approximated using Monte-Carlo estimation – a weighted sum of samples drawn from a Gaussian distribution parameterized by the current trajectory, where the weight of each sample is the target density evaluated at that sample. Additionally, they show how their approach can be extended to handle scenarios with noisy observations of trajectories from the target distribution. Finally, they present experimental results on locomotion and manipulation tasks, demonstrating that their method outperforms other trajectory refinement techniques and RL algorithms in both average step reward and computational time.

Strengths

This paper introduces an innovative approach that leverages diffusion models directly as solvers for trajectory optimization. The key advantage is that if the cost function, dynamics, and constraints can be specified for a given problem, the proposed iterative refinement approach can obtain samples from the desired distribution without having to rely on any demonstration data. If demonstration data is available, the authors demonstrate how it could be used to augment their approach. The paper is also well-presented and easy to understand.

Weaknesses

The requirement for explicit specification of the cost function, dynamics, and constraints can be a limitation in real-world applicatioms. It would also be interesting to see how MBD would perform in the sparse reward or goal completion settings. The performance of MBD presumably heavily relies on the accuracy of the provided dynamics model. Inaccurate models could lead to suboptimal trajectories and compounding errors. It would be useful to study how robust MBD is to varying degrees of model inaccuracy.

Questions

- The paper primarily evaluates MBD on tasks with relatively short horizons (e.g., 50 steps for most locomotion tasks). It would be valuable to understand how the performance of MBD scales with increasing horizon lengths. Do the computational benefits over RL persist for longer horizons? - How does the performance of MBD vary as a function of the number of samples used in the Monte Carlo approximation? - For the RL agents, it looks like the full episode length (e.g. 1000 steps for locomotion tasks like hopper, halfcheetah) is used. The RL agents are presumably trained to maximize rewards over the entire episode, while is MBD optimized for a much shorter horizon. Is this then a fair comparison? The paper could benefit from a discussion of this comparison or additional experiments with RL agents trained on shorter horizons. - How do you envision incorporating conditioning signals in MBD? This would be important for adapting MBD to a receding horizon strategy, where the trajectory is re-planned at each time step based on new observations.

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

The authors have not discussed the limitations of their work.

Reviewer X3LL2024-08-13

Thank you for the clarifications

Thank you for the clarifications. I have a question regarding the notation. Action $u_t$ at state $x_t$ leads to state $x_{t+1}$. Thus, the lhs of equation 1a should have $J_{x_{1:T}, u_{0:T-1}}$ instead of $J_{x_{1:T}, u_{1:T}}$? And I think $Y$ should also be modified to include $u_0$?

Authorsrebuttal2024-08-13

Thanks for the feedback

Yes, you are right. The optimization variable should be $u_{0:T-1}, x_{1:T}$ instead of $u_{1:T}, x_{1:T}$. Thank you so much for point it out! We will correct the notation in the revised version.

Reviewer sfi97/10 · confidence 3/52024-07-13

Summary

The paper presents Model-based Diffusion (MBD), a framework to train diffusion models to solve trajectory optimization (TO) problems. In particular, the method assumes that the cost function associated with a TO problem can be evaluated for any trajectory of decision variables (states and control variables), which it then leverages to compute the target distribution of optimal solutions ($p_0(Y^{(0)})$) up to a normalizing constant. The denoising process in MBD performs a gradient ascent on intermediate distributions which are smoothed, easier to optimize versions of $p_0(Y^{(0)})$. The method deals with unconstrained and constrained TO problems and is also able to incorporate demonstrations. MBD outperforms sota RL and also sampling-based TO methods in contact-rich tasks.

Strengths

- The proposed method is evaluated on contact-rich, high-dimensional tasks and outperforms the baselines in terms of reward while keeping a computational time similar to the fastest baselines. - The paper is well-written and the main ideas are clear and well-motivated. Furthermore, the method shows interesting connections to multi-stage optimization and also to the Cross Entropy Method for sample-based optimization. - The method does not have many hyperparameters and they are robust across most tasks.

Weaknesses

- While the comparison against RL is valuable and gives insights into the overall performance of MDB, the paper should better emphasize that the rewards reported in Table 2 are obtained by rolling out RL policies in an online closed-loop fashion, while the reward associated with MBD is computed according to an open loop execution. Given that the paper lists the adaptation of MDB to online setup as future work, and that the rewards are computed in different ways, simply stating that MDB outperforms PPO by 59% can be misleading. Qualifying such statements with an explanation of the different ways that rewards are computed would further improve the quality of the submission. [Minor] Typo L213 esitimation -> estimation

Questions

- What are the challenges of adapting your method to online tasks with receding horizon strategies? Is it a matter of training MBD to solve TO problems starting from more initial states? -Once MDB has been trained, how long does it take to run the denoising process to get a new trajectory?

Rating

7

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

Limitations of the method are mentioned in the paper as potential lines of future work.

Authorsrebuttal2024-08-09

Thanks for the suggestion!

> Using the naive receding horizon MBD algorithm introduced by the authors, the overall compute time to obtain a new solution is probably much lower due to the use of single-step MBD and to the forward shifting of the trajectory to initialize the next optimization step. Reporting the possible close-loop rates of MBD would also be valuable for the readers. Thanks for the suggestion. Showing the computation time of online MBD is indeed valuable for the audience who interested in real-time applications. We tested the online frequency on RTX 4070Ti GPU and the results are shown in Table 5. We will also include the computation time of MBD in the updated manuscript. Table 5: Online Running Frequency of receding horizon MBD | Env | Frequency (Hz) | | --- | --- | | Hopper | 4.56 | | HalfCheetah | 4.51 | | Ant | 10.28 | 7.46 | | Walker2d | 3.49 | | Humanoid Standup | 6.82 | | Humanoid Running | 4.03 | Please note that the frequency is calculated under the assumption of solving the whole 50 steps TO problem without reduced model at each iteration, which quite different from the MPC approach proposed in [1] which only solve the reduced model. Besides, the mujoco code environment we used is not optimized for GPU, so the actual frequency could be higher with optimized environment. In our work we just use Brax as a simple and easy-to-use option. As the major computation time of MBD is spent on the forward dynamics simulation, it can be further improved by using more efficient physics engine. Moreover, MBD's online frequency can be further improved by introducing learning components including learned value function, policy, or dynamics model like TD-MPC [2]. In practice, by using GPU-optimized Unitree Go2 environment provided by [mujoco_menagerie](https://github.com/google-deepmind/mujoco_menagerie), we can achieve $52.3$ Hz control for Go2 robot with 12 DoF in walking task with 20 steps prediction horizon. Lastly, since MBD is designed to be a TO solver rather than a real-time controller, the computation time is not the main concern. But we totally agree that it is valuable to further explore the how to bring MBD to real-time which can solve the whole dynamic system without reduction model at each iteration and MBD has already shown its potential in this direction. [1] D. Kim, J. Di Carlo, B. Katz, G. Bledt, and S. Kim, “Highly Dynamic Quadruped Locomotion via Whole-Body Impulse Control and Model Predictive Control,” Sep. 14, 2019, arXiv: arXiv:1909.06586. [2] N. Hansen, X. Wang, and H. Su, “Temporal Difference Learning for Model Predictive Control,” Jul. 19, 2022, arXiv: arXiv:2203.04955. doi: 10.48550/arXiv.2203.04955.

Reviewer sfi92024-08-09

Thanks for the clarifications!

I have read the author's response and appreciate the additional experiments and clarifications provided. Regarding the extension to the online setup, it would be useful to provide the frequency at which the close-loop control can be executed. Table 3 reports a compute time of at least 17 seconds for MC-MBD, which is inadequate for close-loop control, especially for highly dynamic systems like the humanoids. Using the naive receding horizon MBD algorithm introduced by the authors, the overall compute time to obtain a new solution is probably much lower due to the use of single-step MBD and to the forward shifting of the trajectory to initialize the next optimization step. Reporting the possible close-loop rates of MBD would also be valuable for the readers. Thanks.

Reviewer X3LL2024-08-12

Thank you for your response

Thank you for your response to my questions and for conducting the additional experiments. I have a few follow-up questions: Regarding the extension to closed-loop control with a receding horizon, could you elaborate on how the current state x_t is incorporated into Algorithm 1? In lines 506-507, you mention that for pushT, the reward is composed of the distance between the target and the object, as well as the orientation difference between them. Is the reward signal available at each state and computed based on the distance and orientation, or is it a sparse reward provided only when the distance/orientation are below certain thresholds?

Authorsrebuttal2024-08-13

Thanks for the comments!

Thank you for the comments. Here are our responses: > Regarding the extension to closed-loop control with a receding horizon, could you elaborate on how the current state x_t is incorporated into Algorithm 1? We would like to refer to line 4 on Algorithm 2, where Y represents the entire control input sequence that $ Y = U = u_{1:T} $. Given the current state $x_t$, we can roll out the control sequences starting from $x_t$ and generate the predicted state sequence $x_{t+1:t+T}$. This procedure allows us to incorporate and current state $x_t$ into MBD's framework just by calculating the score function as shown in line 5 on Algorithm 2. The closed-loop process is effectively streamlined, as our non-receding-horizon MBD algorithm is capable of initiating from any initial state without requiring conditional training, as demonstrated in Algorithm 2, thanks to the model-based nature of MBD. We hope this would clarify the reviewer's inquiry. --- > In lines 506-507, you mention that for pushT, the reward is composed of the distance between the target and the object, as well as the orientation difference between them. Is the reward signal available at each state and computed based on the distance and orientation, or is it a sparse reward provided only when the distance/orientation are below certain thresholds? Thanks for the clarification question. The reward signal is computed at each state without certain thereshold to the object. We consider this reward signal as a sparse since reward is not directly applied to the agent but to the object. The agent only gets reward when the object is moved. That's why PPO cannot solve this task effectively due to most of the movement of the agent is not rewarded and agent need to move a long distance to get the reward, especially when switching the contact point. However, we totally agree that the definition of sparse reward could be vague and we will clarify this as hard-to-explore reward in the revised version.

Reviewer p88D2024-08-13

Thank you for the authors' detailed response. I understand that the settings of MFD and MBD are quite different, but it might be better to empirically demonstrate that MBD can generalize to various dynamics and cost functions. Therefore, I maintain the score.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC