Exact Constraint Conditioning for Function-Space Diffusion Models of Reactor Fields

Generative models that sample whole functions, such as temperature or concentration fields, are increasingly used to infer what happens inside a physical system from a few measurements. Some of the most useful facts we could condition on are exact. A thermocouple reads exactly 452 K. Total mass is conserved exactly. Inlet flux equals the pump setting. Each such statement is an event of probability zero. The standard tool for conditioning these models, a guidance term derived from Doob's h-transform (a recipe for bending a random process so that it ends where you require), assumes a smooth likelihood. In practice people therefore replace each exact constraint with a narrow Gaussian band of width ε and hope that ε is small enough. We propose a sampler that treats exact constraints as exact. The idea comes from how probabilistic logic handles conditioning on measure-zero events: it keeps track separately of the part of the probability that vanishes and the part that stays finite. Applied to function-space diffusion, this lets us handle the part of the guidance that blows up analytically and learn only the part that stays bounded.

Industrial synthesis is the test bed, and it also motivates the work. Single-atom and cluster catalysts that behave well at lab scale sinter or collapse in large reactors because of internal temperature and concentration gradients (Mixed Plastics Wastes Upcycling with High-Stability Single-Atom Ru Catalyst; COx hydrogenation to methanol and other hydrocarbons under mild conditions with Mo3S4@ZSM-5). Today's machine-learning synthesis loops tune 5 to 11 scalar knobs and never see the internal field (Autonomous nanoparticle synthesis by design; Two-step machine learning enables optimized nanoparticle synthesis). A posterior over the internal field can answer the question scale-up actually turns on: given exact sensor readings and exact mass balance, what is the probability that some region of the reactor exceeds the sintering temperature? That posterior is only trustworthy if the constraints it was conditioned on actually hold.

Core Claim

Many hard physical constraints have finite codimension: a finite number $k$ of conditions pins them down. Examples are point sensor readings, integral conservation laws, and flux balances, all written $C(u)=c$ with $C$ mapping the field $u$ to $\mathbb{R}^k$. For these constraints, conditioning a function-space diffusion model is well defined. The reason is that the conditioning variable $C(u_0)$ lives in $\mathbb{R}^k$, where densities exist, even though the field itself lives in a space with no Lebesgue measure (Probability-Flow ODE in Infinite-Dimensional Function Spaces).

Conditioning is well defined, but learning it is still hard. The h-function $h_t(u)=p(C(u_0)=c\mid u_t=u)$ collapses toward a point mass as the diffusion time $t\to 0$. Its log-gradient therefore diverges, and a neural network asked to learn it end to end either cannot fit it or must be fed a soft surrogate. We propose to split the h-function as

$$\log h_t(u) = -\tfrac12\,(C\hat u_0 - c)^\top \Sigma_t^{-1}(C\hat u_0 - c) \;+\; r_t(u),$$

where the symbols are as follows. $\hat u_0=\hat u_0(u,t)$ is the model's denoised estimate of the clean field, obtained from the unconditional score. $\Sigma_t$ is the $k\times k$ covariance of $C(u_0)$ given $u_t$; it is computed from the forward noise schedule and goes to zero as $t\to 0$. $r_t$ is a bounded remainder that a guidance neural operator learns. The singular, "infinitesimal" leading term is handled in closed form. The network sees only $r_t$. At $t=0$ we apply the exact projection onto $\{C(u)=c\}$, taken in the geometry of the Cameron-Martin space, the set of directions along which the reference Gaussian can be shifted without becoming singular.

This construction is the function-space analogue of the $(r,n)$ pairs in Declarative probabilistic logic programming in discrete-continuous domains. That paper represents the probability of a point event as a real coefficient together with an infinitesimal order, so that it never divides by zero. It does this only for finitely many scalar random variables compiled into circuits. We carry the same idea into the guidance term of a diffusion model over fields.

The scope is deliberately limited to finite codimension. Conditioning on an entire boundary trace being equal to a given function is an infinite-codimension event. The Feldman-Hajek singularity discussed in Supervised Guidance Training for Infinite-Dimensional Diffusion Models suggests that such conditioning is generally ill posed unless the target lies in the Cameron-Martin space. We will test this empirically by increasing $k$, rather than claiming it away.

Relation to Prior Work

Two papers supply the machinery we reuse. Supervised Guidance Training for Infinite-Dimensional Diffusion Models derives an infinite-dimensional h-transform and trains a small Fourier neural operator (a network that acts on functions through their Fourier coefficients and so works at any grid resolution) to output the guidance term for Bayesian inverse problems. Its proofs require a differentiable likelihood potential, and noise-free point constraints fall outside them. Our method keeps its training recipe but changes what the network has to learn. Conditioning non-linear and infinite-dimensional diffusion processes shows that discretizing first and conditioning afterward becomes unstable as the mesh is refined. That is the reason we derive the leading term in function space before discretizing. Its results concern endpoint bridges of strong solutions and do not address constraints on functionals of the field.

Wavelet Diffusion Neural Operator motivates the gap. It steers PDE samples with gradients of smooth costs, which work well for objectives but say nothing about exact satisfaction. The probabilistic-logic and game-theory work on infinitesimals (Lexicographic probability, conditional probability, and nonstandard probability) contributes the conceptual move of tracking the order of vanishing instead of discarding it.

Graphoid Properties of Variants of Epistemic Independence Based on Regular Conditioning constrains us. It shows that independence properties can fail when probabilities hit zero. We therefore check whether our sampler's conditionals are consistent under sequential conditioning: conditioning on sensor A and then on sensor B should give the same result as conditioning on both together.

Research Program

The theoretical work has three parts. We will derive $\Sigma_t$ and $\hat u_0$ for linear $C$ under the trace-class Gaussian noise used by function-space diffusion. We will prove that $r_t$ stays bounded as $t\to 0$ when $C$ restricted to the Cameron-Martin space has full rank. Finally, we will show that the resulting sampler converges to the true disintegration of the data measure on $\{C=c\}$, and that the ε-relaxed h-transform tends to the same limit. That last result tells us exactly what the soft baseline is approximating.

For nonlinear $C$, such as a local Arrhenius heat-generation balance, we linearize $C$ at $\hat u_0$ at every step, and we report where this approximation breaks down. On the engineering side, we train unconditional function-space diffusion models with a shared Fourier-neural-operator architecture, then train guidance networks for $r_t$ on randomly sampled constraint values. Because the guidance network can be trained separately and is small, this matches the low parameter cost reported for SGT.

The reactor application uses a simulator that we build. It solves a 2D advection-diffusion-reaction tubular reactor with exothermic kinetics, swept over reactor scale and Péclet number (the ratio of transport by flow to transport by diffusion) to mimic scale-up. Each run gives a temperature field and a concentration field. The conditioning set consists of exact readings from 4 to 32 point sensors, a global mass balance, and the inlet flux. The downstream quantity is the posterior probability that temperature exceeds a sintering threshold anywhere in the reactor, and in the stressed regime this is a rare event.

Baselines

The naive reference point is to draw unconditional samples, project each one exactly onto the constraint set after the fact, and weight by nothing. This baseline satisfies the constraints trivially. Comparing against it shows how much of the posterior's structure comes from guidance during sampling rather than from the final projection. Our method must beat it on Energy Score and on calibration of the hotspot probability. Satisfying the constraints is not enough.

The strongest competitor is SGT with a Gaussian ε-relaxation of each exact constraint (Supervised Guidance Training for Infinite-Dimensional Diffusion Models). SGT is the strongest because it is the principled function-space guidance method in the file, and it reportedly outperforms the heuristic FunDPS on RMSE and Energy Score. The file gives no numerical values: no reported result found on Lacuna for SGT's RMSE or Energy Score values. For a fair comparison, SGT shares our unconditional model, guidance-network size, training steps, and number of sampler steps. In addition, ε is tuned over a log grid from $10^{-1}$ to $10^{-5}$, with the best ε chosen per task on validation data. That tuning budget equals the one we spend on our own learning-rate sweep. Beating this baseline means one of two things. Either our method has lower Energy Score and lower hotspot-probability error than the best-tuned ε at equal compute. Or it matches them while also keeping constraint violation at solver precision across resolutions, whereas the relaxed baseline's violation scales with ε.

FunDPS is included as the heuristic guidance method, run with the same settings. A discretize-then-condition baseline uses a fixed-grid diffusion model with exact linear-Gaussian conditioning on the grid, trained at each resolution. It tests the instability claimed in Conditioning non-linear and infinite-dimensional diffusion processes.

The key ablation removes the analytic leading term and asks the guidance network to learn the full $\log h_t$ with the same exact final projection. This isolates whether separating out the vanishing scale is what matters. A second ablation keeps the leading term but drops the learned remainder $r_t$, which tests whether a purely Gaussian, Tweedie-style approximation of the h-function is enough.

Why not just…?

Why not just use a narrow Gaussian band and anneal ε? This is the real threat, and the proposal is designed to settle it. The only direct evidence in the file against soft relaxation is from finite-dimensional rare-event inference. There, ordinary likelihood weighting failed to converge at event probability $10^{-5}$, while the symbolic infinitesimal method kept 100% accuracy (Declarative probabilistic logic programming in discrete-continuous domains). This does not prove the same failure occurs in function-space guidance. We expect the relaxed guidance to grow like $1/\varepsilon^2$ near $t=0$, which forces either step-size reduction or a fitting error, but this is a prediction, not a result. Our theory says the two methods share a limit. If a well-tuned annealed ε matches our posterior at equal sampler steps, the contribution shrinks to removing a hyperparameter and guaranteeing exact satisfaction, and we will report it that way.

Why not just discretize on a fine grid and condition exactly there? For linear constraints on a fixed grid this is easy and exact, which makes it a serious competitor at a single resolution. Two problems remain. The model must be retrained for each grid. And the cited bridge work reports that conditioning after discretization becomes unstable as resolution grows. Our resolution sweep, training at 32 points and testing at 32, 128, and 512, measures whether that instability appears for functional constraints and whether our sampler avoids it.

Why not just run black-box Bayesian optimization over scalar reactor settings, as ScatterLab does? ScatterLab reached its target nanoparticles in 41 experiments (Autonomous nanoparticle synthesis by design). At a fixed scale, scalar Bayesian optimization may well be sufficient. Our claim is narrower. When the knob settings found at small scale are transferred to a larger reactor, a constraint based on outlet measurements does not detect internal hotspots, while a posterior hotspot probability can. We test this in simulation by comparing Bayesian optimization with an outlet-only feasibility constraint against Bayesian optimization constrained by our posterior hotspot probability, both under the same simulator-query budget. The measure is the fraction of chosen settings that, when simulated in full, actually stay below the sintering threshold at large scale. If the outlet-only version does just as well, the synthesis motivation is weaker than we argue.

Proposed Experiments

We first validate on existing suites. On the SGT heat-equation and sparse-sine tasks, we set observation noise to zero, which turns them into exact point conditioning, and measure RMSE, Energy Score, and constraint violation. On PDEBench 2D diffusion-reaction (PDEBench: An Extensive Benchmark for Scientific Machine Learning), the task used by Probability-Flow ODE in Infinite-Dimensional Function Spaces, we condition on exact mass and on sparse sensors. We report PDEBench's conservation and boundary errors (cRMSE, bRMSE) alongside Sliced Wasserstein distance to a reference posterior. The reference posterior comes from long-run function-space MCMC on a subset of instances where that is affordable. As a calibration point for how much multiresolution operators gain over grid diffusion, Wavelet Diffusion Neural Operator reports MSE more than 25 times lower than DDPM on 1D compressible Navier-Stokes. We do not expect gains of that size from conditioning alone.

Three decisive checks follow. The first is a curve of constraint violation against grid resolution. Ours should stay at solver precision, ε-relaxation should plateau near ε, and discretize-then-condition should degrade with refinement. The second plots posterior quality against sampler steps for each ε together with our method. If the ε-relaxed curves never cross ours, the method is justified on cost. If they cross at moderate step counts, it is not. The third increases the number of constraints $k$ from 4 to 256. If $r_t$ stays bounded for constraints compatible with the Cameron-Martin space and degrades otherwise, this would show empirically where finite-codimension exact conditioning stops being meaningful.

On the reactor simulator, we sweep scale and Péclet number and score hotspot-exceedance probability against brute-force simulation of the posterior ensemble. The figure of merit is the Brier score at rare-event levels down to $10^{-4}$. We finish with the scale-transfer Bayesian-optimization comparison described above. The sequential-versus-joint consistency check from the graphoid concern runs on all tasks.