Manuscript Offprint

arXiv:2610.03503

Getting Your Guidance Weights Right in diffusion and flow-matching posterior sampling

Liam Moroy, Jean-François Giovannelli, Yoann Altmann, Steve McLaughlin, Frédéric Champagnat, Guillaume Bourmaud

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

L. Moroy,

Heriot-Watt University, EPS

Edinburgh, UK

J.-F. Giovannelli

IMS (Univ. Bordeaux, CNRS, BINP)

Bordeaux, France

Y. Altmann

Heriot-Watt University, EPS

Edinburgh, UK

S. McLaughlin

Heriot-Watt University, EPS

Edinburgh, UK

F. Champagnat

ONERA

Paris, France

G. Bourmaud

IMS (Univ. Bordeaux, CNRS, BINP)

Bordeaux, France

ABSTRACT

Training-free posterior sampling methods, also known as Plug-and-Play methods, leverage pretrained unconditional diffusion or flow-matching models to solve inverse problems. Most existing approaches rely on guidance weights to balance, at each time step, prior information from the unconditional score or velocity network with measurement consistency, yet the tuning of these weights is often not discussed and is largely left to heuristics. We introduce a simple and principled offline strategy for automatically tuning these guidance weights. Our key observation is that, at each time step, the conditional denoising score-matching objective for diffusion models, or the conditional flow-matching objective for flow-matching models, is a least-squares objective. Therefore, when the conditional prediction is expressed as a weighted sum of the unconditional network output and a measurement-guidance term, optimizing over these weights reduces to a two-dimensional linear least-squares problem. The resulting time-dependent guidance weights can be optimized offline for a given measurement operator, noise level and sampler at the cost of a single minibatch of sampling trajectories, without retraining or fine-tuning the pretrained generative model. Instantiated with the standard Tweedie-based measurement-consistency term, our approach improves posterior sampling and achieves state-of-the-art reconstruction performance across diffusion- and flow-matching-based methods. Moreover, the optimized guidance weights enable diffusion samplers to reduce the number of sampling steps from 1000 to 50 with no significant degradation in reconstruction quality. Code will be made available.

1 INTRODUCTION

Diffusion models (Ho et al., 2020; Karras et al., 2022; Song & Ermon, 2019; Song et al., 2020; Song & Ermon, 2020) and flow matching models (Lipman et al., 2022; Liu, 2022; Tong et al., 2023; Albergo et al., 2025; Liu et al., 2022) have emerged as dominant families of iterative generative models, achieving remarkable success in synthesizing high-fidelity samples across a wide range of data modalities. However, training these models remains computationally expensive and can require substantial computational resources and time. In inverse problems, where the exact measurement operator and noise characteristics often depend on the acquisition setting specified at inference time, retraining or fine-tuning a generative model for each new acquisition setting is often impractical. Practitioners instead commonly rely on training-free methods (Chung et al., 2022a; Song et al., 2023; Boys et al., 2023; Kim et al., 2025; Martin et al., 2025), also referred to as Plug-and-Play methods. These methods leverage unconditionally pretrained generative models to perform approximate posterior sampling without requiring additional training for different measurement operators or noise levels.

Most existing training-free methods (Chung et al., 2022a; Song et al., 2023; Boys et al., 2023; Kim et al., 2025; Martin et al., 2025) incorporate a measurement-consistency step at each time step to modify the unconditional sampling direction, thereby steering the sampling trajectory toward samples consistent with the measurement. Repeating this procedure throughout the sampling process yields a sample from the approximate posterior distribution. Such methods usually rely on guidance weights to balance, at each time step, the prior information provided by the unconditional score or velocity network against measurement consistency. However, the tuning of these weights is often not discussed and is largely left to heuristics.

In practice, the measurement setup may frequently change, for instance by modifying the number or locations of sensors, or their internal acquisition settings (Donoho, 2006). Such modifications require the guidance weights to be re-tuned, introducing an additional and time-consuming hyperparameter optimization step. Consequently, the need to tune guidance weights represents a key practical bottleneck of existing training-free posterior sampling methods.

This motivates the development of a strategy to automatically and efficiently determine appropriate guidance weights for a given measurement setup. Importantly, such a strategy must introduce negligible computational overhead. From a practitioner's perspective, guidance selection should take only a few seconds, ruling out iterative optimizers (e.g. gradient descent, etc.) that require repeated ODE/SDE integrations. In this paper, we introduce a simple and principled offline calibration strategy for automatically tuning time-dependent guidance weights. Our contributions are as follows:

• We make the key observation that, at each time step, the conditional denoising score-matching objective for diffusion models and the conditional flow-matching objective for flow-matching models are least-squares objectives. Therefore, when the conditional prediction is expressed as a weighted sum of the unconditional network output and a measurement-guidance term, optimizing these weights reduces to a two-dimensional linear least-squares problem. This yields a highly efficient, simulation-free strategy for calibrating time-dependent guidance weights.

• While theoretically grounded, the simulation-free calibration strategy does not guarantee improved posterior sampling trajectories, since neither the measurement-consistency term nor the unconditional network is necessarily optimal. To address this limitation, we propose a greedy SIMulation-based CALibration strategy (SIMCA), which sequentially calibrates the guidance weight at each time step while keeping the weights calibrated at previous time steps fixed. SIMCA requires only a single minibatch of sampling trajectories, making it practical for tuning time-dependent guidance weights in a given measurement setup.

• We empirically demonstrate that SIMCA, instantiated with the standard Tweedie-based measurement-consistency term, matches or surpasses state-of-the-art training-free methods across multiple inverse problems and datasets, using both diffusion and flow-matching backbones.

• We further show that SIMCA enables diffusion samplers to reduce the number of sampling steps from 1000 to 50, a ×\times20 reduction in inference cost, without significant degradation in reconstruction quality.

References (45)