TL;DR
Controlling complex physical systems governed by Partial Differential Equations (PDEs) requires strict safety guarantees, yet deep learning approaches often violate these boundaries when trained on messy, offline data. This paper introduces SafeDiffCon (Safe Diffusion Models for PDE Control), a novel framework that combines diffusion models with conformal prediction to quantify model uncertainty. By adapting the model's distribution during both post-training and inference, SafeDiffCon achieves optimal control performance while successfully satisfying 100% of safety constraints across challenging fluid dynamics and nuclear fusion tasks.
What Problem Does This Paper Address?
From managing plasma stability in a nuclear fusion reactor to controlling fluid flows, many critical scientific and engineering problems are framed as PDE-constrained control problems. Recently, diffusion models have emerged as a powerful tool for these tasks due to their ability to model high-dimensional, non-linear trajectories.
However, real-world deployment has a massive bottleneck: safety. Traditional deep learning control methods rarely provide formal safety guarantees. This is particularly problematic because safety-critical systems must be trained offline using pre-collected datasets to avoid catastrophic failures during exploration. These offline datasets are often highly suboptimal and contain unsafe examples. When a model tries to optimize for a control target, it inevitably shifts away from the training data distribution, leading to unpredictable prediction errors and severe safety violations.
Methods
The authors propose SafeDiffCon, which integrates Conformal Prediction (CP) into a diffusion-based control pipeline to rigorously quantify and mitigate model uncertainty.
The framework operates in four distinct phases:
- Pre-training: A standard diffusion model is trained on offline data to learn the joint distribution of system states and control sequences.
- Uncertainty Quantification via Conformal Prediction: To account for distribution shifts between the static training data and the model's generated trajectories, the authors compute a shifted score set using a calibration dataset. From this, they derive an uncertainty quantile ($Q$). This quantile defines a statistical boundary (conformal interval) within which the true safety score is guaranteed to lie with high probability.
- Post-training with Reweighted Loss: The pre-trained model is fine-tuned globally using a reweighted diffusion loss. Trajectories with lower safety risks (factoring in the uncertainty quantile) and better control objectives are assigned higher weights, steering the model's base distribution toward safer regions.
- Inference-time Fine-tuning: When given a specific control target, the model dynamically adjusts its parameters and generation process over a few iterations using both test-time guidance and localized fine-tuning.
Datasets
The authors evaluated SafeDiffCon on three distinct simulated environments:
- 1D Burgers' Equation: A fundamental equation for fluid and gas dynamics. The task is to guide the system to a target state while keeping the state magnitude below a strict safety threshold ($s_0 = 0.64$).
- 2D Incompressible Fluid (Navier-Stokes): A complex smoke simulation containing obstacles and a designated "hazardous red region." The objective is to maximize smoke passing through a target bucket while ensuring less than 10% enters the hazardous zone. Notably, 53.1% of the training dataset consists of unsafe trajectories.
- Tokamak Fusion Reactor (KSTAR Simulator): A highly non-linear, data-driven simulator based on the Korea Superconducting Tokamak Advanced Research device. The controller must manipulate plasma parameters ($\beta_p$ and $l_i$) while ensuring the safety factor ($q_{95}$) never drops below a critical threshold. 71.18% of the training samples here are unsafe.
Key Insights and Ideas
- Embracing Overconfidence Protection: Instead of relying on a model's point-estimate prediction of safety, SafeDiffCon optimizes against the upper bound of the conformal interval. This ensures that even if the model is uncertain, the actual physical system remains safe.
- Distribution-Shift Aware Calibration: Standard conformal prediction assumes data exchangeability. Because the diffusion model actively steers towards optimal (and thus out-of-distribution) trajectories, the authors dynamically reweight the calibration scores based on the likelihood ratio between the target and training distributions.
- The Necessity of Two-Stage Adaptation: The ablation studies reveal that neither global post-training nor local inference-time fine-tuning is sufficient on its own. Post-training establishes a safe, broad prior, while inference-time tuning refines the model for highly specific, narrow control targets.
Key Results
SafeDiffCon was compared against a wide array of baselines, including Behavior Cloning (BC), Supervised Learning with Lagrangian constraints (SL-Lag), Model Predictive Control (MPC-Lag), Constrained Decision Transformers (CDT), and TREBI (a planning-focused diffusion baseline).
As shown in the results tables, SafeDiffCon was the only method to achieve a 0% unsafe rate ($R$) across all tasks while simultaneously delivering the lowest control error ($J$).
1D Burgers' Equation Results
While standard imitation learning (BC) suffered from a 38% unsafe trajectory rate, SafeDiffCon eliminated all violations while maintaining an exceptionally low control error ($J = 0.0011$).
2D Incompressible Fluid Results
In the highly complex 2D fluid environment, other advanced baselines like CDT and TREBI failed significantly, yielding 30% and 18% unsafe samples respectively. SafeDiffCon achieved perfect safety (0% violation) and a superior control objective score of -0.3548.
Limitations and Future Work
While SafeDiffCon demonstrates flawless safety in simulated environments, the authors note several areas for improvement:
- Real-World Deployment: The current validation relies entirely on numerical solvers and data-driven simulators (like the KSTAR LSTM simulator). Testing on physical hardware remains an open challenge.
- Architecture Agnosticism: The current framework is tailored strictly to diffusion models. The authors plan to explore how these conformal adaptation techniques can be extended to other generative architectures (e.g., flow matching or autoregressive models).
- Tightening Safety Bounds: Currently, ensuring absolute safety can sometimes lead to overly conservative control strategies. Future work will focus on developing stricter coverage metrics that preserve safety without sacrificing control agility.
Summary updated