TL;DR
When you steer a diffusion or flow model toward a specific reward at inference time, it often goes off the rails—over-optimizing the reward and producing bizarre, unnatural outputs ("reward hacking"). While researchers used to blame over-complicated neural reward models for this, this paper proves that the culprit is actually a standard mathematical shortcut used in almost all guidance algorithms. Even better, the authors derive a computationally free, closed-form "damping" schedule to fix it.
What Problem Does This Paper Address?
Pre-trained diffusion and flow-matching models are fantastic at generating realistic images, molecules, or proteins from a learned base distribution $\rho_1(x)$. Often, though, we want to nudge generation at inference time toward a specific goal—say, higher aesthetic quality or better molecular binding—defined by a reward function $r(x)$ scaled by a strength parameter $\lambda$. Mathematically, the goal is to sample from the reward-tilted distribution, $\tilde{\rho}_1(x) \propto \rho_1(x)e^{\lambda r(x)}$, which balances high reward with staying faithful to realistic data.
In practice, turning up the guidance scale $\lambda$ causes reward hacking: if you reward an image for "blueness," the model might erase the subject entirely and hand you a solid blue square. Furthermore, practitioners have long noticed that generating $n$ guided samples and picking the winner (best-of-$n$) works surprisingly well, though nobody had pinned down the exact mechanics of why standard guidance fails to find the best modes on its own.
Methods
To steer a generative trajectory cleanly toward the reward tilt, theory tells us to use a tool from stochastic calculus called the Doob $h$-transform. It modifies the generative trajectory using the logarithmic gradient of the Doob $h$-function, $h_t(x) = \mathbb{E}[e^{\lambda r(X_1)} \mid X_t = x]$—essentially asking, "Given my noisy state right now at time $t$, what is my expected exponentiated reward at the end of generation?"
Because computing that exact expectation across all possible futures is intractable, standard practical algorithms use a $k$-particle plug-in estimator: they take $k$ quick "lookahead" samples (often just $k=1$ to save compute) and average their rewards. Here is the catch: while this sample average is unbiased for $h_t$, taking its logarithm and gradient introduces severe finite-sample bias.
To fix the resulting distortions without running expensive multi-particle lookaheads, the authors analyze an isotropic Gaussian setting and derive a novel reward damping schedule: $$\lambda_t := \frac{\lambda}{1 + 2\lambda\sigma_{1|t}^2}$$ Instead of applying a constant guidance hammer $\lambda$ the whole way through, this schedule dynamically softens the reward scale early in generation (when uncertainty $\sigma_{1|t}^2$ about the final output is high) and ramps up to $\lambda$ as $t \to 1$. In real-world models where true data variance $\sigma^2$ is unknown, $\sigma$ serves as a simple scalar hyperparameter—adding zero extra compute.
Datasets
Rather than training on large-scale datasets, this work evaluates inference-time guidance across synthetic distributions and pre-trained text-to-image setups (no new dataset benchmarks are introduced):
- Synthetic distributions: 1D and 2D Gaussian and Gaussian mixture targets, plus a uniform 2D checkerboard distribution paired with quadratic, indicator, or Gaussian bump rewards.
- Text-to-image generation: Custom text prompts evaluated with the 12-billion-parameter FLUX.1-dev model (paired with Diamond maps for single-step lookahead), guided by pixel-level rewards (blueness, masked brightness), ImageReward (human preference), and Qwen2.5-VL-3B (vision-language model probabilities).
Key Insights and Ideas
- You don't need neural networks to get reward hacking: Even with a single bell-curve (Gaussian) target and a simple quadratic reward, $k=1$ plug-in guidance overshoots the true tilted mean toward the reward maximizer and shrinks sample variance exponentially fast as $\lambda$ grows (instead of rationally).
- Throwing more compute at lookahead barely moves the needle: You might assume using more lookahead particles $k$ quickly fixes the bias. The authors prove that $k$-particle guidance stays trapped near $k=1$ guidance, shifting at most at a sluggish $\sqrt{\log k}$ rate in $\infty$-Wasserstein distance.
- Plug-in guidance is "myopic" across modes: Exact Doob $h$-guidance acts like long-range gravity, pulling trajectories toward distant high-reward clusters. Plug-in guidance relies on local lookahead samples that stay stuck in whatever mode the trajectory started in—making it blind to distant, better modes.
- Damping and best-of-$n$ have distinct, complementary jobs: Reward damping fixes within-mode over-optimization (preventing collapse and overshoot), while best-of-$n$ fixes between-mode selection by giving the initial random seed $n$ chances to land near a high-reward mode.
Key Results
- 2D Checkerboard: Against the true analytic tilt (mean reward
0.914, covariance trace0.457), naive $k=1$ plug-in guidance misses the best modes (0.764reward,1.930trace), while undamped best-of-4 severely collapses variance (0.978reward,0.107trace). Combining best-of-4 with reward damping ($\sigma_{\text{damp}}=0.2$) nails the target distribution (0.920reward,0.429trace) and outperforms heuristic schedules like linear or cosine ramps. - FLUX.1 Text-to-Image: Across pixel-reward, ImageReward, and VLM tasks, single-particle ($k=1$) damped guidance matches or beats the anti-hacking fidelity of $k=8$ particle guidance while using $8\times$ less guidance compute per step. Qualitatively, when optimizing for top-right brightness or blueness, naive guidance erases subjects (like a welder or painter), whereas damped guidance satisfies the reward while keeping the scene intact.
Limitations and Future Work
The exact closed-form theory and the formula for the reward damping schedule are derived under idealized assumptions: Gaussian and Gaussian-mixture targets, quadratic rewards, and a specific "memoryless" noise schedule. Empirically, experiments are scoped to 2D toy distributions and FLUX.1 image generation. Future work includes extending the theoretical bias analysis to non-Gaussian distributions and general rewards, exploring broader KL-regularized reinforcement learning problems beyond diffusion, and testing reward damping in scientific domains like molecular design and protein generation.
Summary updated