Constrained Diffusion Models with Primal-Dual Inference

Samar Hadou, Yigit Berkay Uslu, Alejandro RibeiroarXiv 2026 · arXiv

Here is a concise, engaging summary of the paper "Constrained Diffusion Models with Primal-Dual Inference" tailored for researchers and engineers.

TL;DR

This paper introduces Primal-Dual Inference (PDI), a novel framework that allows diffusion models to satisfy statistical (average) constraints during generation. By treating the Lagrangian dual variable as a dynamic state updated via dual ascent at each denoising step, PDI couples constraint enforcement directly with the sampling trajectory, outperforming static training methods and adapting gracefully to out-of-distribution constraint shifts.

What Problem Does This Paper Address?

Diffusion models are incredibly powerful at generating complex, high-dimensional data, but they struggle when the generated samples must satisfy specific statistical properties or expectations. For instance, in wireless resource allocation, a policy must maximize network utility while guaranteeing a minimum average service rate per user. In portfolio management, asset allocation must maximize returns under expected risk thresholds.

Standard diffusion models lack a reliable mechanism to enforce these distributional (average) constraints. Prior attempts either enforce strict pointwise constraints (which forces every single sample to be compliant, severely hurting diversity and optimality) or rely on a fragile "dual-training" loop that fixes a single dual multiplier before generation begins. This paper tackles the challenge of dynamically guiding the generation process toward statistical feasibility at inference time.

Methods

The authors frame constrained sampling as a saddle-point problem in the Lagrangian dual domain. Under this formulation, the optimal distribution takes the form of an entropy-regularized Gibbs distribution indexed by an optimal dual variable ($\lambda^*$).

Instead of freezing $\lambda$ during generation, Primal-Dual Inference (PDI) updates both the sample ($x_t$) and the dual variable ($\lambda_t$) jointly at each reverse diffusion step:

  1. Primal Step (Denoising): The sampler uses a single, dual-conditioned score network $s_\theta(x_t, t, \lambda_t)$ to denoise the current sample based on the current estimate of the multiplier.
  2. Dual Step (Ascent): The algorithm estimates the constraint violations of the clean data using Tweedie’s formula (which predicts the final clean sample from the current noisy state) and updates $\lambda_t$ via dual ascent.

To make this work, the authors train a single score network conditioned on $\lambda$ across a family of Gibbs distributions. They use an innovative rollout-based training procedure with a replay buffer to ensure the network generalizes well to the trajectories it will encounter during inference.

[Noisy Sample x_t, Multiplier \lambda_t] 
       │
       ├──► 1. Denoise via Score Network conditioned on \lambda_t ──► x_{t+1}
       │
       └──► 2. Estimate clean sample (Tweedie) ──► Calculate Violation ──► Update \lambda_{t+1}

Datasets

The framework was evaluated on three distinct stochastic optimization tasks using synthetically generated problem instances:

  • Constrained Mixture of Gaussians (MoG): A toy setup with 12 modes and 10 linear inequality constraints in a 30-dimensional space.
  • Wireless Resource Allocation: A network configuration with 200 transmitter-receiver pairs where the model generates power allocation vectors to maximize ergodic sum-rate under minimum rate constraints.
  • Portfolio Management: An asset allocation problem involving 500 assets across 10 sectors, aimed at maximizing expected returns subject to per-asset variance-risk budgets.

Key Insights and Ideas

  • Average vs. Pointwise Constraints: Enforcing constraints on average across an ensemble of samples yields significantly better objective values than forcing every individual sample to be feasible. Pointwise enforcement is overly conservative and discards optimal solutions.
  • The "Damping" Effect of Noise: Theoretical analysis (and empirical validation) shows that early, high-noise diffusion steps act as a buffer. They smooth out the score field and damp initial errors in the dual variable, giving $\lambda_t$ time to converge to a stable neighborhood before the generation process becomes highly sensitive to details.
  • Out-of-Distribution (OOD) Robustness: Because the score network is explicitly conditioned on $\lambda$, PDI can adapt to shifted or unseen constraint levels at inference time without retraining. Changing the constraint simply alters the trajectory of $\lambda_t$, which the model naturally tracks.

Key Results

  • Mixture of Gaussians: PDI achieved perfect constraint feasibility while maintaining a vastly superior objective value and higher mode coverage compared to Projected Diffusion Models (PDM) and Primal-Dual Langevin (PDL) dynamics.
  • Wireless Allocation: PDI provided the best balance between maximizing the sum-rate and minimizing constraint violations. It significantly outperformed standard Dual Training (DT), especially when tested on out-of-distribution constraint targets ($r_{min}$ shifts), where DT's performance degraded rapidly.
  • Portfolio Management: PDI successfully navigated the tradeoff between risk and return, maintaining low mean violations and high diversification ($N_{eff}$) compared to unconstrained and pointwise baselines.

Limitations and Future Work

  • Time-Average Guarantees: The theoretical convergence proofs apply to the time-average of the dual variables along the generation trajectory, rather than guaranteeing that the final iterate $\lambda_T$ or the exact terminal distribution matches the optimum perfectly.
  • Hyperparameter Sensitivity: PDI requires careful, problem-specific tuning for the dual-variable prior distribution used during training, as well as the entropy regularization strength ($\beta$).
  • Future Directions: The authors point to scaling PDI up to larger real-world datasets, exploring adaptive dual step sizes ($\eta_t$), and extending the framework to handle chance-constrained optimization problems.

Summary updated

Abstract

This paper develops constrained diffusion models with primal-dual inference (PDI) to sample from optimal distributions of entropy-regularized optimization problems with \emph{average} constraints. We formalize constrained sampling in the Lagrangian dual domain, where the optimal distribution takes the form of a Gibbs distribution indexed by the optimal dual variable. Rather than estimating this dual multiplier before sampling and freezing it throughout generation, PDI jointly infers the optimal primal distribution and its parametrizing dual variable. Each reverse diffusion step denoises using the score field associated with the current multiplier and then updates the multiplier through dual ascent using the estimated constraint violation of the denoised samples. To enable this conditional score field, we train a single dual-conditioned score network over the family of Gibbs distributions induced by the dual variables encountered during inference. We prove that the time average of the dual variables generated along the inference trajectory converges to a neighborhood of the dual optimum and bound the effect of residual dual mismatch on the terminal distribution through schedule-dependent stability factors. We evaluate PDI on constrained sampling from a mixture of Gaussians, wireless resource allocation, and portfolio management.
BibTeX
@misc{hadou2026constrained,
  author = {Samar Hadou and Yigit Berkay Uslu and Alejandro Ribeiro},
  title = {{Constrained Diffusion Models with Primal-Dual Inference}},
  year = {2026},
  eprint = {2606.17192},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.17192},
}

Loading related content...

Figure