Manuscript Offprint

arXiv:2610.38648

Logical Guidance of Stochastic Interpolants

Gerrit Gerhartz, Francesco Alesiani, Jonathan Warrell, Henrik Christiansen, Matheus Ferraz, Mathias Niepert

Gerrit Gerhartz NEC Laboratories Europe ITP, Heidelberg University

Francesco Alesiani NEC Laboratories Europe

Jonathan Warrell NEC Laboratories America

Henrik Christiansen NEC Laboratories Europe

Matheus Ferraz NEC Bio B.V.

Mathias Niepert NEC Laboratories Europe University of Stuttgart

ABSTRACT

Guidance and composition of generative models have applications in visual design, chemistry, and biology. Logical guidance composes conditional scores exactly for diffusion models. However, Flow Matching (FM) and Stochastic Interpolants (SI) learn velocity fields. We show that negation and exclusive disjunction admit exact conditional velocity composition on any interpolant, whereas conjunction, and therefore any formula containing one, is exact on Gaussian paths but in general incurs a drift-interaction error, so composed velocities need not sample the logical target. LOGSI solves this by using score-based re-equilibration as our principled mechanism and falling back to the Gaussian-path velocity rule as an approximate transport predictor. In non-Gaussian bridge problems, generation alternates transport steps with score re-equilibration steps. On image transfer (EMNIST to CMNIST, CelebA) and QM9 source-to-target molecular editing with logical attribute constraints, LOGSI improves rule conformity at the same network-evaluation budget over composed-velocity baselines, while also improving fidelity on the image tasks. More broadly, LOGSI applies wherever stochastic interpolants need guidance and logical combinations of constraints are natural.

1 INTRODUCTION

Guidance and composition are central to generative AI, enabling controlled generation across domains ranging from visual design to chemistry and biology (Saharia et al., 2022; Hoogeboom et al., 2022; Watson et al., 2023; Skreta et al., 2025; Blohm & Garg, 2026). Guidance steers a model toward desired properties, while composition combines multiple conditions or concepts to produce outputs that satisfy more complex requirements. Most existing methods target diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song et al., 2021; 2020), where one endpoint is a fixed Gaussian, and the reverse dynamics depend only on the score. A natural extension is to lift logical guidance to stochastic interpolants (SI) (Albergo et al., 2025), which unify diffusion and flow matching (Lipman et al., 2023) and are not tied to a Gaussian endpoint. Classical guidance (Dhariwal & Nichol, 2021; Ho & Salimans, 2022) for SI has been studied (Feng et al., 2025; Jiang et al., 2026), but logical composition of atomic conditions in this regime remains open. We focus on domain transfer (Liu et al., 2023): an interpolant transports a source distribution ρ0\rho_0 to a target ρ1\rho_1, samples can be initialized from concrete source instances (Albergo et al., 2024), and guidance enforces a Boolean formula φ\varphi over target attributes. For example, we may edit a source molecule by adding a geometry (e.g. rings) and an atom-composition constraint (e.g. oxygen).

Throughout, we distinguish between unconditional velocity and score fields (or velocities and scores for short), denoted by vt(x)v_t(x) and st(x)s_t(x), and conditional velocity and score fields, denoted by vt(x∣c)v_t(x \mid c) and st(x∣c)s_t(x \mid c), which steer generation toward samples satisfying a constraint or property cc.

The core challenge is that SIs learn conditional velocities, but it is not clear a priori how these fields should be combined to enforce a Boolean formula φ\varphi. For conditional scores, Alesiani et al. (2026) (LogDiff) derive exact recursive composition rules. We show that the analogous velocity

Figure

References (78)

  • Stochastic interpolants: A unifying framework for flows and diffusions
  • Stochastic interpolants with data-dependent couplings
  • Logical guidance for the exact composition of diffusion models
  • Composition of pretrained diffusion models: A logic-based calculus
  • Emnist: Extending mnist to handwritten letters
  • Diffusion schrödinger bridge with applications to score-based generative modeling
  • Diffusion models beat gans on image synthesis
  • Reduce, reuse, recycle: Compositional generation with energy-based diffusion models and mcmc
  • On the guidance of flow matching
  • Coind: Enabling logical compositions in diffusion models
  • Deep residual learning for image recognition
  • Classifier-Free Diffusion Guidance
  • Denoising diffusion probabilistic models
  • Equivariant diffusion for molecule generation in 3d
  • Guided streaming stochastic interpolant policy (opens arXiv in a new tab)
  • The MNIST database of handwritten digits, 1998
  • Flow matching for generative modeling
  • I2sb: Image-to-image schrödinger bridge
  • Compositional visual generation with composable diffusion models
  • Deep learning face attributes in the wild
  • Sit: Exploring flow and diffusion-based generative models with scalable interpolant transformers
  • Film: Visual reasoning with a general conditioning layer
  • Quantum chemistry structures and properties of 134 kilo molecules
  • Enumeration of 166 billion organic small molecules in the chemical universe database gdb-17
  • E (n) equivariant graph neural networks
  • Diffusion schrödinger bridge matching
  • The superposition of diffusion models using the itô density estimator
  • Deep Unsupervised Learning using Nonequilibrium Thermodynamics
  • Denoising Diffusion Implicit Models
  • Generative modeling by estimating gradients of the data distribution, 2020 (opens arXiv in a new tab)
  • Score-based generative modeling through stochastic differential equations
  • Nature, 620(7976):1089–1100, 2023
  • Guided flows for generative modeling and decision making (opens arXiv in a new tab)
  • For each disjunction one uses the OR-CI rule if the subformulas are conditionally independent given $x_{t}=x$, and the OR-ME rule if they are mutually exclusive
  • Taking $c$ to be the trivial conditioning event gives $v_{t}(x)=a_{t}x+b_{t}s_{t}(x)$
  • Comparing with $v_t(x \mid \varphi) = \mu_t(x \mid \varphi) - \dot{\gamma}(t)\gamma(t) s_t(x \mid \varphi)$, the score terms cancel and
  • Let $t \in (0,1)$ and $x$ with $p_t(x) > 0$, and let $\psi, \chi$ be subformulas with $p_t(\psi \mid x) = \widehat{\pi}(\psi) > 0$
  • These identities hold for any interpolant $I$, noise schedule $\gamma$, coupling $\pi$ and endpoints $\rho_0,\rho_1$, with no independence or exclusivity assumption
  • Write $q := \widehat{\pi}(\psi)$, $r := \widehat{\pi}(\chi)$ and $b_t := -\dot{\gamma}(t)\gamma(t)$, so that Equation (10) reads $v_t(\cdot \mid c) = \mu_t(\cdot \mid c) + b_t s_t(\cdot \mid c)$ with $b_t$ independent of the conditioning event
  • Adding $b_{t}$ times the score identities to the drift identities yields Equations (40) and (41)
  • Expanding the product in Equation (44) and using linearity of the conditional expectation
  • Conditional independence also makes the composed score exact, so Equation (35) applies and
  • All four cells then carry positive mass, so the cell-conditional drifts $d_t(a_1, a_2)$ are well defined
  • Conditional independence of $A_{1},A_{2}$ together with $A_{i}^{2}=A_{i}$ gives
  • Since $p_1 p_2 > 0$, the bias vanishes if and only if $R_t(x) = 0$, equivalently $(1 - p_1)(1 - p_2)\Delta_t(x) = 0$, and the two limiting cases in the statement follow by inspection of the prefactor
  • Exact score composition equation 7 therefore propagates to the drifts, $\dot{\mu}_t(x \mid \varphi) = \mu_t(x \mid \varphi)$, i.e
  • Fix cluster centres $v_1 = 0, v_2 = 1, v_3 = 2, v_4 = 10$ and a small cluster half-width $\ell/2$ with $\ell \in (0,1)$ (so the intervals $B_j = [v_j - \ell/2, v_j + \ell/2]$ are disjoint)
  • At $t=\frac{1}{2}$, $x_{t}=(x_{0}+x_{1})/2$, so a change of variables gives the conditional density of $x_{t}$ given $x_{1}$:
  • By Bayes' rule
  • For $\gamma \equiv 0$ and linear I
  • Since each cluster $B_j$ is symmetric around its centre $v_j$ and receives uniform weight, $\mathbb{E}[x_1 \mid x_t = 5, x_1 \in B_j] = v_j$ exactly, hence:
  • The four clusters are exactly the four cells of the atom pair, $B_1 = c_1 \wedge c_2$, $B_2 = c_1 \wedge \neg c_2$, $B_3 = \neg c_1 \wedge c_2$ and $B_4 = \neg c_1 \wedge \neg c_2$, with cell-conditional drifts $d_t(a_1, a_2) = 2(v_j - 5)$ for the corresponding cluster j
  • parallelogram
  • Under standard regularity and ergodicity assumptions, these dynamics therefore re-equilibrate the sample toward the desired logical marginal, independently of the preceding transport along $\tilde{v}$
  • Their Theorem 1 gives an Itô estimator for $\mathrm{d}\log p_t(x \mid c_i)$
  • Crucially, matching the increments $\mathrm{d}\log p_t(x \mid c_i)$ along the trajectory only pins down terminal densities up to the initial gap: integrating from 0 to 1 gives
  • This is true for standard diffusion models, where generation begins from a shared Gaussian independent of the condition, but fails in our bridge setting: we do not start from noise but from explicit samples $x_0 \sim \rho_0$, and in general $p_0(x \mid c_i) \neq p_0(x \mid c_j)$
  • >AdamW + cosine annealing to 0 over training</td></tr><tr><td>CFG dropout</td><td colspan=
  • ><tr><td>Dataset</td><td>Attribute</td><td>Accuracy</td></tr><tr><td rowspan=
  • A time-aware classifier for posterior weights in OR / negation, and a held-out evaluator for the conformity metric is also trained (the molecular experiments uses rdkit as conformity metric)
  • Both fields are U-Net-style ResNets with base width 96, conditioning dimension 64, and 3-channel 28×28 inputs
  • This model is trained only on clean Colored MNIST and is not used inside the sampler
  • CelebA's 40 binary attributes are embedded with a multi-label encoder (per-attribute 3-way tables: negative / positive / wildcard) and summed with a sinusoidal timestep embedding
  • We train a SiT model on the same latent geometry (patch size 2, hidden size 192, depth 6, 6 heads) with timestep conditioning only
  • Accuracy of the classifier is reported in Table 3 (Only the tested attributes are reported)
  • We use the EDM-stabilised EGNN variant with hidden size 256, depth 9, and 5 atom-type channels
  • It is trained on noisy graphs $(x_t, h_t)$ with the same bridge noise as the generator; atom posteriors for OR / AND¬ are sigmoids of the corresponding logits at the current $t$
  • Conformity is defined only on RDKit-valid molecules
  • On CMNIST and CelebA the evaluator is the ResNet18 classifier, see last section
  • Generated and reference images are bilinearly resized to 128×128 and clamped to $[0, 1]$ before feature extraction
  • for each $\varphi$ in the evaluation schedule, the reference set is the subset of real Colored MNIST training images whose ground-truth digit and colour satisfy
  • We report the FID scores with the expression-conditioned references (up to 5,000 reals)
  • The validity rate is the fraction of samples for which this pipeline succeeds
  • ring-based labels via RDKit ring perception (has_rings, etc.) and element-presence labels by atomic number
  • As a baseline, we calculate the mean Kabsch-RMSD between two random QM9 molecules
  • When multiple training or evaluation seeds are run, main-text error bars aggregate across seeds for training and evaluation
  • As an ablation we instead use the variance-exploding (VE) signal-to-noise (SNR) rule of Song et al. (2021), originally proposed for Langevin correctors in score-based diffusion sampling:
  • Because this choice introduces the additional hyperparameter $r$, we grid-search $r \in \{0.05, 0.1, 0.16, 0.2\}$ and report the value $r = 0.1$ with highest conformity in the case of the QM9 dataset