betaFeedback

WorksMathematics

Risk-Averse Inference-Time Diffusion Model Alignment with Finite-Sample Guarantees

Abstract

Inference-time alignment steers diffusion models toward downstream objectives without costly fine-tuning, but existing methods typically optimize expected cost (or reward) without explicitly controlling tail risk. In this work, we propose a risk-averse framework for inference-time alignment of diffusion models that balances expected cost and Conditional Value-at-Risk (CVaR) under trajectory-level Kullback-Leibler regularization. We characterize the optimal path distribution and reverse transitions as functions of the CVaR threshold, reducing the alignment problem to a one-dimensional optimization problem over the threshold. We show that this one-dimensional optimization problem can be nonconvex in general, establish sufficient conditions for convexity, and introduce quadratic regularization to enable efficient derivative-free ternary search. Under suitable assumptions, we provide finite-sample guarantees for threshold optimization and value estimation, and combine them into a terminal total-variation bound relative to the regularized target under exact resampling. Experiments on synthetic data and image generation using Stable Diffusion demonstrate improved tail performance over risk-neutral baselines while maintaining competitive average cost.

Introduction

Pretrained diffusion models [1, 2] have shown remarkable success in generating high-quality images and videos [3, 4, 5], but their outputs may not meet the specific needs of a downstream application. One approach is to fine-tune the pretrained model using task-specific rewards [6], but repeated fine-tuning can be expensive as needs change and may be infeasible when model weights are unavailable. An alternative approach is inference-time alignment, which steers the sampling process toward desired outputs without modifying the pretrained model [7, 8]. A classical formulation of inference-time alignment is to optimize the expected cost (resp. reward) at the output, while ensuring that the steered sampling path is close to the pretrained one [6, 7]. However, in practice, good average performance does not preclude the possibility of undesirable tail outcomes. For example, in molecular design where the expected chemical stability is optimized [9], there could still be a non-negligible probability of generating highly unstable candidates. As another example, diffusion-based robot motion planning requires explicit attention to collision avoidance [10, 11], since strong average task performance alone does not rule out occasional dangerous trajectories.

To this end, there is an urgent need for risk-averse inference-time alignment that explicitly accounts for risk by augmenting the expectation-based objective with a coherent risk measure. Among coherent risk measures, Conditional Value-at-Risk (CVaR) provides a principled way to capture tail behavior, as it measures the average cost beyond a prescribed threshold (i.e., Value-at-Risk) of the output distribution. According to [12, 13], CVaR can be expressed as an optimization problem over this one-dimensional threshold. Recent works have incorporated CVaR into generative model fine-tuning through sequential updates [14] or threshold-based reward transformation [9]. However, these works focus on risk-averse fine-tuning, which can be computationally costly and impractical for large pretrained models.

This paper aims to develop a risk-averse inference-time alignment framework that combines expected cost and CVaR under trajectory-level Kullback-Leibler (KL) regularization while keeping the pretrained model frozen. Establishing the reliability of such a framework requires a non-asymptotic analysis of its sampling accuracy. While existing risk-averse fine-tuning work studies sensitivity to threshold errors [9], inference-time alignment must additionally account for estimation errors in the value functions used to guide sampling. A central theoretical challenge is therefore to characterize how errors in CVaR threshold optimization and value function estimation jointly affect the final output distribution, and how many samples are needed to achieve a prescribed accuracy. This leads to the following question:

How can we align pretrained diffusion models at inference time to control tail risk, and what finite-sample guarantees can we establish?

Our Contributions

Our main contributions can be summarized as follows.

CVaR-based inference-time alignment framework. We characterize the optimal risk-averse sampling policy as a function of the CVaR threshold, reducing the risk-averse alignment problem to a one-dimensional threshold optimization problem. This characterization enables existing risk-neutral inference-time samplers, including SVDD and SMC, to incorporate tail-risk control through risk-adjusted value functions while keeping the pretrained diffusion backbone fixed.

Efficient ternary search algorithm for CVaR threshold optimization. We show that the threshold objective can be nonconvex in general and provide sufficient conditions for convexity. For the potentially nonconvex case, we introduce quadratic regularization to obtain a strongly convex objective and employ a ternary search algorithm with an inexact objective evaluation oracle, establishing finite-iteration complexity.

End-to-end sampling guarantees. We further establish finite-sample guarantees for threshold optimization and value estimation under suitable assumptions. Under exact tilted-transition sampling, we combine these results into an end-to-end total-variation bound, quantifying the joint effects of threshold and value-estimation errors on sampling accuracy.

Synthetic and image-generation experiments. We evaluate our risk-averse framework through extensive experiments on heavy-tailed synthetic data and Stable Diffusion image generation [4] with compressibility and aesthetic rewards. Notably, CVaR-SVDD improves empirical tail performance, consistent with our risk-sensitive objective. We further conduct ablation studies across different prompts, sampling procedures, and threshold-optimization algorithms.

Related Work

We review the most relevant works below and discuss additional related works in Appendix A.

CVaR-based generative alignment. Recent works have incorporated CVaR into generative model fine-tuning. Flow Density Control [14] optimizes distributional objectives, including CVaR, through a sequence of fine-tuning problems. Tail-aware Flow Fine-Tuning [9] characterizes an optimal terminal distribution through scalar threshold optimization and uses the resulting transformed reward for fine-tuning. Differently, our framework incorporates CVaR at inference time while keeping the pretrained model fixed. Related inference-time work, RS-Diffuser [15], guides denoising using gradients of CVaR computed from a distributional critic conditioned on noisy candidate plans. In contrast, our formulation optimizes mean-CVaR over the terminal distribution induced by the sampling policy, under trajectory-level KL regularization.

Theoretical guarantees for alignment. Several recent works have established theoretical guarantees for inference-time alignment. Learnable Chernoff Baselines [16] provide total-variation guarantees for approximate rejection sampling from exponentially tilted transitions. DOIT [17] analyzes sampling accuracy under approximation of the dynamic correction induced by Doob’s hh-transform. [18] studies how approximate value functions, quantified through Bellman errors, affect inference-time sampling, including finite-particle SMC complexity. For CVaR-based fine-tuning, [9] also studies sensitivity of the target distribution to threshold errors. Our analysis complements these results by establishing sample-complexity bounds for CVaR threshold optimization and value estimation, and quantifying how these two sources of error jointly affect the final output distribution in total variation.

Background

In this section, we introduce the necessary background.

(Continuous-Space) Diffusion Models

Diffusion models [1, 2] generate samples through a reverse process that progressively removes noise added by a forward process. Given initial data x0∈Rdx_0 \in\mathbb{R}^d, the forward process gradually adds Gaussian noise:

xt=1−βt xt−1+βt wt,t=1,…,T,x_t = \sqrt{1-\beta_t}\,x_{t-1} + \sqrt{\beta_t}\,w_t, \qquad t=1,\ldots,T,

where wt∼i.i.d.N(0,Id)w_t \overset{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0,I_d) and βt∈(0,1)\beta_t \in(0,1) is the noise schedule. Define αt:=1−βt\alpha_t := 1-\beta_t and αˉt:=∏i=1tαi\bar{\alpha}_t := \prod_{i=1}^{t}\alpha_i. Accumulating the forward steps gives

qt∣0(xt∣x0)=N(αˉt x0,(1−αˉt)Id).q_{t|0}(x_t \mid x_0) = \mathcal{N}\left(\sqrt{\bar{\alpha}_t}\,x_0,(1-\bar{\alpha}_t)I_d\right).

Thus, when αˉT\bar{\alpha}_T is sufficiently small, the terminal distribution is approximately standard Gaussian.

The reverse sampling process starts from xT∼qT:=N(0,Id)x_T \sim q_T := \mathcal{N}(0,I_d) and applies learned denoising transitions for t=T,…,1t=T,\ldots,1. Tweedie’s formula yields (cf. [19])

qt−1∣t(xt−1∣xt)=N(mt(xt),σt2Id).q_{t-1|t}(x_{t-1}\mid x_t) = \mathcal{N}\left(m_t(x_t),\sigma_t^2 I_d\right).

where mt(xt):=1αt(xt+(1−αt)st(xt))m_t(x_t) := \frac{1}{\sqrt{\alpha_t}}\left(x_t+(1-\alpha_t)s_t(x_t)\right), sts_t estimates the score, i.e., ∇log⁡qt\nabla\log q_t at time tt, and σt2\sigma_t^2 is a prescribed reverse variance. To unify notation, we also define xT+1x_{T+1} as a (dummy) deterministic state, with qT∣T+1(xT∣xT+1)=qT(xT)q_{T|T+1}(x_T\mid x_{T+1})=q_T(x_T).

Throughout this paper, qq denotes the joint distribution induced by the pretrained sampling path:

q(x0:T)=qT(xT)∏t=1Tqt−1∣t(xt−1∣xt),q(x_{0:T}) = q_T(x_T)\prod_{t=1}^{T}q_{t-1|t}(x_{t-1}\mid x_t),

with qtq_t denoting the marginal distribution at time tt. In particular, q0q_0 is the pretrained model’s output distribution, which serves as the reference distribution for inference-time sampling.

(Risk-Neutral) Inference-Time Alignment

In practice, one often seeks to align a pretrained diffusion model with a reward function to generate samples with higher rewards. To this end, inference-time alignment aims to generate samples with higher rewards without changing the weights of the pretrained model. Writing the terminal cost as c(x0):=−r(x0)c(x_0) := -r(x_0), a typical KL-regularized objective is [7, 20]:

min⁡πEπ[c(x0)]+αKL⁡(π1:T+1∥μ1:T+1),(1)\min_{\pi} \mathbb{E}_{\pi}[c(x_0)] + \alpha\operatorname{KL}(\pi_{1:T+1}\Vert\mu_{1:T+1}), \tag*{(1)}

where α>0\alpha> 0 controls the regularization strength. Here π:=π1:T+1\pi:= \pi_{1:T+1} denotes the joint path distribution induced by the initial distribution πT+1\pi_{T+1} and reverse transitions πt\pi_t, t=1,…,Tt = 1,\ldots,T. The reference distribution μ1:T+1=q\mu_{1:T+1} = q is induced by the pretrained transitions μt:=qt−1∣t\mu_t := q_{t-1|t} with initialization μT+1=qT=N(0,Id)\mu_{T+1} = q_T = \mathcal{N}(0,I_d).

For t=1,…,T+1t = 1,\ldots,T+1, let Vt∗(xt)V_t^*(x_t) denote the optimal regularized cost-to-go (or soft value function) from state xtx_t, defined as follows:

Vt∗(xt):=min⁡π1:tEπ[c(x0)+αKL⁡(π1:t∥μ1:t)∣xt].(2)V_t^*(x_t) := \min_{\pi_{1:t}} \mathbb{E}_{\pi}\left[c(x_0) + \alpha\operatorname{KL}(\pi_{1:t}\Vert\mu_{1:t}) \mid x_t\right]. \tag*{(2)}

Here π1:t(⋅∣xt)\pi_{1:t}(\cdot\mid x_t) and μ1:t(⋅∣xt)\mu_{1:t}(\cdot\mid x_t) denote the laws of the remaining trajectory x0:t−1x_{0:t-1} starting from xtx_t. In other words, Vt∗(xt)V_t^*(x_t) accounts for both the expected terminal cost and the accumulated KL penalties over the remaining reverse steps. Note that the terminal condition is V0∗(x0)=c(x0)V_0^*(x_0) = c(x_0). From [7], the optimal soft value function at time tt has the following recursion

Vt∗(xt)=−αlog⁡Eμt[e−Vt−1∗(xt−1)/α∣xt],(3)V_t^*(x_t) = -\alpha\log\mathbb{E}_{\mu_t}\left[\left.e^{-V_{t-1}^*(x_{t-1})/\alpha}\right|x_t\right], \tag*{(3)}

and the corresponding optimal reverse transitions satisfy

πt∗(xt−1∣xt)=μt(xt−1∣xt)e−(Vt−1∗(xt−1)−Vt∗(xt))/α\pi_t^*(x_{t-1}\mid x_t) = \mu_t(x_{t-1}\mid x_t)e^{-(V_{t-1}^*(x_{t-1})-V_t^*(x_t))/\alpha}
∝μt(xt−1∣xt)e−Vt−1∗(xt−1)/α.\propto\mu_t(x_{t-1}\mid x_t)e^{-V_{t-1}^*(x_{t-1})/\alpha}.

Concatenation over tt further yields

References

  1. [1]Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, pages 6840–6851, 2020.arxiv.org/abs/2006.11239
  2. [2]Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In The Ninth International Conference on Learning Representations, 2021.
  3. [3]Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.arxiv.org/abs/2204.06125
  4. [4]Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10684–10695, June 2022.arxiv.org/abs/2112.10752
  5. [5]Andrew Melnik, Michal Ljubljana, Cong Lu, Qi Yan, Weiming Ren, and Helge Ritter. Video diffusion models: A survey. arXiv preprint arXiv:2405.03150, 2024.arxiv.org/abs/2405.03150
  6. [6]Masatoshi Uehara, Yulai Zhao, Ehsan Hajiramezanali, Gabriele Scalia, Gö kcen Eraslan, Avantika Lal, Sergey Levine, and Tommaso Biancalani. Bridging model-based optimization and generative modeling via conservative fine-tuning of diffusion models. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.arxiv.org/abs/2405.19673
  7. [7]Xiner Li, Yulai Zhao, Chenyu Wang, Gabriele Scalia, Gö kcen Eraslan, Surag Nair, Tommaso Biancalani, Shuiwang Ji, Aviv Regev, Sergey Levine, and Masatoshi Uehara. Derivative-free guidance in continuous and discrete diffusion models with soft value-based decoding. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.arxiv.org/abs/2408.08252
  8. [8]Raghav Singhal, Zachary Horvitz, Ryan Teehan, Mengye Ren, Zhou Yu, Kathleen McKeown, and Rajesh Ranganath. A general framework for inference-time scaling and steering of diffusion models. In Forty-second International Conference on Machine Learning, 2025.arxiv.org/abs/2501.06848
  9. [9]Zifan Wang, Riccardo De Santi, Xiaoyu Mo, Michael M. Zavlanos, Andreas Krause, and Karl Henrik Johansson. Efficient tail-aware generative optimization via flow model fine-tuning. In Forty-third International Conference on Machine Learning, 2026.arxiv.org/abs/2602.16796
  10. [10]Wei Xiao, Tsun-Hsuan Wang, Chuang Gan, Ramin Hasani, Mathias Lechner, and Daniela Rus. Safediffuser: Safe planning with diffusion probabilistic models. In The Thirteenth International Conference on Learning Representations, 2025.
  11. [11]Hao Ma, Sabrina Bodmer, Andrea Carron, Melanie Zeilinger, and Michael Muehlebach. Constraint-aware diffusion guidance for robotics: Real-time obstacle avoidance for autonomous racing. In 9th Annual Conference on Robot Learning, 2025.arxiv.org/abs/2505.13131
  12. [12]R Tyrrell Rockafellar, Stanislav Uryasev, et al. Optimization of conditional value-at-risk. Journal of Risk, 2(3):21–42, 2000.DOI
  13. [13]R Tyrrell Rockafellar and Stanislav Uryasev. Conditional value-at-risk for general loss distributions. Journal of Banking & Finance, 26(7):1443–1471, 2002.DOI
  14. [14]Riccardo De Santi, Marin Vlastelica, Ya-Ping Hsieh, Zebang Shen, Niao He, and Andreas Krause. Flow density control: Generative optimization beyond entropy-regularized fine-tuning. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.arxiv.org/abs/2511.22640
  15. [15]Shiqiang Gong. Rs-diffuser: Risk-sensitive diffusion planning with distributional value guidance. arXiv preprint arXiv:2606.27766, 2026.arxiv.org/abs/2606.27766
  16. [16]Sunil Madhow, Yuchen Liang, Ness Shroff, Yingbin Liang, and Yu-Xiang Wang. Learnable chernoff baselines for provable inference-time alignment. In The Fortieth Annual Conference on Neural Information Processing Systems, 2026.arxiv.org/abs/2602.07738
  17. [17]Qijie Zhu, Zeqi Ye, Han Liu, Zhaoran Wang, and Minshuo Chen. Training-free adaptation of diffusion models via doob’s $h$-transform. In Forty-third International Conference on Machine Learning, 2026.arxiv.org/abs/2602.16198
  18. [18]Youheng Zhu and Yiping Lu. On the power of (approximate) reward models for inference-time scaling. arXiv preprint arXiv:2602.01381, 2026.arxiv.org/abs/2602.01381
  19. [19]Bradley Efron. Tweedie’s formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011.pubmed.ncbi.nlm.nih.gov/22505788
  20. [20]Chenyu Wang, Masatoshi Uehara, Yichun He, Amy Wang, Avantika Lal, Tommi Jaakkola, Sergey Levine, Aviv Regev, Hanchen, and Tommaso Biancalani. Fine-tuning discrete diffusion models via reward optimization with applications to DNA and protein design. In The Thirteenth International Conference on Learning Representations, 2025.arxiv.org/abs/2410.13643
  21. [21]Michael B Cohen, Yin Tat Lee, Gary Miller, Jakub Pachocki, and Aaron Sidford. Geometric median in nearly linear time. In Proceedings of the forty-eighth annual ACM symposium on Theory of Computing, pages 9–21, 2016.arxiv.org/abs/1606.05225
  22. [22]Masatoshi Uehara, Yulai Zhao, Tommaso Biancalani, and Sergey Levine. Understanding reinforcement learning-based fine-tuning of diffusion models: A tutorial and review. arXiv preprint arXiv:2407.13734, 2024.arxiv.org/abs/2407.13734
  23. [23]Kevin Black, Michael Janner, Yilun Du, Ilya Kostrikov, and Sergey Levine. Training diffusion models with reinforcement learning. arXiv preprint arXiv:2305.13301, 2024.arxiv.org/abs/2305.13301
  24. [24]Kevin Clark, Paul Vicol, Kevin Swersky, and David J Fleet. Directly fine-tuning diffusion models on differentiable rewards. arXiv preprint arXiv:2309.17400, 2024.arxiv.org/abs/2309.17400
  25. [25]Masatoshi Uehara, Yulai Zhao, Chenyu Wang, Xiner Li, Aviv Regev, Sergey Levine, and Tommaso Biancalani. Inference-time alignment in diffusion models with reward-guided generation: Tutorial and review. arXiv preprint arXiv:2501.09685, 2025.arxiv.org/abs/2501.09685
  26. [26]Hyungjin Chung, Jeongsol Kim, Michael Thompson Mccann, Marc Louis Klasky, and Jong Chul Ye. Diffusion posterior sampling for general noisy inverse problems. In The Eleventh International Conference on Learning Representations, 2023.arxiv.org/abs/2209.14687
  27. [27]Yuchen Liang, Peizhong Ju, Yingbin Liang, and Ness Shroff. Theory on score-mismatched diffusion models and zero-shot conditional samplers. In The Thirteenth International Conference on Learning Representations, 2025.arxiv.org/abs/2410.13746
  28. [28]Jiaming Song, Arash Vahdat, Morteza Mardani, and Jan Kautz. Pseudoinverse-guided diffusion models for inverse problems. In International Conference on Learning Representations, 2023.
  29. [29]Luhuan Wu, Brian L. Trippe, Christian A Naesseth, John Patrick Cunningham, and David Blei. Practical and asymptotically exact conditional sampling in diffusion models. In Thirty-seventh Conference on Neural Information Processing Systems, 2023.arxiv.org/abs/2306.17775
  30. [30]Bingliang Zhang, Wenda Chu, Julius Berner, Chenlin Meng, Anima Anandkumar, and Yang Song. Improving diffusion inverse problem solving with decoupled noise annealing. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2025.DOI
  31. [31]Jacob K Christopher, Stephen Baek, and Ferdinando Fioretto. Constrained synthesis with projected diffusion models. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.arxiv.org/abs/2402.03559
  32. [32]Sai Shankar Narasimhan, Shubhankar Agarwal, Litu Rout, Sanjay Shakkottai, and Sandeep P. Chinchali. Constrained posterior sampling: Time series generation with hard constraints. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.arxiv.org/abs/2410.12652
  33. [33]András Prékopa. On logarithmic concave measures and functions. Acta Sci. Math., 34:335, 1973.
  34. [34]Pierre Del Moral, Arnaud Doucet, and Ajay Jasra. Sequential Monte Carlo samplers. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 2006.
  35. [35]Ying Fan, Olivia Watkins, Yuning Du, Hao Liu, Moonkyung Ryu, Craig Boutilier, Pieter Abbeel, Mohammad Ghavamzadeh, Kangwook Lee, and Kimin Lee. Dpok: Reinforcement learning for fine-tuning text-to-image diffusion models. arXiv preprint arXiv:2305.16381, 2023.arxiv.org/abs/2305.16381
  36. [36]Christoph Schuhmann. LAION-Aesthetics Predictor V2. https://github.com/christophschuhmann/improved-aesthetic-predictor, 2022. GitHub repository.
  37. [37]Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In International Conference on Learning Representations, 2021.arxiv.org/abs/2010.02502

Paper details

vlnc:W_zjsch7nd
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents