Authors and publishers can request removal at any time via Copyright infringement; we act within 48 hours.
Abstract
Conditional Flow Matching (CFM) represents a fast and high-quality approach to generative modelling, but methods for steering CFM during inference toward energy- or reward-tilted distributions remain underdeveloped. For diffusion models, Feynman-Kac (FK) steering provides a flexible particle-based framework for such inference-time control. In this work, we derive FK steering for CFM and show how stochastic inference can be incorporated while preserving the underlying probability path. We evaluate our approach on a set of synthetic tasks, including the generation of tilted distributions in a high-dimensional space, which is a particularly challenging case for steering approaches. We then apply Feynman-Kac steered CFM to the problem of generating transition states of chemical reactions consistent with the stereochemistry of the given reactant and product, leading to geometric constraints of the viable reaction pathways connecting reactants and products. We further apply FK to steer a pretrained model towards low forces on the semiempirical g-xTB potential energy surface. FK steering improves transition state generation from reactant and product SMILES alone without retraining while also highlighting ambiguity in assigning stereodescriptors to transition states. Code to reproduce this study is available open-source at https://github.com/heid-lab/fkflow.
Summary
This paper extends Feynman–Kac (FK) steering, a particle-based method previously used to control diffusion models during inference, to Conditional Flow Matching (CFM). CFM is a fast and increasingly popular generative modelling technique, but unlike diffusion models it lacked a flexible way to steer generated samples toward energy- or reward-tilted distributions without retraining. The authors derive how FK steering can be applied to CFM, including how to incorporate stochastic inference while keeping the underlying probability path intact, and test the approach on synthetic tasks such as generating tilted distributions in high-dimensional space.
The main application is generating transition states (TS) of chemical reactions—key structures for understanding reaction pathways that are normally expensive to compute with quantum mechanics. The authors use FK-steered CFM to produce TS geometries that are consistent with the stereochemistry (chirality) of given reactant and product molecules, a task complicated by stereocentres that can form, break, or invert during a reaction. They also use FK steering to guide a pretrained model toward structures with low forces according to a semiempirical potential energy surface (g-xTB). The method improves TS generation from reactant and product SMILES alone, without retraining the underlying model, and in doing so reveals ambiguity in how stereodescriptors are assigned to transition states.
Plain-language summary by The Gufo; the paper is the authors’ own text.
Key findings
The paper derives Feynman–Kac steering for Conditional Flow Matching, extending a technique previously limited to diffusion models, while preserving the underlying probability path.
FK steering is demonstrated on synthetic tasks, including generating energy-tilted distributions in high-dimensional, multi-modal settings that are particularly challenging for steering methods.
Applied to transition state generation, FK steering improves consistency with the stereochemistry of reactants and products using only SMILES input, without retraining the model.
FK steering can also guide a pretrained model toward low-force structures on the g-xTB potential energy surface and highlights ambiguity in assigning stereodescriptors to transition states.
The full paper
Introduction
Since its introduction by Lipman et al.,1 Conditional Flow Matching (CFM) has seen several interesting applications, ranging from image,1 audio2 and video3 generation to decision-making,4 time series modelling,5 protein modelling6,7 or molecular structure design,8 amongst others. CFM transforms samples from a source distribution (such as random noise) to samples following a given target distribution (such as images or molecular structures) by modelling probability paths via vector fields. It largely improves on diffusion-based methods both in quality and speed, establishing CFM as a popular generative method.1
For many current applications, the ability to adjust the distributions produced by a CFM model to conform to certain properties has gained importance. This can range from improving image quality for image generation tasks to making chemical structure geometries more physically plausible. Such a task is generally formulated as tilting a model's output distribution with an energy potential- or reward-function. There are several approaches to fine-tuning diffusion and flow matching models to produce samples related to some reward function. Primarily, diffusion allows direct back-propagation over the sampling path.9 In a different direction, stochastic optimal control-based frameworks have been used to fine-tune a model to sample from a tilted distribution, both for diffusion10 and flow matching.11,12 Inference-only steering methods for diffusion models generally fall either under gradient based guidance13 or sequential Monte Carlo (SMC) steering.14,15 Using gradients in the guidance generally leads to a faster convergence but only works for differentiable reward functions. SMC methods have been unified and extended into one framework through Feynman–Kac (FK) steering.16 FK in particular also extends Importance Sampling (IS) which can be used trivially on any distribution to generate tilted samples, although the latter often struggles with distributions in high-dimensional and multi-modal settings. Yet, FK steering has not been extended to CFM and is currently only used to steer diffusion models.
A particularly promising but challenging application for steering methods is the generation of chemical structures, with a breadth of physics-inspired restrictions to tilt the target distribution to samples with low energies, bond length or angle constraints, or correct chirality, where many relevant molecular structures can occur left or right-handed causing a difference in biological activity. Non-steered generative models have shown large success in conformer generation,17–19 the task of generating geometries of molecules that lie at local energy minima. This success has been extended to transition state (TS) prediction or refinement, first using diffusion20 and then using flow matching21–23 models, the latter offering most importantly much faster inference time. The generation of transition state structures is a highly relevant task in chemical reaction modelling. TSs are first order saddle points that lie on a minimal energy reaction pathway on a potential energy surface. They are normally determined through quantum mechanical calculations that are expensive to perform. CFM is able to model the generation of geometries as a transformation of probability distributions.
Generating geometries that conform to right chirality has been a tricky task in conformer generation. Chiral molecules cannot be transformed into their mirror image by rotation and translation alone, which presents a difficulty for the reflection-equivariant (E(3)) architectures used for these generative tasks: with an isotropic prior and no stereochemical input, such a model assigns the same probability to a structure and to its mirror image. GeoMol24 checks every tetrahedral centre against its stereodescriptor and reflects the local structure around it when it needs to be corrected. A simpler choice to handle the problem of chirality in conformer generation is simply flipping a conformation if a geometry with the wrong chirality was predicted.18 A global reflection inverts all stereocenters at once, so it can turn RR into SS but not into RS.
Ref. 18 tried implementing proper chirality handling in a CFM setting by implementing an SO(3)-equivariant architecture, but found that it was outperformed by simple flips. There are several methods specific to graph neural networks to deal with tetrahedral chirality by reducing the invariance of message passing aggregation to be aware of the order of neighbours.25,26 This family of approaches has recently been revitalised: concurrently to our work LoQI27 used graph augmentation for chirally aware conformer generation, and RitS28 later extended this approach to transition state generation. Torsional Diffusion19 only generates torsion angles on top of local structures from RDKit, so the tetrahedral configurations supplied by RDKit are kept by construction. Meanwhile E/Z configurations are not enforced.
In the more complex task of biomolecular modelling there have been recent advances in chirality awareness. Ref. 29 used Feynman–Kac steering to reduce hallucinations including incorrect stereochemistry from a diffusion generative model. Ref. 30 improved accuracy in chiral centres by adding chirality based angle gradients as features.
The difficulty of generating stereochemically consistent geometries is exacerbated in the setting of TS generation. Stereocentres that are not involved in the reaction keep their configuration and can be checked as in conformer generation. Stereocentres can however also lie in the reaction core where they are formed, destroyed, or inverted/substituted. In RDB7,31 this case applies to about two thirds of the stereocentres. The geometry of the generated TS must be consistent with the given reactant and product stereoisomers simultaneously. As such the technique of flipping into position is out of question except for simple cases where chiral centres are not actively involved in the reaction. Ref. 21 started the generation from reactant and product geometries, so that the TS inherits their stereochemistry; this requires 3D reactant and product structures in conformations close to the reaction path as input. Models that start from the molecular graph alone avoid this requirement and need to take the stereochemistry from the graph. TSDiff20 and GoFlow22 pass RDKit chirality tags as atom features, but in a reflection-equivariant network these labels cannot distinguish a structure from its mirror image, and whether they inform the relative configuration of several stereocentres has not been evaluated. RitS28 augments the graph with stereochemical edges and retrains the model; alternatively, stereochemistry can be imposed at inference time. We therefore use stereochemically consistent TS generation from reactant and product graphs with stereodescriptors as a focused application of steering: the target property is unambiguous to evaluate, it is absent from our base model which receives no stereochemical input, and it can be imposed through a simple potential without retraining.
In this work, we introduce for the first time a framework for using Feynman–Kac (FK) steering16 on CFM models to steer predictions to a tilted distribution. Concurrently to our research, ref. 32 recently developed guidance of CFM models towards a tilted distribution by Monte Carlo sampling a guidance vector field. Our approach falls outside of the framework defined in their work, and we include an experimental comparison and highlight the difference in methodology. We then apply FK-CFM to stereochemically consistent transition-state generation. This is achieved by steering GoFlow22 with a potential based on tetrahedral volumes around tetrahedral chiral centres, a potential for E/Z double bonds, and a force potential on g-xTB, and we test the predictions as starting points for TS searches with g-xTB and DFT. To our knowledge, this is the first inference-time steering approach for CFM to demonstrate this level of chirality-aware control on TS generation from 2D graph information alone. We also provide an experimental analysis of FK's ability to isolate modes in a high-dimensional setting, a difficulty that was explicitly discussed in ref. 32.
Methods
We will first summarise flow matching notions in Section 2.1. Section 2.2 discusses the equivalence of flow models with a type of Itô stochastic differential equation (SDE). In Section 2.3 we present Feynman–Kac steering as it applies to this setting.
Conditional flow matching
Conditional Flow Matching (CFM)1 learns a time-dependent velocity field to transport a known source distribution p0 (often chosen to be ) to a target distribution p1. This is done through a flow ψt(x), defined by the flow ODEthat maps X0 ∼ p0 to Xt = ψt(X0). If Xt ∼ pt we say that vt(x) generates the probability path pt. Equivalently, pt and vt satisfy the continuity equation .33
How a probability path and thus a flow is chosen for a pair of distributions (p0, p1) is often a modelling choice, but commonly an interpolation of the corresponding random variables is used:for X0 ∼ p0, X1 ∼ p1 and schedules αt, βt. To ensure consistency with the goal of transforming p0 into p1, these schedules must be chosen such that α1 = β0 = 1 and α0 = β1 = 0. For example, the optimal transport schedule Xt = (1 − t)X0 + tX1 satisfies these conditions. In this setting we say that a flow ψt(x) or the velocity field vt(x) generates the path between p0 and p1 with schedules αt and βt.
A neural network vtθ is trained to approximate vt. Since vt is intractable, CFM regresses on the conditional velocity vt(Xt|X1,X0) = tX1 + tX0, which leads to the same gradients with respect to θ:1
Stochastic differential equations
The Feynman–Kac steering framework of ref. 16 was formulated only for diffusion models. Technically, the similarity in situation does allow direct application of the steering to the CFM, but the deterministic nature of the flow would induce a reduction in available particles at every resampling step. To combat this, we aim to inject stochasticity into the flow model. Fig. 1 depicts a non-steered CFM model versus FK steering with and without stochasticity, to illustrate the difference.
Fig. 1 Illustration of FK steering on a toy flow matching model from a Gaussian distribution (bottom) towards a mixture of two Gaussians (top). Tilting with an energy potential function isolates one of the modes (dashed line). FK steering on a deterministic flow model converges to the correct tilted distribution but leads to a collapse in the number of active paths and a lack of exploration (middle). This is alleviated by injecting a diffusion process that maintains the marginals by correcting the flow velocities (right).
We write stochastic flow models as Itô SDEs dYt = wt(Yt)dt + σ(t)dBt with a drift , a scalar noise schedule σ(t) ≥ 0 and a standard Brownian motion Bt in . A CFM model corresponds to wt = vt and σ ≡ 0. Diffusion can be injected without changing the underlying marginals by correcting the drift with the score ∇ log pt:
Theorem 1 (ref. 34): it is assumed that vt(x) is locally Lipschitz and generates the path pt between p0 and p1 with schedules αt and βt. Then for any noise schedule , the stochastic process Yt defined by the SDEis distributed according to the probability path pt, i.e. Yt ∼ pt.
In the case of a Gaussian prior, the score ∇ log pt(x) can be expressed directly in dependence of the velocity field:
Proposition 2 (ref. 11, B.4): it is assumed that vt(x) is the marginal vector field associated with the conditional flow matching pathXt = αtX1 + βtX0 ∼ ptbetween and p1 with schedules αt and βt, i.e.
Assuming that vt is locally Lipschitz then
Proofs for Theorem 1 and Proposition 2 are given in the SI. The combination of Theorem 1 and Proposition 2 lets us express the CFM ODE as an SDE with any choice of diffusion schedule.
Corollary 3: it is assumed that vt(x) is locally Lipschitz and generates the path pt between and p1 with schedules αt and βt. Then for any , the stochastic process Yt defined by the SDEis distributed according to the probability path pt, i.e. Yt ∼ pt.
In the case of flow matching with non-Gaussian priors, the score needs to be obtained in a non-analytical form. This can be done for any xt by integrating the continuity equation backwards along [0, t]. Since this would incur heavy computational cost at each Euler–Maruyama step, one can instead integrate a batch of paths from the trained CFM model and train a separate score model on the scores obtained. Methods such as [SF]2M35 provide a way to train a flow and score model concurrently without simulation through a stochastic regression objective.
Feynman–Kac steering
Feynman–Kac (FK) steering16 is a framework for steering diffusion models to a tilted distribution. By defining a reward function and a steering temperature , a diffusion model generating samples from a distribution p1(x) is tilted to produce samples from the unnormalised distribution p1(x)·exp(−λU(x)) during inference, with the goal of producing samples with low values of U(x). This is done by concurrently simulating a set of k particles and resampling them based on intermediate potentials Gi. While this framework has originally been formulated for diffusion models, we will describe how it can be adapted to CFM inference.
At each step i, k particles xi[k] are proposed through the model based on the previous paths (x0[k],…,xi−1[k]), either through an ODE integration step of the flow model or through a Euler–Maruyama step on the SDE defined in Theorem 1. Based on the path of a particle j, potentials Gi(x0j,x1j,…,xij) are chosen. The particles xi[k] are then resampled based on these potentials. These basic steps are illustrated in Fig. 2.
Fig. 2 Illustration of the main steps in an iteration of Feynman–Kac flow matching inference. Based on the velocity vectors from a flow matching model (1) an energy potential is evaluated at the one-shot approximation for t = 1 (2). The particles are then resampled (3) before the SDE integration step (4) which reuses the previously calculated velocities.
Particle systems for which along a full path (x0j,x1j,…,xnj) the potentials fulfilconverge to produce samples from the tilted unnormalised distribution p1(x)·exp(−λU(x)) as k → ∞. The specific speed at which this convergence occurs does however depend on the potentials themselves. Following ref. 16 we first define an intermediate reward function rij := r(xij,ti) and then define the potentials through one of three schedules:
• Difference: Gi = exp(−λ(rij − ri−1j)) with r−1j := 0,
• Max: ,
• Sum: ,
And the final potential is always chosen as so that the consistency condition (6) holds. It is noted that good intermediate rewards at xij at step i should aim to encompass the distribution of the reward for the samples obtained through xij as closely as possible. The schedules mentioned favour high-reward, i.e., low-potential, regions. If one wants to more accurately reflect the full tilted distribution, these schedules should be adapted to comply with this task. In particular, one should aim to avoid eliminating low-reward areas early on, e.g. by adding some tempering or annealing into the schedule.
The simplest way to define intermediate rewards is by evaluating the final reward function at the current point i.e. r(xij,t) = U(xij). This is cheap since no new position needs to be sampled, but has only limited relevance in estimating the reward for where paths from this position will end up. Ref. 29 used this method to implement chirality steering.
CFM instead allows evaluating the reward at the Euler one-shot evaluation of the flow model starting from position xij. That is, using vtiθ(xij), we can calculate yij = xij + (1 − ti)vtiθ(xij) as an approximation to the final value of the flow model continuing on from xij. We then define r(xij,t) = U(yij). Note that even though vtiθ(xij) is used in this formula, its use does not cause any additional computational cost, since it needs to be calculated for the next ODE/SDE step, see Algorithm 1. Therefore, depending on the straightness of the paths generated by the flow matching model, this method can lead to a cheap but effective estimation of the final reward that is obtainable starting at xij. In practice and in particular with the sum potential schedule, we often ended up multiplying this reward by an additional time dependent factor to increase steering at later inference steps when this approximation is more accurate and decrease it at early inference steps. For example, when in total L resampling steps are performed, at resampling step we use the intermediate reward with the harmonic sum . We call this the harmonic sum schedule and used it throughout the experiments listed below.
Higher order estimations can also be used as long as no diffusion occurs between the velocity vectors used for this approximation. For example, additionally using vti−1θ(xi−1j), one can get a second order approximationas long as step i − 1 is an ODE integration step and not an SDE step.
For more accuracy in the potential it is also possible to compute approximations of the final sample position with more than one step at the expense of model evaluations that would not occur in the unsteered case. This is especially relevant in cases where one knows the flow to be strongly non-linear.
In use cases similar to GFM32 where one additionally has samples z from the target distribution it is also possible to directly use importance sampling with, for most CFM methods, tractable pt(·|z) and a time annealed potential to resample, although this option has not been explored by us.
Results
We first analyse FK's ability to isolate modes in a high-dimensional setting in a benchmark in Section 3.1. We then compare FK to guidance flow matching32 on the synthetic datasets used in that work in Section 3.2. As the main application, we steer a transition state (TS) generation model with a combination of a cheap geometric potential for enforcing stereochemical consistency and an expensive physical potential, the forces from the semi-empirical method g-xTB 3.3.
High-dimensional mode isolation
Importance Sampling (IS) techniques deal particularly poorly with high-dimensional and multimodal settings. To test the performance of FK-CFM in such a setting, we perform the following benchmark on synthetic datasets. In d dimensions, we train an [SF]2M35 model on a flow from uniform distribution on the hypercube [−1,1]d to a distribution of isotropic Gaussians with small variance centered around the corners of the hypercube [−2,2]d. In this setting, the number of modes increases exponentially in dimension. At the same time each individual mode becomes less likely as the dimensions increase.
We try to isolate one of the Gaussians by tilting with potentials of the formandThe indicator potential I is thus a discontinuous step function that tilts mass away from ([0,∞)d)C, while the distance potential D is a continuous function that achieves the same purpose. For large values of w, only the Gaussian centered at (2, …, 2) should remain. We measure the success of the steering based on the relative number of samples that land in [0,∞)d as well as the sliced Wasserstein-2 distance to the target Gaussian. We compare FK with IS using the same number of particles.
We find that on the indicator potential, FK outperforms IS but suffers from a similar performance degradation once the number of modes is larger than the number of simulation particles, as shown in Fig. 4. For the continuous distance potential, however, FK uses the additional reward structure much more effectively and remains strong at the particle counts considered here, including in higher dimensions (Fig. 3). This is especially noteworthy given the difficulties with high-dimensional distributions reported for guidance methods for flow matching,32 which our FK implementation overcomes.
Fig. 3 Success rate (left) and sliced Wasserstein-2 distance (right) for FK and IS on the d-dimensional benchmark for 32 particles using the indicator and distance potentials. Shown are the median and quartiles over 10 runs. All inference used 50 integration steps with FK reweighing every 3 steps for FK.
Fig. 4 Success rate for FK with the indicator potential for different particle system sizes. Shown are the median and quartiles over 10 runs. Inference used 50 integration steps with FK reweighing every 3 steps.
Comparison with guidance
We evaluated FKS on three pairs of source and target distributions of synthetic 2D datasets in alignment with ref. 32: circle to S-curve, uniform to 8 Gaussians and 8 Gaussians to Moons, see Fig. 5. We trained a CFM model and a minibatch optimal transport CFM (OT) model36 based on their configuration and evaluated Guidance Flow Matching (GFM) and FK using the same two models. For FK we used deterministic inference only without diffusion injection to avoid training a separate score model. We chose to include OT since it naturally generates straighter paths which increases the accuracy of the reward estimation. For GFM we used 10 240 samples from the target distribution for the Monte Carlo sampling of the guidance field. We ran all models and steering methods with 40 integration steps on 1024 samples. The results can be seen in Fig. 5 and Table 1. For details on the parameters used and an extended plot, see the SI. As expected, using FK without stochastic inference results in less distinct samples although all 1024 are still present. We find that FK managed to achieve lower Wasserstein-2 distances than GFM without reliance on using additional target samples during inference or training an additional model. However, it is important to note that we did not perform a rigorous hyperparameter optimisation on the trained models or the inference methods and include this comparison mostly as an illustration to show that both methods solve similar tasks. In application either method can have its advantages purely from the perspective of design: as shown in Section 3.1, FK performs well in cases where only a small fraction of prior samples is relevant to the tilted distribution by eliminating superfluous samples and repopulating the important samples through stochasticity. For these situations, as also mentioned in ref. 32, GFM struggles since it needs to transport the whole prior distribution to the target using untilted target samples. On the other hand, guidance can be expected to perform better for cases where it is important to capture the full tilted distribution well and not just the high-reward areas, since FK is not designed for this task specifically. Furthermore it can be important in applications to obtain a direct coupling between prior samples and tilted target samples, which is possible directly with GFM but would require a backwards integration for FK.
Fig. 5 Distributions generated by Monte Carlo guidance CFM32 (middle) and FK (right). The target distribution tilted with the same potential is displayed on the left.
Transition state generation
Setup and metrics
We generate TS geometries from the 2D molecular graphs of reactants and products without using 3D input. As the base model we use GoFlow,22 trained with the reported hyperparameters on RDB7 (ref. 31) with a random 80/10/10 split into 9540, 1192 and 1194 reactions (processing details in the SI). In the test set, 55.3% of the reactions contain at least one tetrahedral stereocentre in the reactant or product. GoFlow combines N samples per reaction into one prediction by median aggregation, and we aggregate in the same way across all methods.
We steer using the sum of three potentials. For tetrahedral stereocentres we use an FK approach inspired by ref. 29. However, instead of defining the potential based on the dihedral angles involved in a tetrahedral chiral centre, we calculate a potential based on the directed chiral volume of the tetrahedron spanned by the neighbouring atoms based on the chirality of the reactant and product molecules. It is assumed that x1, x2, x3 and x4 are positions that are sorted based on the CIP priorities of the neighbours of a chiral centre of either the reactants or products. Then we define the chiral volume as the triple product
An illustration of this can be seen in Fig. 6. We then flip the sign of this volume if the chiral centre is S such that if the positions have correct chirality the signed volume is always negative. This is then passed through a Relu function to set the potential for correct centres to zero. The final potential for any geometry is the sum over all chiral centres of both the reactant and product of this directed tetrahedral volume.
Fig. 6 Tetrahedral chiral centre of 2-butanol. The neighbours are labelled with their CIP priorities. The chiral potential is determined by the volume of the tetrahedron spanned by the centre's neighbours and their ordering.
Double bond (E/Z) stereochemistry is enforced analogously: for every double bond with an E/Z descriptor in either the reactant or product, we compute the cosine c between the normals of the planes spanned by each double-bond atom and its substituents and add ReLU(1 + τc) with τ = 1 for Z and τ = −1 for E (SI).
Finally we define a force potential through log(1 + FRMS) where FRMS is the root mean square of all force components, in eV Å−1, of a single point evaluation of g-xTB.37 Since TSs are stationary points, the force must vanish there, so steering towards geometries with low forces can help steer towards TSs, as long as the model itself is unlikely to put probability mass at local minima. This steering goes towards stationary points of g-xTB while RDB7 reference TSs were computed using DFT. In the SI we give results for the same experiments performed using the machine-learned potential AIMNet2-rxn.38,39
All runs integrate on a time grid of 51 points with 30 integration steps on [0, 0.8] and 20 steps on [0.8, 1]. In the steering window [0.8, 0.95] the particles are resampled after every step and once more at t = 1. We inject noise with σ = 0.3 with a schedule that ensures stability around the endpoints (see the SI) and use the difference schedule with λ = 100 and N = 30 particles unless stated otherwise. As an importance sampling (IS) baseline we draw N independent samples and reweigh them only once at t = 1 with exp(−λU), corresponding to a post hoc selection using the same potential. All results are means over five seeds; further ablations and standard deviations are given in the SI.
We compare the predictions to the RDB7 reference TSs with the RMSE used in GoFlow, which permutes the indices of atoms of the same element to deal with index ambiguity of chemically interchangeable atoms (e.g. in rotamers) and with the mean absolute error of the interatomic distances (DMAE). In the same way, we also give a metric RMSE + flip which is the smaller of the RMSEs of the prediction and of its mirror image. To measure stereochemistry, we use two error rates over all test reactions. We define a persistent chirality error for reactions in which at least one reaction-consistent chiral centre has a chirality opposite to that dictated by the 2D graph, based on the sign of the chiral volume as in eqn (7).
Secondly we want to give a score that incorporates all chiral centres. Similar to eqn (7) we calculate a chiral volume but this time normalised by the total edge lengths:
We define a thresholded chirality error for reactions in which there is a (not necessarily reaction consistent) chiral centre where the sign of Ṽ is inconsistent with the chirality dictated by the 2D-graph and the absolute value of Ṽ exceeds a threshold θ. For the results presented below, we consistently use θ = 0.25.
Since the purpose of a generated TS is to serve as the starting point of a TS search, we also optimise every prediction to a saddle point on g-xTB with Sella40 and follow the intrinsic reaction coordinate (IRC)41 from it. We classify a prediction as finding the correct saddle if Sella converges to a first-order saddle point within 0.1 Å RMSD of the saddle point that Sella reaches from the RDB7 reference TS on the same surface. We say that a prediction's IRC connects if the two IRC endpoints match the reactant and product in connectivity and stereochemistry. For a subset of 52 = 4·13 test reactions, split into 4 equal classes based on the number of stereocentres, we perform a TS optimisation and IRC with DFT at the ωB97X-D4/def2-TZVP level of theory42–44 using ORCA 6.1.45 Details of both protocols are given in the SI.
Stereochemistry
As can be seen in Fig. 7 left, the base model exhibits a pronounced high-error mode associated with wrong-chirality predictions, both for reactions with change in their chiral centres and those without. This occurs in approximately half of the chiral reactions (Table 2). Applying either the IS baseline or FK with the chiral potentials is able to suppress this failure mode and predict most TSs with the correct chirality. Since the base GoFlow model is able to produce the necessary configuration within the 30 samples even for 3 stereocentres, selecting at t = 1 is sufficient. Most of the improvement in RMSE disappears under RMSE + flip and the DMAE barely changes, so the lower RMSE mainly reflects the removal of the wrong-chirality mode rather than otherwise better geometries. Stereochemistry is therefore a simple steering task at this molecular size.
Fig. 7 RMSE distributions for both the base model (left) and an FK model with a chiral potential (right). The unsteered model has a clear error modality of predicting the wrong chirality, as indicated by the reactions with high RMSE that are categorised with a persistent chirality error (orange) or a threshold chirality error (red). FK strongly suppresses this mode and overwhelmingly predicts the correct chirality.
Table 2 TS generation on the RDB7 test set with N = 30, means over five seeds. PCE and TCE: share of all test reactions with a persistent or thresholded chirality error. Force: median RMS force on g-xTB. IRC connects: share of reactions whose prediction, optimised to a saddle point on g-xTB, has an IRC connecting the reactant and product with the correct stereochemistry. Correct saddle: share of reactions whose prediction optimises to the same saddle point (within 0.1 Å RMSD) as the reference TS
DMAE (Å)
RMSE (Å)
RMSE + flip (Å)
PCE (%)
TCE (%)
Force (eV Å−1)
IRC connects (%)
Correct saddle (%)
RDB7 reference
—
—
—
0.3
2.9
0.255
78.2
—
GoFlow
0.112
0.270
0.167
9.9
25.6
1.075
54.6
52.6
IS, chirality
0.110
0.192
0.150
0.0
1.9
1.083
—
—
FK, chirality
0.110
0.192
0.149
0.0
1.8
1.082
71.9
71.4
IS, force + chirality + E/Z
0.109
0.221
0.167
0.0
1.9
0.620
74.2
70.1
FK, force + chirality + E/Z
0.101
0.212
0.158
0.0
1.8
0.459
74.5
72.9
Some reactions with low RMSE and wrong chirality remain; however this is mostly due to the inaccuracy of the thresholded chirality error calculation and the indeterminate nature of the chirality of the TS: the ground truth TS geometries have a similar fraction of reactions with a thresholded chirality error (see Table 2). In three test reactions, the stored RDB7 geometries of the reactant, TS, and product correspond to the enantiomer of the structure given by the SMILES, so FK, which follows the SMILES, predicts the mirror image of the RDB7 TS. Additionally there are reactions with an (achiral) meso reactant, where two TSs are enantiomers and therefore equally valid in which case the chirality steering can choose the one that is not in RDB7. Both cases are shown in the SI. As a result, RMSE + flip shows a measurable decrease over direct RMSE calculation even for chirality steered inference. This is also displayed in PCE and TCE, where FK is seemingly “better” than the ground truth, reinforcing the view that these metrics should be used purely qualitatively.
In summary, we find that FK-CFM generates stereochemically consistent transition states reliably in most cases, while the remaining failure cases highlight genuine ambiguity in transition-state chirality and in parts of RDB7.
Steering towards low forces
The predictions of GoFlow can be, even when geometrically close, energetically relatively far from stationary points of the potential energy surface. Calculating the median RMS force at a g-xTB level of theory for both the reference TS and the base GoFlow predictions gives values of 0.255 eV Å−1 on the reference and 1.075 eV Å−1 on the GoFlow predictions, an indicator that – despite the difference in level of theory – low-force geometries are rare under the base model. We are thus in a situation similar to that of the distance potential in Section 3.1, where sequential resampling can use the potential more effectively than selection at t = 1. FK with force steering alone reaches a median RMS force of 0.446 eV Å−1. Adding stereochemistry steering on top does not greatly harm the performance, giving a median RMS force of 0.459 eV Å−1 while reducing the TCE from 28.4% to 1.8%. With the same combined potential, IS only reaches 0.620 eV Å−1, and even with 128 samples it stays above FK with 16 particles (0.515 compared to 0.497 eV Å−1). Fig. 8 depicts the cumulative distribution as well as respective medians of the RMS forces. FK also reduces the DMAE. Due to differences in the level of theory, however, the force-steered predictions exhibit a larger RMSE than the predictions steered by stereochemistry alone, although still lower than that of the unsteered GoFlow predictions (Table 2).
Fig. 8 RMS force of the predicted TSs on g-xTB. (a) Cumulative distribution over the test reactions for N = 30, pooled over five seeds. (b) Median RMS force against the number of samples or particles N, and mean and standard deviation over five seeds. For GoFlow, the prediction is the median of N samples.
Starting points for transition state searches
We compare the samples produced by the different steering models by performing a saddle point optimisation and IRC using g-xTB. Due to differences in the level of theory, this evaluation happens on a different potential energy surface than the one used for training. Exact saddle point locations can differ between potential energy surfaces and only 78.2% of the reference structures give the correct reactant and product geometries when performing the same routine. Starting from the FK predictions, the IRC connects the reactant and product with the correct stereochemistry for 74.5% of the reactions, compared to 54.6% for GoFlow and 74.2% for IS (Table 2). For reactions with stereocentres much of this gain comes from the stereochemistry potentials. For the reactions without stereocentres, force steering increases the success rate from 72.4% to 76.3%.
On the four categories of reactions with no stereocentres, one stereocentre, two stereocentres and at least three stereocentres we sampled 13 random reactions each and performed full DFT calculations at the ωB97X-D4/def2-TZVP level of theory in ORCA, for both the GoFlow baseline and the FK steering variant with chirality and force steering with the same settings as in Table 2. Nearly all predictions of both inference models optimise to a first-order saddle point (Table 3). Starting from FK, the IRC connects the reactant and product with the correct stereochemistry for 43 of the 52 reactions compared to 26 for GoFlow, and there is no reaction where only GoFlow succeeds. Disregarding stereochemistry, FK succeeds on 44 of the 52 reactions compared to 38 for GoFlow. The difference grows with the number of stereocentres (Table 4). Many GoFlow predictions lead to a saddle point that connects the reactant and product but with the wrong stereochemistry (Fig. 9).
Table 3 Saddle point optimisation and IRC at the ωB97X-D4/def2-TZVP level of theory for 52 RDB7 test reactions, 13 each with 0, 1, 2 and at least 3 stereocentres in the reactant and product (a centre is counted twice if its CIP label differs between them). Initial structures are the GoFlow baseline and FK with the force, chirality and E/Z potentials (N = 30). RDB7 TS recovered: first-order saddle point within 0.1 Å RMSD of the RDB7 TS. The IRC criteria are the same as in Table 2 but at the DFT level of theory
GoFlow
FK
First-order saddle point
47 (90.4%)
50 (96.2%)
RDB7 TS recovered
21 (40.4%)
36 (69.2%)
IRC connects R and P, any stereochemistry
38 (73.1%)
44 (84.6%)
IRC connects R and P, correct stereochemistry
26 (50.0%)
43 (82.7%)
Table 4 Number of reactions out of 13 per group in Table 3 whose IRC connects the reactant and product, with any and with the correct stereochemistry
Fig. 9 Examples from the DFT subset, one for each group of stereocentres. From left: the reaction with its RDB7 index, RDB7 TS, and for GoFlow and FK the prediction and the saddle point that the DFT optimisation reaches from it, all aligned to the RDB7 TS. Stereocentres are marked green if their configuration matches that of the RDB7 TS and red if inverted; dashed lines are bonds formed or broken. Below each structure: RMSD to the RDB7 TS and, for the DFT saddle points, the outcome of the IRC. All reactions on which the two methods differ or both fail are shown in the SI.
Discussion
Tetrahedral stereochemistry is known from the molecular graph and can also be built into a model directly, by keeping RDKit's local structures fixed19 or by augmenting the graph and retraining.27,28 In this work it mainly serves as a demonstration with an unambiguous target. The force potential shows the more general use: it comes from an external calculator, needs only evaluations and no gradients, and can be combined with other potentials without retraining the model. We expect FK steering to be most useful where constraints vary between applications, are hard to encode during training, or depend on an environment, such as a solvent, a protein pocket or a catalyst, and for systems much larger than those in RDB7, where selecting from independent samples becomes inefficient. It still has general SMC restriction of only producing samples in places where the base models assign non-zero probability.
In the following, we discuss limitations of FK we encountered in this work. The main limitation of FK as presented here is the reliance on a tractable score for the injection of stochasticity during inference. We have mentioned several methods to deal with this in practice. In the absence of such a score one can still apply FK on the deterministic model and achieve guaranteed convergence but with a reduction in the number of distinct samples, although this is a trait shared with IS. Ref. 46 and 47 show that one does not need SDE sampling for stochastic transitions in flow matching inference, but strongly relies on a Gaussian prior for the construction of the transition kernels.
Future work should also concentrate on how FK can integrate with guidance methods that adapt the underlying velocity field such as GFM or steering based on the gradients of the potential or the potential estimation while preserving the marginals. This could be achieved by adapting the steering potentials during updates to the velocity field through an appropriate change of measures and Girsanov's theorem. We leave this to be explored in future work.
Besides tetrahedral stereochemistry we steer E/Z stereochemistry of double bonds. The latter case is relatively rare in RDB7. The same approach would extend to other geometric potentials such as steric clashes or distance constraints. It also remains to investigate more deeply how FK deals with extreme cases where the TS lies very close to either the reactant or product. The prediction of low-RMSE geometries that are characterised as wrong by the thresholded chirality error as well as the similarity in DMAE between the steered and unsteered models seem to indicate that on RDB7 this poses no problem, but ref. 30 explicitly mention steering into out of distribution regions as a likely error source for diffusion FK as applied in ref. 29. This can be alleviated by stronger intermediate reward estimates or by using schedules that less aggressively try to steer towards high-reward regions, at the cost of sampling efficiency.
Conclusion
We have successfully derived Feynman–Kac steering for conditional flow matching and showcased its ability to generate samples from a tilted distribution on low and high-dimensional synthetic data, where we demonstrate how FK performs favourably even for high-dimensional tasks with a sparse tilted distribution. We have further applied FK steering for CFM to the generation of transition states from reactant and product graphs. Steering a pretrained model with stereochemistry and force potentials, without retraining, removes nearly all stereochemistry errors, reaches lower forces than importance sampling with many more samples, and gives better starting points for DFT transition state searches, in particular for reactions with several stereocentres. We envision that FK-CFM will enable advances in several other fields of generative modelling.
LipmanY., ChenR. T. Q., Ben-HamuH., NickelM. and LeM., Flow Matching for Generative Modeling, in The Eleventh International Conference on Learning Representations, 2023
GuoY., DuC., MaZ., ChenX. and YuK., Voiceflow: Efficient text-to-speech with rectified flow matching, in ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2024, pp. 11121–11125
DavtyanA., SameniS. and FavaroP., Efficient Video Prediction via Sparsely Conditioned Flow Matching, in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023, pp. 23263–23274
ZhengQ., LeM., ShaulN., LipmanY., GroverA. and ChenR. T., Guided Flows for Generative Modeling and Decision Making, arXiv, 2023, preprint, arXiv:2311.13443, 10.48550/arXiv.2311.13443 https://doi.org/10.48550/arXiv.2311.13443
TamirE., LaabidN., HeinonenM., GargV. and SolinA., Conditional Flow Matching for Time Series Modelling, in ICML 2024 Workshop on Structured Probabilistic Inference Generative Modeling, 2024
StarkH., JingB., BarzilayR. and JaakkolaT., Harmonic Self-Conditioned Flow Matching for joint Multi-Ligand Docking and Binding Site Design, in Proceedings of the 41st International Conference on Machine Learning, 2024, pp. 46468–46494
JingB., BergerB. and JaakkolaT., AlphaFold Meets Flow Matching for Generating Protein Ensembles, in Proceedings of the 41st International Conference on Machine Learning, 2024, pp. 22277–22303
TianQ., XuY., YangY., WangZ., LiuZ., YanP. and LiX., Equiflow: Equivariant Conditional Flow Matching with Optimal Transport for 3D Molecular Conformation Prediction, arXiv, 2024, preprint, arXiv:2412.11082, 10.48550/arXiv.2412.11082 https://doi.org/10.48550/arXiv.2412.11082
ClarkK., VicolP., SwerskyK. and FleetD. J., Directly Fine-Tuning Diffusion Models on Differentiable Rewards, in The Twelfth International Conference on Learning Representations, 2024
ZhangQ. and ChenY., Path Integral Sampler: A Stochastic Control Approach for Sampling, in The Tenth International Conference on Learning Representations, 2022
Domingo-EnrichC., DrozdzalM., KarrerB. and ChenR. T. Q., Adjoint Matching: Fine-tuning Flow and Diffusion Generative Models with Memoryless Stochastic Optimal Control, arXiv, 2025, preprint, arXiv:2409.08861, 10.48550/arXiv.2409.08861 https://doi.org/10.48550/arXiv.2409.08861
BansalA., ChuH.-M., SchwarzschildA., SenguptaS., GoldblumM., GeipingJ. and GoldsteinT., Universal Guidance for Diffusion Models, in The Twelfth International Conference on Learning Representations, 2024
WuL., TrippeB. L., NaessethC. A., BleiD. M. and CunninghamJ. P., Practical and Asymptotically Exact Conditional Sampling in Diffusion Models, in Advances in Neural Information Processing Systems, 2023, vol. 36
LiX., ZhaoY., WangC., ScaliaG., EraslanG., NairS., BiancalaniT., JiS., RegevA., LevineS. and UeharaM., Derivative-Free Guidance in Continuous and Discrete Diffusion Models with Soft Value-Based Decoding, in Advances in Neural Information Processing Systems, 2025, vol. 38
SinghalR., HorvitzZ., TeehanR., RenM., YuZ., McKeownK. and RanganathR., A General Framework for Inference-time Scaling and Steering of Diffusion Models, in Proceedings of the 42nd International Conference on Machine Learning, 2025, pp. 55810–55827
XuM., YuL., SongY., ShiC., ErmonS. and TangJ., GeoDiff: A Geometric Diffusion Model for Molecular Conformation Generation, in The Tenth International Conference on Learning Representations, 2022
HassanM., ShenoyN., LeeJ., StarkH., ThalerS. and BeainiD., ET-Flow: Equivariant Flow-Matching for Molecular Conformer Generation, in Advances in Neural Information Processing Systems, 2024, vol. 37
JingB., CorsoG., ChangJ., BarzilayR. and JaakkolaT. S., Torsional Diffusion for Molecular Conformer Generation, in Advances in Neural Information Processing Systems, 2022, vol. 35
KimS. WooJ. KimW. Y. Diffusion-based Generative AI for Exploring Transition States from 2D Molecular GraphsNat. Commun.20241534110.1038/s41467-023-44629-638184661PMC10771475 https://doi.org/10.1038/s41467-023-44629-6
DuanC. LiuG.-H. DuY. ChenT. ZhaoQ. JiaH. GomesC. P. TheodorouE. A. KulikH. J. Optimal Transport for Generating Transition States in Chemical ReactionsNat. Mach. Intell.2025761562610.1038/s42256-025-01010-0 https://doi.org/10.1038/s42256-025-01010-0
GalustianL. MarkK. KarwounopoulosJ. KovarM. P.-P. HeidE. GoFlow: efficient transition state geometry prediction with flow matching and E(3)-equivariant neural networksDigital Discovery202543492350110.1039/D5DD00283D41189760PMC12580847 https://doi.org/10.1039/D5DD00283D
GaneaO.-E., PattanaikL., ColeyC. W., BarzilayR., JensenK. F., GreenW. H. and JaakkolaT. S., GeoMol: Torsional Geometric Generation of Molecular 3D Conformer Ensembles, in Advances in Neural Information Processing Systems, 2021, vol. 34
PattanaikL., GaneaO.-E., ColeyI., JensenK. F., GreenW. H. and ColeyC. W., Message Passing Networks for Molecules with Tetrahedral Chirality, arXiv, 2020, preprint, arXiv:2012.00094, 10.48550/arXiv.2012.00094 https://doi.org/10.48550/arXiv.2012.00094
Gai’nskiP., KoziarskiM., TaborJ. and ŚmiejaM., in Machine Learning and Knowledge Discovery in Databases: Research Track; Lecture Notes in Computer Science, Springer Nature Switzerland, Cham, 2023, vol. 14171, pp. 36–52, 10.1007/978-3-031-43418-1_3 https://doi.org/10.1007/978-3-031-43418-1_3
NikitinF., AnstineD. M., ZubatyukR., PaliwalS. G. and IsayevO., Scalable Low-Energy Molecular Conformer Generation with Quantum Mechanical Accuracy, ChemRxiv, 2026, 10.26434/chemrxiv-2025-k4h7v/v3 https://doi.org/10.26434/chemrxiv-2025-k4h7v/v3
NikitinF., AnstineD. M. and IsayevO., Right into the Saddle: Stereochemistry-Aware Generation of Molecular Transition States, ChemRxiv, 2026, preprint, 10.26434/chemrxiv.15001681/v1 https://doi.org/10.26434/chemrxiv.15001681/v1
SpiekermannK. PattanaikL. GreenW. H. High Accuracy Barrier Heights, Enthalpies, and Rate Coefficients for Chemical ReactionsSci. Data2022941710.1038/s41597-022-01529-635851390PMC9293986 https://doi.org/10.1038/s41597-022-01529-6
FengR., YuC., DengW., HuP. and WuT., On the Guidance of Flow Matching, in Proceedings of the 42nd International Conference on Machine Learning, 2025, pp. 16993–17029
VillaniC. et al., Optimal transport: old and new, Springer, 2008, vol. 338
MaoutsaD., ReichS. and OpperM., Interacting Particle Solutions of Fokker-Planck Equations through Gradient-log-density Estimation, 2020, 10.3390/e22080802PMC751737433286573 https://doi.org/10.3390/e22080802
TongA. Y., MalkinN., FatrasK., AtanackovicL., ZhangY., HuguetG., WolfG. and BengioY., Simulation-Free Schrödinger Bridges via Score and Flow Matching, in Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, 2024, pp. 1279–1287
TongA., FatrasK., MalkinN., HuguetG., ZhangY., Rector-BrooksJ., WolfG. and BengioY., Improving and Generalizing Flow-Based Generative Models with Minibatch Optimal Transport, Transactions on Machine Learning Research, 2024
FroitzheimT., MüllerM., HansenA. and GrimmeS., g-xTB: A General-Purpose Extended Tight-Binding Electronic Structure Method For the Elements H to Lr (Z=1–103), ChemRxiv, 2025, preprint, 10.26434/chemrxiv-2025-bjxvt https://doi.org/10.26434/chemrxiv-2025-bjxvt
AnstineD. M. ZubatyukR. IsayevO. AIMNet2: A Neural Network Potential to Meet Your Neutral, Charged, Organic, and Elemental-Organic NeedsChem. Sci.202516102281024410.1039/D4SC08572H40342914PMC12057637 https://doi.org/10.1039/D4SC08572H
AnstineD. M. ZhaoQ. ZubatyukR. ZhangS. SinglaV. NikitinF. SavoieB. M. IsayevO. AIMNet2-rxn: A Machine-Learned Potential for Generalized Reaction Modeling on a Millions-of-Pathways ScaleSci. Adv.202612eaea155710.1126/sciadv.aea1557PMC1364475042842670 https://doi.org/10.1126/sciadv.aea1557
HermesE. D. SargsyanK. NajmH. N. ZádorJ. Sella, an Open-Source Automation-Friendly Molecular Saddle Point OptimizerJ. Chem. Theory Comput.2022186974698810.1021/acs.jctc.2c0039536257023 https://doi.org/10.1021/acs.jctc.2c00395
ChaiJ.-D. Head-GordonM. Systematic Optimization of Long-Range Corrected Hybrid Density FunctionalsJ. Chem. Phys.200812808410610.1063/1.283491818315032 https://doi.org/10.1063/1.2834918
CaldeweyherE. EhlertS. HansenA. NeugebauerH. SpicherS. BannwarthC. GrimmeS. A Generally Applicable Atomic-Charge Dependent London Dispersion CorrectionJ. Chem. Phys.201915015412210.1063/1.509022231005066 https://doi.org/10.1063/1.5090222
WeigendF. AhlrichsR. Balanced Basis Sets of Split Valence, Triple Zeta Valence and Quadruple Zeta Valence Quality for H to Rn: Design and Assessment of AccuracyPhys. Chem. Chem. Phys.2005732973305https://dx.doi.org/10.1039/b508541a10.1039/B508541A16240044 https://doi.org/10.1039/B508541A
NeeseF. Software Update: The ORCA Program System—Version 6.0WIREs Comput. Mol. Sci.202515e7001910.1002/wcms.70019 https://doi.org/10.1002/wcms.70019
HolderriethP., SingerU., JaakkolaT., ChenR. T. Q., LipmanY. and KarrerB., GLASS Flows: Transition Sampling for Alignment of Flow and Diffusion Models, arXiv, 2025, preprint, arXiv:2509.25170, 10.48550/arXiv.2509.25170 https://doi.org/10.48550/arXiv.2509.25170
HolderriethP., ChenD., EyringL., ShahI., AnantharamanG., HeY., AkataZ., JaakkolaT., BoffiN. M. and SimchowitzM., Diamond Maps: Efficient Reward Alignment via Stochastic Flow Maps, arXiv, 2026, preprint, arXiv:2602.05993, 10.48550/arXiv.2602.05993 https://doi.org/10.48550/arXiv.2602.05993
Hi! I can explain how to publish or share, find articles in your field, format citations and answer questions about fees and licensing. How can I help?
Answers are based on The Gufo’s published policies. Editorial decisions are made by the editorial team.