cs.LGNov 14, 2026

Test-Time Constraint-Aware Diffusion Predictive Control

Authors: Braghadeesh Lakshminarayanan, Ojas Phadake, Qi Chen, Dominik Baumann

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 · 

Abstract

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

Appendix figures & tables3 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Jun 13, 2026

DiRecT: Safe Diffusion-Based Planning via Receding-Horizon Denoising

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.
Oct 5, 2026

P3: Persistent Particle Planning for Constrained Diffusion Control

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.
Feb 4, 2025

From Uncertain to Safe: Conformal Adaptation of Diffusion Models for Safe PDE Control

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.