alphaFeedback

WorksMathematics

Internal Guidance as a Sampling Method for Tilted Diffusion Models

AI contributions
  • generative AI tools
View details
Ancillary data
1 code link, 1 data link
View

Abstract

Reward guidance methods sample an exponential tilt of a base density using a diffusion model trained with only samples from the base distribution. Existing methods use what we call external guidance: additive terms in the drift or multiplicative terms on the transition probabilities. We propose internal guidance which leaves the output of the base denoiser unmodified and instead changes the point at which it is evaluated. For discrete distributions embedded in the hypercube {−1,1}d\{-1,1\}^{d}, the denoiser of any linearly tilted density is exactly the base denoiser evaluated at a shifted and rescaled input. In practice the base denoiser is a neural network trained on noised samples of the base distribution. The required evaluation points for sampling the tilted density would be out-of-distribution for basic noising of the base distribution. We modify the training algorithm with random diagonal rescalings of the data, so that the denoiser network learns both in- and out-of-distribution evaluations of the denoiser relative to the base distribution. A single denoiser network samples binary reward tilts, class labels, and infilling with no fine-tuning and no external guidance term.

Introduction

Diffusion models designed via Gaussian noising have become the dominant generative algorithm for continuous distributions [29, 13, 32], and continue to show promise for discrete targets as well [7, 16, 35]. The original theory of diffusion models was established for unconditional generation [31, 32]: given access to an initial pool of samples from a distribution π\pi, we train a model to sample from π\pi. As the field has matured, interest has turned towards conditional generation and tilting. Given access to only a pool of samples from π\pi, and a reward function rr, we want to train a sampling algorithm to sample from an exponential tilt by the reward function for some strength τ\tau with density π~(x)∝π(x)eτr(x)\tilde{\pi}(x) \propto\pi(x)e^{\tau r(x)}.

Existing methods utilize what the authors refer to as external guidance, implementing an additive vector field called a guidance term to modify SDE paths at sampling time [10, 28, 11], or a density ratio to reweight Markov chain conditional probabilities [33, 24, 17, 12]. Methods such as classifier-free guidance [14] implement ad hoc and closed-form guidance terms, but are known to structurally sample the wrong invariant measure and introduce sampling artifacts such as corrupted samples and mode collapse [8, 4]. Exact guidance schemes derive the analytically correct guidance terms, but result in an intractable object that must either be learned in an expensive neural network training run, or approximated by a tractable analog such as an empirical average that introduces compounding errors at sample time.

A recent line of work [15, 21, 20, 22] has opened up a new method for reward-tilted sampling we call internal guidance. Rather than modify the output of the denoiser of the base distribution with additive or multiplicative terms outside of the object, we realize we can instead shift our evaluation point inside the existing base denoiser. Recent work of Moitra et al. [21, Lemma 3.3] has shown for an internal mapping function HH we call a symmetry map, the evaluation of the denoiser of a linear tilted density is an evaluation of the base denoiser at a modified input

Gtilt(u,a)=Gbase(u~=H1(u,a),a~=H2(u,a)).G_{\mathrm{tilt}}(u,a)=G_{\mathrm{base}}(\tilde{u}=H_1(u,a),\tilde{a}=H_2(u,a)).

These symmetry mappings are closed-form objects involving shifting and rescaling inputs, derived from the interactions of linear tilts with the quadratic log-density terms introduced via Gaussian convolution.

Internal guidance has clear benefits. There is no intractable external term to approximate, and the symmetry maps HH are all explicit. A single denoising diffusion model, trained on unconditional sampling of its input distribution, is able to sample an entire family of tilted densities at inference time with no additional reinforcement learning, fine tuning, or external guidance required.

The catch with this method is one of coverage. If we had access to the oracle denoiser GG we could implement such a method with no additional error over base sampling. However, we instead have a network gθg_\theta trained to approximate GG. This network is only accurate in an L2L^2 sense along the sequence of marginal densities produced by noising the base distribution, which we call the training manifold. The equivalent points (u~,a~)(\tilde{u},\tilde{a}) induced by the symmetry map represent an out-of-distribution query from the perspective of the base model denoiser, and we have no control on the accuracy of our trained network at this point.

The relationship of the symmetry map can be captured by an equivalence class: for a tilted density π~\tilde{\pi} and an evaluation point (u,a)(u,a), the equivalence class is all points (u~,a~)(\tilde{u},\tilde{a}) where the base denoiser evaluated at (u~,a~)(\tilde{u},\tilde{a}) is equal to the tilted denoiser at (u,a)(u,a). The work of Moitra et al. [21] can be interpreted as showing this equivalence class exists and is non-empty, and established one symmetry map which creates the class. However, this symmetry alone is not enough to force overlap between the equivalence class of points produced by tilted sampling and the high probability region of the base distribution training manifold the denoiser network was trained on.

To have equivalent points that live near the training manifold, we need to introduce additional symmetry relationships that expand the equivalence class. We restrict our study to discrete distributions embedded in the hypercube {−1,1}d\{-1,1\}^{d}, noised under continuous Gaussian convolution, and a stochastic localization algorithm to implement the reverse sampling and produce discrete outputs. The benefit of embedding in the hypercube is all discrete points are constant norm ∥x∥2=d\lVert x\rVert^2=d. The conditional densities which define the denoiser are quadratic tilts to the base density which introduce linear and quadratic terms to the log-density. By the constant norm property, all quadratic terms normalize out and the denoiser is a pure linear tilt to the base density. This opens up additional symmetries that expand the equivalence class and allow modification to the training manifold. With these additional symmetries, we train a denoiser network that can be evaluated at points which are out-of-distribution from the pure noising of the base distribution, but lie in the equivalence class of points seen at sampling time. We visualize a sketch of this idea in Figure 1. Our contributions are threefold:

  1. Conditional generation tasks such as infilling and reward tilting by binary rewards can be cast as linear tilts in an extended state space by promoting the reward coordinate to an additional random variable noised and denoised when sampling.

Image not extracted

Figure 1. Sketch of denoiser symmetry. The training manifold is where the denoiser network has learned the base denoiser. The sampling manifold is the typical vectors that will be encountered when sampling a tilted density. The equivalence relationships can find a point with equal evaluation of the base denoiser near the training manifold, not all equivalence relationships map back to the region of the training manifold.

  1. We establish the theory of denoiser symmetry, the evaluation of the denoiser of a linear tilt to a base density can be recast as an evaluation of the base denoiser at a shifted evaluation point. We establish additional symmetries specific to hypercube embedded discrete distributions, by the removal of quadratic terms in the conditional log-density.

  1. We introduce diagonal matrix rescalings to our hypercube embedding during training called Λ\Lambda focusing, turning an out-of-distribution learning problem into an in-distribution learning problem, and allowing the base denoiser to be evaluated at locations off the typical noising path.

We demonstrate performance on small discrete sampling targets such as a non-linear reward tilt to a small 12 dimension Ising model with ground truth comparison denoiser; generating and solving 4x4, 6x6, and 9x9 Sudoku puzzles; and conditional class generation of MNIST digit images. These problems are small enough to act as a test bed where the quality of our sampling can be compared against exact ground truth values as a diagnostic of effective sampling, with future work to focus on scaling and more complex target distributions for internal guidance.

Setup

We consider discrete distributions embedded in the hypercube X→{−1,1}d\mathcal{X} \to\{-1,1\}^{d}, noised under Gaussian convolution, and sampled via a reverse process. This form of sampling was considered in Chen et al. [7], referred to as “analog bits”, although the structural results of linear tilts and internal guidance we derive here were not known at the time. Any discrete distribution can be embedded in the hypercube by assigning each element xx of the original discrete state space X\mathcal{X} of size less than 2d2^d, a unique embedding vector e(x)∈{−1,1}de(x) \in\{-1,1\}^d. This is natural for token generation tasks with a finite library such as language models; constraint satisfaction tasks such as generating and solving Sudoku puzzles; image generation with discrete pixel values such as grayscale MNIST digits; and distributions natively in the hypercube such as Ising models.

Our target density π\pi is now restricted to a distribution on the hypercube {−1,1}d\{-1,1\}^d. We are interested in sampling two forms of tilts to π\pi. For any vector v∈Rdv \in\mathbb{R}^d, a linear tilt to π\pi, πv(x)∝π(x)e⟨v,x⟩\pi_v(x) \propto\pi(x)e^{\langle v,x\rangle}. For a binary reward function rr with outputs {−1,1}\{-1,1\} tilts to π\pi by τ>0\tau> 0 times rr, qτ(x)∝π(x)eτr(x)q_\tau(x) \propto\pi(x)e^{\tau r(x)}.

To unify these two objectives, we promote the reward value r(x)r(x) to a new random variable x∗=r(x)x_* = r(x) in an extended d+1d+1 dimensional state space and consider linear tilts in the extended state space. Our original coordinates xix_i are already {−1,1}\{-1,1\} valued, so from the perspective of our density x∗x_* is simply another {−1,1}\{-1,1\} coordinate. It has a deterministic conditional distribution π(x∗∣x)=1{x∗=r(x)}\pi(x_*|x) = 1\{x_* = r(x)\}, but there is no issue with having a probability 1 event in a discrete support set. We then define the extended base density with d+1d+1 coordinates where the reward-tilted version of π\pi is equivalent to a linear tilt in the extended state space by the one-hot vector e∗=(0,⋯ ,0,1)∈Rd+1e_* = (0,\cdots,0,1) \in\mathbb{R}^{d+1},

π(x,x∗)=π(x)1{r(x)=x∗}\pi(x,x_*) = \pi(x)1\{r(x) = x_*\}
π(x)eτr(x)=π(x,x∗)eτ⟨e∗,(x,x∗)⟩.\pi(x)e^{\tau r(x)} = \pi(x,x_*)e^{\tau\langle e_*,(x,x_*)\rangle}.

As such, linear tilts by vectors vv and tilts by the reward function can both be unified as pure linear tilts in the extended state space. We thus consider π\pi as a distribution on the d+1d+1 dimensional hypercube, with the final coordinate being the reward coordinate.

For values a,σ>0a,\sigma> 0 consider a random variable defined by a linear combination of a sample from π\pi with an independent normal random variable

U=aX+σZ, X∼π, Z∼N(0,I).U = aX + \sigma Z,\ X \sim\pi,\ Z \sim N(0,I).

The denoiser of π\pi is the conditional expectation of XX given UU,

Fbase(u,a,σ)=Eπ[X∣u,a,σ]=∑xπ(x)e−12σ2∥u−ax∥2Eπ[e−12σ2∥u−aX∥2].F^{\mathrm{base}}(u,a,\sigma) = E_\pi[X|u,a,\sigma] = \sum_x \frac{\pi(x)e^{-\frac{1}{2\sigma^2}\lVert u-ax\rVert^2}}{E_\pi[e^{-\frac{1}{2\sigma^2}\lVert u-aX\rVert^2}]}.

The denoiser defines the drift which implements the reverse SDE sampling algorithm. A special case is the variance preserving (VP) combination, when a2+σ2=1a^2+\sigma^2=1, or σ=1−a2\sigma=\sqrt{1-a^2}. In that case, we simply indicate Fbase(u,a)F^{\mathrm{base}}(u,a) and note it is a VP combination.

In the extended state space, we are really considering the joint noising of the token bit string and the reward coordinate at the same time, u=(utoken,u∗)u=(u^{\mathrm{token}},u_*)

(UtokenU∗)=a(xtokenx∗)+1−a2(ZZ∗)\begin{pmatrix} U^{\mathrm{token}} \\ U_* \end{pmatrix} = a\begin{pmatrix} x^{\mathrm{token}} \\ x_* \end{pmatrix} + \sqrt{1-a^2}\begin{pmatrix} Z \\ Z_* \end{pmatrix}

a∈[0,1],X,X∗∼π,Z∼N(0,I),Z∗∼N(0,1)a \in[0,1], X,X_* \sim\pi, Z \sim N(0,I), Z_* \sim N(0,1).

Thus our sampler carries a “noisy reward” value in its d+1d+1 coordinate, and does joint denoising of the reward coordinate and the token string at the same time through the reverse diffusion.

Denoisers are expectations of quadratic tilts to the base density. By restricting our base density to be supported on the hypercube, all quadratic terms can be dropped from the exponent of the conditional densities that define the denoiser expectation. As such, all denoiser evaluations of π\pi are expectations of linear tilts to π\pi, and all denoisers of linear tilts to π\pi are themselves further linear tilts to this object. One operator defines the denoiser of π\pi and every linear tilt to π\pi: the general mean-tilt operator.

Definition 1. For any vector v∈Rd+1v \in\mathbb{R}^{d+1} and any value a∈[0,1]a \in[0,1], define VP tilt strength β(a)=a1−a2\beta(a) = \frac{a}{1-a^2}, and define the general mean-tilt operator,

G(v,a)=∑xxπ(x)eβ(a)⟨v,x⟩∑xˉπ(xˉ)eβ(a)⟨v,xˉ⟩.G(v,a) = \sum_x x \frac{\pi(x)e^{\beta(a)\langle v,x\rangle}}{\sum_{\bar{x}}\pi(\bar{x})e^{\beta(a)\langle v,\bar{x}\rangle}}.

The base denoiser FbaseF^{\mathrm{base}} is equal to the operator GG.

Sampling Via Stochastic Localization

Our sampling algorithm will be the stochastic localization path, which is equivalent to a time shifting and rescaling of the marginal densities of score-based diffusion. See Montanari [23] and our discussion in Appendix § 9.§ 2 for further connection. The benefit of stochastic localization is the drift term is exactly the denoiser, rather than being related to the score via Tweedie’s formula [25]. This makes it simpler to construct denoiser-to-denoiser relationships rather than score-to-score relationships.

Definition 2 (Stochastic Localization). For a target density π\pi, initialize a random variable at the origin X0=0X_0 = 0. Then follow the SDE using the denoiser as a drift at a specific time scaling,

dXt=Fπ(Xt,t,t)dt+dBt,dX_t = F^\pi(X_t,t,\sqrt{t})dt + dB_t,

then the marginals at time tt are equivalent to

Xt=tX+tZ,X∼π,Z∼N(0,I).X_t = tX + \sqrt{t}Z, X \sim\pi, Z \sim N(0,I).

For large TT, the normalized variable XT/TX_T/T is equal to the target density with a small normal perturbation of scaling 1/T1/\sqrt{T}. The discrete implementation of this SDE as an algorithm is shown in Algorithm 2.

Denoiser Symmetries

First, we consider properties of the training manifold distribution. Typical points produced under VP noising of the base distribution are norm d+1\sqrt{d+1} with high probability at any signal level, and all roughly the same magnitude in each coordinate.

References

  1. [1]Anderson, B. D. O. (1982). Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313–326.DOI
  2. [2]Austin, J., Johnson, D. D., Ho, J., Tarlow, D., and van den Berg, R. (2021). Structured denoising diffusion models in discrete state-spaces. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2107.03006
  3. [3]Benton, J., De Bortoli, V., Doucet, A., and Deligiannidis, G. (2024). Nearly d-linear convergence bounds for diffusion models via stochastic localization. In International Conference on Learning Representations.arxiv.org/abs/2308.03686
  4. [4]Bradley, A. and Nakkiran, P. (2025). Classifier-free guidance is a predictor-corrector. Transactions on Machine Learning Research.arxiv.org/abs/2408.09000
  5. [5]Chen, H., Lee, H., and Lu, J. (2023a). Improved analysis of score-based generative modeling: User-friendly bounds under minimal smoothness assumptions. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 4735–4763. PMLR.arxiv.org/abs/2211.01916
  6. [6]Chen, S., Chewi, S., Li, J., Li, Y., Salim, A., and Zhang, A. R. (2023b). Sampling is as easy as learning the score: theory for diffusion models with minimal data assumptions. In International Conference on Learning Representations.arxiv.org/abs/2209.11215
  7. [7]Chen, T., Zhang, R., and Hinton, G. (2023c). Analog bits: Generating discrete data using diffusion models with self-conditioning. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2208.04202
  8. [8]Chidambaram, M., Gatmiry, K., Chen, S., Lee, H., and Lu, J. (2024). What does guidance do? a fine-grained analysis in a simple setting. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2409.13074
  9. [9]Conforti, G., Durmus, A., and Silveri, M. G. (2025). KL convergence guarantees for score diffusion models under minimal data assumptions. SIAM Journal on Mathematics of Data Science, 7(1):86–109.
  10. [10]Dandapanthula, S. and Boffi, N. M. (2026). Are we really tilting? The mechanics of reward guidance in flow and diffusion models. arXiv preprint arXiv:2606.02884.arxiv.org/abs/2606.02884
  11. [11]Denker, A., Vargas, F., Padhy, S., Didi, K., Mathis, S., Dutordoir, V., Barbano, R., Mathieu, E., Komorowska, U. J., and Liò, P. (2024). DEFT: Efficient fine-tuning of diffusion models by learning the generalised h-transform. In Advances in Neural Information Processing Systems (NeurIPS), volume 37.arxiv.org/abs/2406.01781
  12. [12]He, J., Hernández-Lobato, J. M., Du, Y., and Vargas, F. (2026). RNE: Plug-and-play diffusion inference-time control and energy-based training. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2506.05668
  13. [13]Ho, J., Jain, A., and Abbeel, P. (2020). Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems (NeurIPS), volume 33.arxiv.org/abs/2006.11239
  14. [14]Ho, J. and Salimans, T. (2022). Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598.arxiv.org/abs/2207.12598
  15. [15]Holderrieth, P., Singer, U., Jaakkola, T., Chen, R. T., Lipman, Y., and Karrer, B. (2025). Glass flows: Transition sampling for alignment of flow and diffusion models. arXiv preprint arXiv:2509.25170.arxiv.org/abs/2509.25170
  16. [16]Hu, K., Qiu, L., Lu, Y., Zhao, H., Li, T., Kim, Y., Andreas, J., and He, K. (2026). Elf: Embedded language flows. arXiv preprint arXiv:2605.10938.arxiv.org/abs/2605.10938
  17. [17]Lee, C. K., Jeha, P., Frellsen, J., Liò, P., Albergo, M. S., and Vargas, F. (2025). Debiasing guidance for discrete diffusion with sequential Monte Carlo. arXiv preprint arXiv:2502.06079.arxiv.org/abs/2502.06079
  18. [18]Lee, H., Lu, J., and Tan, Y. (2022). Convergence for score-based generative modeling with polynomial complexity. In Advances in Neural Information Processing Systems, volume 35, pages 22870–22882.arxiv.org/abs/2206.06227
  19. [19]Lipman, Y., Chen, R. T. Q., Ben-Hamu, H., Nickel, M., and Le, M. (2023). Flow matching for generative modeling. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2210.02747
  20. [20]McDonald, C. (2026). Technical note on relating scores of tilted distributions. arXiv preprint arXiv:2604.27196.arxiv.org/abs/2604.27196
  21. [21]Moitra, A., Risteski, A., and Rohatgi, D. (2026a). Steering diffusion models with quadratic rewards: a fine-grained analysis. arXiv preprint arXiv:2602.16570.arxiv.org/abs/2602.16570
  22. [22]Moitra, A., Risteski, A., and Rohatgi, D. (2026b). The tractability landscape of diffusion alignment: regularization, rewards, and computational primitives. arXiv preprint arXiv:2605.11361.arxiv.org/abs/2605.11361
  23. [23]Montanari, A. (2023). Sampling, diffusions, and stochastic localization. arXiv preprint arXiv:2305.10690.arxiv.org/abs/2305.10690
  24. [24]Nisonoff, H., Xiong, J., Allenspach, S., and Listgarten, J. (2025). Unlocking guidance for discrete state-space diffusion and flow models. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2406.01572
  25. [25]Robbins, H. E. (1992). An empirical Bayes approach to statistics. In Kotz, S. and Johnson, N. L., editors, Breakthroughs in Statistics: Foundations and Basic Theory, pages 388–394. Springer, New York.
  26. [26]Sahoo, S. S., Arriola, M., Schiff, Y., Gokaslan, A., Marroquin, E., Chiu, J. T., Rush, A., and Kuleshov, V. (2024). Simple and effective masked diffusion language models. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2406.07524
  27. [27]Shi, J., Han, K., Wang, Z., Doucet, A., and Titsias, M. K. (2024). Simplified and generalized masked diffusion for discrete data. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2406.04329
  28. [28]Skreta, M., Akhound-Sadegh, T., Ohanesian, V., Bondesan, R., Aspuru-Guzik, A., Doucet, A., Brekelmans, R., Tong, A., and Neklyudov, K. (2025). Feynman-Kac correctors in diffusion: Annealing, guidance, and product of experts. In Proceedings of the 42nd International Conference on Machine Learning (ICML), volume 267 of Proceedings of Machine Learning Research, pages 55906–55949.arxiv.org/abs/2503.02819
  29. [29]Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. (2015). Deep unsupervised learning using nonequilibrium thermodynamics. In Proceedings of the 32nd International Conference on Machine Learning (ICML), pages 2256–2265.
  30. [30]Song, Y., Durkan, C., Murray, I., and Ermon, S. (2021a). Maximum likelihood training of score-based diffusion models. In Advances in Neural Information Processing Systems, volume 34, pages 1415–1428.arxiv.org/abs/2101.09258
  31. [31]Song, Y. and Ermon, S. (2019). Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems (NeurIPS), volume 32.
  32. [32]Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. (2021b). Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations (ICLR).
  33. [33]Wan, Z., Ouyang, Y., Xie, L., Fang, F., Zha, H., and Cheng, G. (2026). Discrete guidance matching: Exact guidance for discrete flow matching. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2509.21912
  34. [34]Wang, Y., He, Y., and Tao, M. (2024). Evaluating the design space of diffusion-based generative models. Advances in Neural Information Processing Systems, 37:19307–19352.arxiv.org/abs/2406.12839
  35. [35]Yang, Z., Guo, W., Zhang, S., Sahoo, S. S., Chen, Y., Vahdat, A., Mardani, M., and Thickstun, J. (2026). Continuous diffusion scales competitively with discrete diffusion for language. arXiv preprint arXiv:2605.18530.arxiv.org/abs/2605.18530

Paper details

vlnc:W_4q8shnze
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 0

downloads · 0

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

CC BY 4.0

Original source

  • Mathematics

generative AI tools · View statement →

Looking for related papers…
Contents