Concept · 1 paper · updated 2026-11-21
Feynman-Kac correctors
Sampling a target built from several pretrained diffusion models, or tilted toward a reward, by carrying log-weights along transported particles instead of retraining. Covers the general Feynman-Kac potential, the generalised version for arbitrary terminal functions of N agents with reward steering, and its known weakness: weight degeneracy. Author-reported results only, from one paper.
samplingdiffusionguidancemodel-compositionimportance-weighting
Markdown5 min read
AI-compiled overview, updated 2026-11-21, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
Overview
Suppose you want samples from a density that is a function of several pretrained diffusion models, for example a ratio, a sum or a mixture of their marginals, or such a density tilted toward a reward. Naively adding the models' scores gives biased samples, because the intermediate distributions along the generative path are then wrong 2610.40383 §1.
The shared idea is to keep a set of particles, move each one with a velocity field, and accumulate a log-weight per particle from a potential along its path. The weighted particles then estimate the target through self-normalised importance weights. Resampling is optional 2610.40383 §2.2. The invariant all variants share is that the final normalised weights estimate the target, so no model is retrained 2610.40383 §3.
The paper builds the target along a geometric path from an initial function h0 to the target h1 of the agents' final marginals, and the potential is what makes the path's distribution exact 2610.40383 §3.
Variants
Earlier Feynman-Kac correctors (as described by the paper)
The paper's introduction and background describe an earlier family of Feynman-Kac correctors that treats specific target families exactly: annealed distributions, products of experts, and classifier-free-guidance-style geometric averages 2610.40383 §1 2610.40383 §2.2. These methods are not in this wiki with a card; the paper's account is the only source on this page for them. The paper says its general result recovers that earlier method as a special case 2610.40383 §1.
Generalised Feynman-Kac correctors (GFKC)
Card: GFKC, arXiv:2610.40383.
- Target. A density proportional to h1 evaluated on the N agents' marginals at t = 1, where h1 is positive, differentiable and integrable. Products, geometric averages, annealed distributions, mixtures and ratios are the paper's examples 2610.40383 §3.
- Potential. The paper gives the potential in closed form for an arbitrary unifying velocity built from the agents' velocities. Its sampler then uses the velocity of agent i for the particles assigned to agent i 2610.40383 §3.
- Log-densities along the path. Because a particle moves with one agent's velocity but each agent's density must still be evaluated, the usual log-density change-of-variables equation is generalised. It adds a divergence term and an inner product of velocity differences with the scores 2610.40383 §3.
- Reward steering. For a reward r and steering parameter kappa > 0 the target becomes h1 times exp(r / kappa). The change is one extra term in the potential. The reward needs a terminal sample, so each particle is projected to t = 1 with its agent's sampler at chosen steering times [arxiv:2610.40383 §3] 2610.40383 §4.1.
- Reported experiments (author-reported). Two Gaussian agents with exact scores, where the authors show close agreement with the analytic target and mass shifts under steering 2610.40383 fig. 1 2610.40383 fig. 3. Two MNIST digit-class agents trained as small diffusion models, where the sum and ratio targets pick out the expected digits and steering moves samples toward a rotated 9 2610.40383 fig. 6 2610.40383 fig. 10.
Reward-guided inference for a single model
The paper contrasts its method with reward-guided inference-time diffusion, which steers one model at a time 2610.40383 §2.3. That method is named here and linked on arXiv only: arXiv:2501.09685. Nothing from its content is used on this page.
When to use which
| Situation | Use | Why |
|---|---|---|
| Target is an arbitrary positive function of several pretrained diffusion models (ratio, sum, mixture) and retraining is not an option | GFKC weighted particles | The general framework covers these targets without retraining 2610.40383 §3 |
| Target is annealed, a product of experts, or a classifier-free-guidance-style geometric average | Earlier Feynman-Kac corrector, or GFKC as its special case | The earlier method is exact for these families; the paper says GFKC recovers it 2610.40383 §1 |
| Want samples tilted toward a reward on the output of a model you already have | GFKC steering with kappa | Adds one term to the potential; the paper reports steering effects for two experiments 2610.40383 §3 2610.40383 fig. 4 |
| Need a reliable effective sample size, or a high-dimensional target with few particles | Treat with caution; add resampling and check weights | Log-weights can differ by thousands, so almost all mass sits on one agent 2610.40383 fig. 7; the paper names this as the main open problem 2610.40383 §5 |
| Only the naive score sum is available and an exact target is not needed | Naive combination, knowing it is biased | The paper argues the sum does not reproduce the intermediate distributions 2610.40383 §1 |
Constraints that the cited results support:
- Model access. The method needs each agent's score and velocity, and divergence estimates along the path 2610.40383 §3.
- Compute. Each step evaluates every agent's score and a divergence per agent. The MNIST experiments use a Hutchinson estimator with ten probes 2610.40383 §4.2. The paper reports no runtime comparison in the text this page is drawn from.
- Numerics. All computation is in the log domain. The MNIST experiments run in double precision and clip log-densities from above at every step 2610.40383 §4.2. The clip value is not stated in the paper.
- Resampling. Algorithm 1 includes a resampling step at a set of times, but the paper does not state that set for its experiments [arxiv:2610.40383 alg. 1] 2610.40383 §4.
Implementation sketch
The common core of the Feynman-Kac corrector family, with the GFKC-specific parts marked where they differ.
# Generic Feynman-Kac corrector [arxiv:2610.40383 §2.2]
# Particles x_m with log-weights logw_m; velocity v and potential g
# are the two model-dependent parts.
# Start from the common prior N(0, I), uniform log-weights [arxiv:2610.40383 §3]
x = sample_prior(M)
logw = zeros(M)
for t in time_grid:
# Potential at the current state, accumulated over the step [§2.2]
logw = logw + dt * g(x, t)
# Transport each particle with the velocity [§2.2]
x = x + dt * v(x, t)
# Optional: resample when the weights degenerate [arxiv:2610.40383 alg. 1]
if resample_now(t):
x, logw = resample(x, logw)
# Subtracting a shared constant from logw leaves normalised weights unchanged
# Self-normalised estimate of the target [arxiv:2610.40383 §2.2]
w = softmax(logw)Where GFKC differs:
- The velocity v is chosen per particle from the agent it is assigned to, and the potential g is the closed-form expression for the chosen unifying velocity 2610.40383 §3.
- Each agent's log-density is tracked along the path with the generalised equation above, and it is clipped from above at every step 2610.40383 §3 2610.40383 §4.2.
- For steering, the potential gains a reward term evaluated on the terminal sample of each particle, projected to t = 1 at the chosen steering times 2610.40383 §4.1.
Contradictions
Only one card lists this concept, so no two papers disagree. Within that paper, the released code differs from the text on several points that change the sampler: the noise term, the index used for steering times, and the resampling set. The card lists each one with its file reference, and this page does not resolve them: see the paper card, section "Paper vs code".
Papers
- GFKC: generalises the Feynman-Kac corrector to arbitrary terminal functions of N diffusion agents, adds reward steering, and reports Gaussian and MNIST experiments.
Source and license
Compiled from the papers listed on this page, all published under CC BY, CC BY-SA or CC0, with citations. See each paper's page for its authors and license.