Girsanov Drift Change
Chapter 19: Stochastic Differential Equations — Girsanov & Reward Fine-Tuning
From the book
Chapter 19: Stochastic Differential Equations. In the chapter mind map this icon labels Girsanov & Reward Fine-Tuning. The discussion below is excerpted and lightly edited from § Reward Fine-Tuning as Optimal Control in Mathematics for AI and Machine Learning.
Girsanov's theorem also turns the fine-tuning of a trained generative SDE into an optimal control problem. Let $P^0$ be the pretrained generative process on $[0, 1]$, with the sample $\mathbf{X}_1$ at the end, and let $r(\mathbf{x})$ be a reward. Fine-tuning adds a control $\sigma\mathbf{u}$ to the drift and maximizes
which rewards the outcome and charges the control energy, keeping the fine-tuned model close to the pretrained one. As for KL-regularized reinforcement learning (the matrix chapter), whose maximizer is a Gibbs distribution, the maximizing path measure is the tilt $dP^/dP^0 \propto e^{r(\mathbf{X}_1)}$, so the fine-tuned samples have density $p^(\mathbf{x}) \propto p^0(\mathbf{x})\, e^{r(\mathbf{x})}$. The tilt depends on the path only through its endpoint, so it is exactly the conditioning of Doob's $h$-transform above with $h(\mathbf{x}, t) = \mathbb{E}_{P^0}\big[e^{r(\mathbf{X}_1)} \mid \mathbf{X}_t = \mathbf{x}\big]$, and the optimal control is
Reward fine-tuning methods learn $\mathbf{u}_\phi$ by estimating this gradient, from simulated trajectories of the current model, without ever computing $h$ itself. With $r(\mathbf{x}) = \log p(y \mid \mathbf{x})$ for a classifier, $p^ \propto p^0(\mathbf{x})\,p(y \mid \mathbf{x})$ and the control is the classifier-guidance term. From a fixed start $\mathbf x_0$ the optimal value is $J(\mathbf u^) = \log h(\mathbf x_0, 0)$, the soft maximum of the reward. For Brownian motion from $\mathbf 0$ ($\mathbf b = \mathbf 0$, $\sigma = 1$) and a linear reward $r(\mathbf x) = \mathbf a^\top\mathbf x$, $h(\mathbf x, t) = e^{\mathbf a^\top\mathbf x + \frac{1}{2}\|\mathbf a\|_2^2(1 - t)}$, so $\mathbf u^ = \mathbf a$ is constant and $p^ = \mathcal N(\mathbf a, I)$: the expected reward rises by $\|\mathbf a\|_2^2$ at a KL cost of $\frac{1}{2}\|\mathbf a\|_2^2$, and $J(\mathbf u^) = \frac{1}{2}\|\mathbf a\|_2^2$. Weighting the KL term by $\lambda$ gives $p^ \propto p^0 e^{r/\lambda}$, so $\lambda$ acts as a temperature: as $\lambda \to 0$ the samples collapse onto the maximizers of $r$, the over-optimization that the KL penalty prevents.
What this drawing shows
What you see. Shows the same random wiggles drawn with two different slopes, illustrating that a Girsanov change of measure shifts only the drift.
In the mind map. Chapter 19 — Girsanov & Reward Fine-Tuning. See From the book above for definitions, figures, and worked examples.
Where to read next
Read the full definitions, figures, and worked examples in Chapter 19: Stochastic Differential Equations — see the mind-map node Girsanov & Reward Fine-Tuning.