Organizations: ELLIS Institute Finland · Also part of Cyber-physical Systems Group, Aalto University, Espoo, Finland. · Indian Institute of Technology, Madras, India · ELLIS Institute Finland & Aalto University, Espoo, Finland · Cyber-physical Systems Group, Aalto University, Espoo, Finland
Diffusion models can learn multimodal distributions over finite-horizon state-input sequences, providing a way to generate candidates for predictive control. However, sequences generated by a pretrained model may violate safety constraints introduced at deployment, for example when obstacles are added or repositioned. Retraining whenever these constraints change limits the usefulness of learned predictive controllers. In this paper, we propose Test-Time Constraint-Aware Diffusion Predictive Control (TCA-DPC), an algorithm for adapting the sampling distribution of a pretrained diffusion controller to newly introduced safety constraints without retraining. We treat the pretrained model as a prior over finite-horizon sequences and define an adapted distribution through exponential tilting based on a constraint-violation penalty. The tilt strength is adjusted online using the fraction of generated sequences that fail constraint verification. We approximately sample the adapted distribution using the Metropolis-adjusted Langevin algorithm in the Gaussian noise space of the pretrained diffusion sampler.
Figures & tables
Figure 1: Avoiding environment. (a) The 96 training demonstrations, coloured by route, i.e., by the side on which they pass the first obstacle and the gap they take between the two middle obstacles. (b)–(d) The three test-time constraint layouts: forbidden regions (blue) and their tightening by γ (grey). None of the forbidden regions appears in the training data.
Top-left
Top-right
Both
Method
Proj.
G
G&C
G
G&C
G
G&C
Viol. ↓
Steps ↓
FB
Prior
✗
1.00
0.10 ± .03
1.00
0.06 ± .02
1.00
0.02 ± .02
16.66
74.8
–
Prior + verification
✗
1.00
0.90 ± .00
0.80
0.46 ± .06
0.94
0.48 ± .07
3.17
73.1
0.12
Fixed β=β0
✗
1.00
0.94 ± .04
0.60
0.38 ± .09
0.96
0.62 ± .11
2.12
69.1
0.08
TCA-DPC
✗
1.00
0.94 ± .04
0.86
0.80 ± .05
0.94
0.74 ± .07
0.73
68.8
0.05
DPCC-C
✓
0.98
0.90 ± .03
0.94
0.78 ± .07
0.90
0.46 ± .11
0.89
66.9
–
Table 1: Closed-loop performance on the three constraint layouts without tightening ( γ=0 ); Viol., Steps and FB are averaged over layouts. Bold marks the best result and underlining the best among methods without projection.
Figure 2: Top-left layout. (a) Closed-loop paths of the prior (grey) and TCA-DPC (blue) without tightening. (b) Tilt strength βt after the first verification failure (median and IQR). (c) Goal-and-constraint success versus tightening γ .
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Top-left
Top-right
Both
Method
Proj.
G
G&C
G
G&C
G
G&C
Viol. ↓
Steps ↓
FB
Prior
✗
1.00
0.10 ± .03
1.00
0.06 ± .02
1.00
0.02 ± .02
16.66
74.8
–
Prior + verification
✗
0.98
0.50 ± .09
0.70
0.14 ± .04
0.94
0.38 ± .11
6.75
74.4
0.31
TCA-DPC
✗
1.00
1.00 ± .00
0.98
0.98 ± .02
0.94
0.90 ± .04
0.07
68.1
0.13
DPCC-C
✓
1.00
1.00 ± .00
1.00
1.00 ± .00
1.00
1.00 ± .00
0.00
63.8
–
DPCC-T
✓
1.00
1.00 ± .00
1.00
0.96 ± .02
0.94
0.94 ± .06
0.04
64.3
–
Appendix
Table 2: Closed-loop results at γ=2.5 cm, mean ( ± s.e.) over 5 models × 10 episodes. Viol., Steps and FB are averaged over layouts. Proj.: run-time projection. Bold : best; underlined : best without projection.
Figure 3: Results on the three constraint layouts, one per row. (a) Closed-loop paths of the prior (grey) and TCA-DPC (blue) without tightening. (b) Tilt strength βt after the first verification failure, median and interquartile range. (c) Success rate versus tightening γ . Results over 50 episodes per layout.
Parameter
Value
G&C ↑
Viol. ↓
fˉ
FB
Reference (TCA-DPC)
0.90 ± .04
0.10
0.25
0.17
MALA steps M
0 (prior + verification)
0.38 ± .11
1.84
0.28
0.24
(ref. 5)
1
0.78 ± .08
0.26
0.24
0.18
2
0.76 ± .05
0.50
0.26
0.19
10
0.88 ± .06
0.12
0.26
0.18
Gain κ
0 (fixed β=103 )
0.84 ± .08
0.32
0.26
0.19
Appendix
Table 3: Ablations on the both layout at γ=2.5 cm. fˉ : mean failure fraction.
Diffusion-based planning generates diverse action sequences or trajectories by progressively denoising candidates conditioned on goals, scenes, and constraints.
Diffusion models have emerged as powerful tools for planning and control by learning multimodal distributions over actions and trajectories. Yet reliable inference-time safety enforcement remains a key barrier to their deployment in safety-critical tasks. Existing approaches typically project each denoising iterate onto the feasible set, even though constraints are defined only on the final clean trajectory. Enforcing feasibility on noisy intermediate samples can therefore overconstrain the sampling dynamics, substantially degrading sample quality. To address this limitation, we introduce DiRecT (Diffusion-based planning via Receding-horizon denoising with Terminal constraints), a training-free algorithm for constrained sampling from diffusion models via stochastic optimal control (SOC). DiRecT enforces constraints only on the final clean sample, avoiding unnecessary restrictions on the intermediate denoising dynamics. Inspired by model predictive control, we derive a principled receding-horizon surrogate for the otherwise intractable constrained SOC formulation, yielding an efficient algorithm that cleanly separates stochastic denoising from constraint satisfaction, progressively steering samples toward feasible final trajectories without distorting the learned diffusion dynamics. Furthermore, DiRecT is highly flexible: it can leverage off-the-shelf or domain-specific optimizers, incorporate priors over environment dynamics, and optimize additional soft rewards. Extensive experiments on safe planning benchmarks demonstrate that DiRecT substantially improves deployment safety and task performance over existing diffusion-based planning baselines.
Diffusion models provide expressive priors over trajectories, but adapting these priors to test-time constraints requires maintaining feasibility and consistency across successive control decisions. We introduce Persistent Particle Planning (P3), a sequential Monte Carlo framework for diffusion control that maintains a weighted population of candidate plans across replanning steps. At each control step, P3 shifts and partially re-noises the candidate trajectories, refines them under the latest observation, and uses constraint-aware weighting and resampling to select among alternative continuations without retraining the diffusion model. We consider denoising and replanning as one Feynman--Kac particle system and analyze it under an idealized repair. We prove that the re-noising depth controls how reliably a kept plan stays on its route, and that keeping a rare, well-separated route takes far fewer plans than rediscovering it by sampling from scratch. Experiments under multiple test-time constraint configurations show that population reuse reduces route switching and improves success without constraint violations. Because P3 refines earlier plans instead of redrawing them, it also needs fewer denoising iterations per replan. On maze-navigation tasks, it plans faster than both regenerated populations and methods that correct a single sampled plan by constrained optimization. Code and pretrained models are available at https://github.com/p3-username/p3-anon.
Hikmet Simsir, Mahyar Fardinfar, Ozgur S. Oguz
Department of Computer Engineering, Bilkent University
The application of deep learning for partial differential equation (PDE)-constrained control is gaining increasing attention. However, existing methods rarely consider safety requirements crucial in real-world applications. To address this limitation, we propose Safe Diffusion Models for PDE Control (SafeDiffCon), which introduce the uncertainty quantile as model uncertainty quantification to achieve optimal control under safety constraints through both post-training and inference phases. Firstly, our approach post-trains a pre-trained diffusion model to generate control sequences that better satisfy safety constraints while achieving improved control objectives via a reweighted diffusion loss, which incorporates the uncertainty quantile estimated using conformal prediction. Secondly, during inference, the diffusion model dynamically adjusts both its generation process and parameters through iterative guidance and fine-tuning, conditioned on control targets while simultaneously integrating the estimated uncertainty quantile. We evaluate SafeDiffCon on three control tasks: 1D Burgers' equation, 2D incompressible fluid, and controlled nuclear fusion problem. Results demonstrate that SafeDiffCon is the only method that satisfies all safety constraints, whereas other classical and deep learning baselines fail. Furthermore, while adhering to safety constraints, SafeDiffCon achieves the best control performance. The code can be found at https://github.com/AI4Science-WestlakeU/safediffcon.
Peiyan Hu, Xiaowei Qian, Wenhao Deng +8
Work done as an intern at Westlake University · Academy of Mathematics and Systems Science, Chinese Academy of Sciences, Beijing, China · School of Engineering, Westlake University, Hangzhou, China +2