The Doob $h$-Transform: From Conditioned Random Walks to Guided SDEs

Suppose a stochastic process usually fails at a task, but we want to study the paths on which it succeeds. A particle might cross an energy barrier before returning to its starting basin, or Brownian motion might arrive at a specified endpoint at a specified time. Repeatedly simulating the original process and discarding failures is exact, but can be hopelessly expensive when success is rare.

The Doob $h$-transform turns the future success condition into a local rule for the next step. For a Markov chain, it changes transition probabilities. For a diffusion, it adds a state-dependent drift. When $h$ is the exact probability of the desired event, the new process produces the original process’s paths conditioned on that event. The randomness is still there; only the path law has changed.

This note derives that statement rather than treating the added drift as a recipe to memorize. We will move from a six-state random walk to continuous-time jumps, then to SDEs and the committor used in rare-event sampling.

1. Start with Bayes’ Rule

Let $X_0,X_1,\ldots$ be a Markov chain with transition matrix $P_{ij}=\Pr(X_{n+1}=j\mid X_n=i)$. Let $E$ be a future event, such as “hit $B$ before $A$.” Write its probability for a chain started at state $i$ as

$$ h(i)=\Pr(E\mid X_0=i). $$

For a hitting event, before the chain has reached either boundary, the Markov property gives

$$ \Pr(E\mid X_n=i,X_{n+1}=j)=h(j). $$

Bayes’ rule now answers the central question: given that success will occur, what is the probability of the next move? Take $\Pr(X_n=i)>0$ and $h(i)>0$ for this calculation:

$$ \begin{aligned} P^{(h)}_{ij} &=\Pr(X_{n+1}=j\mid X_n=i,E)\\ &=\frac{\Pr(E\mid X_{n+1}=j,X_n=i)\,\Pr(X_{n+1}=j\mid X_n=i)\,\Pr(X_n=i)}{\Pr(E\mid X_n=i)\,\Pr(X_n=i)}\\ &=\Pr(X_{n+1}=j\mid X_n=i)\frac{\Pr(E\mid X_{n+1}=j,X_n=i)}{\Pr(E\mid X_n=i)}\\ &=\boxed{P_{ij}\frac{h(j)}{h(i)}}. \end{aligned} $$

The superscript $(h)$ labels quantities under the $h$-transformed process; it is not an exponent. For example, $P_{ij}$ is the original step probability and $P^{(h)}_{ij}$ is the step probability after conditioning.

The factor $h(j)/h(i)$ rewards moves into states from which success is more likely. This is a probability kernel because the law of total probability gives

$$ h(i)=\sum_j P_{ij}h(j), \qquad\text{so}\qquad \sum_j P^{(h)}_{ij}=1. $$

The averaging equation says that $h$ is harmonic for the chain in the region where the event has not yet been decided. For a hitting event, we stop at the first visit to $A$ or $B$, set $h=0$ on $A$ and $h=1$ on $B$, and use the averaging equation only before either set is reached. States with $h=0$ cannot be starting states of the conditioned process.

Why the whole path has the right distribution

For a path $i_0\to i_1\to\cdots\to i_m$, multiply its transformed step probabilities:

$$ \begin{aligned} \Pr^{(h)}(\text{path}\mid X_0=i_0) &=\prod_{k=0}^{m-1}P_{i_k i_{k+1}}\frac{h(i_{k+1})}{h(i_k)}\\ &=\left(\prod_{k=0}^{m-1}P_{i_k i_{k+1}}\right) \frac{h(i_m)}{h(i_0)}. \end{aligned} $$

All intermediate $h$ factors cancel. If the path stops on success, $h(i_m)=1$, and its probability is the original path probability divided by $\Pr(E\mid X_0=i_0)$. That is exactly the probability of the path conditional on $E$. If it stops on failure, $h(i_m)=0$, so the transformed path has zero probability.

This telescoping calculation is the reason the transform is more than a heuristic force pointing toward $B$: with the correct $h$, it preserves the relative probabilities among successful paths.

2. A Random Walk You Can Calculate by Hand

Take the simple symmetric random walk on ${0,1,2,3,4,5}$. States $0$ and $5$ are absorbing, and each interior step goes left or right with probability $1/2$. We want the paths that reach $5$ before $0$.

The success probability $h(i)$ obeys

$$ h(0)=0,\qquad h(5)=1,\qquad h(i)=\tfrac12h(i-1)+\tfrac12h(i+1),\quad 1\le i\le4. $$

The interior equation says the first difference $h(i+1)-h(i)$ is constant. The boundary values then give $h(i)=i/5$. Starting at $i=2$, success has probability $2/5$. The conditioned step probabilities are

$$ P^{(h)}_{2,3}=\frac12\frac{h(3)}{h(2)}=\frac34, \qquad P^{(h)}_{2,1}=\frac12\frac{h(1)}{h(2)}=\frac14. $$

Moving right is now favored, but moving left is still possible. At state $1$, however, the step to $0$ has probability zero: conditioned on eventual success, the process cannot take a path that has already failed.

As a check, consider the particular path $2\to3\to4\to5$. Under the original walk it has probability $1/8$. Conditional on success, its probability is $(1/8)/(2/5)=5/16$. The transformed walk gives the same answer directly:

$$ P^{(h)}_{2,3}P^{(h)}_{3,4}P^{(h)}_{4,5} =\frac34\cdot\frac23\cdot\frac58 =\frac5{16}. $$

3. A Deadline Makes $h$ Time Dependent

Fix a deadline $N$ and a target set $B$. The event we condition on is $E_N={X_N\in B}$: the chain is in $B$ at step $N$. Set $g(i)=1$ for $i\in B$ and $g(i)=0$ otherwise, so $g(X_N)$ records whether this event happened. The function used in the transform is

$$ h_n(i)=\Pr(E_N\mid X_n=i)=\mathbb E[g(X_N)\mid X_n=i], \qquad h_N(i)=g(i). $$

Here $g$ marks success at the deadline, while $h_n(i)$ is the probability of that success from state $i$ at step $n$. Working backward one step gives the backward equation

$$ h_n(i)=\sum_jP_{ij}h_{n+1}(j). $$

Conditioning on $E_N$, Bayes’ rule gives the next-step probability when $h_n(i)>0$:

$$ P^{(h)}_n(i,j) =\Pr(X_{n+1}=j\mid X_n=i,E_N) =P_{ij}\frac{h_{n+1}(j)}{h_n(i)}. $$

Its explicit dependence on $n$ matters. If the deadline is close, the next move may need to be more strongly directed than it was earlier. For a path $i_0\to i_1\to\cdots\to i_N$, multiply its step probabilities:

$$ \begin{aligned} \prod_{n=0}^{N-1}P^{(h)}_n(i_n,i_{n+1}) &=\prod_{n=0}^{N-1}\left[P_{i_n i_{n+1}}\frac{h_{n+1}(i_{n+1})}{h_n(i_n)}\right]\\ &=\left(\prod_{n=0}^{N-1}P_{i_n i_{n+1}}\right)\frac{g(i_N)}{h_0(i_0)}. \end{aligned} $$

The intermediate $h$ factors cancel, and $h_N(i_N)=g(i_N)$. Since $g$ is $0$ or $1$ here, this is exactly the original path law conditioned on $E_N$. For a more general nonnegative payoff $g$, the same construction weights paths by $g(X_N)$ rather than conditioning on an event.

4. From Discrete Steps to Continuous-Time Jumps

In the random walk, $P_{ij}$ was the probability of the next step. In continuous time, the chain can also wait: during a short interval $\Delta t$, it usually stays at $i$. Write $P_{ij}(\Delta t)=\Pr(X_{t+\Delta t}=j\mid X_t=i)$. For $j\ne i$,

$$ P_{ij}(\Delta t)\approx k_{ij}\Delta t, \qquad P_{ii}(\Delta t)\approx 1-\Delta t\sum_{j\ne i}k_{ij}. $$

Thus $k_{ij}$ is the chance of jumping from $i$ to $j$ per unit time. We will apply the same $h(j)/h(i)$ factor as before to these short-time probabilities. First, let $f(i)$ be any number assigned to state $i$. Averaging over a jump or no jump gives

$$ \mathbb E[f(X_{t+\Delta t})\mid X_t=i] \approx\left(1-\Delta t\sum_{j\ne i}k_{ij}\right)f(i) +\Delta t\sum_{j\ne i}k_{ij}f(j). $$

The generator $L$ is the rate at which this expected value initially changes. Subtract $f(i)$, divide by $\Delta t$, and let $\Delta t$ shrink to zero:

$$ \begin{aligned} (Lf)(i) &=\lim_{\Delta t\to0}\frac{\mathbb E[f(X_{t+\Delta t})\mid X_t=i]-f(i)}{\Delta t}\\ &=\sum_{j\ne i}k_{ij}[f(j)-f(i)]. \end{aligned} $$

Each possible jump changes $f$ by $f(j)-f(i)$; the sum weights that change by the jump’s rate. Now let $E$ mean “hit $B$ before $A$” and stop the chain when it first reaches either set. Define $h(i)=\Pr(E\mid X_0=i)$, as in the discrete walk. Then $h(X_t)$ is a martingale under the original law: given the present state, its expected future value equals its current value exactly. For $h$ (though not for an arbitrary $f$), the generator’s numerator is therefore zero:

$$ \mathbb E[h(X_{t+\Delta t})\mid X_t=i]-h(i)=0,\qquad (Lh)(i)=0. $$

Now apply the discrete Bayes rule from Section 1 to a short interval, for $j\ne i$ and $h(i)>0$:

$$ \begin{aligned} P^{(h)}_{ij}(\Delta t) &=\Pr(X_{t+\Delta t}=j\mid X_t=i,E)\\ &=P_{ij}(\Delta t)\frac{h(j)}{h(i)},\\ k^{(h)}_{ij} &=\lim_{\Delta t\to0}\frac{P^{(h)}_{ij}(\Delta t)}{\Delta t} =k_{ij}\frac{h(j)}{h(i)}. \end{aligned} $$

So the discrete probability ratio becomes a jump-rate ratio. The conditioned chain has the same generator formula, using these new rates:

$$ (L^{(h)}f)(i)=\sum_{j\ne i}k^{(h)}_{ij}[f(j)-f(i)]. $$

The compact expression for this generator is the same sum written using the original $L$. Here $hf$ is the function whose value at state $j$ is $h(j)f(j)$. Apply the generator formula to $hf$ and to $h$ separately. The terms containing only values at the starting state cancel:

$$ \begin{aligned} L(hf)(i)-f(i)Lh(i) &=\sum_{j\ne i}k_{ij}\bigl\{h(j)f(j)-h(i)f(i)-f(i)[h(j)-h(i)]\bigr\}\\ &=\sum_{j\ne i}k_{ij}h(j)[f(j)-f(i)]=h(i)(L^{(h)}f)(i). \end{aligned} $$

Dividing by the positive success probability at the starting state gives

$$ (L^{(h)}f)(i)=\frac{L(hf)(i)-f(i)Lh(i)}{h(i)}. $$

Conditioning favors jumps toward success and removes jumps that guarantee failure. The total exit rate is the sum of rates for all destinations. In the interior this sum is unchanged because \((Lh)(i)=0\):

$$ \begin{aligned} \sum_{j\ne i}k^{(h)}_{ij} &=\sum_{j\ne i}k_{ij}\frac{h(j)}{h(i)} =\frac{1}{h(i)}\sum_{j\ne i}k_{ij}\bigl[h(j)-h(i)+h(i)\bigr]\\ &=\frac{1}{h(i)}\sum_{j\ne i}k_{ij}[h(j)-h(i)]+\sum_{j\ne i}k_{ij} =\frac{(Lh)(i)}{h(i)}+\sum_{j\ne i}k_{ij} =\sum_{j\ne i}k_{ij}. \end{aligned} $$

So in this case the waiting time at $i$ is unchanged, while the destination of the next jump is reweighted. A time-dependent or nonharmonic transform can also change the waiting time.

5. The Diffusion Limit: Why the Extra Drift Is $a\nabla\log h$

Consider an Itô diffusion in $\mathbb R^d$,

$$ \mathrm dX_t=b(t,X_t)\,\mathrm dt+\sigma(t,X_t)\,\mathrm dW_t, \qquad a(t,x)=\sigma(t,x)\sigma(t,x)^\top. $$

Let \(\rho(t,x)\) be the probability density of \(X_t\). The Fokker–Planck equation tells us how this density changes:

$$ \partial_t\rho(t,x) =-\sum_i\partial_i\bigl[b_i(t,x)\rho(t,x)\bigr] +\frac12\sum_{i,j}\partial_i\partial_j\bigl[a_{ij}(t,x)\rho(t,x)\bigr]. $$

Here \(i,j\) label spatial coordinates, rather than the states of the jump chain in Section 4; \(b_i\) is a component of the drift, and \(a_{ij}=\sum_m\sigma_{im}\sigma_{jm}\).

To see the connection with a generator, choose a smooth function \(f(x)\) that assigns a number to each position. Its average is \(\mathbb E[f(X_t)]=\int f(x)\rho(t,x)\,\mathrm dx\). Multiply the Fokker–Planck equation by \(f\) and integrate. Assume boundary terms vanish, for example because \(f\) has compact support. Integration by parts moves one derivative in the drift term and two in the noise term from the density onto \(f\):

$$ \begin{aligned} \frac{\mathrm d}{\mathrm dt}\mathbb E[f(X_t)] &=\int f\,\partial_t\rho\,\mathrm dx\\ &=-\sum_i\int f\,\partial_i(b_i\rho)\,\mathrm dx +\frac12\sum_{i,j}\int f\,\partial_i\partial_j(a_{ij}\rho)\,\mathrm dx\\ &=\int\left[\sum_i b_i\,\partial_i f +\frac12\sum_{i,j}a_{ij}\,\partial_i\partial_j f\right]\rho\,\mathrm dx. \end{aligned} $$

The expression in brackets is called \((L_t f)(x)\), the generator acting on a function. It gives the instantaneous change of that function’s average starting from a known position \(x\). To see this directly from the SDE, write \(\Delta X=X_{t+\Delta t}-X_t\). Brownian increments have mean zero, and their covariance over a short interval is proportional to its length, so to first order

$$ \mathbb E[\Delta X_i\mid X_t=x]\approx b_i(t,x)\Delta t, \qquad \mathbb E[\Delta X_i\Delta X_j\mid X_t=x]\approx a_{ij}(t,x)\Delta t. $$

The product of two drift increments is proportional to \((\Delta t)^2\), so it does not contribute at this order. Taylor-expand \(f\) around \(x\):

$$ f(x+\Delta X)-f(x)\approx \sum_i\partial_i f(x)\,\Delta X_i +\frac12\sum_{i,j}\partial_i\partial_j f(x)\,\Delta X_i\Delta X_j. $$

Take its conditional average, divide by the interval length, and let that length shrink to zero. This gives the same expression found from Fokker–Planck:

$$ \begin{aligned} (L_t f)(x) &=\lim_{\Delta t\to0}\frac{\mathbb E[f(X_{t+\Delta t})\mid X_t=x]-f(x)}{\Delta t}\\ &=\sum_i b_i(t,x)\,\partial_i f(x) +\frac12\sum_{i,j}a_{ij}(t,x)\,\partial_i\partial_j f(x). \end{aligned} $$

These are two descriptions of the same diffusion: Fokker–Planck evolves its density, and the generator gives the local rate of change of functions of its state. The integration-by-parts calculation shows exactly how the two descriptions correspond.

For a terminal event \(E\), let \(h(t,x)=\Pr(E\mid X_t=x)\), or use a transition density for an exact endpoint. Assume \(h>0\) and smooth. Along the original trajectory, \(h(t,X_t)\) remains a martingale until the terminal or stopping time. Here \(\partial_t h\) is explicit time change, while \(L_t h\) is the average change from the motion of \(X_t\):

$$ h(t,x)=\mathbb E[h(t+\Delta t,X_{t+\Delta t})\mid X_t=x] \approx h(t,x)+\Delta t[\partial_t h(t,x)+(L_t h)(x)]. $$

Cancel the current value on both sides and divide by the interval length to obtain the backward equation:

$$ \partial_t h+L_t h=0, $$

with terminal or boundary data set by the event. The finite-time transition kernel changes by the same Bayes factor as before:

$$ p^{(h)}(t,y\mid s,x) =p(t,y\mid s,x)\frac{h(t,y)}{h(s,x)},\qquad s<t. $$

To identify the SDE, expand the transformed generator. The ordinary product rule gives $\nabla(hf)=h\nabla f+f\nabla h$. For the second-order term, the two cross derivatives combine because $a$ is symmetric:

$$ L_t(hf)=hL_t f+fL_t h+(a\nabla h)\cdot\nabla f. $$

Consequently, the first line uses the same generator identity as Eq. (14) for the jump chain, now applied to a diffusion. Because \(h\) depends on time, the backward equation is \(\partial_t h+L_t h=0\); \(L_t h\) need not vanish by itself:

$$ \begin{aligned} L^{(h)}_t f &=\frac{L_t(hf)-fL_t h}{h}\\ &=\left(b+a\frac{\nabla h}{h}\right)\cdot\nabla f +\frac12\sum_{i,j}a_{ij}\partial_i\partial_j f\\ &=\left(b+a\nabla\log h\right)\cdot\nabla f +\frac12\sum_{i,j}a_{ij}\partial_i\partial_j f. \end{aligned} $$

Comparing this generator with the Fokker–Planck equation above gives drift \(b+a\nabla\log h\) and unchanged noise. Thus the transformed SDE is

$$ \boxed{\mathrm dX_t=\left[b(t,X_t)+a(t,X_t)\nabla_x\log h(t,X_t)\right]\mathrm dt +\sigma(t,X_t)\,\mathrm dW_t.} $$

Here $W_t$ is Brownian motion under the transformed law. We reuse the symbol from the original SDE, where Brownian motion is understood under the original law. The noise term still has covariance $a$; only the drift changes. If one writes $D=a/2$, the extra drift is $2D\nabla\log h$. This factor of two is easy to lose when switching between $a$ and the physics convention $D$.

The backward equation ensures that the kernel above is normalized. The subtraction of $fL_t h$ in the generator removes a zero-order term; it is useful when deriving the formula even in a region where $L_t h$ is not separately zero. For time-dependent $h$, the relevant harmonic equation is $\partial_t h+L_t h=0$, not $L_t h=0$ by itself.

The same drift from a path likelihood ratio

There is a second derivation that connects the transform to Girsanov’s theorem. Itô’s formula adds a second-derivative correction to the ordinary chain rule because \((\mathrm dW_{t,k})^2=\mathrm dt\); products of different Brownian components contribute zero. Substitute the original SDE into that rule. The bracketed drift coefficient in the second line is \((\partial_t+L_t)h=0\) by the backward equation. Applying the same rule to \(\log h\) gives the last line:

$$ \begin{aligned} \mathrm dh(t,X_t) &=\partial_t h\,\mathrm dt+\nabla h\cdot(b\,\mathrm dt+\sigma\,\mathrm dW_t) +\tfrac12\sum_{i,j}a_{ij}\partial_i\partial_j h\,\mathrm dt\\ &=[(\partial_t+L_t)h]\,\mathrm dt+(\sigma^\top\nabla h)\cdot\mathrm dW_t =(\sigma^\top\nabla h)\cdot\mathrm dW_t,\\ \mathrm d\log h(t,X_t) &=\frac{\mathrm dh}{h}-\frac{(\mathrm dh)^2}{2h^2} =u_t\cdot\mathrm dW_t-\tfrac12(u_t\cdot u_t)\,\mathrm dt. \end{aligned} $$

Here \(u_t=\sigma(t,X_t)^\top\nabla\log h(t,X_t)\), and \((\mathrm dh)^2=\lVert\sigma^\top\nabla h\rVert^2\,\mathrm dt\). All functions and derivatives in the calculation are evaluated at \((t,X_t)\).

Integrate from $0$ to $t$ and exponentiate:

$$ \frac{h(t,X_t)}{h(0,X_0)} =\exp\!\left( \int_0^t u_s\cdot\mathrm dW_s -\frac12\int_0^t(u_s\cdot u_s)\,\mathrm ds \right). $$

The ratio on the left is a path weight: up to time \(t\), a path is weighted by its remaining chance of success divided by its initial chance. Over a short interval, the exponential on the right changes this weight by approximately \(1+u_t\cdot\mathrm dW_t\). Given the present state, each component of \(\mathrm dW_t\) originally has mean zero and variance \(\mathrm dt\), so after reweighting its mean is \(\mathbb E[(1+u_t\cdot\mathrm dW_t)\mathrm dW_t]=u_t\,\mathrm dt\). Its covariance stays the same to leading order.

Girsanov’s theorem makes this short-time calculation exact: when the path weights define a probability law, \(\widetilde W_t=W_t-\int_0^t u_s\,\mathrm ds\) is Brownian motion under that law. Substituting \(\mathrm dW_t=\mathrm d\widetilde W_t+u_t\,\mathrm dt\) into the original SDE gives drift \(b+\sigma u_t=b+a\nabla\log h\), as in Eq. (23). Equation (23) writes \(W_t\) for \(\widetilde W_t\). For a hitting event, use these identities up to the stopping time; for an endpoint bridge, use times \(t<T\).

6. Brownian Bridge: Conditioning on an Endpoint

Let $\mathrm dX_t=\mathrm dW_t$, start at $X_0=x_0$, and require $X_T=y$. An exact point has probability zero under a continuous density, so here $h$ is the transition density to $y$:

$$ h(t,x)=p(T,y\mid t,x) =\frac{1}{\sqrt{2\pi(T-t)}} \exp\!\left[-\frac{(y-x)^2}{2(T-t)}\right],\qquad t<T. $$

Differentiate its logarithm with respect to $x$:

$$ \partial_x\log h(t,x)=\frac{y-x}{T-t}. $$

Since $b=0$ and $a=1$, the bridge SDE is

$$ \mathrm dX_t=\frac{y-X_t}{T-t}\,\mathrm dt+\mathrm dW_t, \qquad t<T. $$

Early in the path, the pull toward $y$ is mild. As $t\uparrow T$, the remaining time shrinks and the pull grows. The path remains random at every time before $T$, but its endpoint is pinned. The same formula follows from the Gaussian conditional law: given $X_t=x$ and $X_T=y$, the expected displacement over a short interval $\Delta t$ is approximately $(y-x)\Delta t/(T-t)$.

Notice the difference from the random walk example. The Brownian bridge targets a specified time and endpoint, so its $h(t,x)$ depends on time. A committor targets which set is hit first, with no fixed deadline, so its $h(x)$ can be time independent.

Conditional diffusion generation

The same construction explains the ideal form of guidance in a generative diffusion sampler. Write the sampler in a time coordinate that increases in the direction it is simulated, with base drift $b$ and covariance $a$. If $Y$ is a desired property of the final sample, define $h(t,x)=\Pr(Y=y\mid X_t=x)$, using a conditional density when $Y$ is continuous. The exact conditional sampler adds

$$ a(t,x)\nabla_x\log h(t,x) =a(t,x)\nabla_x\log\Pr(Y=y\mid X_t=x) $$

to the base drift. This is the mathematical version of classifier guidance: the gradient points toward intermediate states more likely to produce the requested property at the end. The formula is exact only for the true conditional likelihood and the correct time convention. An approximate classifier, or an arbitrarily scaled guidance term, changes the sampling law and generally loses the exact conditioning guarantee.

7. The Committor and Reactive Paths

Let $A$ and $B$ be disjoint sets. The forward committor is

$$ q(x)=\Pr(\text{reach }B\text{ before }A\mid X_0=x). $$

It solves the boundary-value problem

$$ Lq=0\quad\text{outside }A\text{ and }B, \qquad q(x)=0\ (x\in A),\qquad q(x)=1\ (x\in B). $$

Why $Lq=0$? Over a short time $\Delta t$, the Markov property says $q(x)=\mathbb E[q(X_{\Delta t})\mid X_0=x]$ before hitting either set. Subtract $q(x)$, divide by $\Delta t$, and take $\Delta t\to0$. By the definition of the generator, the result is $Lq(x)=0$.

For overdamped Langevin dynamics, let $\gamma>0$ be the constant friction coefficient and $\beta^{-1}=k_{\rm B}T$. The SDE is

$$ \boxed{\mathrm dX_t=-\frac{1}{\gamma}\nabla U(X_t)\,\mathrm dt +\sqrt{\frac{2k_{\rm B}T}{\gamma}}\,\mathrm dW_t.} $$

The Einstein relation gives the diffusion coefficient

$$ D=\frac{k_{\rm B}T}{\gamma}=\frac{1}{\beta\gamma}. $$

Hence the same SDE can be written as

$$ \mathrm dX_t=-D\beta\nabla U(X_t)\,\mathrm dt +\sqrt{2D}\,\mathrm dW_t. $$

Its noise covariance per unit time is $a=2DI$. Taking $h=q$ therefore gives the same transform, now labeled by $(q)$:

$$ \boxed{\mathrm dX_t= \left[-\frac{1}{\gamma}\nabla U(X_t)+\frac{2}{\beta\gamma}\nabla\log q(X_t)\right]\mathrm dt +\sqrt{\frac{2}{\beta\gamma}}\,\mathrm dW_t.} $$

Equivalently, the drift is $-D\beta\nabla U+2D\nabla\log q$, with noise coefficient $\sqrt{2D}$.

This is the precise sense in which the Doob transform is enhanced sampling guided by the committor. It samples the original dynamics conditioned on reaching $B$ before $A$, stopping when $B$ is first reached. It targets a distribution of paths, not merely a flatter equilibrium distribution of configurations.

One-dimensional committor with an explicit solution

Let $A={a}$ and $B={b}$, with $a<x<b$, and use $U=U(x)$. The backward equation here is the earlier $Lq=0$. “Backward” means we specify the future outcome at $a$ and $b$, then find its probability at each earlier starting position $x$; Fokker–Planck instead evolves a density forward in time. With no deadline, $q$ has no time derivative, so $Lq=0$ is the time-independent form of $\partial_t h+L_t h=0$.

In one dimension, the SDE above has drift \(-U^{\prime}(x)/\gamma\) and noise variance per unit time \(2D\). A prime means differentiation with respect to \(x\): \(f^{\prime}(x)=\mathrm df/\mathrm dx\) and \(f^{\prime\prime}(x)=\mathrm d^2f/\mathrm dx^2\). The short-time Taylor term \(\tfrac12f^{\prime\prime}(x)(\Delta X)^2\) has average \(\tfrac12f^{\prime\prime}(x)(2D\Delta t)\), explaining the coefficient \(D\) after division by \(\Delta t\). Thus \((Lf)(x)=-U^{\prime}(x)f^{\prime}(x)/\gamma+D f^{\prime\prime}(x)\). Setting \(f=q\) in \(Lq=0\), with \(q(a)=0\) and \(q(b)=1\), gives

$$ -\frac{U'(x)}{\gamma}q'(x)+Dq''(x)=0, \qquad q(a)=0,\quad q(b)=1. $$

Multiply by $\beta\gamma$ and use $D=1/(\beta\gamma)$; the friction cancels:

$$ q''-\beta U'q'=0 \quad\Longleftrightarrow\quad \frac{\mathrm d}{\mathrm dx}\!\left(e^{-\beta U}q'\right)=0. $$

Hence $q’(x)=C e^{\beta U(x)}$. Integrating and applying both boundary conditions yields

$$ \boxed{q(x)= \frac{\displaystyle\int_a^x e^{\beta U(z)}\,\mathrm dz} {\displaystyle\int_a^b e^{\beta U(z)}\,\mathrm dz}.} $$

Constant friction changes the time scale but cancels from this hitting probability.

The conditioned drift is then fully explicit:

$$ b^{(q)}(x)=-\frac{U'(x)}{\gamma} +2D\frac{e^{\beta U(x)}}{\displaystyle\int_a^x e^{\beta U(z)}\,\mathrm dz}. $$

As a simple check, set $U=0$ and choose units with $D=1/2$, so $\mathrm dX_t=\mathrm dW_t$ on $(0,L)$. Then $q(x)=x/L$, $a=1$, and the transformed drift is $1/x$. Near the failure boundary $x=0$, it strongly repels the process. This is the continuum analogue of the random walk’s zero probability of stepping from state $1$ to state $0$.

The drift becomes singular where $q=0$. The ideal conditioned process is defined where $q>0$; starting exactly on the boundary of $A$ requires an entrance-law or limiting construction. In simulations one usually starts just outside $A$ or uses a regularized committor, while remembering that regularization changes the exact law.

8. Successful Paths and Stochastic Optimal Control

For a path starting at $x$, let $E$ mean “reach $B$ before $A$.” Its chance of success is $q(x)$, where $q$ is the committor. Computing $q$ can be difficult in high-dimensional systems. An approximation may guide sampling, but it does not give the exact conditioned path law without correction.

Why the $h$-transform solves a control problem

Here is the stochastic optimal control (SOC) connection. Let $P$ be the law of the original path from $x$, and let $P^{(q)}=P(\,\cdot\mid E)$ be its law conditioned on success. A proposed controlled path law $Q$ is required to have $Q(E)=1$ and to be absolutely continuous with respect to $P$. We measure how much it changes the original paths by the Kullback–Leibler divergence $\mathrm{KL}(Q\Vert P)=\mathbb E_Q[\log(\mathrm dQ/\mathrm dP)]$.

Recall that \(p=P(E)=q(x)>0\) is the original chance of success from the starting point \(x\). For any successful path, conditioning divides its original probability by $p$: $\mathrm dP^{(q)}=\mathrm dP/p$ on $E$. Since $Q$ only samples paths in $E$, the likelihood ratios obey $\mathrm dQ/\mathrm dP=(\mathrm dQ/\mathrm dP^{(q)})/p$. Taking the logarithm and averaging under $Q$ gives the equality:

$$ \begin{aligned} \mathrm{KL}(Q\Vert P)&=\mathbb E_Q\!\left[\log\frac{\mathrm dQ}{\mathrm dP^{(q)}}\right]-\log p\\ &=\mathrm{KL}(Q\Vert P^{(q)})-\log p\ge -\log p. \end{aligned} $$

The remaining KL term is zero exactly when $Q=P^{(q)}$. Thus the conditional law is the smallest change, in KL, among path laws that guarantee success.

For a diffusion, a control \(u_t\) changes the drift from \(b\) to \(b+\sigma u_t\) while keeping the noise coefficient \(\sigma\). Let \(Q^u\) be the resulting path law. Under \(P\), \(W\) is Brownian and its increments have mean zero. Under \(Q^u\), \(\widetilde W_t=W_t-\int_0^t u_s\,\mathrm ds\) is Brownian: its increments have mean zero, while those of \(W\) have conditional mean \(u_t\,\mathrm dt\). Girsanov’s formula writes the same log likelihood ratio in these two ways:

$$ \begin{aligned} \log\frac{\mathrm dQ^u}{\mathrm dP} &=\int_0^\tau u_t\cdot\mathrm dW_t-\frac12\int_0^\tau \lVert u_t\rVert^2\,\mathrm dt\\ &=\int_0^\tau u_t\cdot\mathrm d\widetilde W_t+\frac12\int_0^\tau \lVert u_t\rVert^2\,\mathrm dt. \end{aligned} $$

The second line substitutes \(\mathrm dW_t=\mathrm d\widetilde W_t+u_t\,\mathrm dt\); it does not treat both increments as zero-mean under one law. KL averages under \(Q^u\), so only the integral against \(\widetilde W\) has mean zero. Hence \(\mathrm{KL}(Q^u\Vert P)=\tfrac12\mathbb E_{Q^u}\int_0^\tau \lVert u_t\rVert^2\,\mathrm dt\), the expected quadratic control cost. If the controlled law enforces \(E\), its cost is at least \(-\log p\); the exact \(h\)-transform reaches that minimum with \(u_t=\sigma^\top\nabla\log q(X_t)\), giving drift \(b+a\nabla\log q\). These identities assume the relevant path laws and stochastic integrals are well defined up to \(\tau\).

9. Transition Path Theory: From Successful Paths to a Reaction Rate

The Doob transform describes an $A\to B$ path after we have selected a successful attempt. Transition path theory (TPT) also asks how many such paths occur per unit time in the original, unconditioned dynamics. Call that equilibrium frequency $R_{AB}$; it is the long-run number of $A\to B$ reactive paths divided by the observation time. A reactive path starts at its last exit from $A$ and ends at its first arrival in $B$, without returning to $A$ in between. E and Vanden-Eijnden derive the corresponding reactive current for diffusions.

Current and rate for the overdamped diffusion

Use the Langevin model of Section 7, with $D=\beta^{-1}/\gamma$ and equilibrium density $\pi(x)=Z^{-1}e^{-\beta U(x)}$, where $Z=\int e^{-\beta U(x)}\,\mathrm dx$ normalizes it. At position $x$, the chance that the future reaches $B$ before $A$ is $q(x)$. Because this equilibrium diffusion is reversible, the chance that the path last came from $A$ is $1-q(x)$. Thus the amount of equilibrium probability carried by $A\to B$ reactive paths near $x$ is $r(x)=\pi(x)q(x)[1-q(x)]$. Here $r(x)$ is the equilibrium density of $A\to B$ reactive trajectories, and committor-conditioned dynamics generates those paths when started from the appropriate reactive initial distribution.

From the Fokker–Planck equation in Section 5, $\partial_t r=-\nabla\cdot(vr)+D\Delta r=-\nabla\cdot J$, so a density $r$ with drift $v$ has probability current $J=vr-D\nabla r$. Put in the conditioned drift $v=-\nabla U/\gamma+2D\nabla\log q$. Since $\nabla\pi=-\beta\pi\nabla U$ and $D\beta=1/\gamma$, the equilibrium terms cancel and leave

$$ \begin{aligned} J_{AB}&=\bigl(-\nabla U/\gamma+2D\nabla\log q\bigr)\pi q(1-q)-D\nabla[\pi q(1-q)]\\ &=\boxed{D\pi\nabla q}. \end{aligned} $$

This current counts original reactive paths per unit time, rather than normalized conditioned paths. Between $A$ and $B$, $Lq=0$ implies $\nabla\cdot J_{AB}=D\nabla\cdot(\pi\nabla q)=\pi Lq=0$. Let $\Omega=\mathbb R^d\setminus(A\cup B)$. Here $\Sigma$ is any surface separating $A$ from $B$, with normal $n$ pointing toward $B$; it can, but need not, be a contour of $q$. The contour $q(x)=1/2$ is one choice. Write $\mathrm dS$ for surface area and $\mathrm dV=\mathrm d^d x$ for volume. The rate has two equivalent forms:

$$ \boxed{R_{AB}=\int_\Sigma J_{AB}\cdot n\,\mathrm dS =D\int_\Omega\pi(x)\lVert\nabla q(x)\rVert^2\,\mathrm dV.} $$

The equality follows directly from $\nabla\cdot(qJ_{AB})=q\nabla\cdot J_{AB}+J_{AB}\cdot\nabla q=D\pi\lVert\nabla q\rVert^2$. Integrate this over $\Omega$ and use the divergence theorem:

$$ \begin{aligned} D\int_\Omega\pi\lVert\nabla q\rVert^2\,\mathrm dV &=\int_\Omega\nabla\cdot(qJ_{AB})\,\mathrm dV =\int_{\partial\Omega}qJ_{AB}\cdot n_\Omega\,\mathrm dS\\ &=\int_{\partial B}J_{AB}\cdot n_\Omega\,\mathrm dS =\int_\Sigma J_{AB}\cdot n\,\mathrm dS=R_{AB}. \end{aligned} $$

Here $n_\Omega$ points outward from $\Omega$. The $A$ boundary contributes zero because $q=0$; at $B$, $q=1$. We assume no flux through any outer boundary. Since $\nabla\cdot J_{AB}=0$, the flux through $\partial B$ equals the flux through $\Sigma$. At fixed $U$ and $T$, the rate scales as $1/\gamma$.

The flux $R_{AB}$ counts successful transitions per unit time across the whole equilibrium ensemble. For a rate per trajectory associated with $A$, divide by the fraction $\theta_A$ whose most recent visit to either basin was to $A$:

$$ k_{AB}=\frac{R_{AB}}{\theta_A},\qquad \theta_A=\int_{\mathbb R^d}\pi(x)[1-q(x)]\,\mathrm d^d x. $$

In this reversible model, $1-q(x)$ is the chance that a trajectory at $x$ last came from $A$. Thus $\theta_A$ includes trajectories currently outside $A$ that last visited it. If these excursions are brief compared with the time spent in $A$, then $\theta_A\approx\pi(A)=\int_A\pi(x)\,\mathrm d^d x$, and $k_{AB}\approx R_{AB}/\pi(A)$.

What to calculate

Given $U$, $\beta$, $\gamma$, and chosen sets $A,B$: compute $\pi$, then solve $Lq=0$ with $q(x)=0$ in $A$ and $q(x)=1$ in $B$. With $D=1/(\beta\gamma)$, evaluate the flux through a separating surface, such as $q=1/2$, or use the volume integral above; the latter can be expensive in high dimensions. On a grid, $q$ comes from a boundary-value solver; from simulation, it can be estimated by launching unbiased trajectories from sampled positions and counting the fraction that hit $B$ first. Comparing fluxes across several surfaces is a useful check: a large disagreement indicates that the numerical committor or current is inaccurate.

For a finite-state jump model, the same rate has an especially direct estimator. Let $\pi_i$ be the stationary probability of state $i$, $k_{ij}$ its jump rate to $j$, and $q_j$ its success probability. A jump from $i\in A$ to $j$ occurs at frequency $\pi_i k_{ij}$, and the ensuing attempt succeeds with probability $q_j$. Hence

$$ \boxed{R_{AB}=\sum_{i\in A}\sum_{j\notin A}\pi_i k_{ij}q_j.} $$

For the three-state chain $0\leftrightarrow1\leftrightarrow2$, take $A={0}$ and $B={2}$, with unit rates in both directions. Then $\pi_i=1/3$ and $q=(0,1/2,1)$, so $R_{AB}=(1/3)(1)(1/2)=1/6$ transitions per unit time. In computation, estimate $\pi$ and $k$ from the original dynamics, solve the small linear system for $q$, and evaluate this sum. The formula is the discrete counterpart of the reactive flux above; see Metzner, Schütte, and Vanden-Eijnden.

10. A Short Map of the Formulas

Setting Future information in $h$ Local rule after conditioning
Discrete chain $h(i)=\Pr(E\mid X_0=i)$ \(P^{(h)}_{ij}=P_{ij}h(j)/h(i)\)
Chain with deadline $h_n(i)=\Pr(E_N\mid X_n=i)$ \(P^{(h)}_n(i,j)=P_{ij}h_{n+1}(j)/h_n(i)\)
Continuous-time jumps $Lh=0$ in the interior \(k^{(h)}_{ij}=k_{ij}h(j)/h(i)\)
Diffusion $\partial_t h+L_t h=0$ $b^{(h)}=b+a\nabla\log h$
Reactive paths $q(x)=\Pr(\text{reach }B\text{ before }A\mid X_0=x)$ Add $a\nabla\log q$ until $B$ is hit

The through-line is Bayes’ rule. A move becomes more likely in proportion to how much it improves the chance of the future condition. The backward equation makes those local probabilities consistent; telescoping makes the resulting entire path law the correct conditional law.