Manuscript Offprint
arXiv:2610.13812Spanning Diffusion and Flow-based Posterior Sampling via Exact Gaussian Conditioning
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Flow-matching and diffusion models are increasingly used as priors for linear inverse problems, however, most methods are bespoke to one class of trajectory prior. Plug-and-play methods have been proposed, however these implicitly decorrelate the guided trajectory, resulting in broad priors that can struggle when data is sparse. This work proposes -Flow: a general plug-and-play method indexed by a correlation parameter that generalises over flow, diffusion, and decorrelated priors, and a confidence parameter that controls how strongly the path distribution is enforced. Each step requires only one forward evaluation of a denoising network, followed by a Gaussian conditioning step. This step is an exact Kalman update that is not dependent on network gradients. We show that many existing guided samplers can be interpreted as instances or approximations of our method, each implicitly using a different trajectory prior and operator in place of the Kalman gain. From this viewpoint, we provide a qualitative comparison of methods in terms of their implicit biases and assumptions. We demonstrate consistently state-of-the-art level performance across 7 inverse problems over 4 datasets in terms of PSNR and SSIM. Moreover, we demonstrate the utility of this prior control, by showing that confident high correlations (strict priors) work best when observations are less informative, while low correlation is preferred when observations are more informative, reflecting the complementary roles of the prior and likelihood in Bayesian inference.
1 INTRODUCTION
Flow-matching [1–3] and diffusion models [4, 5] generate data by transporting a simple noise distribution to the data distribution along a learned trajectory, deterministically or stochastically. This makes them natural priors for linear inverse problems. Given an observation y of a clean sample
the aim is to draw samples, or compute a point estimate from the posterior .
A large body of work approaches this problem by steering the model's reverse trajectory towards y one step at a time. Most of these methods appear tailored to one model class, with likelihood score approximations common in diffusion models (DPS [6], IIGDM [7]), trajectory unrolling tied to flow-matching models (D-Flow [8]), and independent re-noising used in plug-and-play methods (PnP-Flow [9], Flower [10]). Consequently, a scheme developed for one does not naturally carry over to the other without changing its prior behaviour. In this paper, we propose a general conditioning method for guided sampling that generalises over flow, diffusion and independent re-noising priors.
where so that corresponds to the data, to pure noise. Conditional on , each is Gaussian with mean and covariance . A network trained on this interpolant, whether by flow-matching or as a diffusion denoiser, provides at every a one-step estimate of .
Interpolant (2) defines a single deterministic path for each noise realisation , but a guided sampler needs flexibility to move away from this path. We therefore

Figure 1: Three guided trajectories on a toy denoising example for varying . Each line is an independent trajectory, and the black marker is the observation. At the trajectory is anti-correlated which results in the closest convergence to the observation, at every step re-noises independently, and as increases consecutive states become correlated, until at they follow a deterministic flow.
model the current sampler state as a separate variable , whose correlation with the reference path is controlled by a time dependent parameter ,
where is independent of . This process has the same marginal as for every value of . For it fully coincides with , for it is conditionally independent of it given , and for they are negatively correlated. Together, the observation model (1) and interpolant (2) result in the graphical model of Figure 2.
From here, it is natural to condition on everything that is known, i.e., and . Each step the sampler must draw from , which decomposes as
This decomposition admits a natural interpretation. The first factor is the posterior over the ground truth consistent with the data and current state , and the second factor is the transition kernel, a stochastic interpolant [11] between the endpoints and that transports this posterior along the prior trajectory. Every guided sampler approximates this integral, in practice by using a network estimate as a proxy for the unknown .
Standard Gaussian conditioning of (3) (Appendix A, A.1) gives the transition kernel in closed form,
with coefficients , and . This gives the correct marginal of given for every . Deterministic flow-matching updates and the standard diffusion posterior are both members of this family, differing only in their choice of . Table 1 lists three choices of for which
| Coincides with | ||
|---|---|---|
| Independently noised | ||
| Reverse diffusion SDE | ||
| Flow-matching ODE |
Table 1: Common cases of the kernel (5). The diffusion schedule gives a Markovian forward process. Every schedule with defines a valid kernel with the correct marginals.
the kernel coincides with a known construction. We note that for this derivation serves as an alternative construction of the DDIM family [12] (Appendix A, A.1). Negative values of lie outside the DDIM family but define an equally valid kernel.

Figure 2: Graphical model for one reverse step. The state held by the sampler depends on and is correlated, with coefficient , with the reference point on the interpolant path (grey, dashed). It is conditionally independent of given when and coincides with it when . Guided sampling proceeds from to by iteratively modelling the distribution of given and .
1.2 Existing approaches
Three families of guidance cover most of the literature. Each can be seen as approximating (4), and Section 3 writes each in the update form derived in this paper.
The first estimates the ground truth directly, applies a data consistency-based update, and samples independently of . PnP-Flow [9] does this via a gradient step as the data consistency update while FLOWER [10] takes a proximal step. In both cases the corrected point is returned to the trajectory by re-noising with independent noise.
The second family, commonly used in diffusion settings, approximates the conditional score function by adding the score of an approximated likelihood to the unconditional score and integrating. This type of approximation is derived via the gradient of the likelihood evaluated at . DPS [6] and IIGDM [7] are examples of this type of approach. The update is therefore based on the network's own local sensitivity to the state, and its step size is set by hand.
The third family, most common in flow-matching settings, replaces the single step estimator with an estimate derived through a roll-out of the ODE solver. This is exemplified by D-Flow [8], which optimises the noise that seeds a deterministic sampler, backpropagating a data-fidelity loss on the final output through the entire discretised trajectory. Here the observation enters once, at the boundary, and the update is applied to rather than to a state on the trajectory. Closely related variants also apply this update at intermediate points of the trajectory [13].
1.3 Contributions
This paper treats a guided step as a Gaussian conditioning based on the graphical model of Figure 2. Our contributions are as follows.
-
One sampler for flow, diffusion and decorrelated priors. A single correlation parameter spans the flow-matching ODE, the reverse diffusion SDE and independent re-noising, so one method serves all three model classes and the trajectory prior becomes a choice rather than implicitly inherited.
-
Closed-form, gradient-free guidance. Each guided step is an exact Gaussian conditioning update, computed as a Kalman update from a single forward evaluation of the network, with no backpropagation through the network or the trajectory.
-
A comparison of existing methods within a unified view. DPS, IIGDM, PnP-Flow, FLOWER and D-Flow can all be written as a choice of transport and gain, which makes their implicit assumptions explicit and comparable. We compare methods qualitatively based on the transport and gain they apply. For PnP-Flow and DPS we prove that no fixed step size in their gradient step can reproduce the calibrated Kalman gain, as both over-weight the observation increasingly as the trajectory approaches the data.
• Empirical results. We show state-of-the-art performance against existing solvers, and demonstrate that the optimal choice of trajectory prior differs based on the problem, showing that control over the trajectory prior is practically beneficial.
2 METHODOLOGY
Recall equation (4), which expresses the conditional distribution of the next state given the current state and the observation y. We note that this can be further decomposed, being proportional to
clean-signal posterior
Our approach is to carry out the Bayesian inference at the level of the clean signal and then transport the result along the trajectory. The observation model gives a likelihood, a prior over the clean signal combines with it to give the clean-signal posterior, and the transition kernel of Section 1.1 transports that posterior to the next state, as in (4). Section 2.1 derives the resulting update for a Gaussian prior with a given mean and covariance. It is available in closed form for every , costs one forward evaluation of the network per step, and involves no network Jacobian. Section 2.2 then specifies our choice of mean and covariance using Tweedie's formulas.
2.1 Guidance as closed form Gaussian conditioning
We assume for now that the prior over the clean signal, given the state the sampler holds, is Gaussian with a given mean and covariance ,
These may depend on the current state and timestep . We specify our choice of these in Section 2.2. The observation model (1) gives the likelihood .
Posterior over the clean signal. A Gaussian prior combined with a linear-Gaussian likelihood gives a Gaussian posterior, , with
The posterior mean is the prior mean plus a linear correction applied to the residual which incorporates the data. The linear operator applied to the residual is the Kalman gain, which trades off the prior covariance against the observation noise . A confident prior (small ) leaves almost unchanged, and a diffuse prior lets the observation dominate. The posterior covariance is the prior covariance reduced by what the observation resolves.
Transport along the trajectory. By (4) the next state is obtained by transporting this posterior through the kernel (5). The kernel is linear in and its noise is independent of and of , so, given and ,
where are the kernel coefficients (5). That is, the posterior mean over is transported along the same path as the underlying kernel (2), and the posterior variance expands the variance of (2) additively. These formulas can also be derived in a more opaque manner by direct Gaussian conditioning over the jointly Gaussian system . The mean in (9) is therefore , the minimum-mean-squared-error estimate of under the prior.
In order to make a transition we compute the posterior transition mean and add i.i.d. noise with standard deviation as prescribed by the kernel, giving an update rule (5)
We have omitted the contribution of the covariance term. The reason for this is simple; the posterior covariance over is a consequence of our choice of prior over (7) and the observation operator H only. It does not necessarily represent the natural geometry of the data distribution and can introduce excess noise and unnatural structure if propagated.
To reduce variance we draw M independent copies of , all of which are propagated. This mirrors the approach taken in [10]. Averaging the resulting outputs approximates marginalisation over the residual uncertainty in at each step, instead of committing to a single realisation at each step in the trajectory. Algorithm 1 summarises a step of our algorithm.
Figure 5 in Appendix C illustrates this step on a two-dimensional problem, showing the evolution of prior and posterior over at six points of a trajectory for three for different choices of .
2.2 The prior over
The only intractable term in (6) is the prior . Our method deals with this by using a Gaussian approximation, as is implicit in many diffusion
Algorithm 1 One reverse step
Require: known state , observation , operator , noise level , network , correlation , scale , particles
1:
2: compute (5)
3: posterior mean of (8)
4: with
guidance methods [14], which we motivate here using Tweedie's moment estimates. Given we can produce a one-step estimate (e.g. using Tweedie's formula [15]). We use this as the mean of the Gaussian prior (7). We base the covariance on Tweedie's second order formula for the covariance of given ,
In particular we take the data independent component to give a schedule for our prior covariance, and combine this with a tunable confidence parameter , giving
The removal of the Hessian term is primarily a pragmatic one, since this is impractical to compute outright, and Jacobian-vector product-based implementations are significantly slower. We remark however, that this curvature is primarily negative in high likelihood regions of interest, so the omission of this term amounts to enlarging the variance in directions of high negative curvature rather than restricting it to no longer cover the required ground truth.
2.3 Computational cost and stability
Every quantity in (9) is an explicit function of and , and is obtained from a single forward evaluation of the network that is held fixed for the remainder of the step. Computing therefore requires no further evaluation of and no differentiation through it. The network enters only through , and its uncertainty enters only through the scalar in the gain. This is the same cost profile as proximal [9] and data-consistency samplers [10], whereas score-based guidance [6, 7] obtains its update from the network's gradients, and flow-based rollout methods require gradients over the full trajectory rollout [8]. A summary of network evaluations and gradients required per update between methods is summarised in Table 2.
In terms of stability, our approach is constructed at the level of the joint Gaussian system, and therefore is not subject to discretisation error inherent to methods framed around integrating an ODE/SDE. Furthermore, since our method is not guided by network gradients, it remains robust in regions of low density where the lower quantity of training data can result in unpredictable gradients.
3 METHOD COMPARISON
The update (9) has three distinct parts. A prior over the clean signal centred at a point estimate , a data informed update of that estimate with the residual , and transport of the updated estimate back along the trajectory. Every method considered here has this structure, and can be written
so that each method is specified by its gain and its transport . For our update, FLOWER, PnP-Flow, DPS and IIGDM, , , and is the kernel (5) for some , . PnP-Flow and FLOWER have this structure by construction, and Appendix A, A.2, shows that the score-based guidance schemes DPS and IIGDM follow it implicitly. ODE rollout methods that optimise the latent noise have a slightly different structure, setting , (where indexes optimisation iterations). Here the point estimate is defined as the endpoint of the integration trajectory , and transport of the updated estimate follows by the reversal of this trajectory . For all methods we derive the implicit gains , which specify exactly how each method updates its estimate of . Table 2 summarises the results, here we briefly summarise.
Our update is the case , where is the Kalman gain of (8). It automatically balances the prior's uncertainty against the observation noise, resulting in a properly normalised gain which stays bounded as the prior uncertainty grows. The other methods differ in how, and whether, they supply this normalisation.
3.1 FLOWER and PnP-Flow
These methods re-noise with independent noise in each iteration, and therefore implicitly fix . FLOWER computes the posterior mean of exactly so with . FLOWER can therefore be considered as an instance of our method that uses a different prior approximation. PnP-Flow instead takes a gradient step on the data fidelity, , with tuned per problem.
3.2 DPS and IIGDM
DPS adds to the unconditional diffusion step ( ) the gradient of the misfit at the network estimate, differentiated through the network. With and a hand-set step size , its gain is with . For an exact denoiser, Tweedie's formula gives , so DPS approximates the Kalman gain with the prior covariance replaced by a multiple of the network's own posterior covariance, and the inverse residual covariance ( ) replaced by the scalar . IIGDM replaces the point mass by an isotropic Gaussian with covariance , giving a gain proportional to . It contains the normalisation that DPS lacks, with in place of , but still uses the network Jacobian where the Kalman gain uses .
3.3 D-Flow
D-Flow optimises the noise that seeds a deterministic flow-matching model, , by gradient descent on . With at the current iterate and step size , one step on changes the point estimate to , where is the average of along the straight line from the current iterate to the next (Appendix A, A.2). To first order , and the gain has the form proportional to , and so the update can be considered a gradient step preconditioned by , where is the Jacobian of the rollout .
3.4 Comparison summary
Written in this form, the methods differ along three axes. The first is the transport; PnP-Flow and FLOWER use the kernel at and DPS at , while D-Flow transports along the learned flow. The flow and diffusion kernels are based on continuous ODE/SDE dynamics, whilst the PnP-Flow and FLOWER are discontinuous and considerably broader. The second is the gain; our update and FLOWER apply a Kalman gain built from an explicit prior on , whereas PnP-Flow, DPS and D-Flow apply a gradient or Jacobian step whose scalar step size stands in for the residual covariance and so has to be tuned per problem. For PnP-Flow and DPS, Appendix B shows that the Kalman gain cannot be reproduced by choice of step size: as the Kalman gain vanishes while theirs does not, so both increasingly over-weight the observation (Proposition 1). The third is the cost of obtaining the gain, with DPS and IIGDM requiring a gradient through the network at every step and D-Flow requiring the derivative of the whole trajectory, whereas a gain built from the prior needs none.
| Method | Transport | Point estimate | Gain on the residual | Gradients through |
|---|---|---|---|---|
| This paper | kernel, | one step | none | |
| FLOWER | kernel, | one step | none | |
| PnP-Flow | kernel, | one step | none | |
| DPS | kernel, | one step | every step | |
| PIGDM | kernel, | one step | every step | |
| D-Flow | flow, | integrated, | whole trajectory |
Table 2: Every method's update written in the form of (13), with and . For D-Flow, is the average of along the step. Appendix A, A.2, derives the DPS and D-Flow entries.
4 NUMERICAL RESULTS
We evaluate the method across various inverse problems, including super-resolution, denoising, random inpainting, Gaussian deblurring, box inpainting, MRI, and CT reconstruction using a trained flow-matching models as the denoiser, and tested on a full held-out set of test images per problem. For AFHQ-Cats and CelebA we use the experimental setup and datasets, models, and comparison methods as [10], which is the current state-of-the-art on these problems. For the undersampled MRI and sparse-view CT reconstruction experiments we train a new flow-matching model on the FastMRI knee dataset [16, 17] and re-use a trained flow-matching model from [18] trained on the AAPM dataset for CT [19] and compare all methods discussed in Section 3.
Results reported for our method are all based on a 100 step discretisation, and hyperparameters were tuned on a per-case basis for the highest PSNR using the left-out validation set. Comparison methods also all used 100 steps with the exception of two pre-existing baselines which used and steps on the AFHQ-Cats dataset consistent with [10] (indicated by the corresponding superscripts in the table). The final reported numbers report the performance on the test dataset, which is independent of the train and validation sets. We report averaged PSNR, SSIM [20] and LPIPS [21] over these test samples, highlighting the best method in bold and the second best underlined.
4.1 AFHQ-Cats and CelebA
Following the set-up of [9, 10], we evaluate on five inverse problems using the AFHQ-Cats and CelebA datasets. Results are shown in Tables 3 and 4. For AFHQ-Cats our method has the best PSNR in 3 of 5 experiments, and is second ( from the best) in the remaining two. A similar story holds for SSIM, where our method is highest in 3 of 5 experiments and second in the remaining ones by . For LPIPS our method is less performant, though very much competitive with the other approaches. This is not surprising, since our construction marginalises uncertainty to produce MMSE estimates, which (correctly) smooth over the unidentifiable fine structure that LPIPS is sensitive to. This is a classic demonstration of the perception-distortion tradeoff [22]; our method excels in accuracy, and therefore must sacrifice some perceptual capability. The results for CelebA are similar, with our method being best in 3 of 5 cases in PSNR and 4 of 5 in SSIM and second by a margin in the remaining cases. Again LPIPS favours different approaches for state-of-the-art performance, but our method still remains competitive.
4.2 Medical MRI/CT reconstruction
We evaluate on medical image reconstruction problems, sparse-view CT and accelerated MRI, using for each problem a single pretrained general purpose flow-matching prior with no problem-specific retraining. For MRI, we use the FastMRI single-coil knee dataset (, complex-valued, stored as 2 real channels). The forward operator is an orthonormal 2D FFT followed by a variable-density random Cartesian mask retaining of phase-encode lines corresponding to an effective acceleration factor of . We evaluate on a held-out test split of 100 images. For CT, we use the AAPM CT dataset (, single channel) [19]. The forward operator is a sparse-view Radon transform with 60 projection angles evenly spaced over , normalised to unit operator norm, with additive Gaussian noise of standard deviation on the normalised sinogram. We evaluate on 50 test slices, evenly spaced across the AAPM test volume.
We compare our method, -Flow, against five baselines using the same pretrained flow-matching prior. All method-specific hyperparameters were tuned on a held-out validation split, disjoint from the test images reported here. The quantitative results are shown in Table 5. -Flow achieves state-of-the-art performance on both medical imaging tasks, demonstrating that our approach generalises well beyond natural images. On MRI reconstruction, Flower per-
Table 3: AFHQ-Cat performance. Most results were using 100 steps, with the exception of some pre-existing PnP-Flow/Flower baselines which used and steps in certain tasks.
| Method | Denoising | Deblurring | Super-resolution | Random inpainting | Box inpainting | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | |
| Degraded | 20.00 | 0.314 | 0.509 | 23.94 | 0.517 | 0.444 | 11.70 | 0.208 | 0.873 | 13.36 | 0.223 | 1.081 | 21.80 | 0.740 | 0.198 |
| PnP-GS | 32.58 | 0.894 | 0.072 | 27.91 | 0.753 | 0.349 | 24.15 | 0.632 | 0.362 | 29.42 | 0.836 | 0.126 | - | - | - |
| DiffPIR | 30.58 | 0.835 | 0.189 | 27.56 | 0.728 | 0.342 | 23.65 | 0.624 | 0.402 | 31.70 | 0.881 | 0.062 | - | - | - |
| OT-ODE | 30.03 | 0.815 | 27.06 | 0.713 | 25.91 | 0.716 | 29.40 | 0.839 | 0.090 | 24.62 | 0.875 | 0.085 | |||
| D-Flow | 26.13 | 0.574 | 0.175 | 27.82 | 0.721 | 24.64 | 0.601 | 0.190 | 32.20 | 0.894 | 26.26 | 0.842 | |||
| Flow-Priors | 29.41 | 0.763 | 0.153 | 26.47 | 0.700 | 0.181 | 23.51 | 0.570 | 0.272 | 32.37 | 0.906 | 0.047 | 26.20 | 0.818 | 0.118 |
| PnP-Flow | 31.43 | 0.864 | 0.168 | 28.19* | * | * | * | * | * | † | † | † | 26.68 | 0.901 | 0.120 |
| Flower | 32.35 | 0.116 | 28.97 | 0.283 | 26.57* | * | * | † | † | † | 26.88 | ||||
| β-Flow (ours) | 32.55 | 0.894 | 0.089 | 29.18 | 0.790 | 0.290 | 28.38 | 0.797 | 0.186 | 33.88 | 0.057 | 26.86 | 0.083 | ||
Table 4: Results on 100 test images of the dataset CelebA.
| Method | Denoising | Deblurring | Super-resolution | Random inpainting | Box inpainting | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | |
| Degraded | 20.00 | 0.348 | 0.372 | 27.83 | 0.740 | 0.126 | 10.26 | 0.183 | 0.827 | 11.95 | 0.196 | 1.041 | 22.27 | 0.742 | 0.214 |
| PnP-GS | 32.64 | 0.910 | 34.03 | 0.924 | 0.041 | 31.31 | 0.892 | 0.064 | 29.22 | 0.875 | 0.070 | - | - | - | |
| DiffPIR | 31.20 | 0.885 | 0.060 | 32.77 | 0.912 | 0.060 | 31.52 | 0.895 | 0.033 | 31.74 | 0.917 | 0.025 | - | - | - |
| OT-ODE | 30.54 | 0.859 | 33.01 | 0.921 | 31.46 | 0.907 | 28.68 | 0.871 | 0.051 | 29.40 | 0.920 | 0.038 | |||
| D-Flow | 26.04 | 0.607 | 0.092 | 31.25 | 0.854 | 0.038 | 30.47 | 0.843 | 33.67 | 0.943 | 30.70 | 0.899 | |||
| Flow-Priors | 29.34 | 0.768 | 0.134 | 31.54 | 0.858 | 0.056 | 28.35 | 0.713 | 0.102 | 32.88 | 0.871 | 30.07 | 0.858 | 0.048 | |
| PnP-Flow | 32.30 | 0.056 | 34.80 | 0.940 | 0.047 | 31.49 | 0.906 | 0.056 | 0.022 | 31.09 | 0.940 | 0.043 | |||
| Flower | 33.14 | 0.038 | 35.67 | 0.954 | 33.09 | 0.040 | 33.95 | 0.020 | 31.87 | 0.023 | |||||
| β-Flow (ours) | 33.14 | 0.926 | 35.63 | 0.954 | 0.036 | 33.87 | 0.943 | 0.029 | 34.52 | 0.959 | 0.022 | 31.58 | 0.023 | ||
Table 5: FastMRI and AAPM CT datasets results.
| Method | Undersampled MRI | Sparse-view CT | ||||
|---|---|---|---|---|---|---|
| PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | |
| DPS | 36.19 | 0.926 | 28.79 | 0.740 | 0.107 | |
| PIGDM | 36.12 | 0.924 | 35.40 | 0.838 | 0.154 | |
| D-Flow | 34.19 | 0.871 | 0.158 | 27.42 | 0.740 | 0.157 |
| PnP-Flow | 36.30 | 0.907 | 0.094 | 25.70 | 0.695 | 0.186 |
| Flower | 37.70 | 0.091 | 33.41 | |||
| β-Flow (ours) | 37.76 | 0.943 | 0.102 | 36.44 | ||
forms very closely to our method, with the two leading the comparison in PSNR, whereas on sparse-view CT, β-Flow yields clearly superior results in PSNR, which we attribute to the sparse-view CT problem being a more ill-conditioned problem. LPIPS performance is lower, consistent with our other experiments, which we attribute to the perception-distortion trade-off as discussed above [22]. Our method also compares favourably in terms of runtime as shown in Table 9. Fig. 3 compares reconstructions for all datasets.
4.3 and super-resolution scale ablations
Here we investigate the impact of prior hyperparameters and , which both regularise the reconstruction in different ways. We apply super-resolution with the AFHQ-Cats dataset with increasingly severe downsampling scale and assess the impact of these prior hyperparameters on reconstruction quality.
Intuitively, higher values of encourage trajectories to remain closer to flow paths, thus high values regularise by biasing reconstructions towards deterministic flows. This effect can be seen in Table 6 and Figure 6, where the optimal shows clear correlation with the super-resolution downsampling scale. Similarly, regularises behaviour by controlling the relative importance of prior and observations at each step throughout the trajectory. A lower value of implies a more confident prior, thus regularises behaviour by biasing it towards unconditional dynamics. This trend is clearly reflected in Table 7 and is shown for images in Figure 7, where the optimal decreases monotonically as downsampling scale increases. Both effects are visualised on the 2d toy example in Figure 4.
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | |
| -0.6 | 33.08 | .909 | 29.87 | .838 | 27.14 | .762 | 22.00 | .609 |
| -0.3 | 33.07 | .908 | 29.93 | .839 | 27.36 | .768 | 22.40 | .620 |
| 0.0 | 33.04 | .907 | 29.99 | .840 | 27.60 | .772 | 22.84 | .632 |
| 0.3 | 32.96 | .904 | 30.01 | .839 | 27.76 | .776 | 23.40 | .645 |
| 0.6 | 32.76 | .896 | 29.96 | .836 | 27.85 | .777 | 23.93 | .657 |
Table 6: PSNR (dB) and SSIM on AFHQ-Cat super-resolution across the correlation , with fixed. The optimal increases with the downsampling factor, showing reconstructions favour more strongly correlated trajectories at higher scale factors.

Figure 3: Qualitative reconstructions across datasets and problems. All methods used 100 steps (100 updates in the case of D-Flow), and hyperparameters tuned for each dataset and task. Columns 2-4 represent reconstructions from each class of model. In Column 2 the likelihood score methods OT-ODE/IIGDM are applied to the upper/lower two rows respectively. These excel at producing realistic looking fine detail that does not necessarily match the ground truth. In Column 3 is the ODE rollout method D-Flow, which also produces some fine details, but appears sensitive to the degradation process as can be seen in the noise artifacts in row 2 and vertical smearing in row 3. Column 4 shows the independent-renaising method Flower, which achieves excellent accuracy when measurements are informative, but struggles at 100 steps with the sparser 4x super-resolution problem. In Column 5 -Flow achieves excellent accuracy across all problems by adapting the prior to the task.
| ×2 | ×3 | ×4 | ×6 | |||||
|---|---|---|---|---|---|---|---|---|
| PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | PSNR | SSIM | |
| 0.1 | 32.09 | .882 | 30.15 | .845 | 28.40 | .798 | 25.57 | .712 |
| 0.5 | 33.00 | .907 | 30.19 | .846 | 28.22 | .790 | 25.12 | .696 |
| 1.0 | 33.08 | .909 | 30.01 | .839 | 27.85 | .777 | 23.93 | .657 |
| 3.0 | 32.99 | .904 | 29.49 | .823 | 26.47 | .735 | 20.66 | .553 |
Table 7: PSNR (dB) and SSIM on AFHQ-Cat super-resolution for varying confidence scale . For each column is chosen to be the PSNR-optimal value from Table 6 (see Figure 7). The optimal decreases as the downsampling factor increases, favouring a more confident prior when observations are less informative.
5 CONCLUSION
We have introduced a general plug-and-play technique for guided flow sampling for inverse problems that makes the prior behaviour itself an explicit choice. Our method allows an arbitrary denoising generative model to define trajectory priors ranging from deterministic flows to decorrelated, and even anti-correlated paths with controllable strength, while being simply interpreted as standard conditioning in a Gaussian graphical model. We illustrated the practical relevance of this control in super-resolution by demonstrating that harder tasks perform substantially better with straighter trajectories and stronger prior strength. Our method attains state-of-the-art performance in PSNR and SSIM in most tasks, and is from the best performance in all tasks where it is not. Moreover, we demonstrated that many existing approaches can be interpreted as approximations to our approach, and presented a qualitative comparison across model classes that reveals the implicit assumptions contained in three common model classes.
Acknowledgements
This work was supported by the Maths4DL EPSRC Programme on the Mathematics of Deep Learning (EP/V026259/1), the UKRI Strength in Places Fund MyWorld Project (SIPF00006/1), and the Munich Center for Machine Learning (MCML).
References
[1] Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow matching for generative modeling. In International Conference on Learning Representations (ICLR), 2023.
[2] Xingchao Liu, Chengyue Gong, and Qiang Liu. Flow straight and fast: Learning to generate and transfer data with rectified flow. In International Conference on Learning Representations (ICLR), 2023.
[3] Michael S. Albergo and Eric Vanden-Eijnden. Building normalizing flows with stochastic interpolants. In International Conference on Learning Representations (ICLR), 2023.
[4] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, 2020.
[5] Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations (ICLR), 2021.
[6] Hyungjin Chung, Jeongsol Kim, Michael Thompson Mccann, Marc Louis Klasky, and Jong Chul Ye. Diffusion posterior sampling for general noisy inverse problems. In International Conference on Learning Representations (ICLR), 2023.
[7] Jiaming Song, Arash Vahdat, Morteza Mardani, and Jan Kautz. Pseudoinverse-guided diffusion models for inverse problems. In International Conference on Learning Representations (ICLR), 2023.
[8] Heli Ben-Hamu, Omri Puny, Itai Gat, Brian Karrer, Uriel Singer, and Yaron Lipman. D-Flow: Differentiating through flows for controlled generation. In Proceedings of the 41st International Conference on Machine Learning (ICML), volume 235 of Proceedings of Machine Learning Research, 2024.
[9] Ségolène Martin, Anne Gagneux, Paul Hagemann, and Gabriele Steidl. PnP-Flow: Plug-and-play image restoration with flow matching. In
International Conference on Learning Representations (ICLR), 2025.
[10] Mehrsa Pourya, Bassam El Rawas, and Michael Unser. Flower: A flow-matching solver for inverse problems. In International Conference on Learning Representations (ICLR), 2026.
[11] Michael S. Albergo, Nicholas M. Boffi, and Eric Vanden-Eijnden. Stochastic interpolants: A unifying framework for flows and diffusions. arXiv preprint arXiv:2303.08797, 2023.
[12] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In International Conference on Learning Representations (ICLR), 2021.
[13] Alexander Denker, Moshe Eliasof, Zeljko Kereta, and Carola-Bibiane Schönlieb. Trajectory stitching for solving inverse problems with flow-based models. arXiv preprint arXiv:2602.08538, 2026.
[14] Xinyu Peng, Ziyang Zheng, Wenrui Dai, Nuoqian Xiao, Chenglin Li, Junni Zou, and Hongkai Xiong. Improving diffusion models for inverse problems using optimal posterior covariance. In Proceedings of the 41st International Conference on Machine Learning (ICML), volume 235 of Proceedings of Machine Learning Research, pages 40347–40370, 2024.
[15] Bradley Efron. Tweedie's formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011.
[16] Jure Zbontar, Florian Knoll, Anuroop Sriram, Matthew Muckley, Mary Bruno, Aaron Defazio, Marc Parente, Krzysztof J. Geras, Joe Katsnelson, Hersh Chandarana, Zizhao Zhang, Michal Drozdzal, Adriana Romero, Michael G. Rabbat, Pascal Vincent, James Pinkerton, Duo Wang, Nafissa Yakubova, Erich Owens, C. Lawrence Zitnick, Michael P. Recht, Daniel K. Sodickson, and Yvonne W. Lui. fastmri: An open dataset and benchmarks for accelerated mri. ArXiv, abs/1811.08839, 2018. URL https://api.semanticscholar.org/CorpusID:53759905.
[17] Florian Knoll, Jure Zbontar, Anuroop Sriram, Matthew J. Muckley, Mary Bruno, Aaron Defazio, Marc Parente, Krzysztof J. Geras, Joe Katsnelson, Hersh Chandarana, Zizhao Zhang, Michal Drozdzalv, Adriana Romero, Michael Rabbat, Pascal Vincent, James Pinkerton, Duo Wang, Nafissa Yakubova, Erich Owens, C. Lawrence Zitnick, Michael P. Recht, Daniel K. Sodickson, and Yvonne W. Lui. fastmri: A publicly available raw k-space and dicom dataset of knee images for accelerated mr image reconstruction using machine learning. Radiology: Arti-ficial Intelligence, 2(1):e190007, 2020. doi: 10.1148/ryai.2020190007. URL https://doi.org/10.1148/ryai.2020190007. PMID: 32076662.
[18] Alexander Denker, Johannes Hertrich, and Sebastian Neumayer. A stability benchmark of generative regularizers for inverse problems. arXiv preprint arXiv:2605.10076, 2026.
[19] Cynthia H McCollough, Adam C Bartley, Rickey E Carter, Baiyu Chen, Tammy A Drees, Phillip Edwards, David R Holmes III, Alice E Huang, Farhana Khan, Shuai Leng, et al. Low-dose ct for the detection and classification of metastatic liver lesions: results of the 2016 low dose ct grand challenge. Medical physics, 44(10): e339–e352, 2017.
[20] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 13(4):600–612, 2004.
[21] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In 2018 IEEE/CVF conference on computer vision and pattern recognition, pages 586–595. IEEE, 2018.
[22] Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6228–6237. IEEE, 2018.
[23] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), volume 70 of Proceedings of Machine Learning Research, 2017.
Spanning Diffusion and Flow-based Posterior Sampling via Exact Gaussian Conditioning: Supplementary Materials
A DERIVATIONS
A.1 The kernel family. Given , the point on the interpolant and the state of (3) are affine in the same noise , plus independent noise, so they are jointly Gaussian,
where the cross-covariance comes from the shared component . Further conditioning on gives
which is (5) with and .
To recover the diffusion prior from this we note that DDPM is defined using the Markov forward step , with independent of , and so that the marginals are preserved, has the reverse posterior
Matching the coefficient of (14) gives , and at this value the coefficient of and the variance agree as well.
For the DDIM family we note that for marginals , the DDIM kernel with noise scale is
This is (14) with , so covers the DDIM family, and () is the deterministic update used in flow-matching.
Negative is not covered by DDIM, but nonetheless defines a valid kernel which introduces transitions that are actively negatively correlated.
A.2 DPS and D-Flow in the form of (13). A DPS step proceeds by taking an unconditional reverse diffusion step and adding a gradient step based on the data misfit to the estimated ground truth. Taking , this can be written as
where the second line uses with , and . This is (13) with the kernel at and the gain . For an exact denoiser , though a trained network satisfies this only approximately. GDM's isotropic covariance changes the residual weighting to but keeps in place of .
D-Flow. With and at , a gradient step on with step size , and the update it induces on the point estimate, are
(16)
where is the average of along the step . The second line is exact: the fundamental theorem of calculus along the straight line between the iterates gives , the identity behind Integrated Gradients [23]. Applying gives (13) with and the gain of Table 2. To first order , and is the covariance that a unit Gaussian perturbation of induces on . Beyond first order depends on , and so on , so the D-Flow gain is not a fixed operator.
B STEP-SIZE GAINS VERSUS THE KALMAN GAIN
Every method in Table 2 corrects the point estimate by , where is the residual. The step changes the residual to
so is the part of the residual the step removes. The residual can also be written as , thus it is a combination of the prediction error (projected into observation space), which is signal, and observation noise. The Kalman step removes a proportion of the residual that balances the uncertainty in the prior and observations based on Gaussian conditioning. A step that removes more of the residual over-weights the observations, either by treating the data as more certain, or the prior as less certain, leading to overfitting to the noise.
Setting. Let be any linear operator, let be the posterior covariance at the current time , and assume as . Write for the Kalman gain built from a covariance . Ours is with of (12), and is the Kalman gain with the true posterior covariance. PnP-Flow applies , and DPS applies with , where is the Jacobian of the network. The following proposition shows that without tuned step size schedules, PnP-Flow and DPS cannot reproduce the calibrated step of the Kalman gain.
Proposition 1. Let r be a residual with , and let .
(i) Kalman gains, including ours. and , for every .
(ii) PnP-Flow. does not depend on , so the step removes the share of the residual at every step.
(iii) DPS. Assuming as (the denoiser output converges to its input in the limit of no noise) , so the residual removed does not vanish.
PnP-Flow and DPS therefore overweight the observations by continuing to reduce the residual as , where the true conditional mean recognises models the remaining residual as noise. In particular, no fixed step size reproduces the Kalman gain along the trajectory, and these methods require scheduling as a result.
Proof.
(i) With , , so , which tends to zero for and for .
(ii) since .
(iii) for the diffusion kernel , so , and when .
C TWO-DIMENSIONAL ILLUSTRATION
In this appendix we provide some further 2-dimensional visualisations in order to further inspect the mechanisms of the approach, which is difficult to see directly for the high-dimensional image problems of Section 4. We apply our construction to a two-moons denoising problem , so that the priors and posterior at each step are two-dimensional and can be plotted directly. Figure 4 compares the impact of the correlation and confidence parameters on the trajectories generated, and Figure 5 visualises the prior and posterior distributions that are modelled during a single transition at various stages of sampling. Both figures share the same trained flow-matching network, the same true signal and observation .
Individual trajectories across and over 30 steps.
true
observation y

(flow-matching)



: diffusion schedule
(decorrelated)
Figure 4: Trajectories for a two-moons denoising problem under for trajectory priors in and endpoint-uncertainty scale . For the Kalman gain vanishes, so the particles follow the unconditional prior unaffected by the observations. For the prior weakens and lets the Kalman gain pulls the particles towards observation with the magnitude of the pull determined by . Trajectories in the top row are deterministic given the initial noise and observations, as expected of an ODE update, whereas those in the lower two rows take random transitions at each step.

Figure 5: The conditioning step at six times along a trajectory (columns) for three choices of (rows): the decorrelated kernel ( ), the diffusion schedule ( ) and the flow-matching kernel ( ). Each panel shows the prior over before conditioning on (dashed orange) and the posterior (9) (solid green), together with the true signal (red diamond) mapped into current time point (i.e. the red diamonds are showing for the time associated to that column, as this is what the time conditional posterior is targeting). Larger leaves less fresh noise in the kernel, so both prior and posterior contract, and at the conditioning step makes only a small correction to a nearly deterministic update.
D IMPLEMENTATION DETAILS
We base our implementation on the github repository for Flower https://github.com/mehrsapo/Flower which is a fork of the PnP-Flow repository https://github.com/annegnx/PnP-Flow. We inherit the model architecture, weights, and datasets for the AFHQ-Cats and CelebA from these works. For the FastMRI experiment we trained a model using the same architecture, and for the AAPM model we used the pre-trained model from [18].
A fully reproducible implementation with pre-trained weights and dataset splits is planned for released in the near future. The following subsections describe the problem-specific implementation details.
D.1 AFHQ-Cats and CelebA
We inherit the experimental setup, pre-trained model weights, datasets/splits, and baseline hyperparameters directly from [10], which in turn builds on [9].
We evaluate on two datasets. CelebA consists of human face images; AFHQ-Cat consists of cat images. All images are normalised to the range . Models are trained on the full training splits of both datasets. All metrics are reported on 100 test images per dataset using a consistent split with the comparison methods.
All flow-matching methods (including -Flow and the baselines OT-ODE, D-Flow, Flow-Priors, and PnP-Flow) share the same U-Net backbone trained with mini-batch optimal-transport flow matching and a Gaussian latent prior. Pre-trained weights are taken from [9], trained with learning rate : on CelebA for 200 epochs (batch size 128) and on AFHQ-Cat for 400 epochs (batch size 64).
We evaluate on five restoration tasks: denoising with additive Gaussian noise ( ); Gaussian deblurring with a kernel ( for CelebA, for AFHQ-Cat) and additive noise ( ); super-resolution at 2× for CelebA and 4× for AFHQ-Cat (); random inpainting with 70% of pixels removed (); and box inpainting with a centred rectangular mask (40 × 40 for CelebA, 80 × 80 for AFHQ-Cat, ).
We compare against OT-ODE, D-Flow, Flow-Priors, PnP-Flow, PnP-GS, and DiffPIR. Hyperparameters for all baselines are adopted from [10], which performed a grid search on the validation set to maximise PSNR. The number of steps was fixed to 100 for all methods; the Flower and PnP-Flow results that used 200 or 500* steps on AFHQ-Cat are quoted directly from [10] and are indicated by the corresponding superscripts in Table 3.
For -Flow, was selected from a uniform grid on [-0.9, 0.9] at spacing 0.1, augmented with and near the boundaries, and from {0.1, 0.5, 1, 5, 10}, both tuned independently per dataset and task on the held-out validation split. The resulting values are reported in Table 8.
Table 8: -Flow hyperparameters per task,selected on the validation split to maximise PSNR.
| Task | CelebA | AFHQ-Cat | ||
|---|---|---|---|---|
| Denoising | 0.1 | 1.0 | 0.4 | 1.0 |
| Deblurring | -0.99 | 1.0 | -0.8 | 5.0 |
| Super-resolution | -0.9 | 1.0 | 0.5 | 0.1 |
| Random inpainting | -0.9 | 10.0 | -0.9 | 10.0 |
| Box inpainting | 0.9 | 0.1 | 0.8 | 0.1 |
D.2 Medical MRI/CT reconstruction
Every method was tuned on a separate validation set, and the number of steps was fixed to 100 (except for D-Flow). Per-image runtimes for both medical tasks are reported in Table 9.
For the fastMRI dataset, images are 128 × 128, complex-valued (2 real channels). The forward operator retains 20% of phase-encode lines (yielding an effective acceleration), with Gaussian noise added directly in k-space. DPS used , IIGDM used a guidance scale of 0.5, with the conjugate-gradient solver run for up to 100 iterations (tolerance ), PnP-Flow used 5 sample averaging and , kept constant throughout, Flower was run with 5 sample averaging (Flower5), D-Flow used an initialization blend of 0.7, a regularization weight of , 15 outer LBFGS iterations with 20 inner iterations each, and a 6-step Euler discretization of the flow ODE, -Flow used and and also used 5 sample averaging.
For the CT dataset, images are 256 × 256, single-channel. The forward operator is a sparse-view Radon transform with 60 projection angles over [0°, 180°), with Gaussian noise on the normalized sinogram. DPS used , IIGDM used a guidance scale of 1.5, with the same conjugate-gradient settings as above, PnP-Flow used 5 sample averaging and , kept constant throughout, Flower was again run with 5 sample averaging, D-Flow used an initialization blend of 0.8, with the same remaining settings as on MRI, -Flow used and and also used 5 sample averaging.
Table 9: Wall-clock time per image, in seconds, for the MRI and CT results of Table 5, under the same fixed step budget of 100 used there (except D-Flow, which uses its own optimisation budget).
| Method | MRI | CT |
|---|---|---|
| DPS | 8.92 | 7.43 |
| IIGDM | 9.02 | 21.75 |
| D-Flow | 312.52 | 283.87 |
| PnP-Flow | 15.64 | 15.95 |
| Flower | 23.48 | 48.76 |
| β-Flow (ours) | 6.67 | 27.10 |
E AND ABLATION VISUALISATION
AFHQ-Cat superresolution reconstructions vs. ( )
Low-res input
×2


33.26 dB

33.33 dB

33.38 dB

33.39 dB

33.26 dB
×3


29.26 dB

29.48 dB

29.70 dB

29.83 dB

29.88 dB
×4


24.44 dB

26.50 dB

26.76 dB

27.01 dB

27.18 dB
×6


17.63 dB

17.79 dB

18.50 dB

21.10 dB

22.65 dB
Figure 6: Qualitative effect of on AFHQ-Cat super-resolution with fixed . Leftmost column is the observation, and Columns 2-6 show reconstructions with different parameters. As the downsampling factor increases the observation constrains less, and reconstructions benefit more from increased provides. At and , have visible grid artefacts and washed out tone that improve when increases, demonstrating the trend in Table 6.
AFHQ-Cat superresolution reconstructions vs. (each factor at its optimal )
Low-res input

32.63 dB

33.28 dB

33.26 dB

33.12 dB

30.16 dB


30.08 dB

29.83 dB

29.13 dB


28.05 dB

27.73 dB

27.18 dB

25.35 dB


23.87 dB

23.78 dB

22.65 dB

19.88 dB
Figure 7: Qualitative effect of on AFHQ-Cat super-resolution using the same test image as Figure 6. For each scale factor is chosen to be its own PSNR-optimal ( : -0.6, : 0.3, , : 0.6) from Figure 6. A larger widens the prior and lets the observation dominate the update; by this produces blurring and a strong grid artefact, most pronounced at and where the observation is least informative, matching the trend in Table 7.