Test-Time Constraint-Aware Diffusion Predictive Control

Braghadeesh Lakshminarayanan, Ojas Phadake, Qi Chen, Dominik BaumannarXiv 2026 · arXiv

TL;DR

Test-Time Constraint-Aware Diffusion Predictive Control (TCA-DPC) allows robots to adapt to new safety constraints—like a suddenly moved obstacle—on the fly, without retraining their underlying diffusion models. By using "exponential tilting" and gradient-based sampling in the noise space, the algorithm steers a pre-trained controller toward safe trajectories while preserving its learned expertise.

What Problem Does This Paper Address?

Diffusion models have become a powerhouse in robotics because they can learn complex, multimodal distributions of behavior from human demonstrations or simulations. In Diffusion Predictive Control (DPC), these models generate candidate "plans" (sequences of states and inputs).

However, there is a major catch: these models are usually "frozen" after training. If the robot is deployed in an environment with new obstacles or safety rules not present in the training data, the pre-trained sampler might confidently generate a path that leads straight into a wall. Retraining the model every time an obstacle moves is computationally prohibitive for real-time control.

Existing solutions often rely on "projections" (mathematically forcing a path to be safe) or "guidance" (nudging the model during generation). These can be brittle, often requiring explicit geometric descriptions of obstacles or failing when the constraints are highly restrictive.

Methods

The authors propose TCA-DPC, which treats the pre-trained diffusion model as a prior and adapts it into a posterior distribution that favors safety.

  1. Exponential Tilting: They reweight the original distribution using an exponential penalty function. If a generated sequence violates a constraint, its "weight" drops exponentially. This ensures that the relative probabilities of different safe behaviors are preserved, while unsafe ones are suppressed.
  2. Noise-Space MALA: To sample from this new, "tilted" distribution, they use the Metropolis-adjusted Langevin algorithm (MALA). Crucially, they perform this sampling in the Gaussian noise space that feeds into the diffusion model. This allows them to backpropagate gradients of the safety penalty through the entire denoising process to find "safer" noise vectors.
  3. Online Tilt Adjustment: The "strength" of the tilt ($\beta$) is a hyperparameter. Too low, and the robot crashes; too high, and the sampling becomes inefficient. TCA-DPC uses an online feedback rule (similar to an integral controller) that increases $\beta$ if too many generated samples are failing verification and decreases it when the robot is safely within its "failure budget."

Datasets

The researchers evaluated their method on the Avoiding task from the D3IL benchmark.

  • Training Data: 96 human demonstrations covering 24 different routes around obstacles.
  • Test-Time Constraints: Three new layouts (top-left, top-right, and "both") featuring forbidden regions (obstacles) that were never seen during training.
  • Baselines: They compared TCA-DPC against untilted priors, fixed-tilt versions, and DPCC (Diffusion Predictive Control with Constraints), a state-of-the-art projection-based method.

Key Insights and Ideas

  • Gradient-Through-Sampler: By performing MALA in the noise space, the algorithm leverages the full differentiable chain of the denoising network. This is more powerful than simple "guidance" because it allows for more global corrections to the trajectory.
  • Preserving Multimodality: Unlike methods that might collapse to a single "average" path, exponential tilting keeps the diverse options (e.g., going left vs. going right around an obstacle) available, provided both are safe.
  • The "Safety Thermostat": The online adjustment of the tilt parameter $\beta$ is a standout feature. It allows the system to automatically calibrate its "aggressiveness" toward safety based on real-time performance, removing the need for tedious manual tuning.

Key Results

  • Superior Safety: In the most restrictive "both" obstacle layout, TCA-DPC achieved a 74% goal-and-constraint success rate, significantly outperforming the projection-based DPCC-C (46%) when no safety "buffer" was used.
  • Robustness to Tightening: When a safety buffer (tightening) was added, TCA-DPC reached 100% success in several layouts, matching or exceeding specialized projection methods.
  • Reduced Violations: The mean number of violating control steps per episode dropped from 3.17 (for a standard sampler with verification) to just 0.73 with TCA-DPC.
  • Computational Trade-off: The method takes about 1.0 second per control step. While slightly slower than projection-based methods (~0.7s), it offers better performance in complex, unbuffered environments.

Limitations and Future Work

  • Computational Overhead: The need for repeated denoising and gradient computations within the MALA loop makes it slower than simple sampling. The authors suggest reducing this cost as a primary direction for future work.
  • Heuristic Fallbacks: If the sampler fails to find any valid sequence within its budget, it falls back to a heuristic (reusing the previous plan or picking the "least bad" sequence). These fallbacks don't guarantee safety.
  • Differentiability Requirement: The method requires a differentiable constraint penalty function. While common, this might be difficult to define for certain complex or logical constraints.

Summary updated

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.
BibTeX
@misc{lakshminarayanan2026test,
  author = {Braghadeesh Lakshminarayanan and Ojas Phadake and Qi Chen and Dominik Baumann},
  title = {{Test-Time Constraint-Aware Diffusion Predictive Control}},
  year = {2026},
  eprint = {2611.19380},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.19380},
}
Figure