Skip to content

Three Papers That Fix Diffusion Sampling Where It Actually Breaks

#diffusion-models #sampling #ode-solvers #feynman-kac #discrete-diffusion

Three Papers That Fix Diffusion Sampling Where It Actually Breaks ​

Continuous diffusion got a probability flow ODE in 2021. That single piece of math is why you can sample a 1024px image in four steps with a consistency model, and why "distill a diffusion model" is a routine engineering task instead of a research project.

Discrete diffusion never got one. You mask tokens, run a hundred network calls, and hope. Text generation with diffusion models has stayed a curiosity largely because of that gap.

Three recent papers attack different failure modes in the same stack. One gives discrete diffusion its ODE. One makes combining several pretrained diffusion models mathematically correct instead of approximate. One handles integration over bounded domains without pretending the boundary isn't there.

Exponential residual flows: the ODE discrete diffusion was missing ​

The setup in "An ODE-based Sampler for Discrete Diffusion Models" is clever, and it's the kind of clever that makes you wonder why nobody did it sooner.

You can't write an ODE over a discrete state space. Derivatives don't exist there. So the authors augment each token position with a continuous residual variable that drifts toward zero. The discrete token stays fixed while the residual decreases. When the residual hits zero, the token flips to a new value and the residual resets.

Picture a clock whose hand sweeps at a speed set by the current token and the model's forward and backward rate matrices. The token can't change until the hand reaches twelve. That's the mechanism: the residual is a clock with state-dependent speed, not a per-step jump probability.

The vector field depends on the current discrete state plus the forward rate matrix $R_t$ and the backward rate matrix $\hat{R}_t$ of whatever discrete diffusion model you started with. The authors prove this construction preserves the original model's marginals. That proof is the whole contribution. Without it you have a heuristic; with it you have a sampler.

The payoff is the same one continuous diffusion got. Deterministic trajectories mean a fixed map from noise to sample, which supports consistency distillation. A deterministic map is the prerequisite for distillation, because consistency training needs the same input to reliably produce the same output. Stochastic samplers don't give you that.

They specialize the framework to masked and uniform diffusion, derive a practical discretization, and report gains on code and text benchmarks. The empirical wins matter less than the structure. Every accelerated-sampling trick built for continuous diffusion, from DPM-Solver to consistency distillation to progressive distillation, now has a discrete analog to be invented on top of.

Quick Take: the discrete diffusion ODE is a foundation, not a speed record, and foundations are what the field has been missing. ​

Composition: why adding scores gives you the wrong distribution ​

The second paper starts from a complaint I've run into directly. You have a diffusion model for faces, one for sketches, one for a style. You want samples that satisfy all three. The obvious move is to add or multiply the score functions.

That's wrong. Not approximately wrong. Wrong in a way that produces samples from a distribution nobody asked for.

The reason is that scores compose locally but densities don't. Tilt model A's distribution by model B's likelihood, and the resulting score has an extra term you can't see from the score functions alone. Earlier corrections existed, but each one handled a narrow family of targets. Products, mixtures, reward tilts: each needed its own derivation.

Generalized Feynman-Kac correctors (GFKC) generalize all of them. The construction interpolates between an arbitrary initial function and the target function via a geometric path, shows that this interpolation satisfies a Feynman-Kac PDE, and solves for the potential in closed form.

AspectNaive score additionEarlier correctorsGFKC
Target familySingle model onlyProducts, mixtures, or reward tilts, one at a timeAny target function of several models
CorrectnessBiased samplesExact within familyExact within family, arbitrary targets
Retraining neededNoNoNo
Reward steeringNot supportedSeparate derivationFalls out of the same potential
Domain of computationScore spaceMostly density spaceEntirely log domain
Evaluated onn/aAnalytic + small image modelsAnalytic Gaussians, MNIST diffusion

The implementation detail that makes it work is a generalization of the log-probability ODE. Normally you track a single model's density along its own probability flow. Here the trajectory is driven by a different velocity field than any individual model's, so you need to track each model's density along someone else's path. The continuous change-of-variables formula handles it once you write it generally. Everything stays in the log domain, which keeps the numbers stable across a handful of models without rescaling tricks.

Reward steering costs nothing extra. You attach a reward function to the target, and the same potential corrects for it. No separate guidance derivation, no classifier guidance hack, no fine-tuning.

Their validation is honest about scope: analytic Gaussians where ground truth is computable, and MNIST diffusion models. That's a proof of concept, not a benchmark sweep. But matching the analytic target closely is a stronger signal than beating an F1 score on a downstream task, because you can check it against the real answer.

If you've ever tried to run two diffusion models in sequence and gotten mush, this is the paper that explains why and gives you the fix.

Reflected diffusions: integration when the domain has walls ​

The third paper is about a different problem entirely, and it took me a minute to see how it fits. It's numerical integration: estimate $Z = \int_D r(x),dx$ over a bounded convex domain $D$, with $r$ non-negative, in high dimensions.

Standard approaches each fail in a specific way. Quasi-Monte Carlo picks evaluation points without looking at the integrand, so it wastes samples where $r$ is flat and starves the region where $r$ concentrates. Importance sampling fixes that, but only if your proposal distribution already resembles $r$, which is circular. Learned diffusion samplers can supply a good proposal, but they're formulated on $\mathbb{R}^d$. Drop them into a bounded domain and they walk outside it, and the samples you throw away are exactly the ones carrying information about the boundary.

The fix: build the proposal from reflected dynamics. A reflected diffusion stays inside $D$ by construction. Run it to progressively transform the target into the uniform distribution on $D$, train a neural score model to reverse that, and sample backward.

Two results in that pipeline do the heavy lifting. First, a change-of-measure formula for reflected diffusions that yields a training objective with no extra boundary terms. Boundary terms are where reflected-diffusion methods usually die: You either have to approximate local time at the boundary, or you discretize finely enough near the walls that the cost explodes. Getting rid of them entirely is the reason this is practical.

Second, for non-smooth integrands, where reparameterization gradients are undefined or uninformative, they derive a REINFORCE estimator using Gaussian proposals before reflection. That means no evaluating reflected transition densities and no differentiating $r$. If your integrand is a step function or has a kink, this is the branch you use.

They report favorable scaling with both dimension and sample count across synthetic targets and real problems. That combination is the hard part. Most integration methods scale in one and give up in the other.

Two problems that look different but aren't ​

Strip the surface detail and the composition paper and the integration paper are solving the same problem: you have a diffusion model that samples from something close to what you want, and you need to correct it to something exactly what you want.

GFKC corrects a composed target by tracking densities along an off-model trajectory. The reflected-diffusion method corrects an integration estimate by tracking a change of measure under a domain constraint. Both are change-of-variables problems in disguise. Both refuse to retrain the underlying model. Both operate in log space.

The ERF paper belongs to the same family in a looser sense. It's about making the deterministic structure of a diffusion model explicit so you can build on it. All three trade some implementation complexity for exactness, and exactness is the thing that turns a demo into a component.

Here's why that shift matters concretely: if your sampler is provably marginal-preserving, you can swap it for another provably marginal-preserving sampler and reason only about speed. If your composition method is exact, you can add a fifth model to the product and know the distribution is still right without re-deriving anything. Exactness is what lets you stop debugging the math and start debugging your pipeline.

What trips people up ​

The ERF residual isn't a per-step jump probability. If you read it as "probability this token flips this step," you'll build the discretization wrong. The residual is a continuous variable with its own dynamics, and the token change is an event triggered by that variable crossing zero.

Don't add scores and call it composition. This is the single most common mistake in multi-model diffusion work. The score of a tilted distribution is not the sum of the scores. GFKC gives you the missing term; skipping it gives you a distribution that looks plausible and is quietly wrong.

Don't run a standard diffusion sampler on a bounded domain and filter. Rejection sampling at the boundary changes your effective distribution, and in high dimensions the acceptance rate collapses. Use reflected dynamics or set up a wrapped domain, not a post-hoc filter.

Don't apply the REINFORCE branch to smooth integrands. It's there for kinks and discontinuities. On a smooth $r$, reparameterization gradients are lower variance and you should use them.

Don't distill an ERF sampler without checking the discretization step count. Deterministic trajectories are the prerequisite for consistency distillation, but the step schedule still needs to match the rate matrices of the specific diffusion model. Masked and uniform diffusion have different event statistics, and a schedule tuned on one will under-resolve the other.

Where these land in practice ​

Text and code generation with discrete diffusion is the obvious beneficiary of ERFs. The gap between discrete and continuous diffusion sampling quality has been wide for years, and a marginal-preserving deterministic sampler is the first serious piece of infrastructure for closing it. If you're training a masked diffusion language model, this is the sampler to build on.

Multi-model composition is where I expect the fastest adoption. GFKC handles the composition problem without retraining, works in log space so it stays stable with several models, and folds in reward steering at no extra cost. If your product involves combining a base model with a style model and a reward model, this replaces whatever ad-hoc score-arithmetic you're currently doing.

The reflected-diffusion work is narrower: high-dimensional integration over bounded convex domains. That covers options pricing with constrained state variables, Bayesian evidence on parameter bounds, and physics problems with hard constraints. If your domain is $\mathbb{R}^d$ and unconstrained, this paper isn't for you.

One thing to remember ​

All three papers report limited empirical scope. GFKC validates on MNIST. ERFs report gains "across a variety of benchmarks" without a scaling study at the size modern text models run at. The reflected-diffusion method is evaluated on synthetic targets and unspecified real problems. The math is sound in each case; the question is whether the constants hold up at scale, and that's a question these papers don't fully answer.

The Bottom Line ​

If you're training a discrete diffusion model for text or code, adopt the ERF sampler and budget time for consistency distillation on top of it. The deterministic trajectory is the piece that makes accelerated sampling possible, and everything else in that line of work depends on it.

If you're combining multiple pretrained diffusion models, skip the score arithmetic and implement GFKC. It stays in the log domain, needs no retraining, and handles reward steering as a free side effect. The alternative is samples from the wrong distribution with no error signal telling you so.

One thing to watch: the ERF framework is specialized to masked and uniform diffusion right now. Other discrete corruption processes, including the ones used in some DNA and molecule models, haven't been shown to work yet. Expect a follow-up covering general rate matrices within a year, and don't assume the current discretization transfers.