<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Alexandre Thiéry</title>
<link>https://alexxthiery.github.io/notes/index_notes_as_list.html</link>
<atom:link href="https://alexxthiery.github.io/notes/index_notes_as_list.xml" rel="self" type="application/rss+xml"/>
<description>Alex Thiery Notes</description>
<generator>quarto-1.7.32</generator>
<lastBuildDate>Mon, 29 Jun 2026 16:00:00 GMT</lastBuildDate>
<item>
  <title>Predictive Posteriors</title>
  <link>https://alexxthiery.github.io/notes/predictive_posterior/predictive_posterior.html</link>
  <description><![CDATA[ 





<p>A Bayesian model gives a distribution <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta"> for future data, indexed by a parameter <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> abd predictions are usually done through the posterior predictive. If <img src="https://latex.codecogs.com/png.latex?%5CPi_n"> is the posterior on <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, then the posterior predictive is <img src="https://latex.codecogs.com/png.latex?P_%7B%5CPi_n%7D%20=%20%5Cint_%5CTheta%20P_%5Ctheta%20%5C,%20d%5CPi_n(%5Ctheta)"> and it can be interpreted as a mixture of the model components <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta"> weighed by the posterior <img src="https://latex.codecogs.com/png.latex?%5CPi_n">. The standard Bayesian approach chooses the weights by scoring parameters with the likelihood, not by directly scoring the mixture predictive, which can be especially limiting when the model is misspecified!</p>
<p>For example, suppose that the data come from two subpopulations, but the model only accounts for one. The posterior will learn a compromise parameter, and the posterior predictive will be a mixture of one component. A predictive posterior approach, as we will describe below, can learn a mixture of two components and predict much better. This is achieved by scoring the mixture predictive directly, rather than scoring the individual components through the likelihood function. In other words, the predictive posteriors still mix the original model components <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta">, still using a distribution <img src="https://latex.codecogs.com/png.latex?Q"> on <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, but they choose <img src="https://latex.codecogs.com/png.latex?Q"> by scoring the resulting mixture predictive directly in terms of predictive performance. In contrast, Bayes chooses <img src="https://latex.codecogs.com/png.latex?Q"> by scoring the individual components <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta"> through the likelihood function.</p>
<p>Let us setup some notation: the observations take values in a space <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%20Z">, and we typically have <img src="https://latex.codecogs.com/png.latex?n"> observations <img src="https://latex.codecogs.com/png.latex?z_1,%5Cldots,z_n%5Cin%5Cmathcal%20Z">. The parameter <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> belongs to a parameter space <img src="https://latex.codecogs.com/png.latex?%5CTheta">, and <img src="https://latex.codecogs.com/png.latex?p_%5Ctheta(z)"> is the density of <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta"> with respect to a reference measure <img src="https://latex.codecogs.com/png.latex?%5Cmu"> on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%20Z">. The log-likelihood is <img src="https://latex.codecogs.com/png.latex?%5Cell_n(%5Ctheta)%20=%20%5Csum_%7Bi=1%7D%5En%20%5Clog%20p_%5Ctheta(z_i)"> and the model is:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%20M=%5C%7BP_%5Ctheta:%5Ctheta%5Cin%5CTheta%5C%7D.%0A"></p>
<p>A mixing distribution <img src="https://latex.codecogs.com/png.latex?Q"> is a probability distribution on <img src="https://latex.codecogs.com/png.latex?%5CTheta"> and the mixture predictive with respect to <img src="https://latex.codecogs.com/png.latex?Q"> is defined as</p>
<p><span id="eq-predictive-mixture"><img src="https://latex.codecogs.com/png.latex?%0AP_Q%20=%20%5Cint_%5CTheta%20P_%5Ctheta%20%5C,%20dQ(%5Ctheta).%0A%5Ctag%7B1%7D"></span></p>
<p>The mixture <img src="https://latex.codecogs.com/png.latex?P_Q"> is again a probability distribution on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%20Z"> and for an event <img src="https://latex.codecogs.com/png.latex?A%5Csubset%5Cmathcal%20Z"> we have <img src="https://latex.codecogs.com/png.latex?P_Q(A)=%5Cint_%5CTheta%20P_%5Ctheta(A)%5C,dQ(%5Ctheta)">.</p>
<section id="average-the-score-or-score-the-average" class="level3">
<h3 class="anchored" data-anchor-id="average-the-score-or-score-the-average">Average the score or score the average</h3>
<p>Let <img src="https://latex.codecogs.com/png.latex?Q_0"> be a prior or reference measure on <img src="https://latex.codecogs.com/png.latex?%5CTheta">. The <a href="../../notes/sanov/sanov.html">Kullback-Leibler</a> term below is the regularizer. Bayesian and generalized Bayesian approaches can be written as</p>
<p><span id="eq-gibbs-template"><img src="https://latex.codecogs.com/png.latex?%0AQ_n%5EG%0A%5Cin%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7BQ%5Cin%5Cmathcal%20P(%5CTheta)%7D%0A%5Cleft%5C%7B%0A-%5Cint_%5CTheta%20%5Cell_n(%5Ctheta)%5C,dQ(%5Ctheta)%0A+%0A%5Clambda_n%20D_%7B%5Ctext%7BKL%7D%7D(Q%20%5Cmid%20Q_0)%0A%5Cright%5C%7D.%0A%5Ctag%7B2%7D"></span></p>
<p>Standard Bayes is the special case with <img src="https://latex.codecogs.com/png.latex?%5Clambda_n=1"> and <img src="https://latex.codecogs.com/png.latex?Q_0"> the prior, while generalized Bayes allows other losses and scaling of <img src="https://latex.codecogs.com/png.latex?%5Clambda_n"> <span class="citation" data-cites="Bissiri2016">(Bissiri, Holmes, and Walker 2016)</span>. A predictive posterior instead solves</p>
<p><span id="eq-predictive-template"><img src="https://latex.codecogs.com/png.latex?%0AQ_n%5EP%0A%5Cin%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7BQ%5Cin%5Cmathcal%20P(%5CTheta)%7D%0A%5Cleft%5C%7B%0AD_n(P_n,P_Q)%0A+%0A%5Clambda_n%20D_%7B%5Ctext%7BKL%7D%7D(Q%20%5Cmid%20Q_0)%0A%5Cright%5C%7D%0A%5Ctag%7B3%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?P_n=%5Cfrac1n%5Csum_%7Bi=1%7D%5En%5Cdelta_%7Bz_i%7D"> is the empirical distribution of the data and <img src="https://latex.codecogs.com/png.latex?D_n"> is a discrepancy between the predictive <img src="https://latex.codecogs.com/png.latex?P_Q"> and the empirical distribution <img src="https://latex.codecogs.com/png.latex?P_n">. The first term scores the mixture predictive directly, while the second term keeps <img src="https://latex.codecogs.com/png.latex?Q"> close to a reference measure <img src="https://latex.codecogs.com/png.latex?Q_0">. The discrepancy <img src="https://latex.codecogs.com/png.latex?D_n(P_n,P)"> may be chosen as the negative log likelihood, i.e.</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_n(P_n,P_Q)%20=%20-%5Csum_%7Bi=1%7D%5En%20%5Clog%20%5Cint_%5CTheta%20p_%5Ctheta(z_i)%5C,dQ(%5Ctheta),%0A"></p>
<p>but indeed it does not have to be. It can be any scoring rule and a few examples are given in the next section. The regularization term is important to avoid overfitting, especially when the model is misspecified and the mixture predictive can be very flexible. For a pointwise <a href="../../notes/scoring_rules/scoring.html">scoring rule</a> <img src="https://latex.codecogs.com/png.latex?S">, with smaller scores being better, the discrepancy can be written as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_n(P_n,P_Q)%20=%20%5Csum_%7Bi=1%7D%5En%20S(P_Q,z_i).%0A"></p>
<p>Note that the quantity <img src="https://latex.codecogs.com/png.latex?%5Clambda_n"> can be chosen to depend on <img src="https://latex.codecogs.com/png.latex?n">, and it can be tuned to optimize predictive performance, typically using a validation set or cross-validation.</p>
</section>
<section id="log-score-and-mixture-likelihood" class="level3">
<h3 class="anchored" data-anchor-id="log-score-and-mixture-likelihood">Log score and mixture likelihood</h3>
<p>With the log score and no KL penalty, Equation&nbsp;3 becomes</p>
<p><span id="eq-mixture-likelihood"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_Q%0A%5Cleft%5C%7B%0A-%5Csum_%7Bi=1%7D%5En%0A%5Clog%5Cint_%5CTheta%20p_%5Ctheta(z_i)%5C,dQ(%5Ctheta)%0A%5Cright%5C%7D.%0A%5Ctag%7B4%7D"></span></p>
<p>This is the likelihood for a mixture model with unknown mixing distribution <span class="citation" data-cites="Lindsay1995">(Lindsay 1995)</span>. So in this case the predictive posterior is doing classical mixture estimation. If <img src="https://latex.codecogs.com/png.latex?Q"> is restricted to a finite list of predictors, the same objective gives stacking or convex aggregation <span class="citation" data-cites="Yao2018">(Yao et al. 2018)</span>. Better prediction may simply mean that mixtures predict better than single components. The posterior-like part is the <a href="../../notes/information_theory_basics/information_theory_entropy.html">entropy</a> penalty on <img src="https://latex.codecogs.com/png.latex?Q">.</p>
</section>
<section id="conditional-prediction" class="level3">
<h3 class="anchored" data-anchor-id="conditional-prediction">Conditional prediction</h3>
<p>For supervised data, write <img src="https://latex.codecogs.com/png.latex?x%5Cin%5Cmathcal%20X"> for covariates and <img src="https://latex.codecogs.com/png.latex?y%5Cin%5Cmathcal%20Y"> for responses so that the observation is <img src="https://latex.codecogs.com/png.latex?z=(x,y)%5Cin%5Cmathcal%20X%5Ctimes%5Cmathcal%20Y">. Replace <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta"> by a conditional distribution <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta(dy%5Cmid%20x)"> on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%20Y"> and the mixture predictive is</p>
<p><span id="eq-conditional-mixture"><img src="https://latex.codecogs.com/png.latex?%0AP_Q(dy%5Cmid%20x)%0A=%0A%5Cint_%5CTheta%20P_%5Ctheta(dy%5Cmid%20x)%5C,dQ(%5Ctheta).%0A%5Ctag%7B5%7D"></span></p>
<p>If one uses a proper scoring rule <img src="https://latex.codecogs.com/png.latex?S"> as the discrepancy, the predictive posterior solves</p>
<p><span id="eq-conditional-score"><img src="https://latex.codecogs.com/png.latex?%0A%5Csum_%7Bi=1%7D%5En%20S(P_Q(%5Ccdot%5Cmid%20x_i),y_i)%0A+%0A%5Clambda_nD_%7B%5Ctext%7BKL%7D%7D(Q%5Cmid%20Q_0)%0A%5Ctag%7B6%7D"></span></p>
<p>where as usual the first term scores the mixture predictive and the second term keeps <img src="https://latex.codecogs.com/png.latex?Q"> close to a reference measure <img src="https://latex.codecogs.com/png.latex?Q_0">. The log score is a special case, but other proper scoring rules can be used as well.</p>
</section>
<section id="a-latent-subpopulation-example" class="level3">
<h3 class="anchored" data-anchor-id="a-latent-subpopulation-example">A latent-subpopulation example</h3>
<p>Consider the Gaussian regression model <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta(dy%5Cmid%20x)=%5Cmathcal%20N(y;x%5E%5Ctop%5Ctheta,%5Csigma%5E2)%5C,dy"> where <img src="https://latex.codecogs.com/png.latex?sigma%5E2"> is known and <img src="https://latex.codecogs.com/png.latex?%5Ctheta%5Cin%5Cmathbb%20R%5Ep"> is the regression coefficient. Now suppose the population has unobserved groups:</p>
<p><span id="eq-latent-mixture"><img src="https://latex.codecogs.com/png.latex?%0AY%5Cmid%20X=x%0A%5Csim%0A%5Csum_%7Bk=1%7D%5EK%20w_k%5C,%5Cmathcal%20N(y;x%5E%5Ctop%5Ctheta_k,%5Csigma%5E2).%0A%5Ctag%7B7%7D"></span></p>
<p>Bayes under the single-slope model learns one compromise slope, which can have arbitrarily poor predictive performance. A predictive posterior can put mass near <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1,%5Cldots,%5Ctheta_K">, which gives a mixture predictive that can be much closer to the truth. If the groups are part of the scientific model, <img src="https://latex.codecogs.com/png.latex?Q"> estimates population heterogeneity. If the same mixture is only approximating nonlinear regression, heteroscedastic noise, or missing covariates, <img src="https://latex.codecogs.com/png.latex?Q"> is an ensemble representation.</p>
</section>
<section id="a-misspecified-simulator-example" class="level3">
<h3 class="anchored" data-anchor-id="a-misspecified-simulator-example">A misspecified simulator example</h3>
<p>The interpretation changes in mechanistic models. Consider a mechanistic simulator <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta(dy%5Cmid%20x)">. For a deterministic simulator, this may be a point mass, or the simulator output plus observation noise. The parameter <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> may contain rate constants, forcing terms, initial-state corrections, or boundary conditions. If the simulator omits a source of randomness or a reaction channel, ordinary Bayes can learn one best wrong simulator. The mixture can add predictive spread, as is empirically observed in ensemble weather forecasts. It can widen intervals, add heavier tails, or create several plausible predictive modes. Note that this predictive spread is not a discovery of the missing mechanism. It is just a predictive fix for a misspecified model. In other words, there is nothing magical about the mixture predictive: it is just a mixture of the original model components, and the mixture weights are chosen to optimize predictive performance. A broad <img src="https://latex.codecogs.com/png.latex?Q"> may mean physical heterogeneity, missing process noise, numerical ensemble spread, or regularization.</p>
</section>
<section id="what-does-q-mean" class="level3">
<h3 class="anchored" data-anchor-id="what-does-q-mean">What does Q mean?</h3>
<p>The objective identifies <img src="https://latex.codecogs.com/png.latex?P_Q">, not <img src="https://latex.codecogs.com/png.latex?Q"> and the map <img src="https://latex.codecogs.com/png.latex?Q%20%5Cmapsto%20P_Q"> needs not be injective since different mixing distributions can give the same predictive distribution. Two nearly identical predictive distributions can come from very different mixing distributions. The objective directly supports claims about <img src="https://latex.codecogs.com/png.latex?P_Q">. On the other hand, claims about parameter uncertainty, latent heterogeneity, or scientific mechanism need more assumptions. They need identifiability of the mixture representation and a data-generating story in which <img src="https://latex.codecogs.com/png.latex?Q"> has that meaning.</p>
<p>The regularization scale <img src="https://latex.codecogs.com/png.latex?%5Clambda_n"> also matters. While a Bayes-scaled value keeps the posterior analogy closer, a validation-tuned value targets prediction. Large <img src="https://latex.codecogs.com/png.latex?%5Clambda_n"> keeps <img src="https://latex.codecogs.com/png.latex?Q"> close to <img src="https://latex.codecogs.com/png.latex?Q_0">. Small <img src="https://latex.codecogs.com/png.latex?%5Clambda_n"> chases predictive fit. In the second case, the spread of <img src="https://latex.codecogs.com/png.latex?Q"> is partly a tuning effect.</p>
</section>
<section id="computation" class="level3">
<h3 class="anchored" data-anchor-id="computation">Computation</h3>
<p>The optimization is over distributions <img src="https://latex.codecogs.com/png.latex?Q"> on parameter space, so computation starts by choosing a representation of <img src="https://latex.codecogs.com/png.latex?Q">. A variational implementation chooses a parametric density <img src="https://latex.codecogs.com/png.latex?q_%5Clambda"> on <img src="https://latex.codecogs.com/png.latex?%5CTheta"> and optimizes <img src="https://latex.codecogs.com/png.latex?%5Clambda">. A particle implementation uses</p>
<p><span id="eq-particle-q"><img src="https://latex.codecogs.com/png.latex?%0AQ_M=%5Cfrac1M%5Csum_%7Bm=1%7D%5EM%5Cdelta_%7B%5Ctheta_m%7D%0A%5Ctag%7B8%7D"></span></p>
<p>and optimizes the locations <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1,%5Cldots,%5Ctheta_M"> of the particles. This leads to a nonconvex optimizaition problem that is often attacked with stochastic gradient descent. For MMD, CRPS, or energy scores, the objective can often be estimated from simulations. They only require simulation from <img src="https://latex.codecogs.com/png.latex?P_%5Ctheta">, not evaluation of <img src="https://latex.codecogs.com/png.latex?p_%5Ctheta">.</p>
</section>
<section id="where-this-appears" class="level3">
<h3 class="anchored" data-anchor-id="where-this-appears">Where this appears</h3>
<p>Several recent papers study this score-the-mixture update. Predictive variational inference, prediction-centric uncertainty quantification, and predictively oriented posteriors all fit the score-the-mixture pattern <span class="citation" data-cites="Lai2024 Shen2024 McLatchie2025">(Lai, Linero, and Yao 2024; Shen et al. 2024; McLatchie et al. 2025)</span>. Generalized Bayes fits the average-loss pattern <span class="citation" data-cites="Bissiri2016">(Bissiri, Holmes, and Walker 2016)</span>. MMD posterior bootstrap and MMD regression are nearby, but they remain parameter-projection methods unless they score the mixture predictive itself.</p>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-Bissiri2016" class="csl-entry">
Bissiri, P. G., C. C. Holmes, and S. G. Walker. 2016. <span>“A General Framework for Updating Belief Distributions.”</span> <em>Journal of the Royal Statistical Society Series B: Statistical Methodology</em> 78 (5). Oxford University Press (OUP): 1103–30. doi:<a href="https://doi.org/10.1111/rssb.12158">10.1111/rssb.12158</a>.
</div>
<div id="ref-Lai2024" class="csl-entry">
Lai, Jinlin, Antonio Linero, and Yuling Yao. 2024. <span>“Predictive Variational Inference: Learn the Predictively Optimal Posterior Distribution.”</span> arXiv preprint arXiv:2410.14843.
</div>
<div id="ref-Lindsay1995" class="csl-entry">
Lindsay, Bruce G. 1995. <em>Mixture Models: Theory, Geometry and Applications</em>. <em>NSF-CBMS Regional Conference Series in Probability and Statistics</em>. Institute of Mathematical Statistics; American Statistical Association. doi:<a href="https://doi.org/10.1214/cbms/1462106013">10.1214/cbms/1462106013</a>.
</div>
<div id="ref-McLatchie2025" class="csl-entry">
McLatchie, Yann, Badr-Eddine Cherief-Abdellatif, David T. Frazier, and Jeremias Knoblauch. 2025. <span>“Predictively Oriented Posteriors.”</span> arXiv preprint arXiv:2510.01915.
</div>
<div id="ref-Shen2024" class="csl-entry">
Shen, Zheyang, Jeremias Knoblauch, Sam Power, and Chris. J. Oates. 2024. <span>“Prediction-Centric Uncertainty Quantification via MMD.”</span> In <em>International Conference on Artificial Intelligence and Statistics</em>.
</div>
<div id="ref-Yao2018" class="csl-entry">
Yao, Yuling, Aki Vehtari, Daniel Simpson, and Andrew Gelman. 2018. <span>“Using Stacking to Average Bayesian Predictive Distributions (with Discussion).”</span> <em>Bayesian Analysis</em> 13 (3). Institute of Mathematical Statistics: 917–1007. doi:<a href="https://doi.org/10.1214/17-ba1091">10.1214/17-ba1091</a>.
</div>
</div></section></div> ]]></description>
  <category>bayes</category>
  <category>prediction</category>
  <guid>https://alexxthiery.github.io/notes/predictive_posterior/predictive_posterior.html</guid>
  <pubDate>Mon, 29 Jun 2026 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Functional Adjoint Sampler</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/functional_adjoint.html</link>
  <description><![CDATA[ 





<section id="motivation" class="level2">
<h2 class="anchored" data-anchor-id="motivation">Motivation</h2>
<p><a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">Adjoint sampling</a> learns a control drift <img src="https://latex.codecogs.com/png.latex?u(t,x)"> that steers a Brownian motion in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5Ed"> toward a target <img src="https://latex.codecogs.com/png.latex?%5Cpi(x)%20%5Cpropto%20%5Cexp(-E(x))">. Some problems require sampling <em>paths</em> rather than points. Transition path sampling (TPS) is the canonical example: a molecular system has two metastable states <img src="https://latex.codecogs.com/png.latex?A"> and <img src="https://latex.codecogs.com/png.latex?B">, and the goal is to sample reactive trajectories <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D:%20%5B0,L%5D%20%5Cto%20%5Cmathbb%7BR%7D%5Ed"> connecting them. The target is a Gibbs measure over paths, <img src="https://latex.codecogs.com/png.latex?%0A%5Cpi%5B%5Cmathbf%7Bx%7D%5D%20%5Cpropto%20%5Cexp%20%7B%5Cleft(%20-S%5B%5Cmathbf%7Bx%7D%5D%20%5Cright)%7D%20,%20%5Cqquad%20S%5B%5Cmathbf%7Bx%7D%5D%20=%20%5Cint_0%5EL%20E(%5Cmathbf%7Bx%7D(s))%20%5C,%20ds.%0A"></p>
<p>The Functional Adjoint Sampler (FAS) <span class="citation" data-cites="bae2025functional">(<strong>bae2025functional?</strong>)</span> applies <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a> to this setting with an OU reference process instead of Brownian motion. After discretization, the “path” is just a vector in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5E%7BdK%7D">. FAS is adjoint sampling in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5E%7BdK%7D"> with an OU reference process. The infinite-dimensional formulation in the original paper is a presentation choice, not a mathematical necessity. Strip away the infinite-dimensional machinery and the core idea is: adjoint sampling on paths instead of points, with an OU reference instead of Brownian motion, and Dirichlet boundary conditions to pin endpoints.</p>
<p>(The other notes use <img src="https://latex.codecogs.com/png.latex?%5B0,1%5D">; here we use <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D"> to match the FAS paper.)</p>
</section>
<section id="setup-soc-on-path-space" class="level2">
<h2 class="anchored" data-anchor-id="setup-soc-on-path-space">Setup: SOC on path space</h2>
<p>Discretize the path into <img src="https://latex.codecogs.com/png.latex?K"> interior nodes: <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D%20=%20(x_1,%20%5Cldots,%20x_K)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7BdK%7D">, with boundary conditions <img src="https://latex.codecogs.com/png.latex?x_0%20=%20a%20%5Cin%20A"> and <img src="https://latex.codecogs.com/png.latex?x_%7BK+1%7D%20=%20b%20%5Cin%20B"> fixed. The target density on the interior nodes is <img src="https://latex.codecogs.com/png.latex?%5Cpi(%5Cmathbf%7Bx%7D)%20%5Cpropto%20%5Cexp(-S(%5Cmathbf%7Bx%7D))%20%5C,%20%5Cnu(%5Cmathbf%7Bx%7D)"> for some reference measure <img src="https://latex.codecogs.com/png.latex?%5Cnu">. As in <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a>, the terminal cost absorbs the mismatch: <img src="https://latex.codecogs.com/png.latex?g(%5Cmathbf%7Bx%7D)%20=%20S(%5Cmathbf%7Bx%7D)%20+%20%5Clog%20q_T(%5Cmathbf%7Bx%7D_0,%20%5Cmathbf%7Bx%7D)%20-%20%5Clog%20%5Cnu_%5Cinfty(%5Cmathbf%7Bx%7D)">, where <img src="https://latex.codecogs.com/png.latex?q_T"> is the Radon-Nikodym derivative of the OU marginal at time <img src="https://latex.codecogs.com/png.latex?T"> against the invariant measure <img src="https://latex.codecogs.com/png.latex?%5Cnu_%5Cinfty">. The log-RND term <img src="https://latex.codecogs.com/png.latex?%5Clog%20q_T"> corrects for the mismatch between the OU marginal and the invariant measure, analogous to the path-space reweighting in the <a href="../../notes/jarzynski/jarzynski.html">Jarzynski notes</a>.</p>
<p>(Sign convention: <img src="https://latex.codecogs.com/png.latex?g"> is a cost, minimized; consistent with <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a>. The <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> note uses a reward <img src="https://latex.codecogs.com/png.latex?r%20=%20-g">.)</p>
<p>The reference process in <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a> is Brownian motion. For paths, the natural reference is an <strong>Ornstein-Uhlenbeck (OU) process</strong>. Compared to Brownian motion, the OU reference adds a mean-reverting drift <img src="https://latex.codecogs.com/png.latex?-A%5Cmathbf%7Bx%7D">. Two reasons to prefer it: (a) the eigenbasis parameterization with Dirichlet eigenfunctions enforces boundary conditions exactly, and (b) the OU invariant measure concentrates on smooth paths, providing a better prior for path sampling than Brownian motion (which generates rough paths). The reference SDE on <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5E%7BdK%7D"> is <span id="eq-ou-ref"><img src="https://latex.codecogs.com/png.latex?%0Ad%5Cmathbf%7BX%7D_t%20=%20-A%20%5C,%20%5Cmathbf%7BX%7D_t%20%5C,%20dt%20+%20%5Csigma_t%20%5C,%20dW_t%5EQ,%0A%5Ctag%7B1%7D"></span> where <img src="https://latex.codecogs.com/png.latex?A%20=%20-%5CDelta_h"> is the negative discrete Laplacian (positive-definite, eigenvalues <img src="https://latex.codecogs.com/png.latex?%5Clambda_k%20%3E%200">): the <img src="https://latex.codecogs.com/png.latex?K%20%5Ctimes%20K"> tridiagonal matrix with <img src="https://latex.codecogs.com/png.latex?2"> on the diagonal and <img src="https://latex.codecogs.com/png.latex?-1"> on the off-diagonals, incorporating Dirichlet boundary conditions. Here <img src="https://latex.codecogs.com/png.latex?W_t%5EQ"> is a <img src="https://latex.codecogs.com/png.latex?Q">-Wiener process with <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BCov%7D(dW%5EQ)%20=%20Q%5C,dt"> and <img src="https://latex.codecogs.com/png.latex?Q%20=%20A%5E%7B-s%7D"> for some <img src="https://latex.codecogs.com/png.latex?s%20%3E%20d/2">.</p>
<p>The Laplacian <img src="https://latex.codecogs.com/png.latex?A"> has eigenvectors <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_k"> (discrete sine functions) with eigenvalues <img src="https://latex.codecogs.com/png.latex?%5Clambda_k%20%3E%200">. Expanding <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D_t%20=%20%5Csum_k%20c_k(t)%20%5C,%20%5Cvarphi_k">, each mode evolves independently: <span id="eq-mode-sde"><img src="https://latex.codecogs.com/png.latex?%0Adc_k(t)%20=%20-%5Clambda_k%20%5C,%20c_k(t)%20%5C,%20dt%20+%20%5Csigma_t%20%5C,%20%5Clambda_k%5E%7B-s/2%7D%20%5C,%20dB_k(t),%0A%5Ctag%7B2%7D"></span> where <img src="https://latex.codecogs.com/png.latex?B_k"> are independent scalar Brownian motions and <img src="https://latex.codecogs.com/png.latex?%5Clambda_k%5E%7B-s/2%7D"> is the noise amplitude from the covariance operator <img src="https://latex.codecogs.com/png.latex?Q%20=%20A%5E%7B-s%7D">. Each coefficient follows a scalar OU process. In the eigenbasis, the problem decomposes into <img src="https://latex.codecogs.com/png.latex?K"> independent 1D SDEs, each a standard scalar SOC problem.</p>
<p>The controlled SDE adds a drift: <span id="eq-controlled-ou"><img src="https://latex.codecogs.com/png.latex?%0Ad%5Cmathbf%7BX%7D_t%20=%20%20%7B%5Cleft%5B%20-A%20%5C,%20%5Cmathbf%7BX%7D_t%20+%20%5Csigma_t%20%5C,%20Q%5E%7B1/2%7D%20%5C,%20u(t,%20%5Cmathbf%7BX%7D_t)%20%5Cright%5D%7D%20%20%5C,%20dt%20+%20%5Csigma_t%20%5C,%20dW_t%5EQ.%0A%5Ctag%7B3%7D"></span> Same structure as <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a>, with base drift <img src="https://latex.codecogs.com/png.latex?b(%5Cmathbf%7Bx%7D)%20=%20-A%5Cmathbf%7Bx%7D"> instead of <img src="https://latex.codecogs.com/png.latex?b%20=%200">. The optimal control <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%20%5Cnabla%20V"> is a <a href="../../notes/doob_transforms/doob.html">Doob h-transform</a> of the OU process, conditioning it to produce paths with low action.</p>
</section>
<section id="the-adjoint-on-path-space" class="level2">
<h2 class="anchored" data-anchor-id="the-adjoint-on-path-space">The adjoint on path space</h2>
<p>The lean adjoint from the <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> notes satisfies <img src="https://latex.codecogs.com/png.latex?%5Cdot%7B%5Ctilde%7Ba%7D%7D(t)%20=%20-(%5Cnabla_%7B%5Cmathbf%7Bx%7D%7D%20b)%5E%5Ctop%20%5Ctilde%7Ba%7D(t)"> with <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D(T)%20=%20%5Cnabla%20g(%5Cmathbf%7BX%7D_T)">.</p>
<p>Here <img src="https://latex.codecogs.com/png.latex?b(%5Cmathbf%7Bx%7D)%20=%20-A%5Cmathbf%7Bx%7D">, so <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%7B%5Cmathbf%7Bx%7D%7D%20b%20=%20-A"> and the lean adjoint ODE becomes: <span id="eq-lean-adjoint-ou"><img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7B%5Ctilde%7Ba%7D%7D(t)%20=%20A%5E%5Ctop%20%5Ctilde%7Ba%7D(t),%20%5Cqquad%20%5Ctilde%7Ba%7D(T)%20=%20%5Cnabla%20g(%5Cmathbf%7BX%7D_T).%0A%5Ctag%7B4%7D"></span> This is a linear ODE with solution <span id="eq-adjoint-solution"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctilde%7Ba%7D(t)%20=%20e%5E%7B%20%5Ctextcolor%7Bred%7D%7B-(T-t)%7DA%5E%5Ctop%7D%20%5Cnabla%20g(%5Cmathbf%7BX%7D_T).%0A%5Ctag%7B5%7D"></span></p>
<p>Since <img src="https://latex.codecogs.com/png.latex?A"> is symmetric positive-definite with eigenvalues <img src="https://latex.codecogs.com/png.latex?%5Clambda_k">, the matrix exponential <img src="https://latex.codecogs.com/png.latex?e%5E%7B-(T-t)A%5E%5Ctop%7D"> has eigenvalues <img src="https://latex.codecogs.com/png.latex?e%5E%7B-(T-t)%5Clambda_k%7D">. It is diagonal in the eigenbasis: just multiply each mode by the scalar <img src="https://latex.codecogs.com/png.latex?e%5E%7B-(T-t)%5Clambda_k%7D">, no matrix operations needed. In the eigenbasis: <img src="https://latex.codecogs.com/png.latex?%0A%5Ctilde%7Ba%7D_k(t)%20=%20e%5E%7B-(T-t)%5Clambda_k%7D%20%5Ccdot%20%5B%5Cnabla%20g(%5Cmathbf%7BX%7D_T)%5D_k.%0A"> Low-frequency modes (small <img src="https://latex.codecogs.com/png.latex?%5Clambda_k">) get weight close to 1, nearly identical to the Brownian case. High-frequency modes (large <img src="https://latex.codecogs.com/png.latex?%5Clambda_k">) are exponentially : their adjoint contribution at early times is negligible.</p>
<p>Why is the adjoint no longer constant? For Brownian motion (<img src="https://latex.codecogs.com/png.latex?b%20=%200">), perturbing <img src="https://latex.codecogs.com/png.latex?X_t"> by <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20X_t"> shifts <img src="https://latex.codecogs.com/png.latex?X_T"> by the same amount (independent increments), so <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D(t)%20=%20%5Cnabla%20g(X_T)"> for all <img src="https://latex.codecogs.com/png.latex?t">. For OU, the drift <img src="https://latex.codecogs.com/png.latex?-A%5Cmathbf%7Bx%7D"> pulls perturbations back toward zero. A perturbation <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20X_t"> at time <img src="https://latex.codecogs.com/png.latex?t"> decays by <img src="https://latex.codecogs.com/png.latex?e%5E%7B-(T-t)A%7D"> before reaching <img src="https://latex.codecogs.com/png.latex?T">. The terminal cost’s sensitivity to that perturbation is therefore <img src="https://latex.codecogs.com/png.latex?e%5E%7B-(T-t)A%5E%5Ctop%7D%20%5Cnabla%20g(X_T)">, not <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g(X_T)">. High-frequency modes are strongly damped by the OU reference, so the control has less leverage over them at early times: perturbing them costs energy but has minimal terminal effect.</p>
<p>The FAS loss is the <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> loss with this non-constant adjoint: <span id="eq-fas-loss"><img src="https://latex.codecogs.com/png.latex?%0AL_%5Ctext%7BFAS%7D(u)%20=%20%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20%5Cint_0%5ET%20%5Cbig%5C%7Cu(t,%20%5Cmathbf%7BX%7D_t)%20+%20%5Csigma_t%20%5C,%20Q%5E%7B1/2%7D%20%5C,%20%20%5Ctextcolor%7Bblue%7D%7Be%5E%7B-(T-t)A%5E%5Ctop%7D%7D%20%5C,%20%5Cnabla%20g(%5Cmathbf%7BX%7D_T)%5Cbig%5C%7C%5E2%20%5C,%20dt%20%5Cright%5D%7D%20,%0A%5Ctag%7B6%7D"></span> where the expectation is over trajectories of the controlled SDE Equation&nbsp;3 (with stop-gradient). The <img src="https://latex.codecogs.com/png.latex?Q%5E%7B1/2%7D"> factor appears because the control enters the SDE as <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20Q%5E%7B1/2%7D%20u">; the Girsanov change of measure produces <img src="https://latex.codecogs.com/png.latex?%5C%7CQ%5E%7B1/2%7D%20u%5C%7C%5E2">, not <img src="https://latex.codecogs.com/png.latex?%5C%7Cu%5C%7C%5E2">, so the adjoint target picks up <img src="https://latex.codecogs.com/png.latex?Q%5E%7B1/2%7D">. The <img src="https://latex.codecogs.com/png.latex?%20%5Ctextcolor%7Bblue%7D%7Be%5E%7B-(T-t)A%5E%5Ctop%7D%7D"> factor is the OU semigroup, which damps the terminal gradient according to how much the base dynamics attenuate perturbations.</p>
</section>
<section id="boundary-conditions-for-free" class="level2">
<h2 class="anchored" data-anchor-id="boundary-conditions-for-free">Boundary conditions for free</h2>
<p>The Dirichlet eigenfunctions of <img src="https://latex.codecogs.com/png.latex?A"> satisfy <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_k(0)%20=%20%5Cvarphi_k(L)%20=%200">. Any linear combination <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D%20=%20%5Csum_k%20c_k%20%5C,%20%5Cvarphi_k"> automatically satisfies <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D(0)%20=%200"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D(L)%20=%200">.</p>
<p>To enforce <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D(0)%20=%20a"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D(L)%20=%20b">, write <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bx%7D(s)%20=%20%5Cbar%7B%5Cmathbf%7Bx%7D%7D(s)%20+%20%5Csum_k%20c_k%20%5C,%20%5Cvarphi_k(s)"> where <img src="https://latex.codecogs.com/png.latex?%5Cbar%7B%5Cmathbf%7Bx%7D%7D"> is any fixed path connecting <img src="https://latex.codecogs.com/png.latex?a"> to <img src="https://latex.codecogs.com/png.latex?b"> (e.g., linear interpolation). The OU process evolves the <img src="https://latex.codecogs.com/png.latex?c_k"> coefficients; the boundary values are fixed by <img src="https://latex.codecogs.com/png.latex?%5Cbar%7B%5Cmathbf%7Bx%7D%7D">. No penalty terms, no projections. The controlled process respects boundary conditions by construction.</p>
<p><strong>Discretization-invariant sampling.</strong> Train the control <img src="https://latex.codecogs.com/png.latex?u"> on a coarse grid (small <img src="https://latex.codecogs.com/png.latex?K">). At inference, sample at arbitrary resolution by adding more eigenmodes. The high-frequency modes (<img src="https://latex.codecogs.com/png.latex?k%20%3E%20K">) receive zero control and simply follow the OU reference, which already assigns them low variance (<img src="https://latex.codecogs.com/png.latex?%5Clambda_k%5E%7B-s%7D"> decays with <img src="https://latex.codecogs.com/png.latex?k">). This is a standard property of Galerkin truncation for linear reference processes; FAS inherits it rather than inventing it.</p>
</section>
<section id="connection-to-existing-framework" class="level2">
<h2 class="anchored" data-anchor-id="connection-to-existing-framework">Connection to existing framework</h2>
<p>Set <img src="https://latex.codecogs.com/png.latex?A%20=%200">: the OU reference becomes Brownian motion, <img src="https://latex.codecogs.com/png.latex?Q%5E%7B1/2%7D%20=%20I">, <img src="https://latex.codecogs.com/png.latex?e%5E%7B0%7D%20=%20I">, and the FAS loss Equation&nbsp;6 reduces to the <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a> loss <img src="https://latex.codecogs.com/png.latex?%5C%7Cu%20+%20%5Csigma_t%20%5Cnabla%20g(X_1)%5C%7C%5E2">. Standard adjoint sampling is the special case with no spatial structure in the base dynamics.</p>
<p>The reciprocal projection from <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a> carries over directly. Replace the Brownian bridge with an OU bridge: given terminal state <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D_T">, sample <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D_t%20%5Cmid%20%5Cmathbf%7BX%7D_T"> from the OU bridge. Since each mode <img src="https://latex.codecogs.com/png.latex?c_k"> is an independent scalar OU process, the bridge decomposes into <img src="https://latex.codecogs.com/png.latex?K"> independent 1D Gaussian conditionals:</p>
<details>
<summary>
<p style="color: blue;">
OU bridge formula in the eigenbasis
</p>
</summary>
<p style="color: blue;">
For a scalar OU process <img src="https://latex.codecogs.com/png.latex?dc_k%20=%20-%5Clambda_k%20c_k%20%5C,%20dt%20+%20%5Csigma_t%20%5Clambda_k%5E%7B-s/2%7D%20%5C,%20dB_k"> started at <img src="https://latex.codecogs.com/png.latex?c_k(0)%20=%200">, the bridge is standard Gaussian conditioning (cf. <strong>?@eq-bridge</strong> of <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a>): <img src="https://latex.codecogs.com/png.latex?%0Ac_k(t)%20%5Cmid%20c_k(T)%20%5C;%5Csim%5C;%20%5Cmathcal%7BN%7D%20%7B%5Cleft(%20%5Cfrac%7B%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(c_k(t),%20c_k(T))%7D%7Bv_k(T)%7D%20%5C,%20c_k(T),%20%5C;%5C;%20v_k(t)%20-%20%5Cfrac%7B%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(c_k(t),%20c_k(T))%5E2%7D%7Bv_k(T)%7D%20%5Cright)%7D%20,%0A"> with <img src="https://latex.codecogs.com/png.latex?v_k(t)%20=%20%5Clambda_k%5E%7B-s%7D%20%5Cint_0%5Et%20%5Csigma_r%5E2%20%5C,%20e%5E%7B-2%5Clambda_k(t-r)%7D%20%5C,%20dr"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(c_k(t),%20c_k(T))%20=%20e%5E%7B-%5Clambda_k(T-t)%7D%20v_k(t)">.
</p>
</details>
<p>The buffer-based training from <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a> transfers directly: simulate forward to fill a replay buffer, then sample from the OU bridge for cheap inner-loop gradient steps.</p>
<!-- BibTeX entry for ref.bib:
@article{bae2025functional,
  title={Functional Adjoint Sampler},
  author={Bae, Geonho and Lee, Juho},
  journal={arXiv preprint arXiv:2506.04429},
  year={2025},
  url={https://arxiv.org/abs/2506.04429}
}
-->


</section>

 ]]></description>
  <category>SDE</category>
  <category>sampling</category>
  <category>optimal control</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/functional_adjoint.html</guid>
  <pubDate>Sun, 22 Mar 2026 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Discrete Adjoint Matching</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/discrete_adjoint.html</link>
  <description><![CDATA[ 





<!-- TODO: Add historical figure portrait here.
::: {style="text-align:center;"}
![[Name](wiki_link) (dates)](./image.jpg){fig-align="center" width=35%}
:::
-->
<section id="setup" class="level2">
<h2 class="anchored" data-anchor-id="setup">Setup</h2>
<p>We work with a continuous-time Markov chain (CTMC) on a finite state space <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D">. Background on CTMCs, rate matrices, and time-reversal is in the <a href="../../notes/adjoint_samplers_draft/DiscreteDiff.html">discrete diffusion notes</a>. The CTMC is characterized by its transition rate <img src="https://latex.codecogs.com/png.latex?u_t(y,x)">: the infinitesimal probability per unit time of jumping from state <img src="https://latex.codecogs.com/png.latex?x"> to state <img src="https://latex.codecogs.com/png.latex?y%20%5Cneq%20x">. A reference process with rate <img src="https://latex.codecogs.com/png.latex?r_t(y,x)"> defines the base path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D">. Adding a control means replacing <img src="https://latex.codecogs.com/png.latex?r_t"> by <img src="https://latex.codecogs.com/png.latex?u_t">, producing a controlled path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5Eu">.</p>
<p>The path-space KL between <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5Eu"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D"> is (see the <a href="../../notes/girsanov/girsanov.html">Girsanov notes</a> for the continuous analogue):</p>
<p><span id="eq-path-kl"><img src="https://latex.codecogs.com/png.latex?%0AD_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5Eu%20%5C%7C%20%5Cmathbb%7BP%7D)%20=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%5Cint_0%5E1%20%5Csum_%7By%20%5Cneq%20X_t%7D%20%20%7B%5Cleft%5B%20u_t(y,%20X_t)%20%5Clog%20%5Cfrac%7Bu_t(y,%20X_t)%7D%7Br_t(y,%20X_t)%7D%20-%20u_t(y,%20X_t)%20+%20r_t(y,%20X_t)%20%5Cright%5D%7D%20%20dt.%0A%5Ctag%7B1%7D"></span></p>
<p>Each summand <img src="https://latex.codecogs.com/png.latex?u%20%5Clog(u/r)%20-%20u%20+%20r"> is the generalized KL divergence between rates at a single pair <img src="https://latex.codecogs.com/png.latex?(y,%20x)">. It is non-negative, equals zero when <img src="https://latex.codecogs.com/png.latex?u%20=%20r">, and plays the role of <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2"> from the continuous <a href="../../notes/girsanov/girsanov.html">Girsanov</a> penalty.</p>
<p>The discrete stochastic optimal control (SOC) problem (cf.&nbsp;the <a href="../../notes/HJB/HJB.html">HJB notes</a>) is:</p>
<p><span id="eq-soc"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmin_u%20%5C;%20J(u)%20=%20D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5Eu%20%5C%7C%20%5Cmathbb%7BP%7D)%20+%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%7B%5Cleft%5B%20g(X_1)%20%5Cright%5D%7D%20,%0A%5Ctag%7B2%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?g:%20%5Cmathcal%7BX%7D%5Cto%20%5Cmathbb%7BR%7D"> is a terminal cost. For sampling from <img src="https://latex.codecogs.com/png.latex?%5Cpi">, the terminal cost is <img src="https://latex.codecogs.com/png.latex?g(x)%20=%20-%5Clog%20%5Cpi(x)%20+%20%5Ctext%7Bconst%7D"> (when the reference has uniform stationary distribution). By the <a href="../../notes/doob_transforms/doob.html">Doob h-transform</a> (discrete version), the optimal rate is</p>
<p><span id="eq-optimal-rate"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctextcolor%7Bblue%7D%7Bu%5E%5Cstar_t(y,x)%20=%20r_t(y,x)%20%5Ccdot%20%5Cfrac%7B%5Cvarphi_t(y)%7D%7B%5Cvarphi_t(x)%7D%7D,%0A%5Ctag%7B3%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t(x)%20=%20%5Cmathbb%7BE%7D_%5Cmathbb%7BP%7D%20%7B%5Cleft%5B%20e%5E%7B-g(X_1)%7D%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20"> is the discrete Doob <img src="https://latex.codecogs.com/png.latex?h">-function. Writing <img src="https://latex.codecogs.com/png.latex?V_t(x)%20=%20%5Clog%20%5Cvarphi_t(x)"> (consistent with the <a href="../../notes/HJB/HJB.html">HJB notes</a>):</p>
<p><span id="eq-optimal-rate-V"><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar_t(y,x)%20=%20r_t(y,x)%20%5Ccdot%20e%5E%7BV_t(y)%20-%20V_t(x)%7D.%0A%5Ctag%7B4%7D"></span></p>
<p>The structure here is multiplicative: the optimal rate tilts the reference rate by <img src="https://latex.codecogs.com/png.latex?%5Cvarphi(y)/%5Cvarphi(x)">. In the continuous case, <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%20%5Cnabla%20V"> is an additive perturbation of the drift. The DAM paper defines <img src="https://latex.codecogs.com/png.latex?V"> as cost-to-go (<img src="https://latex.codecogs.com/png.latex?V_%7B%5Ctext%7BDAM%7D%7D%20=%20-V_%7B%5Ctext%7Bhere%7D%7D">); the formulas agree since both give <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20r%20%5Ccdot%20%5Cvarphi(y)/%5Cvarphi(x)">.</p>
</section>
<section id="additive-noise-on-cyclic-groups" class="level2">
<h2 class="anchored" data-anchor-id="additive-noise-on-cyclic-groups">Additive noise on cyclic groups</h2>
<p>Continuous <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> relies on translation invariance of Gaussian noise: the reference transition kernel <img src="https://latex.codecogs.com/png.latex?p%5Er_%7B1%7Ct%7D(y%20%5Cmid%20x)%20=%20q_t(y%20-%20x)"> depends only on the displacement <img src="https://latex.codecogs.com/png.latex?y%20-%20x">.</p>
<p>For CTMCs on a finite state space, there is no obvious analogue. The key observation from <span class="citation" data-cites="liu2025dasbs so2026dam">(<strong>liu2025dasbs?</strong>; <strong>so2026dam?</strong>)</span> is to equip the state space with a group structure. Take <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D=%20%5Cmathbb%7BZ%7D_N%5ED">, the cyclic group of integers modulo <img src="https://latex.codecogs.com/png.latex?N"> in <img src="https://latex.codecogs.com/png.latex?D"> dimensions. Each state is <img src="https://latex.codecogs.com/png.latex?x%20=%20(x%5E1,%20%5Cldots,%20x%5ED)"> with <img src="https://latex.codecogs.com/png.latex?x%5Ed%20%5Cin%20%5C%7B0,%201,%20%5Cldots,%20N-1%5C%7D">, and addition is component-wise modulo <img src="https://latex.codecogs.com/png.latex?N">.</p>
<p>Choose a uniform reference rate:</p>
<p><span id="eq-uniform-rate"><img src="https://latex.codecogs.com/png.latex?%0Ar_t(y,%20x)%20=%20%5Cfrac%7B%5Cgamma_t%7D%7BN%7D%20%5Cquad%20%5Ctext%7Bfor%20all%20%7D%20y%20%5Cneq%20x%20%5Ctext%7B%20with%20%7D%20d_H(y,x)%20=%201,%0A%5Ctag%7B5%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?d_H"> is the Hamming distance (differing in exactly one coordinate) and <img src="https://latex.codecogs.com/png.latex?%5Cgamma_t%20%3E%200"> is a noise schedule. Restricting to single-coordinate jumps (<img src="https://latex.codecogs.com/png.latex?d_H(y,x)%20=%201">) keeps the rate matrix sparse and the computation per step <img src="https://latex.codecogs.com/png.latex?O(DN)">. The resulting transition kernel <img src="https://latex.codecogs.com/png.latex?p%5Er_%7B1%7Ct%7D(y%20%5Cmid%20x)"> depends only on <img src="https://latex.codecogs.com/png.latex?y%20-%20x"> (subtraction in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D_N%5ED">):</p>
<p><span id="eq-additive-discrete"><img src="https://latex.codecogs.com/png.latex?%0Ap%5Er_%7B1%7Ct%7D(y%20%5Cmid%20x)%20=%20q_t(y%20-%20x).%0A%5Ctag%7B6%7D"></span></p>
<p>The argument is simple. The uniform rate is invariant under any translation <img src="https://latex.codecogs.com/png.latex?x%20%5Cmapsto%20x%20+%20a"> on <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D_N%5ED">: the jump rate from <img src="https://latex.codecogs.com/png.latex?x%20+%20a"> to <img src="https://latex.codecogs.com/png.latex?y%20+%20a"> equals the rate from <img src="https://latex.codecogs.com/png.latex?x"> to <img src="https://latex.codecogs.com/png.latex?y">. Starting from <img src="https://latex.codecogs.com/png.latex?x"> or <img src="https://latex.codecogs.com/png.latex?x%20+%20a"> and running the same Markov chain, the displacement <img src="https://latex.codecogs.com/png.latex?X_1%20-%20X_0"> has the same distribution. This is the discrete analogue of adding mean-zero Gaussian noise.</p>
</section>
<section id="discrete-adjoint-estimator" class="level2">
<h2 class="anchored" data-anchor-id="discrete-adjoint-estimator">Discrete adjoint estimator</h2>
<section id="from-gradients-to-exponential-differences" class="level3">
<h3 class="anchored" data-anchor-id="from-gradients-to-exponential-differences">From gradients to exponential differences</h3>
<p>The continuous lean adjoint and its simplification for <img src="https://latex.codecogs.com/png.latex?b=0"> are derived in the <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> and <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a> notes. In the discrete case, derivatives do not exist. The optimal control is multiplicative (Equation&nbsp;4), so the relevant quantity is not <img src="https://latex.codecogs.com/png.latex?V(y)%20-%20V(x)"> but <img src="https://latex.codecogs.com/png.latex?e%5E%7BV(y)%20-%20V(x)%7D">. The analogue of <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g"> is the exponential difference <img src="https://latex.codecogs.com/png.latex?e%5E%7Bg(X_1)%20-%20g(y)%7D"> for each possible target state <img src="https://latex.codecogs.com/png.latex?y">. The discrete adjoint terminal condition is:</p>
<p><span id="eq-discrete-adjoint-terminal"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctilde%7Ba%7D_1(y;%20X_1)%20=%20e%5E%7Bg(X_1)%20-%20g(y)%7D.%0A%5Ctag%7B7%7D"></span></p>
</section>
<section id="the-lean-adjoint-ode" class="level3">
<h3 class="anchored" data-anchor-id="the-lean-adjoint-ode">The lean adjoint ODE</h3>
<p>The full discrete adjoint satisfies a backward ODE driven by the rate matrix. At optimality, the <img src="https://latex.codecogs.com/png.latex?u">-dependent terms vanish (the same mechanism as in the continuous case, see <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a>), leaving the lean adjoint. We write <img src="https://latex.codecogs.com/png.latex?r_t(z,%20y)"> for the full generator, including the diagonal <img src="https://latex.codecogs.com/png.latex?r_t(y,y)%20=%20-%5Csum_%7Bz%20%5Cneq%20y%7D%20r_t(z,y)">:</p>
<p><span id="eq-lean-adjoint-ode"><img src="https://latex.codecogs.com/png.latex?%0A-%5Cfrac%7Bd%7D%7Bdt%7D%20%5Ctilde%7Ba%7D_t(y)%20=%20%5Csum_%7Bz%7D%20r_t(z,%20y)%20%5C,%20%5Ctilde%7Ba%7D_t(z),%20%5Cqquad%20%5Ctilde%7Ba%7D_1(y;%20X_1)%20=%20e%5E%7Bg(X_1)%20-%20g(y)%7D.%0A%5Ctag%7B8%7D"></span></p>
<p>Because the reference rates <img src="https://latex.codecogs.com/png.latex?r_t(z,y)"> do not depend on the current state <img src="https://latex.codecogs.com/png.latex?X_t">, this ODE is deterministic and can be solved offline. In the continuous case, <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20b"> depends on <img src="https://latex.codecogs.com/png.latex?X_t">, making the lean adjoint a stochastic ODE that must be integrated along each trajectory.</p>
</section>
<section id="closed-form-solution" class="level3">
<h3 class="anchored" data-anchor-id="closed-form-solution">Closed-form solution</h3>
<p>Because Equation&nbsp;8 is linear with coefficients determined by the reference rate matrix, its solution can be expressed in terms of the reference transition kernel <img src="https://latex.codecogs.com/png.latex?p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)">:</p>
<p><span id="eq-adjoint-closed-form"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctilde%7Ba%7D_t(y;%20X_1)%20=%20%5Csum_%7Bz%20%5Cin%20%5Cmathcal%7BX%7D%7D%20p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20%5C,%20e%5E%7Bg(X_1)%20-%20g(z)%7D.%0A%5Ctag%7B9%7D"></span></p>
<p>This is a weighted average over states <img src="https://latex.codecogs.com/png.latex?z"> that the reference process can reach from <img src="https://latex.codecogs.com/png.latex?y"> by time 1, weighted by <img src="https://latex.codecogs.com/png.latex?e%5E%7Bg(X_1)%20-%20g(z)%7D">.</p>
<details>
<summary>
<p style="color: blue;">
Verifying the closed form.
</p>
</summary>
<p style="color: blue;">
Write <img src="https://latex.codecogs.com/png.latex?P%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)"> for the reference transition probability. The function <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D_t(y)%20=%20%5Csum_z%20P%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20%5C,%20e%5E%7Bg(X_1)%20-%20g(z)%7D"> needs to satisfy Equation&nbsp;8. Differentiating with respect to <img src="https://latex.codecogs.com/png.latex?t">: <img src="https://latex.codecogs.com/png.latex?%0A-%5Cfrac%7Bd%7D%7Bdt%7D%20%5Ctilde%7Ba%7D_t(y)%20=%20-%5Csum_z%20%5Cfrac%7Bd%7D%7Bdt%7D%20P%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20%5C,%20e%5E%7Bg(X_1)%20-%20g(z)%7D.%0A"> The Kolmogorov backward equation gives <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7Bd%7D%7Bdt%7D%20P%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20=%20-%5Csum_%7Bw%7D%20r_t(w,%20y)%20P%5Er_%7B1%7Ct%7D(z%20%5Cmid%20w)"> (the generator acts on the starting state <img src="https://latex.codecogs.com/png.latex?y">). Substituting: <img src="https://latex.codecogs.com/png.latex?%0A-%5Cfrac%7Bd%7D%7Bdt%7D%20%5Ctilde%7Ba%7D_t(y)%20=%20%5Csum_z%20%5Csum_w%20r_t(w,%20y)%20P%5Er_%7B1%7Ct%7D(z%20%5Cmid%20w)%20%5C,%20e%5E%7Bg(X_1)%20-%20g(z)%7D%20=%20%5Csum_w%20r_t(w,%20y)%20%5Ctilde%7Ba%7D_t(w).%0A"> This matches Equation&nbsp;8. At <img src="https://latex.codecogs.com/png.latex?t%20=%201">, <img src="https://latex.codecogs.com/png.latex?P%5Er_%7B1%7C1%7D(z%20%5Cmid%20y)%20=%20%5Cdelta_%7Bz,y%7D">, so <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D_1(y)%20=%20e%5E%7Bg(X_1)%20-%20g(y)%7D">, matching the terminal condition.
</p>
</details>
</section>
<section id="key-identity" class="level3">
<h3 class="anchored" data-anchor-id="key-identity">Key identity</h3>
<p>The discrete adjoint recovers the value function ratio in conditional expectation. Under the optimal path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D">:</p>
<p><span id="eq-discrete-adjoint-expectation"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D%7D%20%7B%5Cleft%5B%20%5Ctilde%7Ba%7D_t(y;%20X_1)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20%20=%20e%5E%7BV_t(y)%20-%20V_t(x)%7D.%0A%5Ctag%7B10%7D"></span></p>
<p>At optimality, the conditional expectation of the discrete adjoint recovers the exponential value difference, exactly the multiplicative factor in Equation&nbsp;4.</p>
<details>
<summary>
<p style="color: blue;">
Deriving Equation&nbsp;10.
</p>
</summary>
<p style="color: blue;">
Under <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D">, the Doob h-transform tilts the transition kernel: <img src="https://latex.codecogs.com/png.latex?p%5E%7Bu%5E%5Cstar%7D_%7B1%7Ct%7D(z%20%5Cmid%20x)%20=%20p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20x)%20%5Ccdot%20e%5E%7B-g(z)%7D/%5Cvarphi_t(x)">, where <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t(x)%20=%20%5Csum_z%20p%5Er_%7B1%7Ct%7D(z%7Cx)%20e%5E%7B-g(z)%7D"> is the Doob <img src="https://latex.codecogs.com/png.latex?h">-function from Equation&nbsp;3. Then: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D%7D%20%7B%5Cleft%5B%20%5Ctilde%7Ba%7D_t(y;%20X_1)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20%20=%20%5Csum_%7Bx_1%7D%20p%5E%7Bu%5E%5Cstar%7D_%7B1%7Ct%7D(x_1%20%5Cmid%20x)%20%5Csum_z%20p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20%5C,%20e%5E%7Bg(x_1)%20-%20g(z)%7D.%0A"> Substitute <img src="https://latex.codecogs.com/png.latex?p%5E%7Bu%5E%5Cstar%7D_%7B1%7Ct%7D(x_1%20%5Cmid%20x)%20=%20p%5Er_%7B1%7Ct%7D(x_1%20%5Cmid%20x)%20e%5E%7B-g(x_1)%7D%20/%20%5Cvarphi_t(x)">: <img src="https://latex.codecogs.com/png.latex?%0A=%20%5Cfrac%7B1%7D%7B%5Cvarphi_t(x)%7D%20%5Csum_%7Bx_1%7D%20p%5Er_%7B1%7Ct%7D(x_1%20%5Cmid%20x)%20%5Csum_z%20p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20e%5E%7B-g(z)%7D%20=%20%5Cfrac%7B%5Cvarphi_t(y)%7D%7B%5Cvarphi_t(x)%7D%20=%20e%5E%7BV_t(y)%20-%20V_t(x)%7D.%0A"> The <img src="https://latex.codecogs.com/png.latex?x_1"> sum gives <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bx_1%7D%20p%5Er_%7B1%7Ct%7D(x_1%20%5Cmid%20x)%20=%201">, and the <img src="https://latex.codecogs.com/png.latex?z"> sum gives <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t(y)%20=%20%5Csum_z%20p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20e%5E%7B-g(z)%7D">.
</p>
</details>
</section>
</section>
<section id="matching-loss" class="level2">
<h2 class="anchored" data-anchor-id="matching-loss">Matching loss</h2>
<section id="why-generalized-kl-not-l2" class="level3">
<h3 class="anchored" data-anchor-id="why-generalized-kl-not-l2">Why generalized KL, not <img src="https://latex.codecogs.com/png.latex?L%5E2"></h3>
<p>The continuous AM loss uses <img src="https://latex.codecogs.com/png.latex?L%5E2"> regression: <img src="https://latex.codecogs.com/png.latex?%5C%7Cu_%5Ctheta%20-%20%5Ctext%7Btarget%7D%5C%7C%5E2">. Rates must be positive, so <img src="https://latex.codecogs.com/png.latex?L%5E2"> regression can produce negative values. The natural divergence for positive quantities is the generalized KL:</p>
<p><span id="eq-gkl"><img src="https://latex.codecogs.com/png.latex?%0AD_%7B%5Ctext%7BgKL%7D%7D(a,%20b)%20=%20%5Csum_%7By%20%5Cneq%20x%7D%20%20%7B%5Cleft%5B%20a(y,x)%20%5Clog%20%5Cfrac%7Ba(y,x)%7D%7Bb(y,x)%7D%20-%20a(y,x)%20+%20b(y,x)%20%5Cright%5D%7D%20.%0A%5Ctag%7B11%7D"></span></p>
<p>This is the Bregman divergence generated by <img src="https://latex.codecogs.com/png.latex?%5Cvarphi(a)%20=%20a%5Clog%20a%20-%20a">, with <img src="https://latex.codecogs.com/png.latex?%5Cvarphi'(a)%20=%20%5Clog%20a">. It is non-negative, equals zero when <img src="https://latex.codecogs.com/png.latex?a%20=%20b">, and the minimizer of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20D_%7B%5Ctext%7BgKL%7D%7D(W,%20c)%20%5Cright%5D%7D%20"> over <img src="https://latex.codecogs.com/png.latex?c"> is <img src="https://latex.codecogs.com/png.latex?c%20=%20%5Cmathbb%7BE%7D%5BW%5D"> (the arithmetic mean, the standard Bregman mean property).</p>
</section>
<section id="the-dam-loss" class="level3">
<h3 class="anchored" data-anchor-id="the-dam-loss">The DAM loss</h3>
<p>Combining Equation&nbsp;3 with Equation&nbsp;10, the regression target for the rate <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta(y,%20x,%20t)"> is <img src="https://latex.codecogs.com/png.latex?r_t(y,%20x)%20%5Ccdot%20%5Ctilde%7Ba%7D_t(y;%20X_1)">. The Discrete Adjoint Matching loss:</p>
<p><span id="eq-dam-loss"><img src="https://latex.codecogs.com/png.latex?%0AL_%7B%5Ctext%7BDAM%7D%7D(%5Ctheta)%20=%20%5Cmathbb%7BE%7D_%7Bt,%20%5C,%20X_t%20%5Csim%20%5Cmathbb%7BP%7D%5E%7B%5Cbar%7Bu%7D%7D%7D%20%20%7B%5Cleft%5B%20D_%7B%5Ctext%7BgKL%7D%7D%20%7B%5Cleft(%20r_t(%5Ccdot,%20X_t)%20%5Ccdot%20%5Ctilde%7Ba%7D_t(%5Ccdot;%20X_1),%20%5C;%5C;%20u_%5Ctheta(%5Ccdot,%20X_t,%20t)%20%5Cright)%7D%20%20%5Cright%5D%7D%20,%0A%5Ctag%7B12%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bu%7D%20=%20%5Ctexttt%7Bsg%7D(u_%5Ctheta)"> (stop-gradient: trajectories are simulated with frozen parameters, gradients only flow through the <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta"> term). The Bregman mean property gives the unique fixed point: the minimizer over <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta"> of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BD_%7B%5Ctext%7BgKL%7D%7D(r%20%5Ccdot%20%5Ctilde%7Ba%7D,%20u_%5Ctheta)%5D"> is <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta%20=%20%5Cmathbb%7BE%7D%5Br%20%5Ccdot%20%5Ctilde%7Ba%7D%5D%20=%20r%20%5Ccdot%20%5Cmathbb%7BE%7D%5B%5Ctilde%7Ba%7D%5D">. By Equation&nbsp;10, <img src="https://latex.codecogs.com/png.latex?r_t%20%5Ccdot%20%5Cmathbb%7BE%7D%5B%5Ctilde%7Ba%7D_t%20%5Cmid%20X_t%5D%20=%20u%5E%5Cstar_t">, so the unique fixed point is <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar">.</p>
<p>When the reference has the additive property (Equation&nbsp;6, uniform rate on <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D_N%5ED">), the target simplifies. Since <img src="https://latex.codecogs.com/png.latex?r_t(y,%20x)%20=%20%5Cgamma_t%20/%20N"> is constant in <img src="https://latex.codecogs.com/png.latex?y">, the regression target at each <img src="https://latex.codecogs.com/png.latex?(y,%20x)"> pair only depends on <img src="https://latex.codecogs.com/png.latex?y"> through <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D_t(y;%20X_1)">, which uses the additive transition kernel <img src="https://latex.codecogs.com/png.latex?p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20=%20q_t(z%20-%20y)">.</p>
<p>The additive structure enters the closed-form Equation&nbsp;9 as follows. Substituting <img src="https://latex.codecogs.com/png.latex?p%5Er_%7B1%7Ct%7D(z%20%5Cmid%20y)%20=%20q_t(z%20-%20y)">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Ctilde%7Ba%7D_t(y;%20X_1)%20=%20%5Csum_z%20q_t(z%20-%20y)%20%5C,%20e%5E%7Bg(X_1)%20-%20g(z)%7D%20=%20%5Cmathbb%7BE%7D_%7BZ%20%5Csim%20q_t(%5Ccdot)%7D%20%7B%5Cleft%5B%20e%5E%7Bg(X_1)%20-%20g(y%20+%20Z)%7D%20%5Cright%5D%7D%20.%0A"></p>
<p>The regression target depends on <img src="https://latex.codecogs.com/png.latex?y"> only through <img src="https://latex.codecogs.com/png.latex?g(y%20+%20Z)">, where <img src="https://latex.codecogs.com/png.latex?Z"> is a random displacement drawn from the reference noise distribution. When <img src="https://latex.codecogs.com/png.latex?y"> differs from <img src="https://latex.codecogs.com/png.latex?x"> in a single coordinate <img src="https://latex.codecogs.com/png.latex?d"> (Hamming distance 1), <img src="https://latex.codecogs.com/png.latex?y%20+%20Z"> and <img src="https://latex.codecogs.com/png.latex?x%20+%20Z"> differ in the same coordinate. This coordinate-wise factorization makes the computation scale as <img src="https://latex.codecogs.com/png.latex?O(DN)"> per state, not <img src="https://latex.codecogs.com/png.latex?O(N%5ED)">.</p>
<p>When the base model uses a masking structure (as in <a href="../../notes/adjoint_samplers_draft/DiscreteDiff.html">discrete diffusion</a>), the optimal rate inherits this structure: if <img src="https://latex.codecogs.com/png.latex?r_t"> only allows single-coordinate jumps, then <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar_t"> also only allows single-coordinate jumps. This reduces the modeling complexity from <img src="https://latex.codecogs.com/png.latex?O(N%5ED)"> to <img src="https://latex.codecogs.com/png.latex?O(DN)">.</p>
</section>
</section>
<section id="dropping-the-memoryless-condition-dasbs" class="level2">
<h2 class="anchored" data-anchor-id="dropping-the-memoryless-condition-dasbs">Dropping the memoryless condition: DASBS</h2>
<p>The value function bias from <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> and the SB decomposition from <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a> apply here verbatim: without the memoryless condition, the SOC terminal marginal is not <img src="https://latex.codecogs.com/png.latex?%5Cpi">. The fix is the same: decompose the <a href="../../notes/shrodinger_bridge/shrodinger.html">Schrodinger bridge</a> into a controller (Doob h-transform via <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t">) plus a corrector (backward potential <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t">), giving</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar_t(y,%20x)%20=%20r_t(y,%20x)%20%5Ccdot%20%5Cfrac%7B%5Cvarphi_t(y)%7D%7B%5Cvarphi_t(x)%7D,%0A"></p>
<p>with modified terminal cost <img src="https://latex.codecogs.com/png.latex?g(x)%20=%20%5Clog(%5Cwidehat%7B%5Cvarphi%7D_1(x)/%5Cpi(x))"> that absorbs the prior coupling.</p>
<section id="alternating-scheme" class="level3">
<h3 class="anchored" data-anchor-id="alternating-scheme">Alternating scheme</h3>
<ul>
<li><p><strong>Controller step</strong>: fix the corrector <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1">, solve the modified SOC with terminal cost <img src="https://latex.codecogs.com/png.latex?g(x)%20=%20%5Clog(%5Cwidehat%7B%5Cvarphi%7D_1(x)/%5Cpi(x))">. This is discrete AM (Equation&nbsp;12) with the modified terminal cost. The controller learns the ratio <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t(y)/%5Cvarphi_t(x)">.</p></li>
<li><p><strong>Corrector step</strong>: fix the controller, learn <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1"> by matching the backward transition rates. Two options:</p>
<ul>
<li><strong>Adjoint matching</strong> for the corrector: uses the additive property to express <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1(z)/%5Cwidehat%7B%5Cvarphi%7D_1(y)"> as a conditional expectation under the current path measure, with target <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_0(x%20-%20y%20+%20z)/%5Cwidehat%7B%5Cvarphi%7D_0(x)"> and the boundary condition <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_0%20=%20%5Cmu%20/%20%5Cvarphi_0">.</li>
<li><strong>Denoising matching</strong> for the corrector: regresses onto <img src="https://latex.codecogs.com/png.latex?p%5Er_%7B1%7Ct%7D(x_1%5E%7Bd%20%5Cgets%20n%7D%20%5Cmid%20x)%20/%20p%5Er_%7B1%7Ct%7D(x_1%20%5Cmid%20x)">, the ratio of reference transition probabilities. This does not require the additive property and works for general reference kernels.</li>
</ul></li>
</ul>
<p>This alternation is <a href="../../notes/shrodinger_bridge/shrodinger.html">IPFP/Sinkhorn</a> in disguise: each half-step solves a half-bridge problem. Convergence follows from the contraction argument in the <a href="../../notes/shrodinger_bridge/shrodinger.html">SB notes</a>; see <span class="citation" data-cites="liu2025dasbs">(<strong>liu2025dasbs?</strong>)</span> for the discrete convergence proof.</p>
<p>Empirical finding from <span class="citation" data-cites="liu2025dasbs">(<strong>liu2025dasbs?</strong>)</span>: non-memoryless reference schedules outperform memoryless ones in discrete settings. The memoryless condition forces aggressive mixing that wastes computation; relaxing it allows more efficient transport.</p>
</section>
</section>
<section id="summary-continuous-vs-discrete" class="level2">
<h2 class="anchored" data-anchor-id="summary-continuous-vs-discrete">Summary: continuous vs discrete</h2>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>Continuous</th>
<th>Discrete</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>State space</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5ED"></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D_N%5ED"></td>
</tr>
<tr class="even">
<td>Base dynamics</td>
<td>SDE, Brownian motion</td>
<td>CTMC, uniform rate</td>
</tr>
<tr class="odd">
<td>Additive noise</td>
<td>Gaussian: <img src="https://latex.codecogs.com/png.latex?p_%7B1%7Ct%7D(y%5Cmid%20x)%20=%20q_t(y-x)"></td>
<td>Cyclic group: <img src="https://latex.codecogs.com/png.latex?p_%7B1%7Ct%7D(y%5Cmid%20x)%20=%20q_t(y%20-%20x)"></td>
</tr>
<tr class="even">
<td>Optimal control</td>
<td><img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%20%5Cnabla%20V"> (additive)</td>
<td><img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20r_t%20%5Ccdot%20e%5E%7BV(y)-V(x)%7D"> (multiplicative)</td>
</tr>
<tr class="odd">
<td>Adjoint terminal</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g(X_1)"> (gradient)</td>
<td><img src="https://latex.codecogs.com/png.latex?e%5E%7Bg(X_1)%20-%20g(y)%7D"> (exponential difference)</td>
</tr>
<tr class="even">
<td>Adjoint ODE</td>
<td>Stochastic (<img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20b"> depends on <img src="https://latex.codecogs.com/png.latex?X_t">)</td>
<td>Deterministic (admits closed form)</td>
</tr>
<tr class="odd">
<td>Matching loss</td>
<td><img src="https://latex.codecogs.com/png.latex?L%5E2"> regression</td>
<td>Generalized KL divergence</td>
</tr>
<tr class="even">
<td>Corrector</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1"> (score)</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1(y)/%5Cwidehat%7B%5Cvarphi%7D_1(x)"> (ratio)</td>
</tr>
</tbody>
</table>
<p>The discrete analogue of Nelson’s relation from the <a href="../../notes/adjoint_samplers_draft/BMS.html">BMS notes</a> is detailed balance: <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar_t(y,x)/u%5E%7B%5Cstar,%5Ctext%7Brev%7D%7D_t(x,y)%20=%20p%5E%5Cstar_t(y)/p%5E%5Cstar_t(x)">.</p>
<!-- BibTeX entries to add to ref.bib:
@article{liu2025dasbs,
  title={Discrete Adjoint Schr{\"o}dinger Bridge Sampler},
  author={Liu, Bingchang and Shi, Yubin and Chen, Ricky T. Q. and Grathwohl, Will and De Bortoli, Valentin},
  journal={arXiv preprint arXiv:2506.xxxxx},
  year={2025}
}
@article{so2026dam,
  title={Discrete Adjoint Matching},
  author={So, Junhyun and Chen, Sung Ju and Lee, Jeongyol and Lee, Dongha},
  journal={arXiv preprint arXiv:2506.xxxxx},
  year={2026}
}
-->


</section>

 ]]></description>
  <category>CTMC</category>
  <category>markov</category>
  <category>sampling</category>
  <category>optimal control</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/discrete_adjoint.html</guid>
  <pubDate>Sun, 22 Mar 2026 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Adjoint Sampling</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/adjoint_sampling.html</link>
  <description><![CDATA[ 





<!-- TODO: Add historical figure portrait here.
::: {style="text-align:center;"}
![[Name](wiki_link) (dates)](./image.jpg){fig-align="center" width=35%}
:::
-->
<p>The <a href="../../notes/HJB/HJB.html">HJB notes</a> left us with a clean picture and a frustrating bottleneck. To sample from a target <img src="https://latex.codecogs.com/png.latex?%5Cpi(x)%20%5Cpropto%20%5Cexp(-E(x))">, start a Brownian motion at <img src="https://latex.codecogs.com/png.latex?X_0%20=%200">, add a control drift <img src="https://latex.codecogs.com/png.latex?u(t,x)">, and choose <img src="https://latex.codecogs.com/png.latex?u"> to minimize the stochastic optimal control cost <span id="eq-soc"><img src="https://latex.codecogs.com/png.latex?%0AJ(u)%20=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%7B%5Cleft%5B%20%5Cint_0%5E1%20%5Ctfrac%7B1%7D%7B2%7D%5C%7Cu(t,X_t)%5C%7C%5E2%20%5C,%20dt%20+%20g(X_1)%20%5Cright%5D%7D%20,%0A%5Ctag%7B1%7D"></span> where <img src="https://latex.codecogs.com/png.latex?g(x)%20=%20%5Clog%20p%5E%5Ctext%7Bbase%7D_1(x)%20-%20%5Clog%20%5Cpi(x)"> is the terminal cost. (Sign convention: the <a href="../../notes/HJB/HJB.html">HJB notes</a> use a maximization convention with reward <img src="https://latex.codecogs.com/png.latex?g_%5Ctext%7BHJB%7D">; here we use minimization with cost <img src="https://latex.codecogs.com/png.latex?g%20=%20-g_%5Ctext%7BHJB%7D">, so <img src="https://latex.codecogs.com/png.latex?V%20=%20-J"> and the optimal control takes the same form <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%20%5Cnabla%20V"> in both conventions.) The controlled SDE is <span id="eq-controlled-sde"><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20=%20%5Csigma_t%20%5C,%20u(t,X_t)%20%5C,%20dt%20+%20%5Csigma_t%20%5C,%20dW_t,%20%5Cqquad%20X_0%20=%200,%0A%5Ctag%7B2%7D"></span> with scalar noise schedule <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%3E%200"> (when <img src="https://latex.codecogs.com/png.latex?%5Csigma"> is a matrix, <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%5E%5Ctop%20%5Cnabla%20V">; the scalar case simplifies this to <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%5Cnabla%20V">). The base process (<img src="https://latex.codecogs.com/png.latex?u%20%5Cequiv%200">) gives <img src="https://latex.codecogs.com/png.latex?X_t%20%5Csim%20%5Cmathcal%7BN%7D(0,%20%5Cnu_t%20I)"> with cumulative variance <img src="https://latex.codecogs.com/png.latex?%5Cnu_t%20=%20%5Cint_0%5Et%20%5Csigma_s%5E2%20%5C,%20ds">. By <a href="../../notes/girsanov/girsanov.html">Girsanov</a>, <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5Eu%20%5C%7C%20%5Cmathbb%7BP%7D)%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%5Cint_0%5E1%20%5C%7Cu%5C%7C%5E2%20%5C,%20dt"> (the <a href="../../notes/girsanov/girsanov.html">Girsanov notes</a> derive <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D,%20%5Cmathbb%7BP%7D%5Eu)%20=%20%5Cfrac%7B1%7D%7B2%7D%5Cmathbb%7BE%7D_%5Cmathbb%7BP%7D%5B%5Cint%20%5C%7Cu%5C%7C%5E2%20dt%5D">; the formula with <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D"> follows from an analogous calculation, or by substituting the Girsanov weight), so the SOC trades terminal cost against control effort. The optimal control is <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar(t,x)%20=%20%5Csigma_t%20%5Cnabla%20V(t,x)"> where <img src="https://latex.codecogs.com/png.latex?V%20=%20%5Clog%20h"> and <span id="eq-h-function"><img src="https://latex.codecogs.com/png.latex?%0Ah(t,x)%20=%20%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20%5Cexp(-g(X_1))%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%0A%5Ctag%7B3%7D"></span> under the base process. This is the <a href="../../notes/doob_transforms/doob.html">Doob h-transform</a>: <img src="https://latex.codecogs.com/png.latex?h"> tilts the path measure toward low-cost terminal states. The optimal control <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> points in the direction of <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20h">, i.e.&nbsp;toward regions where <img src="https://latex.codecogs.com/png.latex?h"> is large, where the expected future cost-to-go is small, where the energy <img src="https://latex.codecogs.com/png.latex?E"> is low. At optimality the controlled path measure equals the <a href="../../notes/shrodinger_bridge/shrodinger.html">Schrodinger bridge</a>: <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D(%5Cboldsymbol%7BX%7D)%20=%20%5Cmathbb%7BP%7D(%5Cboldsymbol%7BX%7D%20%5Cmid%20X_1)%20%5C,%20%5Cpi(X_1)">. The <a href="../../notes/shrodinger_bridge/shrodinger.html">SB notes</a> show that the SB minimizing <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BQ%7D%5C%7C%20%5Cmathbb%7BP%7D)"> with <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_0%20=%20%5Cdelta_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_1%20=%20%5Cpi"> has <img src="https://latex.codecogs.com/png.latex?d%5Cmathbb%7BQ%7D/d%5Cmathbb%7BP%7D%5Cpropto%20%5Cvarphi_1(X_1)"> (no initial tilt, since <img src="https://latex.codecogs.com/png.latex?%5Cdelta_0"> is already the base initial distribution). This means <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D(%5Cboldsymbol%7BX%7D)%20=%20%5Cmathbb%7BP%7D(%5Cboldsymbol%7BX%7D%20%7C%20X_1)%20%5Cpi(X_1)"> after normalizing the terminal potential so that <img src="https://latex.codecogs.com/png.latex?%5Cint%20%5Cvarphi_1(x)%20p_1%5E%7B%5Ctext%7Bbase%7D%7D(x)%20dx%20=%201">. The optimal cost is <img src="https://latex.codecogs.com/png.latex?J(u%5E%5Cstar)%20=%20-%5Clog%20h(0,0)">. The formula <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%20%5Cnabla%20V"> is elegant; computing <img src="https://latex.codecogs.com/png.latex?V"> is not. The function <img src="https://latex.codecogs.com/png.latex?h"> in Equation&nbsp;3 requires averaging <img src="https://latex.codecogs.com/png.latex?%5Cexp(-g)"> over all possible futures of a Brownian motion, which is as hard as the original sampling problem.</p>
<p>Three natural questions arise.</p>
<section id="can-i-learn-ustar-without-computing-h" class="level3">
<h3 class="anchored" data-anchor-id="can-i-learn-ustar-without-computing-h">Can I learn <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> without computing <img src="https://latex.codecogs.com/png.latex?h">?</h3>
<p>The <a href="../../notes/adjoint_method/adjoint.html">adjoint notes</a> provide a tool for exactly this situation. For an ODE <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx%7D%20=%20b(t,x)"> with running cost <img src="https://latex.codecogs.com/png.latex?f"> and terminal cost <img src="https://latex.codecogs.com/png.latex?g">, the adjoint variable <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)%20=%20%5Cnabla_%7BX_t%7D%5B%5Ctext%7Bfuture%20cost%7D%5D"> satisfies <img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7B%5Clambda%7D(t)%20=%20-%5Cnabla_x%20f%20-%20(%5Cnabla_x%20b)%5E%5Ctop%20%5Clambda(t),%20%5Cqquad%20%5Clambda(1)%20=%20%5Cnabla%20g(X_1).%0A"> The full adjoint ODE for a controlled SDE with drift <img src="https://latex.codecogs.com/png.latex?b%20+%20%5Csigma_t%20u"> also contains terms involving <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20u">: <img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7Ba%7D(t)%20=%20-%20%7B%5Cleft%5B%20%5Cnabla_x%20b%20+%20%5Csigma_t%20%5Cnabla_x%20u%20%5Cright%5D%7D%20%5E%5Ctop%20a(t)%20-%20(%5Cnabla_x%20u)%5E%5Ctop%20u,%20%5Cqquad%20a(1)%20=%20%5Cnabla%20g(X_1).%0A"> As described in the <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> note, the <img src="https://latex.codecogs.com/png.latex?u">-dependent terms (<img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%5Cnabla_x%20u%5E%5Ctop%20a"> and <img src="https://latex.codecogs.com/png.latex?(%5Cnabla_x%20u)%5E%5Ctop%20u">) have zero conditional expectation at optimality. Dropping them does not change the fixed point but reduces gradient variance. The resulting <em>lean adjoint</em> <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D(t)"> satisfies <img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7B%5Ctilde%7Ba%7D%7D(t)%20=%20-(%5Cnabla_x%20b)%5E%5Ctop%20%5Ctilde%7Ba%7D(t),%20%5Cqquad%20%5Ctilde%7Ba%7D(1)%20=%20%5Cnabla%20g(X_1),%0A"> which depends only on the base drift <img src="https://latex.codecogs.com/png.latex?b">, not on the control <img src="https://latex.codecogs.com/png.latex?u">. This is a practical win: no need to compute <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20u">, which is expensive for neural network parameterizations.</p>
<p>Now set <img src="https://latex.codecogs.com/png.latex?%20%5Ctextcolor%7Bblue%7D%7Bb%20=%200%7D"> and <img src="https://latex.codecogs.com/png.latex?%20%5Ctextcolor%7Bblue%7D%7Bf%20=%200%7D">: the base process is pure scaled Brownian motion, and the running cost is just the control penalty (which does not enter the lean adjoint). Both forcing terms vanish. The lean adjoint ODE becomes <img src="https://latex.codecogs.com/png.latex?%5Cdot%7B%5Ctilde%7Ba%7D%7D%20=%200"> with terminal condition <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D(1)%20=%20%5Cnabla%20g(X_1)">. So <span id="eq-constant-adjoint"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctextcolor%7Bblue%7D%7B%5Ctilde%7Ba%7D(t;%20%5Cboldsymbol%7BX%7D)%20=%20%5Cnabla%20g(X_1)%7D,%20%5Cqquad%20%5Ctext%7Bfor%20all%20%7D%20t%20%5Cin%20%5B0,1%5D.%0A%5Ctag%7B4%7D"></span> No backward ODE to solve. The regression target at every time <img src="https://latex.codecogs.com/png.latex?t"> is just the terminal gradient <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g(X_1)">.</p>
<p>The intuition is clean. This decomposition <img src="https://latex.codecogs.com/png.latex?X_1%20=%20X_t%20+%20%5Cint_t%5E1%20%5Csigma_s%20%5C,%20dW_s"> holds for the <em>base process</em> (<img src="https://latex.codecogs.com/png.latex?u%20=%200">). Under the base process, the two pieces <img src="https://latex.codecogs.com/png.latex?X_t"> and <img src="https://latex.codecogs.com/png.latex?%5Cint_t%5E1%20%5Csigma_s%20dW_s"> are independent: Brownian increments do not remember the past. Holding the future noise realization fixed and perturbing <img src="https://latex.codecogs.com/png.latex?X_t"> by a small displacement <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20X_t">, the terminal state shifts by the same amount: <img src="https://latex.codecogs.com/png.latex?X_1%20%5Cmapsto%20X_1%20+%20%5Cdelta%20X_t">. The sensitivity of the terminal cost to the intermediate state is therefore <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%7BX_t%7D%20g(X_1)%20=%20%5Cnabla%20g(X_1)"> along each base trajectory, confirming Equation&nbsp;4. This argument uses the <em>base</em> process decomposition <img src="https://latex.codecogs.com/png.latex?X_1%20=%20X_t%20+%20%5Cint_t%5E1%20%5Csigma_s%20dW_s">, which holds for <img src="https://latex.codecogs.com/png.latex?u%20=%200">. Along <em>controlled</em> trajectories, <img src="https://latex.codecogs.com/png.latex?X_1"> depends nonlinearly on <img src="https://latex.codecogs.com/png.latex?X_t"> through <img src="https://latex.codecogs.com/png.latex?u">, and the full adjoint <img src="https://latex.codecogs.com/png.latex?a(t)%20%5Cneq%20%5Cnabla%20g(X_1)">. The lean adjoint is constant because it is defined using the base dynamics (<img src="https://latex.codecogs.com/png.latex?b%20=%200">), not the controlled dynamics. Its virtue is that it avoids computing <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20u"> while having the same fixed point as the full adjoint. This is the simplest possible adjoint: the base dynamics offer no resistance to perturbations, so the terminal gradient propagates unchanged backward through time.</p>
<p>The <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> loss with target Equation&nbsp;4 is <span id="eq-am-loss"><img src="https://latex.codecogs.com/png.latex?%0AL_%5Ctext%7BAM%7D(u)%20=%20%5Cmathbb%7BE%7D_%7B%5Cboldsymbol%7BX%7D%20%5Csim%20%5Cmathbb%7BP%7D%5E%7B%5Cbar%7Bu%7D%7D%7D%20%20%7B%5Cleft%5B%20%20%5Cint_0%5E1%20%5Ctfrac%7B1%7D%7B2%7D%5C%7Cu(t,X_t)%20+%20%5Csigma_t%20%5C,%20%5Cnabla%20g(X_1)%5C%7C%5E2%20%5C,%20dt%20%5Cright%5D%7D%20,%0A%5Ctag%7B5%7D"></span> where <img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bu%7D%20=%20%5Ctexttt%7Bstopgrad%7D(u)">: trajectories are simulated with the current (frozen) parameters, and gradients only flow through the <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta"> term inside the square. Concretely, for each trajectory the computational graph is: simulate <img src="https://latex.codecogs.com/png.latex?X_0%20%5Cto%20X_1"> using <img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bu%7D"> (no gradient), compute <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g(X_1)"> (one energy gradient call), then for each saved <img src="https://latex.codecogs.com/png.latex?(t,%20X_t)"> along the path, evaluate <img src="https://latex.codecogs.com/png.latex?%5C%7Cu_%5Ctheta(t,%20X_t)%20+%20%5Csigma_t%20%5Cnabla%20g(X_1)%5C%7C%5E2"> and backpropagate through <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta"> only. This regresses <img src="https://latex.codecogs.com/png.latex?u(t,%20X_t)"> onto <img src="https://latex.codecogs.com/png.latex?-%5Csigma_t%20%5Cnabla%20g(X_1)"> at each <img src="https://latex.codecogs.com/png.latex?(t,%20X_t)"> pair along the trajectory. The unique fixed point is <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar(t,x)%20=%20-%5Csigma_t%20%5C,%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D%7D%5B%5Cnabla%20g(X_1)%20%5Cmid%20X_t%20=%20x%5D"> (exchanging <img src="https://latex.codecogs.com/png.latex?%5Cnabla"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D">, valid under regularity of <img src="https://latex.codecogs.com/png.latex?g">): the conditional expectation, under the optimally controlled process, of the terminal gradient. Comparing with <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%20%5Cnabla%20%5Clog%20h">, the adjoint target <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g(X_1)"> is a stochastic estimate of <img src="https://latex.codecogs.com/png.latex?-%5Cnabla%20V(t,%20X_t)">; the regression averages many noisy terminal gradients to recover the smooth gradient of the value function.</p>
<p>This is just mean-squared-error regression. No backward ODE, no Hessians, no importance weights. For each trajectory, evaluate <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g"> once at the endpoint, and you have training signal at every intermediate time. But there is still a computational bottleneck: each gradient step on Equation&nbsp;5 requires simulating the controlled SDE forward (to produce trajectories), and evaluating the energy function at <img src="https://latex.codecogs.com/png.latex?X_1">. Both operations are expensive. The next section removes the first cost almost entirely.</p>
</section>
<section id="can-i-avoid-simulating-the-sde-to-generate-training-data" class="level3">
<h3 class="anchored" data-anchor-id="can-i-avoid-simulating-the-sde-to-generate-training-data">Can I avoid simulating the SDE to generate training data?</h3>
<p>The loss Equation&nbsp;5 only depends on the pair <img src="https://latex.codecogs.com/png.latex?(X_t,%20X_1)">, not the full trajectory: <span id="eq-am-pairs"><img src="https://latex.codecogs.com/png.latex?%0AL_%5Ctext%7BAM%7D(u)%20=%20%5Cint_0%5E1%20%5Cmathbb%7BE%7D_%7B(X_t,%20X_1)%20%5Csim%20p%5E%7B%5Cbar%7Bu%7D%7D_%7Bt,1%7D%7D%20%20%7B%5Cleft%5B%20%5Ctfrac%7B1%7D%7B2%7D%5C%7Cu(t,X_t)%20+%20%5Csigma_t%20%5Cnabla%20g(X_1)%5C%7C%5E2%20%5Cright%5D%7D%20%20%5C,%20dt.%0A%5Ctag%7B6%7D"></span> Sampling these pairs still requires simulating the controlled SDE forward, which is the expensive part. The key practical innovation is to replace the joint <img src="https://latex.codecogs.com/png.latex?p%5E%7B%5Cbar%7Bu%7D%7D_%7Bt,1%7D(x_t,%20x_1)"> with the product <span id="eq-reciprocal-joint"><img src="https://latex.codecogs.com/png.latex?%0Ap%5E%5Ctext%7Bbase%7D_%7Bt%20%5Cmid%201%7D(x_t%20%5Cmid%20x_1)%20%5Ccdot%20p%5E%7B%5Cbar%7Bu%7D%7D_1(x_1).%0A%5Ctag%7B7%7D"></span> Keep the terminal marginal from the current control, but fill in the interior with the base Brownian bridge. This decouples the expensive step (generating <img src="https://latex.codecogs.com/png.latex?X_1">) from the cheap step (sampling <img src="https://latex.codecogs.com/png.latex?X_t"> given <img src="https://latex.codecogs.com/png.latex?X_1">).</p>
<p><strong>The bridge formula.</strong> Under the base process, <img src="https://latex.codecogs.com/png.latex?X_t%20%5Csim%20%5Cmathcal%7BN%7D(0,%20%5Cnu_t%20I)"> and <img src="https://latex.codecogs.com/png.latex?X_1%20=%20X_t%20+%20Z"> where <img src="https://latex.codecogs.com/png.latex?Z%20=%20%5Cint_t%5E1%20%5Csigma_s%20%5C,%20dW_s%20%5Csim%20%5Cmathcal%7BN%7D(0,%20(%5Cnu_1%20-%20%5Cnu_t)I)"> is independent of <img src="https://latex.codecogs.com/png.latex?X_t">. The pair <img src="https://latex.codecogs.com/png.latex?(X_t,%20X_1)"> is jointly Gaussian with <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BX_t%5D%20=%200">, <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BX_1%5D%20=%200">, <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BVar%7D%7D(X_t)%20=%20%5Cnu_t%20I">, <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BVar%7D%7D(X_1)%20=%20%5Cnu_1%20I">, and <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(X_t,%20X_1)%20=%20%5Cnu_t%20I"> (since <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(X_t,%20X_t%20+%20Z)%20=%20%5Cmathop%7B%5Cmathrm%7BVar%7D%7D(X_t)">). Standard Gaussian conditioning (cf.&nbsp;the <a href="../../notes/doob_transforms/doob.html">Brownian bridge</a> in the Doob notes) gives <span id="eq-bridge"><img src="https://latex.codecogs.com/png.latex?%0AX_t%20%5Cmid%20X_1%20=%20x_1%20%5C;%5Csim%5C;%20%5Cmathcal%7BN%7D%20%7B%5Cleft(%20%5Cfrac%7B%5Cnu_t%7D%7B%5Cnu_1%7D%20%5C,%20x_1,%20%5C;%5C;%20%5Cfrac%7B%5Cnu_t(%5Cnu_1%20-%20%5Cnu_t)%7D%7B%5Cnu_1%7D%20%5C,%20I%20%5Cright)%7D%20.%0A%5Ctag%7B8%7D"></span> Sampling from Equation&nbsp;8 is a single Gaussian draw: <img src="https://latex.codecogs.com/png.latex?X_t%20=%20%5Cfrac%7B%5Cnu_t%7D%7B%5Cnu_1%7D%20x_1%20+%20%5Csqrt%7B%5Cfrac%7B%5Cnu_t(%5Cnu_1%20-%20%5Cnu_t)%7D%7B%5Cnu_1%7D%7D%20%5C,%20%5Cxi"> with <img src="https://latex.codecogs.com/png.latex?%5Cxi%20%5Csim%20%5Cmathcal%7BN%7D(0,%20I)">. For constant <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%20%5Csigma">, we have <img src="https://latex.codecogs.com/png.latex?%5Cnu_t%20=%20%5Csigma%5E2%20t"> and Equation&nbsp;8 simplifies to <img src="https://latex.codecogs.com/png.latex?X_t%20%5Cmid%20X_1%20%5Csim%20%5Cmathcal%7BN%7D(t%20%5C,%20x_1,%20%5Csigma%5E2%20t(1-t)%20I)">, the classical Brownian bridge.</p>
<details>
<summary>
The Gaussian conditioning, spelled out.
</summary>
<p style="color: blue;">
Write <img src="https://latex.codecogs.com/png.latex?X_1%20=%20X_t%20+%20Z"> with <img src="https://latex.codecogs.com/png.latex?Z%20%5Csim%20%5Cmathcal%7BN%7D(0,%20(%5Cnu_1%20-%20%5Cnu_t)I)"> independent of <img src="https://latex.codecogs.com/png.latex?X_t">. The joint <img src="https://latex.codecogs.com/png.latex?(X_t,%20X_1)"> is Gaussian, and the conditional <img src="https://latex.codecogs.com/png.latex?X_t%20%5Cmid%20X_1%20=%20x_1"> is also Gaussian with <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D%5BX_t%20%5Cmid%20X_1%20=%20x_1%5D%20=%20%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(X_t,%20X_1)%20%5C,%20%5Cmathop%7B%5Cmathrm%7BVar%7D%7D(X_1)%5E%7B-1%7D%20%5C,%20x_1%20=%20%5Cfrac%7B%5Cnu_t%7D%7B%5Cnu_1%7D%20%5C,%20x_1,%0A"> <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7BVar%7D%7D(X_t%20%5Cmid%20X_1)%20=%20%5Cmathop%7B%5Cmathrm%7BVar%7D%7D(X_t)%20-%20%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(X_t,%20X_1)%20%5C,%20%5Cmathop%7B%5Cmathrm%7BVar%7D%7D(X_1)%5E%7B-1%7D%20%5C,%20%5Cmathop%7B%5Cmathrm%7BCov%7D%7D(X_1,%20X_t)%20=%20%5Cnu_t%20%20%7B%5Cleft(%201%20-%20%5Cfrac%7B%5Cnu_t%7D%7B%5Cnu_1%7D%20%5Cright)%7D%20%20I%20=%20%5Cfrac%7B%5Cnu_t(%5Cnu_1%20-%20%5Cnu_t)%7D%7B%5Cnu_1%7D%20%5C,%20I.%0A"> The conditional mean is a linear interpolation between <img src="https://latex.codecogs.com/png.latex?0"> and <img src="https://latex.codecogs.com/png.latex?x_1">, weighted by <img src="https://latex.codecogs.com/png.latex?%5Cnu_t%20/%20%5Cnu_1">. The conditional variance peaks at the midpoint and vanishes at <img src="https://latex.codecogs.com/png.latex?t%20=%200"> (since <img src="https://latex.codecogs.com/png.latex?%5Cnu_0%20=%200">, we know <img src="https://latex.codecogs.com/png.latex?X_0%20=%200"> with certainty) and at <img src="https://latex.codecogs.com/png.latex?t%20=%201"> (since we conditioned on <img src="https://latex.codecogs.com/png.latex?X_1%20=%20x_1">).
</p>
</details>
<p>Substituting Equation&nbsp;7 into Equation&nbsp;6 gives the <em>Reciprocal Adjoint Matching</em> (RAM) loss: <span id="eq-ram"><img src="https://latex.codecogs.com/png.latex?%0AL_%5Ctext%7BRAM%7D(u)%20=%20%5Cint_0%5E1%20%5Clambda(t)%20%5C,%20%5Cmathbb%7BE%7D_%7B%5Csubstack%7BX_1%20%5Csim%20p%5E%7B%5Cbar%7Bu%7D%7D_1%20%5C%5C%20X_t%20%5Csim%20p%5E%5Ctext%7Bbase%7D_%7Bt%20%5Cmid%201%7D(%5Ccdot%20%5Cmid%20X_1)%7D%7D%20%20%7B%5Cleft%5B%20%5Ctfrac%7B1%7D%7B2%7D%5C%7Cu(t,X_t)%20+%20%5Csigma_t%20%5Cnabla%20g(X_1)%5C%7C%5E2%20%5Cright%5D%7D%20%20%5C,%20dt,%0A%5Ctag%7B9%7D"></span> where <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)%20=%201/%5Csigma_t%5E2"> is a time-weighting that normalizes the regression target magnitude across time (does not change the optimum). Sampling the training pair <img src="https://latex.codecogs.com/png.latex?(X_t,%20X_1)"> now proceeds as: (1) generate <img src="https://latex.codecogs.com/png.latex?X_1"> by running the controlled SDE forward (one expensive simulation), (2) for each <img src="https://latex.codecogs.com/png.latex?X_1">, sample <img src="https://latex.codecogs.com/png.latex?t%20%5Csim%20%5Ctext%7BUniform%7D(%5B0,1%5D)"> and draw <img src="https://latex.codecogs.com/png.latex?X_t"> from Equation&nbsp;8 (one Gaussian draw). One energy evaluation of <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g(X_1)"> gives training signal for arbitrarily many <img src="https://latex.codecogs.com/png.latex?(t,%20X_t)"> pairs.</p>
<p><strong>Why does this substitution work?</strong> At optimality, <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D%20=%20%5Cmathbb%7BP%7D%5E%5Cstar"> is the Schrodinger bridge, which factorizes as <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(%5Cboldsymbol%7BX%7D%20%5Cmid%20X_1)%20%5Ccdot%20%5Cpi(X_1)">. Marginalizing over intermediate times, <img src="https://latex.codecogs.com/png.latex?p%5E%7Bu%5E%5Cstar%7D_%7Bt,1%7D(x_t,%20x_1)%20=%20p%5E%5Ctext%7Bbase%7D_%7Bt%20%5Cmid%201%7D(x_t%20%5Cmid%20x_1)%20%5Ccdot%20%5Cpi(x_1)">. At the fixed point, the replacement Equation&nbsp;7 is exact. Away from optimality, the replacement defines a <em>reciprocal projection</em> <img src="https://latex.codecogs.com/png.latex?%5CPi(u)">: the Schrodinger bridge with the same terminal marginal <img src="https://latex.codecogs.com/png.latex?p%5Eu_1"> as the current control.</p>
<details>
<summary>
The projection never increases the SOC cost.
</summary>
<p style="color: blue;">
Write <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BSB%7D_%7Bp%5Eu_1%7D"> for the Schrodinger bridge with terminal marginal <img src="https://latex.codecogs.com/png.latex?p%5Eu_1">, i.e.&nbsp;the path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(%5Cboldsymbol%7BX%7D%20%5Cmid%20X_1)%20%5C,%20p%5Eu_1(X_1)">. Its Radon-Nikodym derivative against <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D"> is <img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%5B%5Ctext%7BSB%7D_%7Bp%5Eu_1%7D%5D%7D%7Bd%5Cmathbb%7BP%7D%7D(%5Cboldsymbol%7BX%7D)%20=%20%5Cfrac%7Bp%5Eu_1(X_1)%7D%7Bp%5E%5Ctext%7Bbase%7D_1(X_1)%7D,%0A"> since <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(%5Cboldsymbol%7BX%7D%20%5Cmid%20X_1)%20=%20%5Cmathbb%7BP%7D(%5Cboldsymbol%7BX%7D)%20/%20p%5E%5Ctext%7Bbase%7D_1(X_1)">. The path-space KL from <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5Eu"> to <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BSB%7D_%7Bp%5Eu_1%7D"> is then <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0AD_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5Eu%20%5C%7C%20%5Ctext%7BSB%7D_%7Bp%5Eu_1%7D)%0A&amp;=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%7B%5Cleft%5B%20%5Clog%20%5Cfrac%7Bd%5Cmathbb%7BP%7D%5Eu%7D%7Bd%5Cmathbb%7BP%7D%7D%20+%20%5Clog%20%5Cfrac%7Bd%5Cmathbb%7BP%7D%7D%7Bd%5B%5Ctext%7BSB%7D_%7Bp%5Eu_1%7D%5D%7D%20%5Cright%5D%7D%20%20%5C%5C%0A&amp;=%20%5Cunderbrace%7BD_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5Eu%20%5C%7C%20%5Cmathbb%7BP%7D)%7D_%7B%5Cfrac%7B1%7D%7B2%7D%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%5Cint%20%5C%7Cu%5C%7C%5E2%20%5C,%20dt%7D%20+%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%7B%5Cleft%5B%20%5Clog%20%5Cfrac%7Bp%5E%5Ctext%7Bbase%7D_1(X_1)%7D%7Bp%5Eu_1(X_1)%7D%20%5Cright%5D%7D%20.%0A%5Cend%7Baligned%7D%0A"> The first term is the Girsanov KL (<a href="../../notes/girsanov/girsanov.html">Girsanov notes</a>). Now decompose the SOC cost using <img src="https://latex.codecogs.com/png.latex?g%20=%20%5Clog(p%5E%5Ctext%7Bbase%7D_1%20/%20%5Cpi)%20=%20%5Clog(p%5E%5Ctext%7Bbase%7D_1%20/%20p%5Eu_1)%20+%20%5Clog(p%5Eu_1%20/%20%5Cpi)">: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0AJ(u)%20&amp;=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%7B%5Cleft%5B%20%5Ctfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2%20+%20g(X_1)%20%5Cright%5D%7D%20%20%5C%5C%0A&amp;=%20%5Cunderbrace%7B%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%7B%5Cleft%5B%20%5Ctfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2%20+%20%5Clog%20%5Cfrac%7Bp%5E%5Ctext%7Bbase%7D_1(X_1)%7D%7Bp%5Eu_1(X_1)%7D%20%5Cright%5D%7D%20%7D_%7BD_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5Eu%20%5C%7C%20%5Ctext%7BSB%7D_%7Bp%5Eu_1%7D)%7D%20+%20%5Cunderbrace%7B%5Cmathbb%7BE%7D_%7Bp%5Eu_1%7D%20%7B%5Cleft%5B%20%5Clog%20%5Cfrac%7Bp%5Eu_1(X_1)%7D%7B%5Cpi(X_1)%7D%20%5Cright%5D%7D%20%7D_%7BD_%7B%5Ctext%7BKL%7D%7D(p%5Eu_1%20%5C%7C%20%5Cpi)%7D.%0A%5Cend%7Baligned%7D%0A"> The first term is the path-space KL computed above; the second is the marginal KL. The projection <img src="https://latex.codecogs.com/png.latex?%5CPi(u)"> minimizes the first term over all controls sharing terminal marginal <img src="https://latex.codecogs.com/png.latex?p%5Eu_1">, driving the path-space KL to zero (this requires <img src="https://latex.codecogs.com/png.latex?p%5Eu_1"> to be absolutely continuous with respect to <img src="https://latex.codecogs.com/png.latex?p_1%5E%7B%5Ctext%7Bbase%7D%7D">, which holds for typical neural network controls). Its minimum is achieved by the SB with terminal marginal <img src="https://latex.codecogs.com/png.latex?p%5Eu_1">, which has drift <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20%5Cvarphi_t"> for the appropriate Doob h-transform. Since the terminal marginal is preserved, the marginal KL is unchanged. Hence <img src="https://latex.codecogs.com/png.latex?J(%5CPi(u))%20%5Cleq%20J(u)">.
</p>
</details>
<p>After projection, RAM and AM coincide: <img src="https://latex.codecogs.com/png.latex?%5CPi(u)"> is a SB with terminal marginal <img src="https://latex.codecogs.com/png.latex?p%5Eu_1">, so its path measure factorizes as <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(%5Ccdot%20%7C%20X_1)%20p%5Eu_1(X_1)">, and the reciprocal projection is the identity. The two losses have the same fixed point and the same critical points on the projected space. In other words, we lose nothing by using the cheaper loss, and we gain a monotone improvement guarantee.</p>
<p><strong>The algorithm.</strong> The full Adjoint Sampling algorithm <span class="citation" data-cites="havens2025adjoint">(<strong>havens2025adjoint?</strong>)</span> alternates between two phases. The outer loop (expensive) simulates the controlled SDE forward to produce terminal samples <img src="https://latex.codecogs.com/png.latex?%5C%7BX_1%5E%7B(i)%7D%5C%7D">, evaluates <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g(X_1%5E%7B(i)%7D)">, and stores the pairs in a replay buffer <img src="https://latex.codecogs.com/png.latex?%5CcB">. The inner loop (cheap) draws <img src="https://latex.codecogs.com/png.latex?(X_1,%20%5Cnabla%20g)"> from the buffer, samples <img src="https://latex.codecogs.com/png.latex?t%20%5Csim%20%5Ctext%7BUniform%7D(%5B0,1%5D)"> and <img src="https://latex.codecogs.com/png.latex?X_t"> from the bridge Equation&nbsp;8, and updates <img src="https://latex.codecogs.com/png.latex?u"> by gradient descent on the RAM loss Equation&nbsp;9. Many gradient steps per energy evaluation, since the inner loop never touches <img src="https://latex.codecogs.com/png.latex?E">.</p>
<p>This scheme has a clean fixed-point interpretation. Each outer step implicitly performs the reciprocal projection <img src="https://latex.codecogs.com/png.latex?%5CPi"> (by freezing the terminal samples), and each inner step minimizes the AM loss on the projected control. If <img src="https://latex.codecogs.com/png.latex?u_i"> denotes the current control and we fully converge the inner loop using <img src="https://latex.codecogs.com/png.latex?X_1"> samples from <img src="https://latex.codecogs.com/png.latex?p%5E%7Bu_i%7D_1">, the update satisfies <img src="https://latex.codecogs.com/png.latex?%0Au_%7Bi+1%7D%20=%20%5CPi(u_i)%20-%20%5Cfrac%7B%5Cdelta%20L_%5Ctext%7BAM%7D%7D%7B%5Cdelta%20u%7D(%5CPi(u_i)).%0A"> The fixed point <img src="https://latex.codecogs.com/png.latex?u%20=%20%5CPi(u)"> with <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cdelta%20L_%5Ctext%7BAM%7D%7D%7B%5Cdelta%20u%7D(u)%20=%200"> is exactly the optimal control <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar">. In practice the inner loop is not converged fully: the buffer is refreshed when the control has drifted sufficiently from the stored samples.</p>
<p>The computational savings are significant. Previous SOC-based samplers require simulating the SDE <em>and</em> backpropagating through it at every gradient step, plus at least one energy evaluation per step. Adjoint Sampling decouples sampling from optimization: the outer loop produces <img src="https://latex.codecogs.com/png.latex?N"> terminal samples per buffer refresh (each requiring one SDE simulation + one <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g"> evaluation), while the inner loop does <img src="https://latex.codecogs.com/png.latex?K%20%5Cgg%20N"> gradient updates using stored buffer entries (each requiring one Gaussian draw from Equation&nbsp;8 + one forward pass of the neural network). No SDE simulation, no energy call during the inner loop. The ratio <img src="https://latex.codecogs.com/png.latex?K/N"> of gradient updates to energy evaluations can be in the hundreds. For expensive energy functions like molecular force fields, this is the difference between feasibility and infeasibility.</p>
<p>The replay buffer also provides a form of experience replay: older samples from earlier stages of training remain in the buffer alongside fresh samples, smoothing the optimization. Buffer entries are weighted uniformly; more sophisticated prioritization schemes are possible but have not been explored.</p>
</section>
<section id="what-if-the-prior-is-not-a-dirac" class="level3">
<h3 class="anchored" data-anchor-id="what-if-the-prior-is-not-a-dirac">What if the prior is not a Dirac?</h3>
<p>The setup <img src="https://latex.codecogs.com/png.latex?X_0%20=%200"> is restrictive. For molecular systems, a harmonic oscillator prior <img src="https://latex.codecogs.com/png.latex?%5Cmu"> that starts particles near equilibrium bond lengths is a far better starting point: the transport cost is lower and convergence is faster. Even for non-molecular problems, starting from a Gaussian <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmathcal%7BN%7D(0,%20I)"> and using a moderate noise schedule <img src="https://latex.codecogs.com/png.latex?%5Csigma_t"> is more natural than pumping all the stochasticity through the Brownian motion from a single point.</p>
<p>The base process <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D"> now starts from <img src="https://latex.codecogs.com/png.latex?X_0%20%5Csim%20%5Cmu"> (not <img src="https://latex.codecogs.com/png.latex?%5Cdelta_0">), and <img src="https://latex.codecogs.com/png.latex?%5Cnu_t">, <img src="https://latex.codecogs.com/png.latex?p_t%5E%7B%5Cmathbb%7BP%7D%7D">, and the Brownian bridge all depend on this initial distribution. With a non-trivial prior, <img src="https://latex.codecogs.com/png.latex?X_0"> and <img src="https://latex.codecogs.com/png.latex?X_1"> are coupled under the base process, and the initial value function bias from the <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> note reappears. The SOC optimal terminal marginal is <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_1)%20%5Cpropto%20%5Cint%20%5Cmathbb%7BP%7D(X_0,%20X_1)%20%5C,%20e%5E%7B-g(X_1)%20+%20V_0(X_0)%7D%20%5C,%20dX_0">, which is not proportional to <img src="https://latex.codecogs.com/png.latex?%5Cpi(X_1)"> because the <img src="https://latex.codecogs.com/png.latex?V_0(X_0)"> factor cannot be pulled out of the integral. The memoryless condition (<img src="https://latex.codecogs.com/png.latex?X_0%20%5Cperp%20X_1"> under <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D">) eliminates this bias by making the integral over <img src="https://latex.codecogs.com/png.latex?X_0"> collapse to a constant, but it also forces <img src="https://latex.codecogs.com/png.latex?X_0%20=%200"> (or equivalently, requires a noise schedule <img src="https://latex.codecogs.com/png.latex?%5Csigma_t"> that injects enough noise to erase all memory of <img src="https://latex.codecogs.com/png.latex?X_0"> by time 1, as discussed in the <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> note).</p>
<p>The fix comes from the <a href="../../notes/shrodinger_bridge/shrodinger.html">Schrodinger bridge</a> formulation. Instead of solving a plain SOC (which only imposes <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_1%20%5Capprox%20%5Cpi"> via a terminal cost), solve the full SB problem that imposes both marginal constraints <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_0%20=%20%5Cmu"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_1%20=%20%5Cpi"> simultaneously. The SB <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D%5E%5Cstar"> minimizing <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BQ%7D%5C%7C%20%5Cmathbb%7BP%7D)"> subject to these two constraints has path measure <span id="eq-sb-rn"><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%5Cmathbb%7BQ%7D%5E%5Cstar%7D%7Bd%5Cmathbb%7BP%7D%7D(%5Cboldsymbol%7BX%7D)%20%5C;%5Cpropto%5C;%20%5Cwidehat%7B%5Cvarphi%7D_0(X_0)%20%5C,%20%5Cvarphi_1(X_1),%0A%5Ctag%7B10%7D"></span> with time-dependent SB potentials <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t(x)%20=%20%5Cmathbb%7BE%7D_%5Cmathbb%7BP%7D%5B%5Cvarphi_1(X_1)%20%5Cmid%20X_t%20=%20x%5D"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t(x)%20=%20%5Cmathbb%7BE%7D_%5Cmathbb%7BP%7D%5B%5Cwidehat%7B%5Cvarphi%7D_0(X_0)%20%5Cmid%20X_t%20=%20x%5D"> (in the <a href="../../notes/shrodinger_bridge/shrodinger.html">SB notes</a>, these are defined with endpoint potentials <img src="https://latex.codecogs.com/png.latex?f,%20g">; here <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_1"> corresponds to <img src="https://latex.codecogs.com/png.latex?g"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_0"> to <img src="https://latex.codecogs.com/png.latex?f">). The forward potential <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t"> is the <a href="../../notes/doob_transforms/doob.html">Doob h-transform</a>: the SB process has drift <img src="https://latex.codecogs.com/png.latex?b_t%20+%20%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20%5Cvarphi_t">, steering trajectories toward the target. The backward potential <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t"> propagates information about the prior <img src="https://latex.codecogs.com/png.latex?%5Cmu"> forward in time.</p>
<p>The SB <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D%5E%5Cstar"> is also a controlled diffusion (its drift is the base drift plus <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20%5Cvarphi_t">), so it must solve some SOC problem with an appropriate terminal cost. What terminal cost? The SOC optimal joint from the <a href="../../notes/HJB/HJB.html">HJB notes</a> is <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_0,%20X_1)%20%5Cpropto%20%5Cmathbb%7BP%7D(X_0,%20X_1)%20%5C,%20e%5E%7B-g(X_1)%20+%20V_0(X_0)%7D">, while the SB joint from Equation&nbsp;10 is <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_0,%20X_1)%20%5Cpropto%20%5Cmathbb%7BP%7D(X_0,%20X_1)%20%5C,%20%5Cwidehat%7B%5Cvarphi%7D_0(X_0)%20%5C,%20%5Cvarphi_1(X_1)">. The SOC here optimizes both the drift <img src="https://latex.codecogs.com/png.latex?u"> and the initial distribution (the HJB formulation in Equation&nbsp;1 jointly optimizes <img src="https://latex.codecogs.com/png.latex?q_0"> and <img src="https://latex.codecogs.com/png.latex?u">). The SB constraint <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_0%20=%20%5Cmu"> pins the initial distribution, and <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_0"> enters through this constraint. Matching the terminal tilt requires <img src="https://latex.codecogs.com/png.latex?e%5E%7B-g(X_1)%7D%20%5Cpropto%20%5Cvarphi_1(X_1)">. The SB marginal constraint at <img src="https://latex.codecogs.com/png.latex?t%20=%201"> requires <img src="https://latex.codecogs.com/png.latex?%5Cpi(x)%20=%20p%5E%5Cmathbb%7BP%7D_1(x)%20%5C,%20%5Cwidehat%7B%5Cvarphi%7D_1(x)%20%5C,%20%5Cvarphi_1(x)">, giving <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_1(x)%20=%20%5Cpi(x)/(p%5E%5Cmathbb%7BP%7D_1(x)%20%5C,%20%5Cwidehat%7B%5Cvarphi%7D_1(x))">. Substituting into <img src="https://latex.codecogs.com/png.latex?g%20=%20-%5Clog%20%5Cvarphi_1%20+%20%5Ctext%7Bconst%7D"> identifies the modified terminal cost: <span id="eq-modified-terminal"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctextcolor%7Bblue%7D%7Bg(x)%20=%20%5Clog%20%5Cfrac%7B%5Cwidehat%7B%5Cvarphi%7D_1(x)%7D%7B%5Cpi(x)%7D%7D%20+%20%5Ctext%7Bconst%7D.%0A%5Ctag%7B11%7D"></span> Compared to the original <img src="https://latex.codecogs.com/png.latex?g%20=%20%5Clog(p%5E%5Cmathbb%7BP%7D_1%20/%20%5Cpi)">, the base marginal <img src="https://latex.codecogs.com/png.latex?p%5E%5Cmathbb%7BP%7D_1"> is replaced by <img src="https://latex.codecogs.com/png.latex?%20%5Ctextcolor%7Bblue%7D%7B%5Cwidehat%7B%5Cvarphi%7D_1%7D">: a corrector that accounts for the coupling between <img src="https://latex.codecogs.com/png.latex?X_0"> and <img src="https://latex.codecogs.com/png.latex?X_1">. This is the central insight from <span class="citation" data-cites="liu2025adjoint">(<strong>liu2025adjoint?</strong>)</span>: every SB problem can be recast as an SOC problem with a modified terminal cost that absorbs the prior coupling.</p>
<p>Does this corrector actually remove the bias? Marginalize the SB joint over <img src="https://latex.codecogs.com/png.latex?X_0">: <span id="eq-debias"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0Ap%5E%5Cstar(X_1)%0A&amp;%5Cpropto%20%5Cvarphi_1(X_1)%20%5Cint%20%5Cmathbb%7BP%7D(X_1%20%5Cmid%20X_0)%20%5C,%20%5Cwidehat%7B%5Cvarphi%7D_0(X_0)%20%5C,%20%5Cmu(X_0)%20%5C,%20dX_0%5C%5C%0A&amp;=%20%5Cvarphi_1(X_1)%20%5C,%20%5Cwidehat%7B%5Cvarphi%7D_1(X_1)%20%5C,%20p%5E%5Cmathbb%7BP%7D_1(X_1)%20=%20%5Cpi(X_1).%0A%5Cend%7Baligned%7D%0A%5Ctag%7B12%7D"></span> The second step uses <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1(x)%20%5C,%20p%5E%5Cmathbb%7BP%7D_1(x)%20=%20%5Cint%20%5Cmathbb%7BP%7D_%7B1%7C0%7D(x%20%5Cmid%20y)%20%5C,%20%5Cwidehat%7B%5Cvarphi%7D_0(y)%20%5C,%20%5Cmu(y)%20%5C,%20dy"> (the definition of <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1"> combined with Bayes’ rule), and the last step uses the SB marginal constraint <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_1%20%5C,%20%5Cwidehat%7B%5Cvarphi%7D_1%20%5C,%20p%5E%5Cmathbb%7BP%7D_1%20=%20%5Cpi">. This is a consistency check: IF the SB potentials satisfy the Sinkhorn equations, THEN the terminal marginal is <img src="https://latex.codecogs.com/png.latex?%5Cpi">. The existence of potentials satisfying these constraints follows from the Sinkhorn/IPFP theory in the <a href="../../notes/shrodinger_bridge/shrodinger.html">SB notes</a> (this requires <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BQ%7D%5C%7C%20%5Cmathbb%7BP%7D)%20%3C%20%5Cinfty"> for some <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D"> satisfying the marginal constraints; see the <a href="../../notes/shrodinger_bridge/shrodinger.html">SB notes</a> for conditions). The corrector <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1"> cancels the initial value function bias exactly. Every SB problem decomposes as: a Doob h-transform (the forward potential <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t">, which steers trajectories toward the target) plus a corrector (the backward potential <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t">, which absorbs the prior bias). The adjoint method handles the first piece; we now need a way to learn the second.</p>
</section>
<section id="corrector-matching" class="level3">
<h3 class="anchored" data-anchor-id="corrector-matching">Corrector matching</h3>
<p>The modified AM loss with terminal cost Equation&nbsp;11 needs <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1">, which is unknown. Since <img src="https://latex.codecogs.com/png.latex?b%20=%200">, the lean adjoint is still constant (the same argument from Equation&nbsp;4 applies), and the AM loss becomes <span id="eq-am-corrector"><img src="https://latex.codecogs.com/png.latex?%0AL_%5Ctext%7BAM%7D(u)%20=%20%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20%5Cbig%5C%7Cu_t(X_t)%20+%20%5Csigma_t%20%20%7B%5Cleft(%20%5Cnabla%20E%20+%20%20%5Ctextcolor%7Bblue%7D%7B%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1%7D%20%5Cright)%7D%20(X_1)%5Cbig%5C%7C%5E2%20%5Cright%5D%7D%0A%5Ctag%7B13%7D"></span> where the expectation is over bridge pairs <img src="https://latex.codecogs.com/png.latex?(X_t,%20X_1)">. The corrector score <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1"> adds one extra term alongside the energy gradient <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20E">. When <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cdelta_0">, we have <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_0%20=%20%5Ctext%7Bconst%7D"> (no prior information to propagate), hence <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t%20=%20%5Ctext%7Bconst%7D"> for all <img src="https://latex.codecogs.com/png.latex?t">, and Equation&nbsp;13 reduces to the plain AM loss Equation&nbsp;5.</p>
<p>To derive a learning objective for <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1">, start from the definition <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t(x)%20=%20%5Cmathbb%7BE%7D_%5Cmathbb%7BP%7D%5B%5Cwidehat%7B%5Cvarphi%7D_0(X_0)%20%5Cmid%20X_t%20=%20x%5D">. Converting from a backward conditional to a forward integral via Bayes’ rule (<img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7B0%7Ct%7D(y%7Cx)%20=%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5Cmu(y)%20/%20p_t%5E%5Cmathbb%7BP%7D(x)">): <img src="https://latex.codecogs.com/png.latex?%0A%5Cwidehat%7B%5Cvarphi%7D_t(x)%20=%20%5Cint%20%5Cwidehat%7B%5Cvarphi%7D_0(y)%20%5C,%20%5Cmathbb%7BP%7D_%7B0%7Ct%7D(y%20%7C%20x)%20%5C,%20dy%20=%20%5Cfrac%7B%5Cint%20%5Cwidehat%7B%5Cvarphi%7D_0(y)%20%5C,%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5C,%20%5Cmu(y)%20%5C,%20dy%7D%7Bp_t%5E%5Cmathbb%7BP%7D(x)%7D.%0A"> Define <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7B%5Cvarphi%7D_0(y)%20=%20%5Cwidehat%7B%5Cvarphi%7D_0(y)%20%5Ccdot%20%5Cmu(y)"> to absorb the prior. Then <span id="eq-phi-integral"><img src="https://latex.codecogs.com/png.latex?%0A%5Cwidehat%7B%5Cvarphi%7D_t(x)%20%5C,%20p_t%5E%5Cmathbb%7BP%7D(x)%20=%20%5Cint%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5C,%20%5Ctilde%7B%5Cvarphi%7D_0(y)%20%5C,%20dy.%0A%5Ctag%7B14%7D"></span> Take <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20%5Clog"> of both sides (exchanging <img src="https://latex.codecogs.com/png.latex?%5Cnabla"> and <img src="https://latex.codecogs.com/png.latex?%5Cint">, valid under standard regularity): <img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_t(x)%20+%20%5Cnabla_x%20%5Clog%20p_t%5E%5Cmathbb%7BP%7D(x)%20=%20%5Cfrac%7B%5Cint%20%5Cnabla_x%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5C,%20%5Ctilde%7B%5Cvarphi%7D_0(y)%20%5C,%20dy%7D%7B%5Cwidehat%7B%5Cvarphi%7D_t(x)%20%5C,%20p_t%5E%5Cmathbb%7BP%7D(x)%7D.%0A"> Rewrite the numerator using <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D%20=%20(%5Cnabla_x%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D)%20%5C,%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D">: <span id="eq-log-grad-product"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%5B%5Cwidehat%7B%5Cvarphi%7D_t(x)%20%5C,%20p_t%5E%5Cmathbb%7BP%7D(x)%5D%20=%20%5Cfrac%7B%5Cint%20%5Cnabla_x%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5C,%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5C,%20%5Ctilde%7B%5Cvarphi%7D_0(y)%20%5C,%20dy%7D%7B%5Cwidehat%7B%5Cvarphi%7D_t(x)%20%5C,%20p_t%5E%5Cmathbb%7BP%7D(x)%7D.%0A%5Ctag%7B15%7D"></span> The ratio <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5C,%20%5Ctilde%7B%5Cvarphi%7D_0(y)%20/%20%5B%5Cwidehat%7B%5Cvarphi%7D_t(x)%20%5C,%20p_t%5E%5Cmathbb%7BP%7D(x)%5D"> is a probability distribution over <img src="https://latex.codecogs.com/png.latex?y">, and it is exactly the SB posterior <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_0%20=%20y%20%5Cmid%20X_t%20=%20x)">.</p>
<details>
<summary>
The Bayes’ rule step.
</summary>
<p style="color: blue;">
The SB joint at times <img src="https://latex.codecogs.com/png.latex?0"> and <img src="https://latex.codecogs.com/png.latex?t"> factorizes as <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_0,%20X_t)%20%5Cpropto%20%5Cwidehat%7B%5Cvarphi%7D_0(X_0)%20%5C,%20%5Cmu(X_0)%20%5C,%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(X_t%20%7C%20X_0)%20%5C,%20%5Cvarphi_t(X_t)">. The posterior is <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_0%20=%20y%20%5Cmid%20X_t%20=%20x)%20%5Cpropto%20%5Cwidehat%7B%5Cvarphi%7D_0(y)%20%5C,%20%5Cmu(y)%20%5C,%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%20%7C%20y)%20=%20%5Ctilde%7B%5Cvarphi%7D_0(y)%20%5C,%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)">. Normalizing over <img src="https://latex.codecogs.com/png.latex?y"> gives exactly the denominator <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t(x)%20%5C,%20p_t%5E%5Cmathbb%7BP%7D(x)%20=%20%5Cint%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7Cy)%20%5Ctilde%7B%5Cvarphi%7D_0(y)%20%5C,%20dy"> from Equation&nbsp;14. So the ratio in Equation&nbsp;15 is <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_0%20=%20y%20%5Cmid%20X_t%20=%20x)">, as claimed.
</p>
</details>
<p>Substituting back into Equation&nbsp;15: <span id="eq-cm-tweedie"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%5B%5Cwidehat%7B%5Cvarphi%7D_t(x)%20%5C,%20p_t%5E%5Cmathbb%7BP%7D(x)%5D%20=%20%5Cmathbb%7BE%7D_%7Bp%5E%5Cstar%7D%20%7B%5Cleft%5B%20%5Cnabla_x%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%20%5Cmid%200%7D(x%20%5Cmid%20X_0)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A%5Ctag%7B16%7D"></span> The left side is <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_t%20+%20%5Cnabla%20%5Clog%20p_t%5E%5Cmathbb%7BP%7D">, not just <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_t">. To isolate the corrector score, subtract <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20p_t%5E%5Cmathbb%7BP%7D">: <img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_t(x)%20=%20%5Cmathbb%7BE%7D_%7Bp%5E%5Cstar%7D%20%7B%5Cleft%5B%20%5Cnabla_x%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(x%7CX_0)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20%20-%20%5Cnabla%20%5Clog%20p_t%5E%5Cmathbb%7BP%7D(x).%0A"> At <img src="https://latex.codecogs.com/png.latex?t%20=%201">, the corrector enters the AM loss Equation&nbsp;13 evaluated at <img src="https://latex.codecogs.com/png.latex?X_1">. The base marginal score <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20p_1%5E%5Cmathbb%7BP%7D"> is known in closed form (it is the score of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BN%7D(0,%20%5Cnu_1%20I)">, namely <img src="https://latex.codecogs.com/png.latex?-x/%5Cnu_1">). So the corrector score at <img src="https://latex.codecogs.com/png.latex?t=1"> decomposes into a conditional expectation (which we learn by regression) minus a known Gaussian score (which we subtract analytically). Equation&nbsp;16 is a <a href="../../notes/reverse_and_tweedie/reverse_and_tweedie.html">Tweedie-type formula</a>: the score of the product <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_t%20%5Ccdot%20p_t%5E%5Cmathbb%7BP%7D"> at <img src="https://latex.codecogs.com/png.latex?(t,x)"> is the conditional expectation of the transition score <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%20%5Cmid%200%7D(x%20%5Cmid%20X_0)"> given <img src="https://latex.codecogs.com/png.latex?X_t%20=%20x">. The structure is identical to the denoising score matching identity: the score of a mixture equals the expected score of the component, averaged over the posterior on the component index.</p>
<p>Since any conditional expectation minimizes a least-squares loss, Equation&nbsp;16 at <img src="https://latex.codecogs.com/png.latex?t%20=%201"> gives: <span id="eq-cm"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20%5Clog%5B%5Cwidehat%7B%5Cvarphi%7D_1%20%5Ccdot%20p_1%5E%5Cmathbb%7BP%7D%5D%20=%20%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_h%20%5C;%20%5Cmathbb%7BE%7D_%7B(X_0,%20X_1)%20%5Csim%20p%5E%5Cstar_%7B0,1%7D%7D%20%20%7B%5Cleft%5B%20%5Cbig%5C%7Ch(X_1)%20-%20%5Cnabla_%7BX_1%7D%20%5Clog%20%5Cmathbb%7BP%7D(X_1%20%5Cmid%20X_0)%5Cbig%5C%7C%5E2%20%5Cright%5D%7D%20.%0A%5Ctag%7B17%7D"></span> This is the <strong>corrector matching</strong> (CM) loss: regress <img src="https://latex.codecogs.com/png.latex?h"> onto the base transition score at endpoint pairs. In practice, the expectation is over the current model’s endpoint pairs <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_1)%20%5Csim%20p%5E%7Bu%5E%7B(k)%7D%7D_%7B0,1%7D">, not the unknown SB joint <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar_%7B0,1%7D">. Each CM step finds the best approximation to <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%5B%5Cwidehat%7B%5Cvarphi%7D_1%20%5Ccdot%20p_1%5E%7B%5Cmathbb%7BP%7D%7D%5D"> at the current iterate; alternation converges by the IPFP contraction argument. For the Brownian base, <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(X_1%20%5Cmid%20X_0)%20=%20%5Cmathcal%7BN%7D(X_0,%20(%5Cnu_1%20-%20%5Cnu_0)I)">, and the transition score is just <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%7BX_1%7D%20%5Clog%20%5Cmathbb%7BP%7D(X_1%20%5Cmid%20X_0)%20=%20-(X_1%20-%20X_0)/(%5Cnu_1%20-%20%5Cnu_0)">, known in closed form. The regression target is a Gaussian score evaluated at the endpoints; no energy evaluation needed. The minimizer of Equation&nbsp;17 gives <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%5B%5Cwidehat%7B%5Cvarphi%7D_1%20%5Ccdot%20p_1%5E%5Cmathbb%7BP%7D%5D">; to recover <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1"> we subtract the known base score <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20p_1%5E%5Cmathbb%7BP%7D(x)%20=%20-x/%5Cnu_1">.</p>
<p>Note the parallel with the AM loss. Both are mean-squared-error regressions. AM regresses the control <img src="https://latex.codecogs.com/png.latex?u"> onto the energy gradient <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g"> at pairs <img src="https://latex.codecogs.com/png.latex?(X_t,%20X_1)"> from the bridge. CM regresses the corrector <img src="https://latex.codecogs.com/png.latex?h"> onto the transition score at endpoint pairs <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_1)"> from the current process. Both are self-consistent: the expectation is over the model’s own samples. Both have a conditional expectation as their unique fixed point.</p>
<p>The CM loss Equation&nbsp;17 should not be confused with the bridge matching objectives in data-driven SB methods like <span class="citation" data-cites="de2021diffusion">(<strong>de2021diffusion?</strong>)</span>, where <img src="https://latex.codecogs.com/png.latex?X_1"> must be drawn from the target <img src="https://latex.codecogs.com/png.latex?%5Cpi">. Here, both AM and CM use only on-policy samples from the current control <img src="https://latex.codecogs.com/png.latex?u">. This is what makes the approach scalable: no target samples are needed.</p>
</section>
<section id="alternating-am-cm-ipfp" class="level3">
<h3 class="anchored" data-anchor-id="alternating-am-cm-ipfp">Alternating AM + CM = IPFP</h3>
<p>The AM loss Equation&nbsp;13 needs <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1">. The CM loss Equation&nbsp;17 needs samples from <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar">. Neither can be solved alone. The fix: alternate.</p>
<ol type="1">
<li><strong>AM step:</strong> Solve Equation&nbsp;13 with <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1%20%5Capprox%20h%5E%7B(k-1)%7D"> to get <img src="https://latex.codecogs.com/png.latex?u%5E%7B(k)%7D">.</li>
<li><strong>CM step:</strong> Solve Equation&nbsp;17 with endpoint pairs from <img src="https://latex.codecogs.com/png.latex?u%5E%7B(k)%7D"> to get <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Bh%7D%5E%7B(k)%7D%20%5Capprox%20%5Cnabla%20%5Clog%5B%5Cwidehat%7B%5Cvarphi%7D_1%20%5Ccdot%20p_1%5E%5Cmathbb%7BP%7D%5D">, then set <img src="https://latex.codecogs.com/png.latex?h%5E%7B(k)%7D%20=%20%5Ctilde%7Bh%7D%5E%7B(k)%7D%20-%20%5Cnabla%20%5Clog%20p_1%5E%5Cmathbb%7BP%7D"> (subtracting the known base score).</li>
</ol>
<p>Initialize with <img src="https://latex.codecogs.com/png.latex?h%5E%7B(0)%7D%20=%200">. The first AM stage uses terminal cost <img src="https://latex.codecogs.com/png.latex?g(x)%20=%20E(x)%20+%20%5Ctext%7Bconst%7D"> (since <img src="https://latex.codecogs.com/png.latex?%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1%20%5Capprox%200">) and regresses the control onto <img src="https://latex.codecogs.com/png.latex?-%5Csigma_t%20%5Cnabla%20E(X_1)">: pure energy-guided transport with no corrector. This recovers exactly the Adjoint Sampling algorithm, which is the right starting point when no better guess for the corrector is available. The first CM stage then learns <img src="https://latex.codecogs.com/png.latex?h%5E%7B(1)%7D%20%5Capprox%20%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1"> from the endpoint pairs produced by <img src="https://latex.codecogs.com/png.latex?u%5E%7B(1)%7D">. Subsequent stages progressively refine both the control and the corrector.</p>
<p>The alternation has a variational interpretation. The AM step solves a forward half-bridge: <img src="https://latex.codecogs.com/png.latex?%5Cmin_%7B%5Cmathbb%7BQ%7D:%20%5Cmathbb%7BQ%7D_0%20=%20%5Cmu%7D%20D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BQ%7D%5C%7C%20%5Cmathbb%7BQ%7D%5E%7B%5Ctext%7Bbwd%7D%7D)">, where <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D%5E%7B%5Ctext%7Bbwd%7D%7D"> is the backward SDE determined by the previous corrector <img src="https://latex.codecogs.com/png.latex?h%5E%7B(k-1)%7D">. The CM step solves a backward half-bridge: <img src="https://latex.codecogs.com/png.latex?%5Cmin_%7B%5Cmathbb%7BQ%7D:%20%5Cmathbb%7BQ%7D_1%20=%20%5Cpi%7D%20D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5E%7Bu%5E%7B(k)%7D%7D%20%5C%7C%20%5Cmathbb%7BQ%7D)">, updating the corrector to absorb whatever bias remains. Alternating between forward and backward half-bridge projections is exactly <a href="../../notes/shrodinger_bridge/shrodinger.html">IPFP/Sinkhorn</a> on path-space <span class="citation" data-cites="de2021diffusion">(<strong>de2021diffusion?</strong>)</span>.</p>
<p>Recall from the <a href="../../notes/shrodinger_bridge/shrodinger.html">SB notes</a> that the static Sinkhorn algorithm alternates between projecting the coupling onto the set <img src="https://latex.codecogs.com/png.latex?%5C%7B%5Cgamma%20:%20%5Cgamma_0%20=%20%5Cnu_0%5C%7D"> and the set <img src="https://latex.codecogs.com/png.latex?%5C%7B%5Cgamma%20:%20%5Cgamma_1%20=%20%5Cnu_1%5C%7D">. Here, we do the same thing on path-space: the forward half-bridge imposes <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_0%20=%20%5Cmu"> but lets <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_1"> float; the backward half-bridge imposes <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_1%20=%20%5Cpi"> but lets <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D_0"> float. Each projection is itself a KL minimization over a convex constraint set, so each step reduces the KL to the SB solution. Convergence to <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D%5E%5Cstar"> follows from standard IPFP contraction <span class="citation" data-cites="de2021diffusion">(<strong>de2021diffusion?</strong>)</span>, provided each inner optimization is solved exactly (which never holds in practice with finite gradient steps; the practical version uses a few optimization steps per stage). In practice, 3-5 outer stages suffice; each stage consists of many AM or CM gradient steps.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 16%">
<col style="width: 14%">
<col style="width: 45%">
<col style="width: 22%">
</colgroup>
<thead>
<tr class="header">
<th>Method</th>
<th>Prior</th>
<th>Terminal cost <img src="https://latex.codecogs.com/png.latex?g(x)"></th>
<th>Corrector</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Adjoint Sampling <span class="citation" data-cites="havens2025adjoint">(<strong>havens2025adjoint?</strong>)</span></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cdelta_0"> (memoryless)</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Clog%20%5Cfrac%7Bp%5E%5Cmathbb%7BP%7D_1(x)%7D%7B%5Cpi(x)%7D"></td>
<td>None (<img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_1%20=%20%5Ctext%7Bconst%7D">)</td>
</tr>
<tr class="even">
<td>ASBS <span class="citation" data-cites="liu2025adjoint">(<strong>liu2025adjoint?</strong>)</span></td>
<td>Arbitrary <img src="https://latex.codecogs.com/png.latex?%5Cmu"></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Clog%20%5Cfrac%7B%5Cwidehat%7B%5Cvarphi%7D_1(x)%7D%7B%5Cpi(x)%7D"></td>
<td>Learned <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cwidehat%7B%5Cvarphi%7D_1"></td>
</tr>
</tbody>
</table>
<p>ASBS reduces to Adjoint Sampling when <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cdelta_0">: the corrector becomes constant and the CM step is trivially solved. A concrete example of a useful non-Dirac prior: for molecular conformer generation, one can use a harmonic oscillator prior <img src="https://latex.codecogs.com/png.latex?%5Cmu(x)%20%5Cpropto%20%5Cexp(-%5Cfrac%7B%5Calpha%7D%7B2%7D%20%5Csum_%7Bi%20%3C%20j%7D%20%5C%7Cx_i%20-%20x_j%20-%20r%5E0_%7Bij%7D%5C%7C%5E2)"> where <img src="https://latex.codecogs.com/png.latex?r%5E0_%7Bij%7D"> are equilibrium bond lengths read from the molecular graph. Particles start in a physically reasonable arrangement rather than at the origin, reducing the transport cost substantially.</p>
<p>Every piece was already in the earlier notes. The <a href="../../notes/adjoint_method/adjoint.html">adjoint method</a> gives the regression target (<img src="https://latex.codecogs.com/png.latex?%5Cnabla%20g"> is constant along trajectories when <img src="https://latex.codecogs.com/png.latex?b%20=%200">). The <a href="../../notes/doob_transforms/doob.html">Brownian bridge</a> gives cheap training pairs (Gaussian conditioning, one draw per sample). The <a href="../../notes/shrodinger_bridge/shrodinger.html">Schrodinger bridge</a> gives the corrector (endpoint potentials that debias the prior). Adjoint sampling <span class="citation" data-cites="havens2025adjoint">(<strong>havens2025adjoint?</strong>)</span> assembles the first two; ASBS <span class="citation" data-cites="liu2025adjoint">(<strong>liu2025adjoint?</strong>)</span> adds the third. The reader who has followed the series could have assembled this themselves.</p>
<p>The overall picture: sampling from an unnormalized Boltzmann distribution <img src="https://latex.codecogs.com/png.latex?%5Cpi%20%5Cpropto%20e%5E%7B-E%7D"> reduces to solving a stochastic optimal control problem, which reduces to a sequence of mean-squared-error regressions on cheap Gaussian training pairs. The only expensive operation (energy evaluation at terminal samples) is amortized over many gradient updates. With a Dirac prior, a single matching objective suffices. With a non-trivial prior, two alternating objectives (AM + CM) converge to the Schrodinger bridge via IPFP.</p>
<p>The ideas generalize beyond the <img src="https://latex.codecogs.com/png.latex?b%20=%200"> setting, though the simplifications are less dramatic. With a non-zero base drift (e.g.&nbsp;a pre-trained diffusion model as in the <a href="../../notes/adjoint_samplers_draft/adjoint_matching.html">adjoint matching</a> note), the lean adjoint ODE is no longer trivially constant; it must be solved backward along each trajectory. The reciprocal projection still applies in principle, but the bridge distribution <img src="https://latex.codecogs.com/png.latex?p%5E%5Ctext%7Bbase%7D_%7Bt%20%5Cmid%201%7D"> is no longer a simple Gaussian, and must be approximated (e.g.&nbsp;by linearizing the base drift). The <img src="https://latex.codecogs.com/png.latex?b%20=%200"> case is the sweet spot: everything is closed-form, the adjoint is constant, the bridge is Gaussian, and the only approximation is the neural network parameterization of <img src="https://latex.codecogs.com/png.latex?u">.</p>
<p>A note on related methods. The RAM loss Equation&nbsp;9 is closely related to the training objectives in PDDS <span class="citation" data-cites="phillips2024particle">(<strong>phillips2024particle?</strong>)</span> and Target Score Matching <span class="citation" data-cites="de2024target">(<strong>de2024target?</strong>)</span>, where the same squared-error expression appears inside the expectation. The difference is in what the expectation is taken over: PDDS and TSM sample <img src="https://latex.codecogs.com/png.latex?X_1"> from the target distribution <img src="https://latex.codecogs.com/png.latex?%5Cpi"> (requiring importance sampling or SMC), while Adjoint Sampling samples <img src="https://latex.codecogs.com/png.latex?X_1"> from the current model <img src="https://latex.codecogs.com/png.latex?p%5E%7B%5Cbar%7Bu%7D%7D_1">. This makes the loss a moving target, which is harder to analyze but far more practical: no target samples needed, no importance weights, no resampling.</p>
<!-- BibTeX entries to add to ref.bib:
@article{havens2025adjoint,
  title={Adjoint Sampling: Highly Scalable Diffusion Samplers via Adjoint Matching},
  author={Havens, Aaron and Huang, Benjamin and Urain, Julen and Amos, Brandon and Sener, Ozan and Domingo-Enrich, Carles and Peters, Jan and Shalit, Uri and Rish, Irina},
  journal={ICML 2025},
  year={2025},
  url={https://arxiv.org/abs/2504.11713}
}
@article{domingoenrich2024adjoint,
  title={Adjoint Matching: Fine-Tuning Flow and Diffusion Generative Models with Memoryless Stochastic Optimal Control},
  author={Domingo-Enrich, Carles and Drozdzal, Michal and Liao, Ricky T. Q. and Chen, Ricky T. Q.},
  journal={arXiv preprint arXiv:2409.15861},
  year={2024},
  url={https://arxiv.org/abs/2409.15861}
}
@article{phillips2024particle,
  title={Particle Denoising Diffusion Sampler},
  author={Phillips, Angus and Wildberger, Jonas and Rector-Brooks, Jarrid and Bengio, Yoshua},
  journal={ICML 2024},
  year={2024},
  url={https://arxiv.org/abs/2402.06320}
}
@article{de2024target,
  title={Target Score Matching},
  author={De Bortoli, Valentin and Thornton, James and Heng, Jeremy and Doucet, Arnaud},
  year={2024},
  url={https://arxiv.org/abs/2402.08667}
}
@article{liu2025adjoint,
  title={Adjoint {S}chr{\"o}dinger Bridge Sampler},
  author={Liu, Guan-Horng and Chen, Tianrong and Lipman, Yaron and Albergo, Michael S. and Vanden-Eijnden, Eric},
  year={2025},
  url={https://arxiv.org/abs/2503.02874}
}
@article{de2021diffusion,
  title={Diffusion {S}chr{\"o}dinger bridge with applications to score-based generative modeling},
  author={De Bortoli, Valentin and Thornton, James and Heng, Jeremy and Doucet, Arnaud},
  journal={NeurIPS},
  year={2021},
  url={https://arxiv.org/abs/2106.01357}
}
-->


</section>

 ]]></description>
  <category>SDE</category>
  <category>markov</category>
  <category>sampling</category>
  <category>Schrodinger bridge</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/adjoint_sampling.html</guid>
  <pubDate>Sat, 21 Mar 2026 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Bridge Matching Sampler</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/BMS.html</link>
  <description><![CDATA[ 





<!-- TODO: Add historical figure portrait here. Suggested: [Edward Nelson](https://en.wikipedia.org/wiki/Edward_Nelson) (1932-2014). Use format:
::: {style="text-align:center;"}
![[Edward Nelson](https://en.wikipedia.org/wiki/Edward_Nelson) (1932 - 2014)](./nelson.jpg){fig-align="center" width=35%}
:::
-->
<p>Consider a controlled SDE on <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D"> with scalar noise schedule <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%3E%200">,</p>
<p><span id="eq-controlled-sde"><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20=%20%5Csigma_t%20%5C,%20u(X_t,%20t)%20%5C,%20dt%20+%20%5Csigma_t%20%5C,%20dW_t,%20%5Cquad%20X_0%20%5Csim%20p_0.%0A%5Ctag%7B1%7D"></span></p>
<p>The goal: find <img src="https://latex.codecogs.com/png.latex?u"> such that <img src="https://latex.codecogs.com/png.latex?X_T%20%5Csim%20%5Cpi">, where <img src="https://latex.codecogs.com/png.latex?%5Cpi(x)%20=%20%5Crho(x)/%5Cmathcal%7BZ%7D"> is a target density known up to normalization. <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">Adjoint sampling</a> solves this with a Dirac prior and memoryless condition; adding a corrector for arbitrary priors requires alternating optimization. The <em>Bridge Matching Sampler</em> (BMS) identifies a single coupling, the <em>independent coupling</em>, that makes the regression target fully tractable and removes the need for alternation.</p>
<section id="nelsons-relation" class="level3">
<h3 class="anchored" data-anchor-id="nelsons-relation">Nelson’s relation</h3>
<p>Let <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5Eu"> denote the path measure of Equation&nbsp;1 with time marginals <img src="https://latex.codecogs.com/png.latex?p_t">. Write the Euler discretization with step <img src="https://latex.codecogs.com/png.latex?%5Cdelta">:</p>
<p><span id="eq-euler-fwd"><img src="https://latex.codecogs.com/png.latex?%0AX_%7Bt+%5Cdelta%7D%20=%20X_t%20+%20%5Csigma_t%20%5C,%20u(X_t,t)%20%5C,%20%5Cdelta%20+%20%5Csigma_t%20%5Csqrt%7B%5Cdelta%7D%20%5C,%20%5Cmathbf%7Bn%7D,%20%5Cqquad%20%5Cmathbf%7Bn%7D%5Csim%20%5Cmathcal%7BN%7D(0,I).%0A%5Ctag%7B2%7D"></span></p>
<p>The forward conditional mean is <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BX_%7Bt+%5Cdelta%7D%20%5Cmid%20X_t%20=%20x%5D%20=%20x%20+%20%5Csigma_t%20%5C,%20u(x,t)%20%5C,%20%5Cdelta">. Now compute the backward conditional mean <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BX_t%20%5Cmid%20X_%7Bt+%5Cdelta%7D%20=%20y%5D"> using Bayes’ rule, exactly as in the <a href="../../notes/reverse_and_tweedie/reverse_and_tweedie.html">reverse diffusions</a> note. For <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20%5Cll%201">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BP%7D(X_t%20%5Cin%20dx%20%5Cmid%20X_%7Bt+%5Cdelta%7D%20=%20y)%20%5C;%5Cpropto%5C;%20p_t(x)%20%5C,%20%5Cexp%20%7B%5Cleft%5C%7B%20-%5Cfrac%7B%5C%7Cy%20-%20x%20-%20%5Csigma_t%20%5C,%20u(x,t)%20%5C,%20%5Cdelta%5C%7C%5E2%7D%7B2%20%5Csigma_t%5E2%20%5C,%20%5Cdelta%7D%20%5Cright%5C%7D%7D%20.%0A"></p>
<p>Expanding <img src="https://latex.codecogs.com/png.latex?p_t(x)%20%5Capprox%20p_t(y)%20%5Cexp(%5Cleft%3C%20%5Cnabla%20%5Clog%20p_t(y),%20x%20-%20y%20%5Cright%3E)"> and completing the square, the conditional mean is</p>
<p><span id="eq-backward-mean"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D%5BX_t%20%5Cmid%20X_%7Bt+%5Cdelta%7D%20=%20y%5D%20=%20y%20-%20%5Csigma_t%20%5C,%20u(y,t)%20%5C,%20%5Cdelta%20+%20%5Csigma_t%5E2%20%5C,%20%5Cnabla%20%5Clog%20p_t(y)%20%5C,%20%5Cdelta%20+%20O(%5Cdelta%5E2).%0A%5Ctag%7B3%7D"></span></p>
<p>(The second-order correction to <img src="https://latex.codecogs.com/png.latex?%5Clog%20p_t"> affects the conditional variance at <img src="https://latex.codecogs.com/png.latex?O(%5Cdelta)"> but not the conditional mean, which is all we need.)</p>
<details>
<summary>
Completing the square:
</summary>
<p style="color: blue;">
</p><p>Drop multiplicative constants independent of <img src="https://latex.codecogs.com/png.latex?x">. The exponent in the posterior is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%3C%20%5Cnabla%20%5Clog%20p_t(y),%20x%20-%20y%20%5Cright%3E%20-%20%5Cfrac%7B%5C%7Cy%20-%20x%20-%20%5Csigma_t%20u%20%5Cdelta%5C%7C%5E2%7D%7B2%5Csigma_t%5E2%20%5Cdelta%7D.%0A"></p>
Write <img src="https://latex.codecogs.com/png.latex?z%20=%20x%20-%20y">. The quadratic piece is <img src="https://latex.codecogs.com/png.latex?-%5C%7Cz%20+%20%5Csigma_t%20u%20%5Cdelta%5C%7C%5E2/(2%5Csigma_t%5E2%5Cdelta)">, with mean at <img src="https://latex.codecogs.com/png.latex?z%20=%20-%5Csigma_t%20u%20%5Cdelta">. The linear piece <img src="https://latex.codecogs.com/png.latex?%5Cleft%3C%20%5Cnabla%20%5Clog%20p_t(y),%20z%20%5Cright%3E"> shifts the Gaussian mean by <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%5E2%20%5Cdelta%20%5C,%20%5Cnabla%20%5Clog%20p_t(y)"> (the standard “linear tilt of a Gaussian” identity: if <img src="https://latex.codecogs.com/png.latex?f(z)%20%5Cpropto%20%5Cexp(-%5C%7Cz%20-%20m%5C%7C%5E2/(2s%5E2)%20+%20%5Cleft%3C%20a,z%20%5Cright%3E)">, then the mean shifts from <img src="https://latex.codecogs.com/png.latex?m"> to <img src="https://latex.codecogs.com/png.latex?m%20+%20s%5E2%20a">, with <img src="https://latex.codecogs.com/png.latex?s%5E2%20=%20%5Csigma_t%5E2%5Cdelta"> and <img src="https://latex.codecogs.com/png.latex?a%20=%20%5Cnabla%20%5Clog%20p_t(y)">). So <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5Bz%5D%20=%20-%5Csigma_t%20u%20%5Cdelta%20+%20%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20p_t(y)%5Cdelta%20+%20O(%5Cdelta%5E2)">, giving <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BX_t%20%5Cmid%20X_%7Bt+%5Cdelta%7D%20=%20y%5D%20=%20y%20-%20%5Csigma_t%20u%20%5Cdelta%20+%20%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20p_t(y)%5Cdelta">.
<p></p>
</details>
<p>From the <a href="../../notes/reverse_and_tweedie/reverse_and_tweedie.html">reverse diffusions</a> note, the time-reversed process <img src="https://latex.codecogs.com/png.latex?%5Coverleftarrow%7BX%7D_s%20=%20X_%7BT-s%7D"> satisfies</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ad%5Coverleftarrow%7BX%7D_s%20=%20%20%7B%5Cleft%5B%20-%5Csigma_%7BT-s%7D%20%5C,%20u(%5Coverleftarrow%7BX%7D_s,%20T-s)%20+%20%5Csigma_%7BT-s%7D%5E2%20%5C,%20%5Cnabla%20%5Clog%20p_%7BT-s%7D(%5Coverleftarrow%7BX%7D_s)%20%5Cright%5D%7D%20%20ds%20+%20%5Csigma_%7BT-s%7D%20%5C,%20d%5Coverleftarrow%7BB%7D_s.%0A"></p>
<p>The reversed drift is <img src="https://latex.codecogs.com/png.latex?-%5Csigma_t%20u%20+%20%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20p_t">. Define <img src="https://latex.codecogs.com/png.latex?v"> by writing this reversed drift as <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20v">, so that the reversed SDE takes the form <img src="https://latex.codecogs.com/png.latex?d%5Coverleftarrow%7BX%7D_s%20=%20%5Csigma_%7BT-s%7D%20v(%5Coverleftarrow%7BX%7D_s,%20T-s)%20ds%20+%20%5Csigma_%7BT-s%7D%20d%5Coverleftarrow%7BB%7D_s">. Then <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20v%20=%20-%5Csigma_t%20u%20+%20%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20p_t">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?v%20=%20-u%20+%20%5Csigma_t%20%5Cnabla%20%5Clog%20p_t">. Rearranging:</p>
<p>This is <strong>Nelson’s relation</strong>:</p>
<p><span id="eq-nelson"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctextcolor%7Bblue%7D%7Bu(x,t)%20+%20v(x,t)%20=%20%5Csigma_t%20%5C,%20%5Cnabla%20%5Clog%20p_t(x).%7D%0A%5Ctag%7B4%7D"></span></p>
<p>As a sanity check, Equation&nbsp;3 confirms this: the backward conditional mean <img src="https://latex.codecogs.com/png.latex?y%20-%20%5Csigma_t%20u%20%5Cdelta%20+%20%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20p_t%20%5Cdelta"> identifies the reversed drift as <img src="https://latex.codecogs.com/png.latex?-%5Csigma_t%20u%20+%20%5Csigma_t%5E2%20%5Cnabla%20%5Clog%20p_t%20=%20%5Csigma_t%20v">, consistent with the time-reversal formula.</p>
<p>This holds for any Markov diffusion of the form Equation&nbsp;1 with scalar noise schedule <img src="https://latex.codecogs.com/png.latex?%5Csigma_t"> and marginals <img src="https://latex.codecogs.com/png.latex?p_t">.</p>
</section>
<section id="reciprocal-class-and-markovian-projection" class="level3">
<h3 class="anchored" data-anchor-id="reciprocal-class-and-markovian-projection">Reciprocal class and Markovian projection</h3>
<p>Let <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D"> denote the reference (uncontrolled) process <img src="https://latex.codecogs.com/png.latex?dX_t%20=%20%5Csigma_t%20%5C,%20dW_t">. Write <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7B%7C0,T%7D(%5Ccdot%20%7C%20x_0,%20x_T)"> for the law of the reference process conditioned on <img src="https://latex.codecogs.com/png.latex?X_0%20=%20x_0,%20X_T%20=%20x_T">. A path measure <img src="https://latex.codecogs.com/png.latex?%5CPi"> belongs to the <em>reciprocal class</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BR%7D(%5Cmathbb%7BP%7D)"> if it has the form <img src="https://latex.codecogs.com/png.latex?%5CPi%20=%20%5CPi_%7B0,T%7D%20%5C,%20%5Cmathbb%7BP%7D_%7B%7C0,T%7D">, where <img src="https://latex.codecogs.com/png.latex?%5CPi_%7B0,T%7D"> is an endpoint coupling and <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7B%7C0,T%7D"> is the reference bridge (Brownian bridge for Brownian <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D">); see the <a href="../../notes/shrodinger_bridge/shrodinger.html">Schrodinger bridges</a> note.</p>
<p>A reciprocal measure is generally non-Markovian: the bridge drift depends on <img src="https://latex.codecogs.com/png.latex?X_T">. The <em>Markovian projection</em> finds a Markovian drift <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> whose time marginals match those of <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar"> (see <span class="citation" data-cites="Brunick2013">(Brunick and Shreve 2013)</span> for existence/uniqueness). (Existence and uniqueness of the Markovian projection requires the path-dependent drift to satisfy a linear growth condition; see Brunick and Shreve (2013).) This is an <img src="https://latex.codecogs.com/png.latex?L%5E2"> projection: if <img src="https://latex.codecogs.com/png.latex?%5Cxi(X,t)"> is the path-dependent drift of <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar">, then</p>
<p><span id="eq-markov-proj"><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar(x,t)%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%20%7B%5Cleft%5B%20%5Cxi(X,t)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A%5Ctag%7B5%7D"></span></p>
<p>Why? For any Markovian <img src="https://latex.codecogs.com/png.latex?u">, expand <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%5B%5C%7C%5Cxi%20-%20u(X_t,t)%5C%7C%5E2%5D"> and use the tower property:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%20%7B%5Cleft%5B%20%5C%7C%5Cxi%20-%20u%5C%7C%5E2%20%5Cright%5D%7D%20%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%20%7B%5Cleft%5B%20%5C%7C%5Cxi%20-%20u%5E%5Cstar%5C%7C%5E2%20%5Cright%5D%7D%20%20+%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%20%7B%5Cleft%5B%20%5C%7Cu%5E%5Cstar%20-%20u%5C%7C%5E2%20%5Cright%5D%7D%20.%0A"></p>
<p>The cross-term vanishes because <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%5B%5Cxi%20-%20u%5E%5Cstar%20%5Cmid%20X_t%5D%20=%200"> by definition of <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar">. So <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> minimizes the matching loss</p>
<p><span id="eq-matching-loss"><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar%20=%20%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7Bu%7D%20%5C;%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%20%20%7B%5Cleft%5B%20%5Cint_0%5ET%20%5Cfrac%7B1%7D%7B2%7D%20%5C%7C%20%5Cxi(X,t)%20-%20u(X_t,t)%20%5C%7C%5E2%20%5C,%20dt%20%5Cright%5D%7D%20.%0A%5Ctag%7B6%7D"></span></p>
</section>
<section id="fixed-point-iteration" class="level3">
<h3 class="anchored" data-anchor-id="fixed-point-iteration">Fixed-point iteration</h3>
<p>All three methods (adjoint sampling with Dirac prior, adjoint sampling with corrector, BMS) follow the same template. Starting from some control <img src="https://latex.codecogs.com/png.latex?u_0">:</p>
<ol type="1">
<li><strong>Simulate</strong> the current SDE <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu_i%7D"> to generate endpoint pairs <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_T)">.</li>
<li><strong>Reciprocal projection</strong>: form a coupling <img src="https://latex.codecogs.com/png.latex?%5CPi%5Ei_%7B0,T%7D"> from the endpoints, define <img src="https://latex.codecogs.com/png.latex?%5CPi%5Ei%20=%20%5CPi%5Ei_%7B0,T%7D%20%5C,%20%5Cmathbb%7BP%7D_%7B%7C0,T%7D">.</li>
<li><strong>Markovianize</strong>: update <img src="https://latex.codecogs.com/png.latex?u_%7Bi+1%7D"> by regressing onto the bridge drift via Equation&nbsp;6.</li>
</ol>
<p>If <img src="https://latex.codecogs.com/png.latex?u_i%20=%20u%5E%5Cstar">, then <img src="https://latex.codecogs.com/png.latex?%5CPi%5Ei%20=%20%5CPi%5E%5Cstar"> and <img src="https://latex.codecogs.com/png.latex?u_%7Bi+1%7D%20=%20u%5E%5Cstar">, so <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> is a fixed point. Convergence of this iteration is not guaranteed in general; the BMS paper treats it as empirically effective. What distinguishes the methods is the coupling in step 2, which determines the regression target <img src="https://latex.codecogs.com/png.latex?%5Cxi">.</p>
</section>
<section id="target-score-identity" class="level3">
<h3 class="anchored" data-anchor-id="target-score-identity">Target score identity</h3>
<p>To get a tractable <img src="https://latex.codecogs.com/png.latex?%5Cxi">, we need the score <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5CPi%5E%5Cstar_t(x)">. Define the cumulative variance <img src="https://latex.codecogs.com/png.latex?%5Cnu_t%20=%20%5Cint_0%5Et%20%5Csigma_s%5E2%20%5C,%20ds"> and <img src="https://latex.codecogs.com/png.latex?%5Cgamma_t%20=%20%5Cnu_t/%5Cnu_T">. The bridge <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7B%7C0,T%7D"> is Gaussian: for <img src="https://latex.codecogs.com/png.latex?t%20%5Cin%20(0,T)">,</p>
<p><span id="eq-bridge-marginal"><img src="https://latex.codecogs.com/png.latex?%0AX_t%20%5Cmid%20(X_0,%20X_T)%20%5C;%5Csim%5C;%20%5Cmathcal%7BN%7D%20%7B%5Cleft(%20(1-%5Cgamma_t)%20X_0%20+%20%5Cgamma_t%20X_T,%20%5C;%5C;%20%5Cnu_T%20%5Cgamma_t(1-%5Cgamma_t)%20%5C,%20I%20%5Cright)%7D%20.%0A%5Ctag%7B7%7D"></span></p>
<p>The marginal density of <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar"> at time <img src="https://latex.codecogs.com/png.latex?t"> is</p>
<p><span id="eq-marginal-density"><img src="https://latex.codecogs.com/png.latex?%0A%5CPi%5E%5Cstar_t(x)%20=%20%5Cint%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D(x%20%5Cmid%20x_0,%20x_T)%20%5C,%20%5CPi%5E%5Cstar_%7B0,T%7D(x_0,%20x_T)%20%5C,%20dx_0%20%5C,%20dx_T.%0A%5Ctag%7B8%7D"></span></p>
<p>Differentiate <img src="https://latex.codecogs.com/png.latex?%5Clog%20%5CPi%5E%5Cstar_t(x)">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%20%5CPi%5E%5Cstar_t(x)%20=%20%5Cfrac%7B%5Cint%20%5Cnabla_x%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D(x%20%5Cmid%20x_0,%20x_T)%20%5C,%20%5CPi%5E%5Cstar_%7B0,T%7D(x_0,%20x_T)%20%5C,%20dx_0%20%5C,%20dx_T%7D%7B%5CPi%5E%5Cstar_t(x)%7D.%0A"></p>
<p>Since <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D"> is Gaussian with mean <img src="https://latex.codecogs.com/png.latex?(1-%5Cgamma_t)x_0%20+%20%5Cgamma_t%20%5C,%20x_T">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D(x%20%5Cmid%20x_0,%20x_T)%20=%20-%5Cfrac%7Bx%20-%20(1-%5Cgamma_t)x_0%20-%20%5Cgamma_t%20%5C,%20x_T%7D%7B%5Cnu_T%5Cgamma_t(1-%5Cgamma_t)%7D.%0A"></p>
<details>
<summary>
Integration by parts to swap gradients:
</summary>
<p style="color: blue;">
</p><p>The identity <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D%20=%20-%5Cfrac%7B1%7D%7B1-%5Cgamma_t%7D%20%5Cnabla_%7Bx_0%7D%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D"> relies on the Gaussian bridge having a mean that is affine in <img src="https://latex.codecogs.com/png.latex?(x_0,%20x_T)"> with endpoint-independent variance. Shifting <img src="https://latex.codecogs.com/png.latex?x"> by <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> is equivalent to shifting <img src="https://latex.codecogs.com/png.latex?x_0"> by <img src="https://latex.codecogs.com/png.latex?-%5Cvarepsilon/(1-%5Cgamma_t)">, which holds because the mean is <img src="https://latex.codecogs.com/png.latex?(1-%5Cgamma_t)x_0%20+%20%5Cgamma_t%20x_T">. Beyond Gaussian references, the TSI still holds conceptually but the gradient swap takes a different form.</p>
<p>Integrate by parts in <img src="https://latex.codecogs.com/png.latex?x_0">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%20%5CPi%5E%5Cstar_t(x)%20=%20%5Cfrac%7B1%7D%7B1-%5Cgamma_t%7D%20%5Cfrac%7B%5Cint%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D(x%20%5Cmid%20x_0,%20x_T)%20%5C,%20%5Cnabla_%7Bx_0%7D%20%5CPi%5E%5Cstar_%7B0,T%7D(x_0,%20x_T)%20%5C,%20dx_0%20%5C,%20dx_T%7D%7B%5CPi%5E%5Cstar_t(x)%7D,%0A"></p>
<p>where we moved <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%7Bx_0%7D"> from <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D"> onto <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_%7B0,T%7D"> (boundary terms vanish by decay of <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_%7B0,T%7D%20%5Ccdot%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D"> at infinity). (The minus from <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20%5Cmathbb%7BP%7D=%20-%5Cfrac%7B1%7D%7B1-%5Cgamma_t%7D%20%5Cnabla_%7Bx_0%7D%20%5Cmathbb%7BP%7D"> and the minus from integration by parts cancel, giving a positive coefficient <img src="https://latex.codecogs.com/png.latex?+%5Cfrac%7B1%7D%7B1-%5Cgamma_t%7D">.) Write <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_%7B0,T%7Ct%7D"> for the conditional distribution of <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_T)"> given <img src="https://latex.codecogs.com/png.latex?X_t%20=%20x"> under <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar">. Recognizing the conditional expectation:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%20%5CPi%5E%5Cstar_t(x)%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar_%7B0,T%7Ct%7D%7D%20%7B%5Cleft%5B%20%5Cfrac%7B1%7D%7B1-%5Cgamma_t%7D%20%5Cnabla_%7BX_0%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D(X_0,X_T)%20%5C;%5CBig%7C%5C;%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A"></p>
<p>The same argument with integration by parts in <img src="https://latex.codecogs.com/png.latex?x_T"> gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla_x%20%5Clog%20%5CPi%5E%5Cstar_t(x)%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar_%7B0,T%7Ct%7D%7D%20%7B%5Cleft%5B%20%5Cfrac%7B1%7D%7B%5Cgamma_t%7D%20%5Cnabla_%7BX_T%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D(X_0,X_T)%20%5C;%5CBig%7C%5C;%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A"></p>
Since both expressions equal the same score, any convex combination <img src="https://latex.codecogs.com/png.latex?(1-c(t))"> times the first plus <img src="https://latex.codecogs.com/png.latex?c(t)"> times the second is also valid, for any <img src="https://latex.codecogs.com/png.latex?c(t)%20%5Cin%20(0,1%5D">.
<p></p>
</details>
<p>This gives the <strong>generalized target score identity</strong>: for any <img src="https://latex.codecogs.com/png.latex?c(t)%20%5Cin%20(0,1%5D">,</p>
<p><span id="eq-tsi"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20%5Clog%20%5CPi%5E%5Cstar_t(x)%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar_%7B0,T%7Ct%7D%7D%20%7B%5Cleft%5B%20%5Cfrac%7B1-c(t)%7D%7B1-%5Cgamma_t%7D%20%5Cnabla_%7BX_0%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D%20+%20%5Cfrac%7Bc(t)%7D%7B%5Cgamma_t%7D%20%5Cnabla_%7BX_T%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D%20%5C;%5CBig%7C%5C;%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A%5Ctag%7B9%7D"></span></p>
<p>(The endpoints <img src="https://latex.codecogs.com/png.latex?c%20=%200"> and <img src="https://latex.codecogs.com/png.latex?c%20=%201"> are excluded because they would divide by <img src="https://latex.codecogs.com/png.latex?%5Cgamma_t"> or <img src="https://latex.codecogs.com/png.latex?1%20-%20%5Cgamma_t">, which vanish at <img src="https://latex.codecogs.com/png.latex?t%20=%200"> or <img src="https://latex.codecogs.com/png.latex?t%20=%20T">.)</p>
<p>(The gradient-integral interchange and vanishing boundary terms require regularity of <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_%7B0,T%7D"> and decay of the integrand at infinity; these hold for sub-Gaussian couplings.)</p>
</section>
<section id="general-regression-target" class="level3">
<h3 class="anchored" data-anchor-id="general-regression-target">General regression target</h3>
<p>Now combine everything. For a reciprocal process <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar%20=%20%5CPi%5E%5Cstar_%7B0,T%7D%20%5Cmathbb%7BP%7D_%7B%7C0,T%7D">, the bridge drift decomposes into forward and backward pieces: <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%7BX_t%7D%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0,T%7D(X_t%20%7C%20X_0,%20X_T)%20=%20%5Cnabla_%7BX_t%7D%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(X_t%20%7C%20X_0)%20+%20%5Cnabla_%7BX_t%7D%20%5Clog%20%5Cmathbb%7BP%7D_%7BT%7Ct%7D(X_T%20%7C%20X_t)">. The first piece points back toward <img src="https://latex.codecogs.com/png.latex?X_0">; the second points forward toward <img src="https://latex.codecogs.com/png.latex?X_T">. The backward Markovian drift <img src="https://latex.codecogs.com/png.latex?v%5E%5Cstar"> extracts the backward piece and averages it over <img src="https://latex.codecogs.com/png.latex?X_0%20%7C%20X_t">:</p>
<p><span id="eq-backward-drift"><img src="https://latex.codecogs.com/png.latex?%0Av%5E%5Cstar(x,t)%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar_%7B0%7Ct%7D%7D%20%7B%5Cleft%5B%20%5Csigma_t%20%5C,%20%5Cnabla_%7BX_t%7D%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(X_t%20%5Cmid%20X_0)%20%5C;%5CBig%7C%5C;%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A%5Ctag%7B10%7D"></span></p>
<p>Since <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7Bt%7C0%7D"> is Gaussian <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BN%7D(X_0,%20%5Cnu_t%20I)">, this is <img src="https://latex.codecogs.com/png.latex?-%5Csigma_t(X_t%20-%20X_0)/%5Cnu_t"> averaged over <img src="https://latex.codecogs.com/png.latex?X_0%20%5Cmid%20X_t">. This follows from the bridge drift decomposition above: the <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cmathbb%7BP%7D_%7BT%7Ct%7D"> piece, when averaged over <img src="https://latex.codecogs.com/png.latex?X_T%20%7C%20X_t">, gives the forward drift <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> by the Doob h-transform. So <img src="https://latex.codecogs.com/png.latex?v%5E%5Cstar"> is the remaining backward piece, averaged over <img src="https://latex.codecogs.com/png.latex?X_0%20%7C%20X_t">.</p>
<p>Nelson’s relation Equation&nbsp;4 was derived for <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5Eu"> with marginals <img src="https://latex.codecogs.com/png.latex?p_t">. Here we apply it to <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D">, which has marginals <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_t"> (the Markovian projection preserves marginals). This gives the <em>Markovian</em> forward drift: <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%20%5Cnabla%20%5Clog%20%5CPi%5E%5Cstar_t%20-%20v%5E%5Cstar">. Both the score <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5CPi%5E%5Cstar_t"> and the backward drift <img src="https://latex.codecogs.com/png.latex?v%5E%5Cstar"> are conditional expectations (from Equation&nbsp;9 and Equation&nbsp;10 respectively). To get a regression target for the matching loss Equation&nbsp;6, we need a <em>non-Markovian</em> drift <img src="https://latex.codecogs.com/png.latex?%5Cxi(X,t)"> whose conditional expectation <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Cxi%20%5Cmid%20X_t%5D"> equals <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar">. Substituting the integrands (before conditioning) from Equation&nbsp;9 and Equation&nbsp;10 into Nelson gives such a <img src="https://latex.codecogs.com/png.latex?%5Cxi">:</p>
<p><span id="eq-xi-general"><img src="https://latex.codecogs.com/png.latex?%0A%5Csigma_t%5E%7B-1%7D%20%5C,%20%5Cxi(X,t)%20=%20%5Cfrac%7B1-c(t)%7D%7B1-%5Cgamma_t%7D%20%5Cnabla_%7BX_0%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D(X_0,X_T)%20+%20%5Cfrac%7Bc(t)%7D%7B%5Cgamma_t%7D%20%5Cnabla_%7BX_T%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D(X_0,X_T)%20-%20%5Cnabla_%7BX_t%7D%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(X_t%20%5Cmid%20X_0).%0A%5Ctag%7B11%7D"></span></p>
<p>The first two terms are the TSI integrand (the quantity inside <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Ccdot%20%5Cmid%20X_t%5D"> in Equation&nbsp;9, which conditions on <img src="https://latex.codecogs.com/png.latex?X_t"> to give <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%5Cnabla%20%5Clog%20%5CPi%5E%5Cstar_t">). The third term is the backward drift integrand from Equation&nbsp;10 (conditioning on <img src="https://latex.codecogs.com/png.latex?X_t"> gives <img src="https://latex.codecogs.com/png.latex?v%5E%5Cstar">). Their combination, before conditioning, is a valid <img src="https://latex.codecogs.com/png.latex?%5Cxi"> with <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%5B%5Cxi%20%5Cmid%20X_t%5D%20=%20u%5E%5Cstar">. Both the TSI integrand (depending on <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_T)">) and the backward drift integrand (depending on <img src="https://latex.codecogs.com/png.latex?X_0">) are expectations under <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar"> conditioned on <img src="https://latex.codecogs.com/png.latex?X_t">. Since <img src="https://latex.codecogs.com/png.latex?X_0"> is a marginal of <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_T)">, the two integrands live in the same conditional probability space and can be combined before taking <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Ccdot%20%7C%20X_t%5D">.</p>
<p>Here <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_t,%20X_T)"> are all determined by the bridge path: <img src="https://latex.codecogs.com/png.latex?X_0,%20X_T"> from the coupling, <img src="https://latex.codecogs.com/png.latex?X_t"> from Equation&nbsp;7. The Markovianization step fits <img src="https://latex.codecogs.com/png.latex?u(X_t,t)"> to <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Cxi(X,t)%20%5Cmid%20X_t%5D"> via Equation&nbsp;6.</p>
<p>The tractability of Equation&nbsp;11 depends entirely on the coupling scores <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D">.</p>
</section>
<section id="three-couplings-three-algorithms" class="level3">
<h3 class="anchored" data-anchor-id="three-couplings-three-algorithms">Three couplings, three algorithms</h3>
<p><strong>Half-bridge / <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling</a>.</strong> Set <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_%7B0,T%7D%20=%20%5Cdelta_%7Bx_0%7D%20%5Cotimes%20%5Cpi"> (Dirac prior, memoryless condition). With <img src="https://latex.codecogs.com/png.latex?x_0%20=%200"> and <img src="https://latex.codecogs.com/png.latex?c(t)%20=%20%5Cgamma_t">: since <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_0%20=%20%5Cdelta_0">, we use only the <img src="https://latex.codecogs.com/png.latex?X_T"> branch of the TSI (the <img src="https://latex.codecogs.com/png.latex?X_0"> integration-by-parts is not needed when <img src="https://latex.codecogs.com/png.latex?X_0"> is deterministic), and Equation&nbsp;11 reduces to Equation&nbsp;12. The paper derives this in Prop 4 (Appendix C.2); the key steps are below.</p>
<details>
<summary>
Reduction from Equation&nbsp;11 to Equation&nbsp;12:
</summary>
<p style="color: blue;">
</p><p>Start from Equation&nbsp;11 with <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_%7B0,T%7D%20=%20%5Cdelta_0%20%5Cotimes%20%5Cpi">. Since <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_0%20=%20%5Cdelta_0">, we use only the <img src="https://latex.codecogs.com/png.latex?X_T"> branch of the TSI (the <img src="https://latex.codecogs.com/png.latex?X_0"> integration-by-parts is not needed when <img src="https://latex.codecogs.com/png.latex?X_0"> is deterministic). With <img src="https://latex.codecogs.com/png.latex?c(t)%20=%20%5Cgamma_t">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Csigma_t%5E%7B-1%7D%20%5Cxi%20=%20%5Cnabla%20%5Clog%20%5Cpi(X_T)%20-%20%5Cnabla_%7BX_t%7D%20%5Clog%20%5Cmathbb%7BP%7D_%7Bt%7C0%7D(X_t%20%5Cmid%200).%0A"></p>
<p>Since <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7Bt%7C0%7D(%5Ccdot%20%5Cmid%200)%20=%20%5Cmathcal%7BN%7D(0,%20%5Cnu_t%20I)">, its score at <img src="https://latex.codecogs.com/png.latex?X_t"> is <img src="https://latex.codecogs.com/png.latex?-X_t/%5Cnu_t">. So</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Csigma_t%5E%7B-1%7D%20%5Cxi%20=%20%5Cnabla%20%5Clog%20%5Cpi(X_T)%20+%20%5Cfrac%7BX_t%7D%7B%5Cnu_t%7D.%0A"></p>
<p>Since <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_T%20=%20%5Cmathcal%7BN%7D(0,%20%5Cnu_T%20I)">, its score is <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cmathbb%7BP%7D_T(x)%20=%20-x/%5Cnu_T">, so <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cpi(X_T)%20+%20X_t/%5Cnu_t"> can be rewritten after Markovianization. Under the half-bridge coupling <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar%20=%20%5Cdelta_0%20%5Cotimes%20%5Cpi%20%5Ccdot%20%5Cmathbb%7BP%7D_%7B%7C0,T%7D">, the bridge from <img src="https://latex.codecogs.com/png.latex?0"> to <img src="https://latex.codecogs.com/png.latex?X_T"> gives <img src="https://latex.codecogs.com/png.latex?X_t%20%5Cmid%20X_T%20%5Csim%20%5Cmathcal%7BN%7D(%5Cgamma_t%20X_T,%20%5Cnu_T%5Cgamma_t(1-%5Cgamma_t)I)">. The conditional expectation <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BX_t/%5Cnu_t%20%5Cmid%20X_T%5D%20=%20%5Cgamma_t%20X_T%20/%20%5Cnu_t%20=%20X_T/%5Cnu_T"> (using <img src="https://latex.codecogs.com/png.latex?%5Cgamma_t%20=%20%5Cnu_t/%5Cnu_T">). So <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cpi(X_T)%20+%20X_T/%5Cnu_T%20=%20%5Cnabla%20%5Clog%20%5Cpi(X_T)%20-%20%5Cnabla%20%5Clog%20%5Cmathbb%7BP%7D_T(X_T)%20=%20%5Cnabla%20%5Clog%5B%5Cpi/%5Cmathbb%7BP%7D_T%5D(X_T)">. After Markovianization:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar(x,t)%20=%20%5Csigma_t%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20%5Cnabla%20%5Clog%20%5Cpi(X_T)%20+%20%5Cfrac%7BX_T%7D%7B%5Cnu_T%7D%20%5C;%5CBig%7C%5C;%20X_t%20=%20x%20%5Cright%5D%7D%20%20=%20%5Csigma_t%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20%5Cnabla%20%5Clog%20%5Cfrac%7B%5Cpi(X_T)%7D%7B%5Cmathbb%7BP%7D_T(X_T)%7D%20%5C;%5CBig%7C%5C;%20X_t%20=%20x%20%5Cright%5D%7D%20,%0A"></p>
<p>since <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cmathbb%7BP%7D_T(X_T)%20=%20-X_T/%5Cnu_T"> for <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_T%20=%20%5Cmathcal%7BN%7D(0,%5Cnu_T%20I)">. The non-Markovian <img src="https://latex.codecogs.com/png.latex?%5Cxi"> that gives this after conditioning is simply <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%5Cnabla_%7BX_T%7D%20%5Clog%5B%5Cpi/%5Cmathbb%7BP%7D_T%5D(X_T)">, which depends only on <img src="https://latex.codecogs.com/png.latex?X_T">. The <img src="https://latex.codecogs.com/png.latex?X_t">-dependent bridge score <img src="https://latex.codecogs.com/png.latex?X_t/%5Cnu_t"> cancels against the <img src="https://latex.codecogs.com/png.latex?X_t">-dependent part of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Cnabla%20%5Clog%20%5Cpi(X_T)%20%5Cmid%20X_t%5D"> under the Markovian projection, leaving only a function of <img src="https://latex.codecogs.com/png.latex?X_T">.</p>
Alternatively: the paper shows directly that setting <img src="https://latex.codecogs.com/png.latex?c(t)%20=%20%5Cgamma_t"> in the general SHB formula (Lemma C.2) causes all <img src="https://latex.codecogs.com/png.latex?X_0">-dependent terms to cancel, leaving <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%5E%7B-1%7D%5Cxi%20=%20%5Cnabla_%7BX_T%7D%5Clog%5B%5Cpi/%5Cmathbb%7BP%7D_T%5D(X_T)">.
<p></p>
</details>
<p><span id="eq-xi-as"><img src="https://latex.codecogs.com/png.latex?%0A%5Csigma_t%5E%7B-1%7D%20%5C,%20%5Cxi(X,t)%20=%20%5Cnabla_%7BX_T%7D%20%5Clog%20%5Cfrac%7B%5Cpi(X_T)%7D%7B%5Cmathbb%7BP%7D_T(X_T)%7D,%0A%5Ctag%7B12%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_T%20=%20%5Cmathcal%7BN%7D(0,%20%5Cnu_T%20I)"> (the terminal marginal of the reference). Simple, but requires Dirac prior and large <img src="https://latex.codecogs.com/png.latex?%5Csigma_t"> for exploration.</p>
<p><strong>Full Schrodinger bridge / <a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">adjoint sampling with corrector</a>.</strong> Set <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar_%7B0,T%7D%20=%20%5Chat%5Cvarphi_0(x_0)%20%5C,%20%5Cmathbb%7BP%7D_%7BT%7C0%7D(x_T%20%5Cmid%20x_0)%20%5C,%20%5Cvarphi_T(x_T)">, the <a href="../../notes/shrodinger_bridge/shrodinger.html">Schrodinger bridge</a> coupling. The drift becomes</p>
<p><span id="eq-xi-asbs"><img src="https://latex.codecogs.com/png.latex?%0A%5Csigma_t%5E%7B-1%7D%20%5C,%20%5Cxi(X,t)%20=%20%5Cnabla_%7BX_T%7D%20%5Clog%20%5Cfrac%7B%5Cpi(X_T)%7D%7B%5Chat%5Cvarphi_T(X_T)%7D,%0A%5Ctag%7B13%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cvarphi_T"> is the backward Schrodinger potential. This allows arbitrary priors, but <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cvarphi_T"> is unknown and must be learned alongside <img src="https://latex.codecogs.com/png.latex?u">, requiring alternating IPF-style updates.</p>
<p><strong>Independent coupling / BMS.</strong> Set</p>
<p><span id="eq-indep-coupling"><img src="https://latex.codecogs.com/png.latex?%0A%5CPi%5E%5Cstar_%7B0,T%7D%20=%20p_0%20%5Cotimes%20%5Cpi.%0A%5Ctag%7B14%7D"></span></p>
<p>Plug into Equation&nbsp;11. The coupling scores factor trivially: <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%7BX_0%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D%20=%20%5Cnabla%20%5Clog%20p_0(X_0)"> and <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%7BX_T%7D%20%5Clog%20%5CPi%5E%5Cstar_%7B0,T%7D%20=%20%5Cnabla%20%5Clog%20%5Cpi(X_T)">. The regression target becomes</p>
<p><span id="eq-xi-bms"><img src="https://latex.codecogs.com/png.latex?%0A%5Csigma_t%5E%7B-1%7D%20%5C,%20%5Cxi(X,t)%20=%20%5Cfrac%7B1-c(t)%7D%7B1-%5Cgamma_t%7D%20%5Cnabla%20%5Clog%20p_0(X_0)%20+%20%5Cfrac%7Bc(t)%7D%7B%5Cgamma_t%7D%20%5Cnabla%20%5Clog%20%5Cpi(X_T)%20-%20%5Cfrac%7BX_t%20-%20X_0%7D%7B%5Cnu_t%7D.%0A%5Ctag%7B15%7D"></span></p>
<p>Every term on the right is known: <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20p_0"> is the prior score (assumed known, e.g.&nbsp;Gaussian), <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5Cpi%20=%20%5Cnabla%20%5Clog%20%5Crho"> is the target score (computable from the unnormalized density), and <img src="https://latex.codecogs.com/png.latex?(X_t%20-%20X_0)/%5Cnu_t"> is the Gaussian transition score. No unknown potentials, no alternation.</p>
</section>
<section id="the-independent-coupling-why-it-works" class="level3">
<h3 class="anchored" data-anchor-id="the-independent-coupling-why-it-works">The independent coupling: why it works</h3>
<p>The independent coupling <img src="https://latex.codecogs.com/png.latex?p_0%20%5Cotimes%20%5Cpi"> satisfies the boundary constraints by construction: marginalizing over <img src="https://latex.codecogs.com/png.latex?X_T"> gives <img src="https://latex.codecogs.com/png.latex?p_0">, marginalizing over <img src="https://latex.codecogs.com/png.latex?X_0"> gives <img src="https://latex.codecogs.com/png.latex?%5Cpi">. The terminal marginal of <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar%20=%20(p_0%20%5Cotimes%20%5Cpi)%20%5Cmathbb%7BP%7D_%7B%7C0,T%7D"> is <img src="https://latex.codecogs.com/png.latex?%5Cpi">: since <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7BT%7C0,T%7D(x%20%5Cmid%20x_0,%20x_T)%20=%20%5Cdelta(x%20-%20x_T)"> (the bridge is pinned at its endpoint),</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CPi%5E%5Cstar_T(x)%20=%20%5Cint%20%5Cmathbb%7BP%7D_%7BT%7C0,T%7D(x%20%5Cmid%20x_0,%20x_T)%20%5C,%20p_0(x_0)%20%5C,%20%5Cpi(x_T)%20%5C,%20dx_0%20%5C,%20dx_T%20=%20%5Cint%20%5Cdelta(x%20-%20x_T)%20%5C,%20%5Cpi(x_T)%20%5C,%20dx_T%20=%20%5Cpi(x).%0A"></p>
<p>The Markovian projection preserves time marginals, so <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D_T%20=%20%5Cpi">: the controlled SDE with drift <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> hits the target at time <img src="https://latex.codecogs.com/png.latex?T">. Combined with <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D_0%20=%20p_0"> (from the initial condition), <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> is a fixed point.</p>
<p>The Schrodinger bridge coupling minimizes path-space KL (as shown in the <a href="../../notes/shrodinger_bridge/shrodinger.html">SB notes</a>). The independent coupling sacrifices this optimality for a fully tractable regression target.</p>
<p>At each iteration, the coupling is <img src="https://latex.codecogs.com/png.latex?%5CPi%5Ei_%7B0,T%7D%20=%20%5Cmathbb%7BP%7D%5E%7Bu_i%7D_0%20%5Cotimes%20%5Cmathbb%7BP%7D%5E%7Bu_i%7D_T">: independently resample <img src="https://latex.codecogs.com/png.latex?X_0"> and <img src="https://latex.codecogs.com/png.latex?X_T"> from their marginals under the current SDE. In practice, simulate trajectories, then randomly pair the initial and terminal samples.</p>
<p>Sampling the bridge is cheap: given <img src="https://latex.codecogs.com/png.latex?(x_0,%20x_T)">, draw <img src="https://latex.codecogs.com/png.latex?X_t"> from Equation&nbsp;7 and evaluate Equation&nbsp;15. No full trajectory simulation needed during regression.</p>
</section>
<section id="damped-iteration" class="level3">
<h3 class="anchored" data-anchor-id="damped-iteration">Damped iteration</h3>
<p>The undamped iteration <img src="https://latex.codecogs.com/png.latex?u_%7Bi+1%7D%20=%20%5CPhi(u_i)"> can overshoot in high dimensions. The damped version uses step size <img src="https://latex.codecogs.com/png.latex?%5Calpha%20%5Cin%20(0,1%5D">:</p>
<p><span id="eq-damped"><img src="https://latex.codecogs.com/png.latex?%0Au_%7Bi+1%7D%20=%20%5Calpha%20%5C,%20%5CPhi(u_i)%20+%20(1-%5Calpha)%20%5C,%20u_i.%0A%5Ctag%7B16%7D"></span></p>
<p>Setting <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%20(1-%5Calpha)/%5Calpha">, this solves</p>
<p><span id="eq-damped-var"><img src="https://latex.codecogs.com/png.latex?%0Au_%7Bi+1%7D%20=%20%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_u%20%5C;%20%20%7B%5Cleft%5C%7B%20%20%5Cmathbb%7BE%7D_%7B%5CPi%5Ei%7D%20%20%7B%5Cleft%5B%20%5Cint_0%5ET%20%5Cfrac%7B1%7D%7B2%7D%20%5C%7C%20%5Cxi%20-%20u(X_t,t)%20%5C%7C%5E2%20%5C,%20dt%20%5Cright%5D%7D%20%20%5C;+%5C;%20%20%5Ctextcolor%7Bblue%7D%7B%5Ceta%20%5C,%20%5Cmathbb%7BE%7D_%7B%5CPi%5Ei%7D%20%20%7B%5Cleft%5B%20%5Cint_0%5ET%20%5Cfrac%7B1%7D%7B2%7D%20%5C%7C%20u_i(X_t,t)%20-%20u(X_t,t)%20%5C%7C%5E2%20%5C,%20dt%20%5Cright%5D%7D%20%7D%20%20%5Cright%5C%7D%7D%20.%0A%5Ctag%7B17%7D"></span></p>
<details>
<summary>
Deriving Equation&nbsp;16 from Equation&nbsp;17:
</summary>
<p style="color: blue;">
</p><p>Apply the bias-variance decomposition (Pythagorean identity from the Markovian projection) to the first term:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D_%7B%5CPi%5Ei%7D%20%7B%5Cleft%5B%20%5C%7C%5Cxi%20-%20u%5C%7C%5E2%20%5Cright%5D%7D%20%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5Ei%7D%20%7B%5Cleft%5B%20%5C%7C%5Cxi%20-%20%5CPhi(u_i)%5C%7C%5E2%20%5Cright%5D%7D%20%20+%20%5Cmathbb%7BE%7D_%7B%5CPi%5Ei%7D%20%7B%5Cleft%5B%20%5C%7C%5CPhi(u_i)%20-%20u%5C%7C%5E2%20%5Cright%5D%7D%20,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5CPhi(u_i)%20=%20%5Cmathbb%7BE%7D_%7B%5CPi%5Ei%7D%5B%5Cxi%20%5Cmid%20X_t%5D">. The first piece is independent of <img src="https://latex.codecogs.com/png.latex?u"> (irreducible noise from the non-Markovian <img src="https://latex.codecogs.com/png.latex?%5Cxi">). Dropping it, Equation&nbsp;17 reduces to</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Au_%7Bi+1%7D%20=%20%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_u%20%5C;%20%5Cmathbb%7BE%7D_%7B%5CPi%5Ei%7D%20%7B%5Cleft%5B%20%5Ctfrac%7B1%7D%7B2%7D%5C%7C%5CPhi(u_i)%20-%20u%5C%7C%5E2%20+%20%5Ctfrac%7B%5Ceta%7D%7B2%7D%5C%7Cu_i%20-%20u%5C%7C%5E2%20%5Cright%5D%7D%20.%0A"></p>
Pointwise first-order condition: <img src="https://latex.codecogs.com/png.latex?-(%5CPhi(u_i)%20-%20u)%20-%20%5Ceta(u_i%20-%20u)%20=%200">, giving <img src="https://latex.codecogs.com/png.latex?(1+%5Ceta)u%20=%20%5CPhi(u_i)%20+%20%5Ceta%20%5C,%20u_i">. So <img src="https://latex.codecogs.com/png.latex?u%20=%20%5Cfrac%7B1%7D%7B1+%5Ceta%7D%5CPhi(u_i)%20+%20%5Cfrac%7B%5Ceta%7D%7B1+%5Ceta%7Du_i">. With <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%20(1-%5Calpha)/%5Calpha">: <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B1+%5Ceta%7D%20=%20%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Ceta%7D%7B1+%5Ceta%7D%20=%201-%5Calpha">, recovering Equation&nbsp;16.
<p></p>
</details>
<p>The <img src="https://latex.codecogs.com/png.latex?%20%5Ctextcolor%7Bblue%7D%7B%5Ctext%7Bsecond%20term%7D%7D"> penalizes deviation from the previous iterate. Each step balances fitting new bridge data against staying close to <img src="https://latex.codecogs.com/png.latex?u_i">, preventing mode collapse from aggressive updates.</p>
</section>
<section id="summary" class="level3">
<h3 class="anchored" data-anchor-id="summary">Summary</h3>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Method</th>
<th>Coupling <img src="https://latex.codecogs.com/png.latex?%5CPi%5Ei_%7B0,T%7D"></th>
<th>Regression target <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%5E%7B-1%7D%20%5Cxi"></th>
<th>Limitation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">AS</a></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Bx_0%7D%20%5Cotimes%20%5Cmathbb%7BP%7D%5E%7Bu_i%7D_T"></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5B%5Cpi/%5Cmathbb%7BP%7D_T%5D(X_T)"></td>
<td>Dirac prior</td>
</tr>
<tr class="even">
<td><a href="../../notes/adjoint_samplers_draft/adjoint_sampling.html">AS + corrector</a></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu_i%7D_%7B0,T%7D"></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cnabla%20%5Clog%20%5B%5Cpi/%5Chat%5Cvarphi_T%5D(X_T)"></td>
<td>Alternating opt.</td>
</tr>
<tr class="odd">
<td>BMS</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7Bu_i%7D_0%20%5Cotimes%20%5Cmathbb%7BP%7D%5E%7Bu_i%7D_T"></td>
<td>Equation&nbsp;15</td>
<td>None (single obj.)</td>
</tr>
</tbody>
</table>
<p>All three converge to a fixed point <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> transporting <img src="https://latex.codecogs.com/png.latex?p_0"> to <img src="https://latex.codecogs.com/png.latex?%5Cpi">. The matching loss Equation&nbsp;6 is a forward KL objective: <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_u%20D_%7B%5Ctext%7BKL%7D%7D(%5CPi%5E%5Cstar%20%5Cmid%20%5Cmathbb%7BP%7D%5Eu)">. This follows from the Girsanov KL decomposition: <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5CPi%5E%5Cstar%20%5C%7C%20%5Cmathbb%7BP%7D%5Eu)%20=%20%5Ctext%7B(irreducible%20variance)%7D%20+%20%5Cmathbb%7BE%7D_%7B%5CPi%5E%5Cstar%7D%5B%5Cint%20%5Cfrac%7B1%7D%7B2%7D%5C%7C%5Cxi%20-%20u%5C%7C%5E2%20dt%5D">, so minimizing the matching loss over <img src="https://latex.codecogs.com/png.latex?u"> is equivalent to minimizing <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5CPi%5E%5Cstar%20%5C%7C%20%5Cmathbb%7BP%7D%5Eu)">. Forward KL is mode-covering (it penalizes placing zero mass where <img src="https://latex.codecogs.com/png.latex?%5CPi%5E%5Cstar"> has mass); since the Markovian projection preserves time marginals, mode coverage at the path level implies mode coverage at the terminal marginal level, which drives mode diversity in practice.</p>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-Brunick2013" class="csl-entry">
Brunick, Gerard, and Steven Shreve. 2013. <span>“Mimicking an Itô Process by a Solution of a Stochastic Differential Equation.”</span> <em>The Annals of Applied Probability</em> 23 (4). Institute of Mathematical Statistics. doi:<a href="https://doi.org/10.1214/12-aap881">10.1214/12-aap881</a>.
</div>
</div></section></div> ]]></description>
  <category>SDE</category>
  <category>markov</category>
  <category>sampling</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/BMS.html</guid>
  <pubDate>Sat, 21 Mar 2026 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Adjoint Matching</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/adjoint_matching.html</link>
  <description><![CDATA[ 





<!-- TODO: Add historical figure portrait here.
::: {style="text-align:center;"}
![[Name](wiki_link) (dates)](./image.jpg){fig-align="center" width=35%}
:::
-->
<section id="setup" class="level2">
<h2 class="anchored" data-anchor-id="setup">Setup</h2>
<p>Consider a pre-trained generative model that produces samples <img src="https://latex.codecogs.com/png.latex?X_1"> by simulating the SDE</p>
<p><span id="eq-base-sde"><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20=%20b(X_t,%20t)%20%5C,%20dt%20+%20%5Csigma_t%20%5C,%20dW_t,%20%5Cqquad%20X_0%20%5Csim%20%5Cmathcal%7BN%7D(0,%20I)%0A%5Ctag%7B1%7D"></span></p>
<p>on <img src="https://latex.codecogs.com/png.latex?%5B0,1%5D">. We restrict to scalar, state-independent <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%3E%200"> throughout, matching the generative model setting. The drift <img src="https://latex.codecogs.com/png.latex?b"> encodes a learned score or velocity field. The path distribution of this process is <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D"> and the terminal distribution is <img src="https://latex.codecogs.com/png.latex?p_1(x)">. Given a reward function <img src="https://latex.codecogs.com/png.latex?r:%20%5Cmathbb%7BR%7D%5ED%20%5Cto%20%5Cmathbb%7BR%7D">, we want to fine-tune the model so that its output distribution becomes the <em>tilted distribution</em></p>
<p><span id="eq-tilted"><img src="https://latex.codecogs.com/png.latex?%0A%5Cpi(x)%20%5Cpropto%20p_1(x)%20%5C,%20%5Cexp(r(x)).%0A%5Ctag%7B2%7D"></span></p>
<p>We assume <img src="https://latex.codecogs.com/png.latex?r"> is smooth and that all expectations below are well-defined. Introduce a control <img src="https://latex.codecogs.com/png.latex?u(t,x)"> and the controlled SDE</p>
<p><span id="eq-controlled-sde"><img src="https://latex.codecogs.com/png.latex?%0AdX%5Eu_t%20=%20%20%7B%5Cleft%5B%20b(X%5Eu_t,%20t)%20+%20%5Csigma_t%20%5C,%20%20%5Ctextcolor%7Bblue%7D%7Bu(t,%20X%5Eu_t)%7D%20%5Cright%5D%7D%20%20%5C,%20dt%20+%20%5Csigma_t%20%5C,%20dW_t.%0A%5Ctag%7B3%7D"></span></p>
<p>The <a href="../../notes/girsanov/girsanov.html">Girsanov theorem</a> gives <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D%5Eu%20%5C%7C%20%5Cmathbb%7BP%7D)%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%5Cint_0%5E1%20%5C%7Cu(t,%20X%5Eu_t)%5C%7C%5E2%20%5C,%20dt"> (the <a href="../../notes/girsanov/girsanov.html">Girsanov notes</a> derive <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Cmathbb%7BP%7D,%20%5Cmathbb%7BP%7D%5Eu)"> with expectation under <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D">; the two directions are equal for the control-affine case since <img src="https://latex.codecogs.com/png.latex?%5Cint%20u%5E%5Ctop%20dW"> has zero expectation under either measure), so the stochastic optimal control problem</p>
<p><span id="eq-soc"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmin_u%20%5C;%20J(u)%20=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5Eu%7D%20%20%7B%5Cleft%5B%20%20%5Cint_0%5E1%20%5Ctfrac%7B1%7D%7B2%7D%20%5C%7Cu(t,%20X%5Eu_t)%5C%7C%5E2%20%5C,%20dt%20-%20r(X%5Eu_1)%20%20%5Cright%5D%7D%0A%5Ctag%7B4%7D"></span></p>
<p>maximizes the terminal reward while penalizing deviations from the base process. Equivalently, we maximize <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B-%5Cfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2%20+%20r(X_1)%5D">, which is the SOC problem from the <a href="../../notes/HJB/HJB.html">HJB notes</a> with <img src="https://latex.codecogs.com/png.latex?f%20=%200"> and <img src="https://latex.codecogs.com/png.latex?g%20=%20r">. Here we fix <img src="https://latex.codecogs.com/png.latex?X_0%20%5Csim%20%5Cmathcal%7BN%7D(0,I)"> and optimize only over <img src="https://latex.codecogs.com/png.latex?u">, unlike the joint <img src="https://latex.codecogs.com/png.latex?(q,u)"> optimization in the HJB notes.</p>
</section>
<section id="value-function-bias" class="level2">
<h2 class="anchored" data-anchor-id="value-function-bias">Value function bias</h2>
<p>The <a href="../../notes/HJB/HJB.html">HJB notes</a> show that the optimal control is <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar(t,x)%20=%20%5Csigma_t%5E%5Ctop%20%5Cnabla%20V(t,x)"> where <img src="https://latex.codecogs.com/png.latex?V(t,x)%20=%20%5Clog%20h(t,x)"> is the value function and</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ah(t,x)%20=%20%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20%5Cexp(r(X_1))%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%0A"></p>
<p>under the base process. Combining Ito’s formula on <img src="https://latex.codecogs.com/png.latex?V(t,X_t)"> with the <a href="../../notes/HJB/HJB.html">HJB equation</a> and <a href="../../notes/girsanov/girsanov.html">Girsanov</a>, the bivariate marginal of the optimal path measure satisfies</p>
<p><span id="eq-radon-nikodym"><img src="https://latex.codecogs.com/png.latex?%0Ap%5E%5Cstar(X_0,%20X_1)%20%5Cpropto%20p%5E%7B%5Ctext%7Bbase%7D%7D(X_0,%20X_1)%20%5C,%20%5Cexp%20%7B%5Cleft(%20r(X_1)%20-%20V(0,%20X_0)%20%5Cright)%7D%20.%0A%5Ctag%7B5%7D"></span></p>
<p>The <a href="../../notes/HJB/HJB.html">HJB notes</a> derive (final displayed equation) the pathwise identity <img src="https://latex.codecogs.com/png.latex?V(t_2,%20X_%7Bt_2%7D)%20-%20V(t_1,%20X_%7Bt_1%7D)%20=%20%5Cint_%7Bt_1%7D%5E%7Bt_2%7D%20%5Cfrac%7B1%7D%7B2%7D%5C%7Cu%5E%5Cstar%5C%7C%5E2%20ds%20+%20%5Ctext%7Bmartingale%7D"> via Ito’s formula and the HJB equation. Plugging this into the <a href="../../notes/girsanov/girsanov.html">Girsanov</a> path-level RN derivative <img src="https://latex.codecogs.com/png.latex?d%5Cmathbb%7BP%7D%5E%7Bu%5E%5Cstar%7D/d%5Cmathbb%7BP%7D=%20%5Cexp(-%5Cfrac%7B1%7D%7B2%7D%5Cint%20%5C%7Cu%5E%5Cstar%5C%7C%5E2%20ds%20+%20%5Cint%20u%5E%7B%5Cstar%5Ctop%7D%20dW_s)"> and taking expectations (which kills the martingale), the path-dependent terms reduce to endpoint functions, yielding Equation&nbsp;5.</p>
<p>The factor <img src="https://latex.codecogs.com/png.latex?%5Cexp(-V(0,%20X_0))%20=%201/h(0,%20X_0)"> is the conditional normalizing constant: given <img src="https://latex.codecogs.com/png.latex?X_0">, the RN derivative of the optimal path conditioned on <img src="https://latex.codecogs.com/png.latex?X_0"> is <img src="https://latex.codecogs.com/png.latex?%5Cexp(r(X_1))/h(0,%20X_0)">.</p>
<p>Marginalizing the joint over <img src="https://latex.codecogs.com/png.latex?X_0">:</p>
<p><span id="eq-marginal-bad"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign%7D%0Ap%5E%5Cstar(X_0,%20X_1)%20&amp;%5Cpropto%20p%5E%7B%5Ctext%7Bbase%7D%7D(X_0,%20X_1)%20%5C,%20%5Cexp%20%7B%5Cleft(%20r(X_1)%20-%20V(0,%20X_0)%20%5Cright)%7D%20%5C%5C%0Ap%5E%5Cstar(X_1)%20&amp;=%20%5Cint%20p%5E%7B%5Ctext%7Bbase%7D%7D(X_0,%20X_1)%20%5C,%20%5Cexp%20%7B%5Cleft(%20r(X_1)%20-%20V(0,%20X_0)%20%5Cright)%7D%20%20%5C,%20dX_0.%0A%5Cend%7Balign%7D%0A%5Ctag%7B6%7D"></span></p>
<p>When <img src="https://latex.codecogs.com/png.latex?X_0"> and <img src="https://latex.codecogs.com/png.latex?X_1"> are correlated under <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D">, the factor <img src="https://latex.codecogs.com/png.latex?%5Cexp(-V(0,%20X_0))"> cannot be pulled out of the integral. The marginal <img src="https://latex.codecogs.com/png.latex?p%5E%5Cstar(X_1)"> is <em>not</em> proportional to <img src="https://latex.codecogs.com/png.latex?p_1(X_1)%20%5Cexp(r(X_1))">. The SOC solution tilts both the terminal and the initial distribution, and the fine-tuned model does not sample from Equation&nbsp;2.</p>
<p>As a concrete example, take <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%200"> (standard flow matching). The ODE <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BX%7D_t%20=%20b(X_t,%20t)"> is deterministic: <img src="https://latex.codecogs.com/png.latex?X_0"> fully determines <img src="https://latex.codecogs.com/png.latex?X_1%20=%20%5CPhi(X_0)"> for a diffeomorphism <img src="https://latex.codecogs.com/png.latex?%5CPhi">. Adding a control <img src="https://latex.codecogs.com/png.latex?u"> in Equation&nbsp;3 has zero effect since <img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%200"> kills both the noise and the control term (the control enters as <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20u">, so it vanishes with <img src="https://latex.codecogs.com/png.latex?%5Csigma_t">; this is specific to the control-affine parameterization). The optimal control is trivially <img src="https://latex.codecogs.com/png.latex?u%20=%200"> since any nonzero <img src="https://latex.codecogs.com/png.latex?u"> adds cost (<img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2">) without affecting the trajectory. The bias is maximal.</p>
</section>
<section id="memoryless-noise-schedule" class="level2">
<h2 class="anchored" data-anchor-id="memoryless-noise-schedule">Memoryless noise schedule</h2>
<p>Look again at Equation&nbsp;6. If <img src="https://latex.codecogs.com/png.latex?X_0%20%5Cperp%20X_1"> under the base process, then <img src="https://latex.codecogs.com/png.latex?p%5E%7B%5Ctext%7Bbase%7D%7D(X_0,%20X_1)%20=%20p%5E%7B%5Ctext%7Bbase%7D%7D(X_0)%20%5C,%20p_1(X_1)"> and</p>
<p><span id="eq-marginal-good"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign%7D%0Ap%5E%5Cstar(X_1)%20&amp;=%20p_1(X_1)%20%5C,%20%5Cexp(r(X_1))%20%5Cint%20p%5E%7B%5Ctext%7Bbase%7D%7D(X_0)%20%5C,%20%5Cexp(-V(0,%20X_0))%20%5C,%20dX_0%5C%5C%0A&amp;%5Cpropto%20p_1(X_1)%20%5C,%20%5Cexp(r(X_1)).%0A%5Cend%7Balign%7D%0A%5Ctag%7B7%7D"></span></p>
<p>The integral over <img src="https://latex.codecogs.com/png.latex?X_0"> collapses to a constant. The bias disappears.</p>
<p>A base process Equation&nbsp;1 is <em>memoryless</em> when <img src="https://latex.codecogs.com/png.latex?X_0%20%5Cperp%20X_1">. For the family of generative SDEs that arise in flow matching and diffusion models, this condition pins down <img src="https://latex.codecogs.com/png.latex?%5Csigma_t">.</p>
<p>The generative SDE Equation&nbsp;1 is built to have the same time marginals as the reference interpolation <img src="https://latex.codecogs.com/png.latex?%5Cbar%7BX%7D_t%20=%20%5Cbeta_t%20%5Cbar%7BX%7D_0%20+%20%5Calpha_t%20%5Cbar%7BX%7D_1"> with <img src="https://latex.codecogs.com/png.latex?%5Cbar%7BX%7D_0%20%5Csim%20%5Cmathcal%7BN%7D(0,I)"> independent of <img src="https://latex.codecogs.com/png.latex?%5Cbar%7BX%7D_1">. Conditionally on <img src="https://latex.codecogs.com/png.latex?%5Cbar%7BX%7D_1">, this reference has <img src="https://latex.codecogs.com/png.latex?%5Cbar%7BX%7D_t%20%5Cmid%20%5Cbar%7BX%7D_1%20%5Csim%20%5Cmathcal%7BN%7D(%5Calpha_t%20%5Cbar%7BX%7D_1,%20%5Cbeta_t%5E2%20I)">: the conditional variance is <img src="https://latex.codecogs.com/png.latex?%5Cbeta_t%5E2">, which starts at <img src="https://latex.codecogs.com/png.latex?%5Cbeta_0%5E2%20=%201"> (pure noise) and decays to <img src="https://latex.codecogs.com/png.latex?%5Cbeta_1%5E2%20=%200"> (deterministic). The unified drift from <span class="citation" data-cites="domingoenrich2024adjoint">(<strong>domingoenrich2024adjoint?</strong>)</span> is</p>
<p><span id="eq-unified-drift"><img src="https://latex.codecogs.com/png.latex?%0Ab(x,t)%20=%20%5Ckappa_t%20%5C,%20x%20+%20%20%7B%5Cleft(%20%5Ctfrac%7B%5Csigma_t%5E2%7D%7B2%7D%20+%20%5Ceta_t%20%5Cright)%7D%20%20%5Cnabla%20%5Clog%20p_t(x)%0A%5Ctag%7B8%7D"></span></p>
<p>This drift is constructed so that the SDE has the same time marginals as the reference interpolation; the <img src="https://latex.codecogs.com/png.latex?%5Ckappa_t%20x"> term handles the deterministic scaling and the score term corrects for the noise. Here <img src="https://latex.codecogs.com/png.latex?%5Ckappa_t%20=%20%5Cdot%7B%5Calpha%7D_t%20/%20%5Calpha_t"> and <img src="https://latex.codecogs.com/png.latex?%5Ceta_t%20=%20%5Cbeta_t(%5Cdot%7B%5Calpha%7D_t%20%5Cbeta_t%20/%20%5Calpha_t%20-%20%5Cdot%7B%5Cbeta%7D_t)">. For the SDE to produce independent <img src="https://latex.codecogs.com/png.latex?X_0"> and <img src="https://latex.codecogs.com/png.latex?X_1">, it needs to inject enough noise to erase memory of <img src="https://latex.codecogs.com/png.latex?X_0"> by time 1. The base SDE with drift <img src="https://latex.codecogs.com/png.latex?b"> and diffusion <img src="https://latex.codecogs.com/png.latex?%5Csigma_t"> has the same marginals as <img src="https://latex.codecogs.com/png.latex?%5Cbar%7BX%7D_t">. For <img src="https://latex.codecogs.com/png.latex?X_0%20%5Cperp%20X_1"> to hold, the noise must be large enough that the SDE “forgets” its initial condition by time 1. The memoryless noise level <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%20%5Csqrt%7B2%5Ceta_t%7D"> is the unique choice that makes the conditional law <img src="https://latex.codecogs.com/png.latex?X_t%20%7C%20X_1"> under the SDE match the reference Gaussian structure <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BN%7D(%5Calpha_t%20X_1,%20%5Cbeta_t%5E2%20I)"> for all <img src="https://latex.codecogs.com/png.latex?t">. The paper (Proposition in Section 12.1 of <span class="citation" data-cites="domingoenrich2024adjoint">(<strong>domingoenrich2024adjoint?</strong>)</span>) proves this by analyzing the time-reversed SDE and showing that the coefficient of <img src="https://latex.codecogs.com/png.latex?X_0"> in the explicit solution vanishes if and only if <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%5E2%20%5Cgeq%202%5Ceta_t">, with <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%5E2%20=%202%5Ceta_t"> being the minimal such choice. This requires</p>
<p><span id="eq-memoryless"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctextcolor%7Bblue%7D%7B%5Csigma_t%20=%20%5Csqrt%7B2%20%5Ceta_t%7D%7D.%0A%5Ctag%7B9%7D"></span></p>
<p>Near <img src="https://latex.codecogs.com/png.latex?t=0">, <img src="https://latex.codecogs.com/png.latex?%5Ceta_t%20%5Cto%20%5Cinfty"> so <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%5Cto%20%5Cinfty">: the process mixes aggressively, erasing memory of <img src="https://latex.codecogs.com/png.latex?X_0">. Near <img src="https://latex.codecogs.com/png.latex?t=1">, <img src="https://latex.codecogs.com/png.latex?%5Ceta_t%20%5Cto%200"> so <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%5Cto%200">: the process stabilizes around <img src="https://latex.codecogs.com/png.latex?X_1">.</p>
<details>
<summary>
Why <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%20%5Csqrt%7B2%5Ceta_t%7D"> is the right condition (sketch):
</summary>
The time-reversed SDE for <img src="https://latex.codecogs.com/png.latex?%5Cvec%7BX%7D_t%20=%20X_%7B1-t%7D"> is a linear SDE whose explicit solution expresses <img src="https://latex.codecogs.com/png.latex?%5Cvec%7BX%7D_1%20=%20X_0"> as a function of <img src="https://latex.codecogs.com/png.latex?%5Cvec%7BX%7D_0%20=%20X_1">. The coefficient of <img src="https://latex.codecogs.com/png.latex?X_1"> in this expression involves <img src="https://latex.codecogs.com/png.latex?%5Cexp(-%5Cint_0%5E1%20%5Csigma_s%5E2/(2%5Cbeta_s%5E2)%20ds)">. For <img src="https://latex.codecogs.com/png.latex?X_0%20%5Cperp%20X_1">, this coefficient must vanish, requiring <img src="https://latex.codecogs.com/png.latex?%5Cint%20%5Csigma_s%5E2/(2%5Cbeta_s%5E2)%20ds%20=%20%5Cinfty">. The threshold is <img src="https://latex.codecogs.com/png.latex?%5Csigma_s%5E2%20=%202%5Ceta_s"> (the paper proves this in Appendix 12.1). Below this threshold, correlation persists; above it, the process mixes too aggressively and distorts the time marginals.
</details>
<details>
<summary>
Checking the flow matching schedule explicitly:
</summary>
<p style="color: blue;">
Take <img src="https://latex.codecogs.com/png.latex?%5Calpha_t%20=%20t"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta_t%20=%201-t">. Then <img src="https://latex.codecogs.com/png.latex?%5Cdot%7B%5Calpha%7D_t%20=%201">, <img src="https://latex.codecogs.com/png.latex?%5Cdot%7B%5Cbeta%7D_t%20=%20-1">, <img src="https://latex.codecogs.com/png.latex?%5Ckappa_t%20=%201/t">, and <img src="https://latex.codecogs.com/png.latex?%0A%5Ceta_t%20=%20(1-t)%20%7B%5Cleft(%20%5Cfrac%7B1%7D%7Bt%7D(1-t)%20-%20(-1)%20%5Cright)%7D%20%20=%20(1-t)%20%7B%5Cleft(%20%5Cfrac%7B1-t%7D%7Bt%7D%20+%201%20%5Cright)%7D%20%20=%20%5Cfrac%7B(1-t)%7D%7Bt%7D.%0A"> So the memoryless schedule is <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%20%5Csqrt%7B2(1-t)/t%7D">, which blows up as <img src="https://latex.codecogs.com/png.latex?t%20%5Cto%200"> (aggressive mixing near the noise) and vanishes as <img src="https://latex.codecogs.com/png.latex?t%20%5Cto%201"> (stabilizing near the sample).
</p>
</details>
<p>(In practice, the time interval is truncated to <img src="https://latex.codecogs.com/png.latex?%5B%5Cvarepsilon,%201%5D"> to avoid the singularity at <img src="https://latex.codecogs.com/png.latex?t%20=%200">.)</p>
<p>For DDIM with <img src="https://latex.codecogs.com/png.latex?%5Calpha_t%20=%20%5Csqrt%7B%5Cbar%7B%5Calpha%7D_t%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cbeta_t%20=%20%5Csqrt%7B1%20-%20%5Cbar%7B%5Calpha%7D_t%7D">, the memoryless schedule gives <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%20%5Csqrt%7B%5Cdot%7B%5Cbar%7B%5Calpha%7D%7D_t%20/%20%5Cbar%7B%5Calpha%7D_t%7D">, which is exactly the DDPM noise schedule (verified in the details block above for flow matching; for the DDPM verification, see Table 1 of the paper). The DDPM noise schedule is the memoryless schedule for DDIM.</p>
<p>The paper proves (Theorem 2) that within the family of SDEs sharing marginals with the reference flow, the memoryless schedule is not just sufficient but <em>necessary</em> for the fine-tuned velocity to be convertible to arbitrary noise schedules. The memoryless schedule is the unique choice that preserves the velocity-score relationship: a model trained under the memoryless schedule yields consistent velocity and score fields, <img src="https://latex.codecogs.com/png.latex?v_%5Ctheta(t,x)%20=%20b(x,t)%20+%20%5Csigma_t%20u_%5Ctheta(t,x)"> and <img src="https://latex.codecogs.com/png.latex?s_%5Ctheta(t,x)%20=%20-u_%5Ctheta(t,x)/%5Csigma_t%20+%20%5Cnabla%20%5Clog%20p_t(x)">, enabling conversion to arbitrary noise schedules after fine-tuning.</p>
<p>The memoryless schedule is only needed during fine-tuning. After learning the control <img src="https://latex.codecogs.com/png.latex?u">, the fine-tuned model (base drift plus control) can be converted back to a velocity field and sampled with any <img src="https://latex.codecogs.com/png.latex?%5Csigma_t">, including <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%200">.</p>
</section>
<section id="adjoint-matching" class="level2">
<h2 class="anchored" data-anchor-id="adjoint-matching">Adjoint Matching</h2>
<p>With the memoryless schedule, we need to solve Equation&nbsp;4. The <a href="../../notes/adjoint_method/adjoint.html">adjoint method</a> gives the gradient of the cost <img src="https://latex.codecogs.com/png.latex?J"> along a trajectory. The adjoint state is the sensitivity of the future cost to perturbations at time <img src="https://latex.codecogs.com/png.latex?t">:</p>
<p><span id="eq-adjoint-state"><img src="https://latex.codecogs.com/png.latex?%0Aa(t)%20=%20%5Cnabla_%7BX_t%7D%20%20%7B%5Cleft%5B%20%20%5Cint_t%5E1%20%5Ctfrac%7B1%7D%7B2%7D%20%5C%7Cu(s,%20X_s)%5C%7C%5E2%20%5C,%20ds%20-%20r(X_1)%20%20%5Cright%5D%7D%20.%0A%5Ctag%7B10%7D"></span></p>
<p>Applying the adjoint ODE from the <a href="../../notes/adjoint_method/adjoint.html">adjoint notes</a> to the controlled drift <img src="https://latex.codecogs.com/png.latex?b%20+%20%5Csigma_t%20u"> with running cost <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2"> and terminal cost <img src="https://latex.codecogs.com/png.latex?-r">:</p>
<p><span id="eq-adjoint-ode"><img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7Ba%7D(t)%20=%20-%20%7B%5Cleft%5B%20%5Cnabla_x%20b%20+%20%5Csigma_t%20%5C,%20%5Cnabla_x%20u%20%5Cright%5D%7D%20%5E%5Ctop%20a(t)%20-%20%5Cunderbrace%7B(%5Cnabla_x%20u)%5E%5Ctop%20u%7D_%7B%5Cnabla_x(%5Cfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2)%20%5Ctext%7B%20(chain%20rule)%7D%7D,%20%5Cqquad%20a(1)%20=%20-%5Cnabla%20r(X_1).%0A%5Ctag%7B11%7D"></span></p>
<p>The conditional expectation <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5Ba(t)%20%5Cmid%20X_t%20=%20x%5D%20=%20%5Cnabla_x%20J(u;%20x,%20t)"> is the gradient of the cost functional; heuristically, following the SDE extension described in the <a href="../../notes/adjoint_method/adjoint.html">adjoint notes</a> (the interchange of gradient and conditional expectation requires regularity of <img src="https://latex.codecogs.com/png.latex?r"> and integrability of <img src="https://latex.codecogs.com/png.latex?%5Cnabla%20r%20%5Ccdot%20%5Cexp(r)">). The paper defines <img src="https://latex.codecogs.com/png.latex?V"> as cost-to-go (minimization); we use the HJB notes’ convention <img src="https://latex.codecogs.com/png.latex?V%20=%20%5Clog%20h"> (reward-to-go, maximization). The two are negatives of each other: <img src="https://latex.codecogs.com/png.latex?V_%7B%5Ctext%7Bhere%7D%7D%20=%20-V_%7B%5Ctext%7Bpaper%7D%7D">. Since <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20=%20%5Csigma_t%5E%5Ctop%20%5Cnabla%20V"> and <img src="https://latex.codecogs.com/png.latex?V(t,x)%20=%20-J(u%5E%5Cstar;%20x,%20t)"> at optimality, we get</p>
<p><span id="eq-fixed-point"><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar(t,%20x)%20=%20-%5Csigma_t%5E%5Ctop%20%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20a(t;%20X,%20u%5E%5Cstar)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A%5Ctag%7B12%7D"></span></p>
<p>This is a fixed-point condition: <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> is the unique control satisfying Equation&nbsp;12.</p>
<p>Turn this into a regression. For a current control <img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bu%7D"> (parameters frozen), simulate <img src="https://latex.codecogs.com/png.latex?X%20%5Csim%20%5Cmathbb%7BP%7D%5E%7B%5Cbar%7Bu%7D%7D">, solve the adjoint ODE Equation&nbsp;11 backward, and regress:</p>
<p><span id="eq-basic-am"><img src="https://latex.codecogs.com/png.latex?%0AL_%7B%5Ctext%7Bbasic%7D%7D(%5Ctheta)%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5Cint_0%5E1%20%5C%7C%20u_%5Ctheta(X_t,%20t)%20+%20%5Csigma_t%5E%5Ctop%20a(t;%20X,%20%5Cbar%7Bu%7D)%20%5C%7C%5E2%20%5C,%20dt,%20%5Cqquad%20X%20%5Csim%20%5Cmathbb%7BP%7D%5E%7B%5Cbar%7Bu%7D%7D,%20%5Cquad%20%5Cbar%7Bu%7D%20=%20%5Ctexttt%7Bsg%7D(u_%5Ctheta).%0A%5Ctag%7B13%7D"></span></p>
<p>Here <img src="https://latex.codecogs.com/png.latex?%5Ctexttt%7Bsg%7D"> denotes stop-gradient: the trajectory and adjoint use frozen parameters; gradients only flow through the <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta"> term. Expanding: <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%5Ctheta%20L_%7B%5Ctext%7Bbasic%7D%7D%20=%20%5Cmathbb%7BE%7D%5B(%5Cnabla_%5Ctheta%20u_%5Ctheta)%5E%5Ctop%20(u_%5Ctheta%20+%20%5Csigma_t%20a)%5D">. At <img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bu%7D%20=%20u_%5Ctheta"> (stop-gradient), the <img src="https://latex.codecogs.com/png.latex?a"> term produces the continuous adjoint gradient from Equation&nbsp;11. So this basic version produces the same parameter updates as the standard adjoint method.</p>
<section id="the-lean-adjoint" class="level3">
<h3 class="anchored" data-anchor-id="the-lean-adjoint">The lean adjoint</h3>
<p>The full adjoint Equation&nbsp;11 contains terms involving <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20u">. At optimality, these terms have conditional expectation zero.</p>
<details>
<summary>
Removing the <img src="https://latex.codecogs.com/png.latex?u">-dependent terms:
</summary>
<p>Both sides are column vectors in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5ED">. The minimizer of the regression Equation&nbsp;13 is the conditional expectation:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar(t,%20x)%20=%20-%5Csigma_t%5E%5Ctop%20%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20a(t)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20.%0A"></p>
<p>Right-multiply both sides by the Jacobian <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20u%5E%5Cstar(t,%20x)">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Au%5E%5Cstar(t,%20x)%5E%5Ctop%20%5Cnabla_x%20u%5E%5Cstar(t,%20x)%20=%20-%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20a(t)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20%5E%5Ctop%20%5Csigma_t%20%5C,%20%5Cnabla_x%20u%5E%5Cstar(t,%20x).%0A"></p>
<p>Since <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar(t,x)"> and <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20u%5E%5Cstar(t,x)"> are deterministic functions of <img src="https://latex.codecogs.com/png.latex?(t,x)">, they can be pulled in and out of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Ccdot%20%7C%20X_t%20=%20x%5D"> freely. Rearranging and applying the tower property:</p>
<p><span id="eq-zero-terms"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D%20%7B%5Cleft%5B%20u%5E%5Cstar(t,%20x)%5E%5Ctop%20%5Cnabla_x%20u%5E%5Cstar(t,%20x)%20+%20a(t)%5E%5Ctop%20%5Csigma_t%20%5C,%20%5Cnabla_x%20u%5E%5Cstar(t,%20x)%20%5Cmid%20X_t%20=%20x%20%5Cright%5D%7D%20%20=%200.%0A%5Ctag%7B14%7D"></span></p>
The terms inside the expectation appear in the full adjoint ODE Equation&nbsp;11 (they are the <img src="https://latex.codecogs.com/png.latex?u">-dependent pieces: <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20%5C,%20%5Cnabla_x%20u%5E%5Ctop%20a"> and <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x(%5Cfrac%7B1%7D%7B2%7D%5C%7Cu%5C%7C%5E2)%20=%20(%5Cnabla_x%20u)%5E%5Ctop%20u">). They vanish in conditional expectation at optimality.
</details>
<p>This gives the <em>lean adjoint</em> <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D(t)">:</p>
<p><span id="eq-lean-adjoint"><img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7B%5Ctilde%7Ba%7D%7D(t)%20=%20-%5Cnabla_x%20b(X_t,%20t)%5E%5Ctop%20%5Ctilde%7Ba%7D(t),%20%5Cqquad%20%5Ctilde%7Ba%7D(1)%20=%20-%5Cnabla%20r(X_1).%0A%5Ctag%7B15%7D"></span></p>
<p>Compare with Equation&nbsp;11: every <img src="https://latex.codecogs.com/png.latex?u">-dependent term is gone. The lean adjoint depends only on the base drift <img src="https://latex.codecogs.com/png.latex?b">, not on the control. No need to compute <img src="https://latex.codecogs.com/png.latex?%5Cnabla_x%20u">, which is expensive for neural networks. The lean adjoint also has smaller magnitude since the removed terms cancel in expectation but add gradient variance.</p>
<p>The lean adjoint is the adjoint ODE from the <a href="../../notes/adjoint_method/adjoint.html">adjoint notes</a> applied to the base dynamics <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx%7D%20=%20b(t,x)"> with terminal cost <img src="https://latex.codecogs.com/png.latex?-r">.</p>
<p>The Adjoint Matching loss replaces the full adjoint with the lean one:</p>
<p><span id="eq-am-loss"><img src="https://latex.codecogs.com/png.latex?%0AL_%7B%5Ctext%7BAM%7D%7D(%5Ctheta)%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5Cint_0%5E1%20%5C%7C%20u_%5Ctheta(X_t,%20t)%20+%20%5Csigma_t%5E%5Ctop%20%5Ctilde%7Ba%7D(t;%20X,%20%5Cbar%7Bu%7D)%20%5C%7C%5E2%20%5C,%20dt,%20%5Cqquad%20X%20%5Csim%20%5Cmathbb%7BP%7D%5E%7B%5Cbar%7Bu%7D%7D.%0A%5Ctag%7B16%7D"></span></p>
<p>The unique critical point of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BL_%7B%5Ctext%7BAM%7D%7D%5D"> is <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar">. The argument above shows that <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5Ba(t)%5E%5Ctop%20%5Csigma_t%20%5Cnabla_x%20u%5E%5Cstar%20+%20(%5Cnabla_x%20u%5E%5Cstar)%5E%5Ctop%20u%5E%5Cstar%20%5Cmid%20X_t%5D%20=%200"> at optimality. This does NOT mean the lean adjoint <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D(t)"> equals <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5Ba(t)%20%5Cmid%20X_t%5D"> pointwise; it means that replacing <img src="https://latex.codecogs.com/png.latex?a"> by <img src="https://latex.codecogs.com/png.latex?%5Ctilde%7Ba%7D"> in the regression loss produces the same gradient at <img src="https://latex.codecogs.com/png.latex?u%20=%20u%5E%5Cstar">. To see why: the gradient of <img src="https://latex.codecogs.com/png.latex?L_%7B%5Ctext%7BAM%7D%7D(%5Ctheta)%20=%20%5Cfrac%7B1%7D%7B2%7D%5Cmathbb%7BE%7D%5C%7Cu_%5Ctheta%20+%20%5Csigma_t%20%5Ctilde%7Ba%7D%5C%7C%5E2"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> is <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B(%5Cnabla_%5Ctheta%20u_%5Ctheta)%5E%5Ctop(u_%5Ctheta%20+%20%5Csigma_t%20%5Ctilde%7Ba%7D)%5D">. At <img src="https://latex.codecogs.com/png.latex?u_%5Ctheta%20=%20u%5E%5Cstar">, this equals <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B(%5Cnabla_%5Ctheta%20u%5E%5Cstar)%5E%5Ctop(u%5E%5Cstar%20+%20%5Csigma_t%20%5Ctilde%7Ba%7D)%5D">. Adding back the removed terms: <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar%20+%20%5Csigma_t%20a%20=%20u%5E%5Cstar%20+%20%5Csigma_t%20%5Ctilde%7Ba%7D%20+%20%5Csigma_t(%5Ctext%7Bremoved%20terms%7D)">. Since the removed terms have zero conditional expectation given <img src="https://latex.codecogs.com/png.latex?X_t"> and <img src="https://latex.codecogs.com/png.latex?%5Cnabla_%5Ctheta%20u%5E%5Cstar"> is a function of <img src="https://latex.codecogs.com/png.latex?X_t">, the tower property gives <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B(%5Cnabla_%5Ctheta%20u%5E%5Cstar)%5E%5Ctop%20%5Csigma_t(%5Ctext%7Bremoved%7D)%5D%20=%200">. So the gradients of the lean and basic losses agree at <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar">, and by the uniqueness of the critical point of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BL_%7B%5Ctext%7Bbasic%7D%7D%5D"> (Appendix 13.3 of the paper), <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> is also the unique critical point of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5BL_%7B%5Ctext%7BAM%7D%7D%5D">.</p>
<p>Unlike the basic version, the lean adjoint produces a <em>different</em> gradient than the standard adjoint method away from optimality (the removed terms have expectation zero only at <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar">, not elsewhere). The paper reports more stable convergence in practice.</p>
</section>
</section>
<section id="after-fine-tuning" class="level2">
<h2 class="anchored" data-anchor-id="after-fine-tuning">After fine-tuning</h2>
<p>The memoryless schedule <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%20%5Csqrt%7B2%5Ceta_t%7D"> is only used during training. After convergence, the fine-tuned drift can be converted to a velocity field and sampled with any noise schedule, including <img src="https://latex.codecogs.com/png.latex?%5Csigma_t%20=%200"> for deterministic generation.</p>
<!-- BibTeX entries to add to ref.bib:
@article{domingoenrich2024adjoint,
  title={Adjoint Matching: Fine-Tuning Flow and Diffusion Generative Models with Memoryless Stochastic Optimal Control},
  author={Domingo-Enrich, Carla and Drozdzal, Michal and Karras, Brian and Chen, Ricky T. Q. and Lipman, Yaron},
  journal={ICML 2025},
  year={2024},
  url={https://arxiv.org/abs/2409.08861}
}
-->


</section>

 ]]></description>
  <category>SDE</category>
  <category>markov</category>
  <category>optimal control</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/adjoint_matching.html</guid>
  <pubDate>Sat, 21 Mar 2026 16:00:00 GMT</pubDate>
</item>
<item>
  <title>The mean-field Potts model</title>
  <link>https://alexxthiery.github.io/notes/potts_transition/potts.html</link>
  <description><![CDATA[ 





<!-- ::: {style="text-align:center;"}
![[Renfrey Potts](https://en.wikipedia.org/wiki/Renfrey_Potts) (1925–2005)](./potts.jpg){fig-align="center" width=35%}
::: -->
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/potts_transition/potts_scatter_N200_S5000_F50.gif" class="img-fluid figure-img" style="width:100.0%"></p>
<figcaption>Mean-field Potts model (<img src="https://latex.codecogs.com/png.latex?N=200">, <img src="https://latex.codecogs.com/png.latex?q=3">). Left: samples in barycentric coordinates. Right: free energy <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta(r)"> on the ordered ansatz, with local minima marked.</figcaption>
</figure>
</div>
</div>
<p>The mean-field <a href="https://en.wikipedia.org/wiki/Potts_model">Potts model</a> is a very simple model with a first order phase transition; for Monte-Carlo simulation, it is especially interesting since this first order <a href="https://en.wikipedia.org/wiki/Phase_transition">phase transition</a> implies that standard tempering strategies such as <a href="https://en.wikipedia.org/wiki/Parallel_tempering">parallel-tempering</a> or sequential-monte-carlo are inefficient when local-move MCMC are used. Increasing the number of intermediate temperature just does not help (much) producing samples at low temperatures <span class="citation" data-cites="woodard2009sufficient bhatnagar2004torpid">(Woodard, Schmidler, and Huber 2009; Bhatnagar and Randall 2004)</span></p>
<section id="potts-model" class="level3">
<h3 class="anchored" data-anchor-id="potts-model">Potts model</h3>
<p>Consider the Potts model with <img src="https://latex.codecogs.com/png.latex?q"> colors on the complete graph with <img src="https://latex.codecogs.com/png.latex?N"> vertices. A configuration is <img src="https://latex.codecogs.com/png.latex?%5Csigma=(%5Csigma_1,%5Cdots,%5Csigma_N)"> with <img src="https://latex.codecogs.com/png.latex?%5Csigma_i%5Cin%5C%7B1,%5Cdots,q%5C%7D">. Define the energy <img src="https://latex.codecogs.com/png.latex?%0AE(%5Csigma)%5C;=%5C;-%5Cfrac%7B1%7D%7B2N%7D%5Csum_%7Bi,j=1%7D%5EN%20%5Cmathbf%201%5C%7B%5Csigma_i=%5Csigma_j%5C%7D.%0A"> At inverse temperature <img src="https://latex.codecogs.com/png.latex?%5Cbeta">, the Boltzmann distribution is <img src="https://latex.codecogs.com/png.latex?%5Cmu_%5Cbeta(%5Csigma)=e%5E%7B-%5Cbeta%20E(%5Csigma)%7D%20/%20Z_%5Cbeta">. On the complete graph, the only relevant macroscopic variable is the empirical proportions vector <img src="https://latex.codecogs.com/png.latex?%0A%5Crho=(%5Crho_1,%5Cdots,%5Crho_q),%5Cqquad%0A%5Crho_a=%5Cfrac1N%5Cbigl%7C%5C%7Bi:%5Csigma_i=a%5C%7D%5Cbigr%7C.%0A"></p>
<p>so that <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Ba=1%7D%5Eq%20%5Crho_a=1">. A short computation rewrites the energy in terms of <img src="https://latex.codecogs.com/png.latex?%5Crho">: <img src="https://latex.codecogs.com/png.latex?%0AE(%5Crho)=%20-%5Cfrac%7BN%7D%7B2%7D%5Csum_%7Ba=1%7D%5Eq%20%5Crho_a%5E2,%0A"> up to an additive constant irrelevant for Gibbs weights. The <a href="../../notes/sanov/sanov.html">number of configurations</a> with a given <img src="https://latex.codecogs.com/png.latex?%5Crho"> is <img src="https://latex.codecogs.com/png.latex?%5Cexp%5C%7BN%20%5C,%20H(%5Crho)+o(N)%5C%7D">, where <img src="https://latex.codecogs.com/png.latex?H(%5Crho)=-%5Csum_a%20%5Crho_a%5Clog%5Crho_a"> is the <a href="https://en.wikipedia.org/wiki/Entropy_(information_theory)">Shannon entropy</a>. Putting energy and entropy together, typical samples from <img src="https://latex.codecogs.com/png.latex?%5Cmu_%5Cbeta"> concentrate near minimizers of the mean-field free-energy functional: <img src="https://latex.codecogs.com/png.latex?%0A%5CPhi_%5Cbeta(%5Crho)%0A=%5Csum_%7Ba=1%7D%5Eq%20%5Crho_a%5Clog%5Crho_a%0A-%5Cfrac%7B%5Cbeta%7D%7B2%7D%5Csum_%7Ba=1%7D%5Eq%20%5Crho_a%5E2%0A"></p>
<p>constrained to the probability simplex. Everything that follows is geometry: how the minima of <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta"> evolve as the inverse temperature <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> varies.</p>
<p><strong>Local minima:</strong> Two features make the analysis almost trivial. First, permuting colors leaves <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta"> unchanged. Second, a stationary point under the simplex constraint satisfies a Lagrange-multiplier condition <img src="https://latex.codecogs.com/png.latex?%0A%5Clog%5Crho_a+1-%5Cbeta%5Crho_a=%5Clambda%0A"> for <img src="https://latex.codecogs.com/png.latex?a=1,%5Cdots,q">. Hence each coordinate <img src="https://latex.codecogs.com/png.latex?%5Crho_a"> must solve the same scalar equation. From this, one finds that all local minima are necessarily of the following two types:</p>
<ul>
<li><p><strong>Disordered point</strong> (uniform): <img src="https://latex.codecogs.com/png.latex?%0A%5Crho%5E%7B%5Cmathrm%7Bdis%7D%7D=%5CBigl(%5Cfrac1q,%5Cdots,%5Cfrac1q%5CBigr),%0A"> always a stationary point.</p></li>
<li><p><strong>Ordered points</strong> (one dominant color, the rest equal): <img src="https://latex.codecogs.com/png.latex?%0A%5Crho%5E%7B%5Cmathrm%7Bord%7D%7D(r)=%5CBigl(r,%5C%20%5Cunderbrace%7B%5Cfrac%7B1-r%7D%7Bq-1%7D,%5Cdots,%5Cfrac%7B1-r%7D%7Bq-1%7D%7D_%7Bq-1%5C%20%5Ctext%7Btimes%7D%7D%5CBigr)%0A"> for some dominant proportion <img src="https://latex.codecogs.com/png.latex?r%3E1/q">. There are <img src="https://latex.codecogs.com/png.latex?q"> such points by choosing which color is dominant.</p></li>
</ul>
<p>The remaining work is algebra: determine, as a function of <img src="https://latex.codecogs.com/png.latex?%5Cbeta">, when ordered stationary points exist, and which of the stationary points are local minima versus saddles. The details are routine and add little insight.</p>
</section>
<section id="the-phase-diagram-in-beta" class="level2">
<h2 class="anchored" data-anchor-id="the-phase-diagram-in-beta">The phase diagram in <img src="https://latex.codecogs.com/png.latex?%5Cbeta"></h2>
<p>Assume <img src="https://latex.codecogs.com/png.latex?q%5Cge%203">. Then the model exhibits a first-order transition, and metastability appears on both sides. There are two key inverse temperatures:</p>
<ul>
<li><strong>Spinodal threshold <img src="https://latex.codecogs.com/png.latex?%5Cbeta_s"></strong>: the ordered stationary points appear as local minima.</li>
<li><strong>Coexistence threshold <img src="https://latex.codecogs.com/png.latex?%5Cbeta_c"></strong>: the disordered minimum and the ordered minimum have equal free energy.</li>
</ul>
<p>For the normalization above, the coexistence point is <img src="https://latex.codecogs.com/png.latex?%0A%5Cbeta_c=%5Cfrac%7B2(q-1)%5Clog(q-1)%7D%7Bq-2%7D.%0A"></p>
<p>The geometry of <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta"> splits into three regimes.</p>
<section id="high-temperature-betabeta_s" class="level3">
<h3 class="anchored" data-anchor-id="high-temperature-betabeta_s">High temperature: <img src="https://latex.codecogs.com/png.latex?%5Cbeta%3C%5Cbeta_s"></h3>
<ul>
<li><strong>Critical points:</strong> only the uniform point <img src="https://latex.codecogs.com/png.latex?%5Crho%5E%7B%5Cmathrm%7Bdis%7D%7D">.</li>
<li><strong>Landscape:</strong> <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta"> is strictly minimized at <img src="https://latex.codecogs.com/png.latex?%5Crho%5E%7B%5Cmathrm%7Bdis%7D%7D">.</li>
<li><strong>Meaning:</strong> entropy dominates; colors mix.</li>
</ul>
</section>
<section id="metastable-coexistence-beta_sbetabeta_c" class="level3">
<h3 class="anchored" data-anchor-id="metastable-coexistence-beta_sbetabeta_c">Metastable coexistence: <img src="https://latex.codecogs.com/png.latex?%5Cbeta_s%3C%5Cbeta%3C%5Cbeta_c"></h3>
<ul>
<li><strong>Critical points:</strong> the uniform point remains a (global) minimum, but there are also <img src="https://latex.codecogs.com/png.latex?q"> ordered local minima <img src="https://latex.codecogs.com/png.latex?%5Crho%5E%7B%5Cmathrm%7Bord%7D%7D"> and corresponding saddles separating them from the uniform basin.</li>
<li><strong>Landscape:</strong> multiple basins exist, but the uniform basin is lowest.</li>
</ul>
</section>
<section id="low-temperature-betabeta_c" class="level3">
<h3 class="anchored" data-anchor-id="low-temperature-betabeta_c">Low temperature: <img src="https://latex.codecogs.com/png.latex?%5Cbeta%3E%5Cbeta_c"></h3>
<ul>
<li><strong>Critical points:</strong> the ordered minima become the global minima; the uniform point persists as a local minimum (until it eventually disappears at a second spinodal on the low-temperature side).</li>
<li><strong>Landscape:</strong> the roles swap: ordered basins are deepest; the uniform basin becomes metastable.</li>
<li><strong>Meaning:</strong> energy dominates; one color wins.</li>
</ul>
<p>At <img src="https://latex.codecogs.com/png.latex?%5Cbeta=%5Cbeta_c">, the global minimizer changes discontinuously (as can be seen in the animation at the start of these notes): the equilibrium state jumps from <img src="https://latex.codecogs.com/png.latex?%5Crho%5E%7B%5Cmathrm%7Bdis%7D%7D"> to an ordered vector with one strictly larger coordinate. This is in contrast with the (mean-field) Curie–Weiss Ising model (<img src="https://latex.codecogs.com/png.latex?q=2">), where the ordered minimizers bifurcate continuously from the disordered one, i.e.&nbsp;a second-order transition. For <img src="https://latex.codecogs.com/png.latex?q%5Cge%203">, ordered minima appear while the uniform minimum is still globally optimal, and the eventual swap of global minima happens with a jump. That single change in the geometry of <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta"> is the entire origin of the first-order transition and the metastable window.</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/potts_transition/potts_scatter_N10000_S5000_F50.gif" class="img-fluid figure-img" style="width:100.0%"></p>
<figcaption>Mean-field Potts model (<img src="https://latex.codecogs.com/png.latex?N=10%5E4">, <img src="https://latex.codecogs.com/png.latex?q=3">). Left: samples in barycentric coordinates. Right: free energy <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta(r)"> on the ordered ansatz.</figcaption>
</figure>
</div>
</div>
</section>
<section id="why-tempering-fails" class="level3">
<h3 class="anchored" data-anchor-id="why-tempering-fails">Why tempering fails</h3>
<p>The phase diagram above has a direct, and somewhat depressing, consequence for sampling. Consider a single-site <a href="https://en.wikipedia.org/wiki/Gibbs_sampling">Gibbs sampler</a> targeting <img src="https://latex.codecogs.com/png.latex?%5Cmu_%5Cbeta">: at each step, pick a vertex <img src="https://latex.codecogs.com/png.latex?i"> uniformly and resample <img src="https://latex.codecogs.com/png.latex?%5Csigma_i"> from its conditional. This chain moves <img src="https://latex.codecogs.com/png.latex?%5Crho"> by increments of order <img src="https://latex.codecogs.com/png.latex?1/N">. To cross the free energy barrier separating the disordered and ordered basins, it must pass through configurations where <img src="https://latex.codecogs.com/png.latex?%5CPhi_%5Cbeta"> is <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BO%7D(1)"> above the basin floors. Since the Boltzmann weight of such configurations is suppressed by <img src="https://latex.codecogs.com/png.latex?e%5E%7B-%5CTheta(N)%7D">, the mixing time is exponential in <img src="https://latex.codecogs.com/png.latex?N"> for any <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> in the coexistence window <img src="https://latex.codecogs.com/png.latex?%5B%5Cbeta_s,%20%5Cbeta_c%5D">.</p>
<p>The standard fix is <a href="https://en.wikipedia.org/wiki/Parallel_tempering">parallel tempering</a>: run chains at a ladder of temperatures <img src="https://latex.codecogs.com/png.latex?%5Cbeta_1%20%3C%20%5Cbeta_2%20%3C%20%5Cdots%20%3C%20%5Cbeta_K"> and propose swaps between adjacent chains. The hope is that high-temperature chains explore freely and pass information down. For second-order transitions such as the Curie–Weiss model (<img src="https://latex.codecogs.com/png.latex?q=2">), this works: the barrier height vanishes continuously at the critical point, so a fine enough temperature ladder eliminates all bottlenecks.</p>
<p>For the mean-field Potts model with <img src="https://latex.codecogs.com/png.latex?q%20%5Cge%203">, the situation is entirely different. The barrier does not shrink to zero; it appears suddenly at <img src="https://latex.codecogs.com/png.latex?%5Cbeta_s"> with height <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BO%7D(1)"> in free energy, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BO%7D(N)"> in log-probability. At every temperature in the metastable window, each chain individually faces an exponential barrier. Swapping two chains that are both trapped accomplishes nothing <span class="citation" data-cites="bhatnagar2004torpid">(Bhatnagar and Randall 2004)</span>,<span class="citation" data-cites="woodard2009sufficient">(Woodard, Schmidler, and Huber 2009)</span>. For tempering to help, adjacent temperatures must have distributions with reasonable overlap. But in the coexistence window, <img src="https://latex.codecogs.com/png.latex?%5Cmu_%5Cbeta"> is bimodal for every <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20%5Cin%20%5B%5Cbeta_s,%20%5Cbeta_c%5D">: it places most of its mass on two well-separated regions with an exponentially suppressed valley in between. Making adjacent temperatures closer does not fix this; it just gives you two equally bimodal distributions that swap happily within each basin but never across.</p>



</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-bhatnagar2004torpid" class="csl-entry">
Bhatnagar, Nayantara, and Dana Randall. 2004. <span>“Torpid Mixing of Simulated Tempering on the Potts Model.”</span> In <em>SODA</em>, 4:478–87.
</div>
<div id="ref-woodard2009sufficient" class="csl-entry">
Woodard, Dawn, Scott Schmidler, and Mark Huber. 2009. <span>“Sufficient Conditions for Torpid Mixing of Parallel and Simulated Tempering.”</span>
</div>
</div></section></div> ]]></description>
  <category>analysis</category>
  <guid>https://alexxthiery.github.io/notes/potts_transition/potts.html</guid>
  <pubDate>Mon, 23 Feb 2026 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Gegenbauer Polynomials and the Laplacian</title>
  <link>https://alexxthiery.github.io/notes/gegenbauer/gegenbauer.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/gegenbauer/gegenbauer.jpg" class="img-fluid figure-img" style="width:35.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Leopold_Gegenbauer">Leopold Gegenbauer</a> (1849 – 1903)</figcaption>
</figure>
</div>
</div>
<section id="zonal-spherical-harmonics" class="level3">
<h3 class="anchored" data-anchor-id="zonal-spherical-harmonics">Zonal spherical harmonics</h3>
<p>Understanding the eigenfunctions of the spherical Laplacian is a central task. These eigenfunctions form the building blocks of harmonic analysis on spheres.</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/gegenbauer/Spherical_Harmonics.png" class="img-fluid figure-img" style="width:85.0%"></p>
<figcaption>Spherical Harmonics</figcaption>
</figure>
</div>
</div>
<p>A particularly important situation arises when the function of interest depends only on the angular separation from a fixed axis.</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/gegenbauer/zonal.jpg" class="img-fluid figure-img" style="width:35.0%"></p>
<figcaption>Zonal Spherical Harmonics</figcaption>
</figure>
</div>
</div>
<p>Such zonal functions retain full rotational symmetry around that axis and reduce the spherical Laplacian to a one-dimensional operator. Its eigenfunctions turn out to be polynomials on the interval <img src="https://latex.codecogs.com/png.latex?%5B-1,1%5D"> with a very specific weight. These polynomials are the <a href="https://en.wikipedia.org/wiki/Gegenbauer_polynomials">Gegenbauer polynomials</a>, which generalize several classical families of orthogonal polynomials, including the Legendre and Chebyshev polynomials.</p>
</section>
<section id="reminder-on-differential-operators" class="level2">
<h2 class="anchored" data-anchor-id="reminder-on-differential-operators">Reminder on differential operators</h2>
<p>Many problems require the ability to compute gradients, divergences, and Laplacians in arbitrary coordinate systems. Before specializing to spherical coordinates in higher dimensions, it is useful to recall the geometric meaning of these operators and the minimal formalism needed to manipulate them. Suppose that a point in space is described by a collection of coordinates <img src="https://latex.codecogs.com/png.latex?%0Aq%20=%20(q%5E1,%20%5Cdots,%20q%5En).%0A"> If we make a small change <img src="https://latex.codecogs.com/png.latex?(dq%5E1,%5Cdots,dq%5En)">, the physical displacement has a length denoted by <img src="https://latex.codecogs.com/png.latex?ds">. In an orthogonal coordinate system, each coordinate direction comes with a scale factor <img src="https://latex.codecogs.com/png.latex?h_i(q)"> such that a change <img src="https://latex.codecogs.com/png.latex?dq%5Ei"> corresponds to a “physical” displacement of length <img src="https://latex.codecogs.com/png.latex?h_i(q),%20dq%5Ei"> along the unit vector <img src="https://latex.codecogs.com/png.latex?e_i">. These functions <img src="https://latex.codecogs.com/png.latex?h_i"> encode how the coordinate system stretches or compresses distances along each axis. Once the scale factors are known, the rest of the differential operators follow directly.</p>
<p><strong>The gradient:</strong> For a scalar function <img src="https://latex.codecogs.com/png.latex?f(q)">, the change produced by varying only <img src="https://latex.codecogs.com/png.latex?q%5Ei"> is approximately <img src="https://latex.codecogs.com/png.latex?%5Cpartial_%7Bd%20q%5Ei%7D%20f%20%5Ccdot%20dq%5Ei">. The physical distance traveled in this move is <img src="https://latex.codecogs.com/png.latex?h_i%20%5C,%20dq%5Ei">. The rate of increase of <img src="https://latex.codecogs.com/png.latex?f"> per unit distance in the direction <img src="https://latex.codecogs.com/png.latex?e_i"> is therefore <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7Bh_i%7D%20%5Cfrac%7B%5Cpartial%20f%7D%7B%5Cpartial%20q%5Ei%7D">. This is the <img src="https://latex.codecogs.com/png.latex?i">th component of the gradient. Summing over all directions gives <img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20f%20=%20%5Csum_%7Bi=1%7D%5En%20%5Cleft(%20%5Cfrac%7B1%7D%7Bh_i%7D%5Cfrac%7B%5Cpartial%20f%7D%7B%5Cpartial%20q%5Ei%7D%20%5Cright)%20e_i.%0A"></p>
<p><strong>The divergence</strong> describes the net outflow of a vector field from an infinitesimal volume around a point. Consider a vector field <img src="https://latex.codecogs.com/png.latex?v%20=%20%5Csum_i%20v%5Ei%20e_i">. Place a tiny coordinate-aligned box at a point. Its physical edge lengths are <img src="https://latex.codecogs.com/png.latex?h_i%20%5C,%20dq%5Ei">, so its infinitesimal volume is: <img src="https://latex.codecogs.com/png.latex?%0AdV%20=%20%5Cleft(%20%5Cprod_%7Bi=1%7D%5En%20h_i(q)%20%5Cright)%20dq%5E1%20%5Ccdots%20dq%5En.%0A"> The flux of <img src="https://latex.codecogs.com/png.latex?v"> through the pair of faces orthogonal to <img src="https://latex.codecogs.com/png.latex?e_i"> is <img src="https://latex.codecogs.com/png.latex?v%5Ei"> multiplied by the physical area of those faces: <img src="https://latex.codecogs.com/png.latex?%5Cprod_%7Bj%5Cne%20i%7D%20h_j">. The divergence is the total outward flux divided by the infinitesimal volume: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bdiv%7D%7Dv%0A=%0A%5Cfrac%7B1%7D%7B%5Cprod_j%20h_j%7D%0A%5Csum_%7Bi=1%7D%5En%0A%5Cfrac%7B%5Cpartial%7D%7B%5Cpartial%20q%5Ei%7D%0A%5Cleft(%0Av%5Ei%20%5C,%20%5Cfrac%7B%5Cprod_j%20h_j%7D%7Bh_i%7D%0A%5Cright).%0A"></p>
<p>This expression is simply “flux in direction <img src="https://latex.codecogs.com/png.latex?i">” minus “flux in direction <img src="https://latex.codecogs.com/png.latex?i">” across the opposite face, normalized by the physical volume.</p>
<p><strong>The Laplacian</strong> is the divergence of the gradient. It describes how a scalar function curves around a point since it measures the net outflow of the gradient field. It also encodes how <img src="https://latex.codecogs.com/png.latex?f"> compares to its local averages over small spheres. In orthogonal coordinates, inserting the expression for the gradient into the divergence formula yields: <span id="eq-master-laplacian"><img src="https://latex.codecogs.com/png.latex?%0A%5CDelta%20f%0A=%0A%5Cfrac%7B1%7D%7B%5Cprod_j%20h_j%7D%0A%5Csum_%7Bi=1%7D%5En%0A%5Cfrac%7B%5Cpartial%7D%7B%5Cpartial%20q%5Ei%7D%0A%5Cleft(%0A%5Cfrac%7B%5Cprod_j%20h_j%7D%7Bh_i%5E2%7D%0A%5Cfrac%7B%5Cpartial%20f%7D%7B%5Cpartial%20q%5Ei%7D%0A%5Cright).%0A%5Ctag%7B1%7D"></span></p>
<p>This is the expression we will apply to spherical coordinates in the next section.</p>
<section id="spherical-coordinates-and-the-laplacian" class="level3">
<h3 class="anchored" data-anchor-id="spherical-coordinates-and-the-laplacian">Spherical coordinates and the Laplacian</h3>
<p>To analyze rotationally symmetric functions, we now specialize the general formulas from the previous section to spherical coordinates in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5Ed">. A point <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cmathbb%7BR%7D%5Ed"> is described by a radius <img src="https://latex.codecogs.com/png.latex?r%20%5Cge%200"> together with <img src="https://latex.codecogs.com/png.latex?(d-1)"> angular coordinates <img src="https://latex.codecogs.com/png.latex?%0A(r,%5Ctheta_1,%5Cdots,%5Ctheta_%7Bd-1%7D).%0A"> The radius <img src="https://latex.codecogs.com/png.latex?r%20=%20%5C%7Cx%5C%7C"> determines the sphere on which the point lies, and the angles <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1,%5Cdots,%5Ctheta_%7Bd-1%7D"> specify a direction on the unit sphere <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-1%7D">. Geometrically, the construction is recursive: fixing <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1"> leaves an <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-2%7D">; choosing <img src="https://latex.codecogs.com/png.latex?%5Ctheta_2"> then fixes a point on that <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-2%7D">, and so on until the last coordinate <img src="https://latex.codecogs.com/png.latex?%5Ctheta_%7Bd-1%7D">, which parameterizes a circle. In these coordinates, motion in the radial direction has physical length <img src="https://latex.codecogs.com/png.latex?dr"> so that <img src="https://latex.codecogs.com/png.latex?h_r%20=%201">. Motion in the direction of <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1"> traces a circle of radius <img src="https://latex.codecogs.com/png.latex?r"> so that <img src="https://latex.codecogs.com/png.latex?h_%7B%5Ctheta_1%7D%20=%20r">. Holding <img src="https://latex.codecogs.com/png.latex?r"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1"> fixed while varying <img src="https://latex.codecogs.com/png.latex?%5Ctheta_2"> traces a circle of radius <img src="https://latex.codecogs.com/png.latex?r%20%5Csin%20%5Ctheta_1">, hence <img src="https://latex.codecogs.com/png.latex?h_%7B%5Ctheta_2%7D%20=%20r%20%5Csin%20%5Ctheta_1">. Continuing in this way, the general pattern is <img src="https://latex.codecogs.com/png.latex?%0Ah_%7B%5Ctheta_k%7D%0A=%20r%20%5Csin%20%5Ctheta_1%20%5Ccdots%20%5Csin%20%5Ctheta_%7Bk-1%7D,%0A%5Cqquad%20k%20=%201,%5Cdots,d-1.%0A"> These scale factors reflect the fact that angular displacements correspond to motion along circles whose radii depend on the previously chosen angles. The physical volume of an infinitesimal coordinate box is the product of all scale factors, giving <img src="https://latex.codecogs.com/png.latex?%0AdV%0A=%20r%5E%7Bd-1%7D%5C,%0A(%5Csin%5Ctheta_1)%5E%7Bd-2%7D%0A(%5Csin%5Ctheta_2)%5E%7Bd-3%7D%0A%5Ccdots%0A(%5Csin%5Ctheta_%7Bd-2%7D)%5C,%0Adr%5C,%20d%5Ctheta_1%20%5Ccdots%20d%5Ctheta_%7Bd-1%7D.%0A"> The factor <img src="https://latex.codecogs.com/png.latex?r%5E%7Bd-1%7D"> is the familiar scaling of the surface area of a sphere. The remaining sine powers encode the intrinsic geometry of <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-1%7D">.</p>
<p><strong>Spherical Laplacian:</strong> Inserting these scale factors into the general expression Equation&nbsp;1 gives the Laplacian in spherical coordinates: <img src="https://latex.codecogs.com/png.latex?%0A%5CDelta%20f%0A=%0A%5Cbig%5B%20%5Cpartial_r%5E2%20f%20+%20%5Cfrac%7Bd-1%7D%7Br%7D%5Cpartial_r%20f%20%5Cbig%5D%0A+%20%5Cfrac%7B1%7D%7Br%5E2%7D%5C,%5CDelta_%7BS%5E%7Bd-1%7D%7D%20f.%0A"> The operator <img src="https://latex.codecogs.com/png.latex?%5CDelta_%7BS%5E%7Bd-1%7D%7D"> is the Laplacian intrinsic to the unit sphere <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-1%7D">, whose expression is not particularly enlightening or useful for our purposes here. For example, the first term reads: <img src="https://latex.codecogs.com/png.latex?%0A%5CDelta_%7BS%5E%7Bd-1%7D%7D%20f%0A=%0A%5Cfrac%7B1%7D%7B(%5Csin%5Ctheta_1)%5E%7Bd-2%7D%7D%5C,%5Cpartial_%7B%5Ctheta_1%7D%0A%5Cleft(%0A(%5Csin%5Ctheta_1)%5E%7Bd-2%7D%20%5C,%5Cpartial_%7B%5Ctheta_1%7D%20f%0A%5Cright)%0A+%20%5Ccdots%0A"> What matters is that it acts only on the angular variables <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1,%5Cdots,%5Ctheta_%7Bd-1%7D">, treating <img src="https://latex.codecogs.com/png.latex?r"> as a constant. The factor <img src="https://latex.codecogs.com/png.latex?(d-1)/r"> arises because the surface area of spheres grows like <img src="https://latex.codecogs.com/png.latex?r%5E%7Bd-1%7D">, while the factor <img src="https://latex.codecogs.com/png.latex?1/r%5E2"> preceding <img src="https://latex.codecogs.com/png.latex?%5CDelta_%7BS%5E%7Bd-1%7D%7D"> reflects the fact that angular motion takes place along circles of radius <img src="https://latex.codecogs.com/png.latex?r">. Furthermore, this scaling is clear by dimensional analysis: the Laplacian has units of inverse length squared, and <img src="https://latex.codecogs.com/png.latex?%5CDelta_%7BS%5E%7Bd-1%7D%7D"> is dimensionless since it acts on the unit sphere. In the next section, we restrict <img src="https://latex.codecogs.com/png.latex?%5CDelta_%7BS%5E%7Bd-1%7D%7D"> to zonal functions, which depend only on the polar angle <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1">.</p>
</section>
<section id="zonal-functions" class="level3">
<h3 class="anchored" data-anchor-id="zonal-functions">Zonal functions</h3>
<p>We now study the angular part of the Laplacian on the sphere. A particularly important class of functions are the zonal functions, which depend only on the angle with a fixed direction. Fix a unit vector <img src="https://latex.codecogs.com/png.latex?e%20%5Cin%20S%5E%7Bd-1%7D">; typically, one takes <img src="https://latex.codecogs.com/png.latex?e"> to be the “north pole” <img src="https://latex.codecogs.com/png.latex?e%20=%20(1,0,%5Cldots,0)"> and we will do so here. A function <img src="https://latex.codecogs.com/png.latex?f:%20S%5E%7Bd-1%7D%20%5Cto%20%5Cmathbb%7BR%7D"> is called zonal (with respect to <img src="https://latex.codecogs.com/png.latex?e">) if it only depends on the inner product <img src="https://latex.codecogs.com/png.latex?x%20%5Ccdot%20e%20=%20%5Ccos%20%5Ctheta_1">; this means that there is a function <img src="https://latex.codecogs.com/png.latex?F:%20%5B0,%5Cpi%5D%20%5Cto%20%5Cmathbb%7BR%7D"> and <img src="https://latex.codecogs.com/png.latex?G:%20%5B-1,1%5D%20%5Cto%20%5Cmathbb%7BR%7D"> such that <img src="https://latex.codecogs.com/png.latex?%0Af(x)%20=%20F(%5Ctheta_1)%20=%20G(z)%0A"> where we set <img src="https://latex.codecogs.com/png.latex?z%20=%20%5Ccos%20%5Ctheta_1%20=%20x%20%5Ccdot%20e">. To keep notation simple, we will often conflate <img src="https://latex.codecogs.com/png.latex?f">, <img src="https://latex.codecogs.com/png.latex?F">, and <img src="https://latex.codecogs.com/png.latex?G"> and write <img src="https://latex.codecogs.com/png.latex?f(x)">, <img src="https://latex.codecogs.com/png.latex?f(%5Ctheta_1)">, or <img src="https://latex.codecogs.com/png.latex?f(z)"> depending on context. The zonal functions describe rotational symmetry around the axis spanned by <img src="https://latex.codecogs.com/png.latex?e"> and arise naturally in problems where only the angular separation between two points matters. If <img src="https://latex.codecogs.com/png.latex?f"> depends only on the polar angle <img src="https://latex.codecogs.com/png.latex?%5Ctheta_1">, all derivatives with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta_2,%5Cdots,%5Ctheta_%7Bd-1%7D"> vanish. The spherical Laplacian therefore reduces to the one-dimensional operator <img src="https://latex.codecogs.com/png.latex?%0A%5CDelta_%7BS%5E%7Bd-1%7D%7D%20f(x)%0A=%0A%5Cfrac%7B1%7D%7B%5Csin%5E%7Bd-2%7D%5Ctheta_1%7D%5C,%0A%5Cpartial_%7B%5Ctheta_1%7D%5C!%0A%5Cleft(%0A%5Csin%5E%7Bd-2%7D%5Ctheta_1%20%5C,%0A%5Cpartial_%7B%5Ctheta_1%7D%20f(%5Ctheta_1)%0A%5Cright).%0A"> Using <img src="https://latex.codecogs.com/png.latex?%5Csin%5Ctheta_1%20=%20%5Csqrt%7B1-z%5E2%7D"> and the chain rule, simple but tedious algebraic manipulations lead to the expression: <img src="https://latex.codecogs.com/png.latex?%0A%5CDelta_%7BS%5E%7Bd-1%7D%7D%20f(x)%0A=%0A(1-z%5E2)%20f''(z)%20-%20(d-1)%20z%20f'(z).%0A"> A convenient notation for the zonal part of the spherical Laplacian is <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D_d%20f(z)%0A=%0A(1-z%5E2)%5C,%20f''(z)%20-%20(d-1)%5C,%20z%5C,%20f'(z)%0A"> for <img src="https://latex.codecogs.com/png.latex?z%20%5Cin%20%5B-1,1%5D">. This operator is simply the restriction of the spherical Laplacian <img src="https://latex.codecogs.com/png.latex?%5CDelta_%7BS%5E%7Bd-1%7D%7D"> to zonal functions. If <img src="https://latex.codecogs.com/png.latex?d%5Csigma"> denotes the surface measure on <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-1%7D">, then for any two zonal functions <img src="https://latex.codecogs.com/png.latex?f,g:%20S%5E%7Bd-1%7D%20%5Cto%20%5Cmathbb%7BR%7D">, one has the weighted self-adjointness property: <img src="https://latex.codecogs.com/png.latex?%5Cint_%7BS%5E%7Bd-1%7D%7D%20f(x)%20%5C,%20g(x)%20%5C,%20d%5Csigma(x)%0A=%0A%5Cint_%7B-1%7D%5E1%20f(z)%20%5C,%20g(z)%20%5C,%20w_d(z)%5C,%20dz,%0A"> where, computing the marginal over all but the first angle, gives the weight: <img src="https://latex.codecogs.com/png.latex?%0Aw_d(z)%20=%20(1-z%5E2)%5E%7B%5Cfrac%7Bd-3%7D%7B2%7D%7D.%0A"> Furthermore, since the spherical Laplacian is self-adjoint on <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-1%7D"> with respect to the standard inner product, so is <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D_d"> with respect to this weighted inner product: <img src="https://latex.codecogs.com/png.latex?%5Cint_%7B-1%7D%5E1%20(%5Cmathcal%7BL%7D_d%20f)(z)%5C,%20g(z)%5C,%20w_d(z)%5C,%20dz%0A=%0A%5Cint_%7B-1%7D%5E1%20f(z)%5C,%20(%5Cmathcal%7BL%7D_d%20g)(z)%5C,%20w_d(z)%5C,%20dz.%0A"> Now, suppose we look for eigenfunctions of the spherical Laplacian on <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-1%7D">, i.e.&nbsp;functions <img src="https://latex.codecogs.com/png.latex?f"> satisfying <img src="https://latex.codecogs.com/png.latex?-%5CDelta_%7BS%5E%7Bd-1%7D%7D%20f%20=%20%5Clambda%20f">, that are zonal: <a href="https://en.wikipedia.org/wiki/Zonal_spherical_harmonics">zonal spherical harmonics</a>.</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/gegenbauer/zonal_spherical.jpg" class="img-fluid figure-img" style="width:35.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Zonal_spherical_harmonics">Zonal spherical harmonics</a></figcaption>
</figure>
</div>
</div>
<p>This eigenvalue equation becomes <img src="https://latex.codecogs.com/png.latex?-%5Cmathcal%7BL%7D_d%20f%20=%20%5Clambda%20f">, which reads: <span id="eq-gegenbauer-ode"><img src="https://latex.codecogs.com/png.latex?%0A(1-z%5E2)%20f''(z)%20-%20(d-1)%20z%20f'(z)%20+%20%5Clambda%20f(z)%20=%200.%0A%5Ctag%7B2%7D"></span> Since the eigenvalues of the spherical Laplacian on <img src="https://latex.codecogs.com/png.latex?S%5E%7Bd-1%7D"> are given by: <img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%20n(n+d-2)"> for integers <img src="https://latex.codecogs.com/png.latex?n%20%5Cge%200">, we set <img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%20n(n+d-2)"> in the following.</p>
</section>
<section id="gegenbauer-polynomials." class="level3">
<h3 class="anchored" data-anchor-id="gegenbauer-polynomials.">Gegenbauer polynomials.</h3>
<p>Equation&nbsp;2 is a second-order ordinary differential equation on the interval <img src="https://latex.codecogs.com/png.latex?%5B-1,1%5D"> and it is customary to parametrize it by <img src="https://latex.codecogs.com/png.latex?%5Calpha%20%3E%20-%5Ctfrac12"> by setting <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%20d/2-1">. Since the eigenvalues of the spherical Laplacian in dimension <img src="https://latex.codecogs.com/png.latex?d"> are <img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%20n(n+d-2)">, the equation becomes: <span id="eq-gegenbauer-ode-alpha"><img src="https://latex.codecogs.com/png.latex?(1-z%5E2)%20y''(z)%20-%20(2%5Calpha%20+%201)%20z%20y'(z)%20+%20n(n+2%5Calpha)%5C,%20y(z)%20=%200.%0A%5Ctag%7B3%7D"></span> One can then show that this equation admits polynomial solutions of degree <img src="https://latex.codecogs.com/png.latex?n">, called the <a href="https://en.wikipedia.org/wiki/Gegenbauer_polynomials">Gegenbauer polynomials</a> and usually denoted by <img src="https://latex.codecogs.com/png.latex?C_n%5E%7B(%5Calpha)%7D(z)">. Furthermore, if we insist that the solutions be regular on the entire interval <img src="https://latex.codecogs.com/png.latex?%5B-1,1%5D"> and can be lifted to smooth functions on the sphere, then these polynomial solutions are the only ones! For a given dimension <img src="https://latex.codecogs.com/png.latex?d=2%5Calpha+2"> and eigenvalue <img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%20n(n+d-2)"> of the spherical Laplacian, up to rotational symmetry and normalization, there is a unique eigenfunction and it is described by the Gegenbauer polynomial <img src="https://latex.codecogs.com/png.latex?C_n%5E%7B(%5Calpha)%7D(z)">. They can be recursively defined as <img src="https://latex.codecogs.com/png.latex?C_0%5E%7B(%5Calpha)%7D(z)%20=%201"> and <img src="https://latex.codecogs.com/png.latex?C_1%5E%7B(%5Calpha)%7D(z)%20=%202%5Calpha%20z">, together with the recurrence relation: <img src="https://latex.codecogs.com/png.latex?%0An(n+1)%20%5C,%20C_%7Bn+1%7D%5E%7B(%5Calpha)%7D(z)%0A=%202%20(n+%5Calpha)%20z%20%5C,%20C_n%5E%7B(%5Calpha)%7D(z)%0A-%20(n+2%5Calpha%20-1)%20%5C,%20C_%7Bn-1%7D%5E%7B(%5Calpha)%7D(z).%0A"></p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/gegenbauer/poly.png" class="img-fluid figure-img" style="width:85.0%"></p>
<figcaption>Gegenbauer Polynomials: <img src="https://latex.codecogs.com/png.latex?%5Calpha=3"></figcaption>
</figure>
</div>
</div>
<p>By construction, for any vector <img src="https://latex.codecogs.com/png.latex?e%20%5Cin%20S%5E%7Bd-1%7D">, the function defined on the sphere by <img src="https://latex.codecogs.com/png.latex?Y_n(x)%20=%20C_n%5E%7B(d/2-1)%7D(x%20%5Ccdot%20e)"> is a zonal spherical harmonic of degree <img src="https://latex.codecogs.com/png.latex?n"> in dimension <img src="https://latex.codecogs.com/png.latex?d"> with corresponding eigenvalue <img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%20n(n+d-2)">. <a href="https://en.wikipedia.org/wiki/Legendre_polynomials">Legendre polynomials</a> are a special case of Gegenbauer polynomials obtained by setting <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%20%5Ctfrac12">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?d=3">. In that case, the Legendre polynomial are orthogonal with respect to the uniform weight on <img src="https://latex.codecogs.com/png.latex?%5B-1,1%5D"> since <img src="https://latex.codecogs.com/png.latex?w_3(z)%20=%201">. Similarly, setting <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200"> (i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?d=2">) gives the <a href="https://en.wikipedia.org/wiki/Chebyshev_polynomials">Chebyshev polynomials</a> of the first kind, which are orthogonal with respect to the weight <img src="https://latex.codecogs.com/png.latex?w_2(z)%20=%20(1-z%5E2)%5E%7B-1/2%7D">. This also illuminates why the Chebyshev polynomials are defined on the interval <img src="https://latex.codecogs.com/png.latex?%5B-1,1%5D"> with that specific weight and satisfy <img src="https://latex.codecogs.com/png.latex?T_n(%5Ccos%20%5Ctheta)%20=%20%5Ccos(n%20%5Ctheta)">: they are simply the zonal spherical harmonics in dimension <img src="https://latex.codecogs.com/png.latex?d=2">.</p>


</section>
</section>

 ]]></description>
  <category>analysis</category>
  <guid>https://alexxthiery.github.io/notes/gegenbauer/gegenbauer.html</guid>
  <pubDate>Sun, 23 Nov 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Scoring Rules for Probabilistic Forecasts</title>
  <link>https://alexxthiery.github.io/notes/scoring_rules/scoring.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/scoring_rules/Savage.jpg" class="img-fluid figure-img" style="width:35.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Leonard_Jimmie_Savage">Leonard Jimmie Savage</a> (1917 – 1971)</figcaption>
</figure>
</div>
</div>
<p>When working with probabilistic models, predictions are expressed as full distributions rather than point estimates. To keep things simple, we focus on the case where the outcome <img src="https://latex.codecogs.com/png.latex?Y"> to be predicted consists of a finite number of <img src="https://latex.codecogs.com/png.latex?n"> possible outcomes labeled <img src="https://latex.codecogs.com/png.latex?%5B1:n%5D%20=%20%5C%7B1,2,%5Cldots,n%5C%7D">. A probabilistic forecast then takes the form of a vector <img src="https://latex.codecogs.com/png.latex?%5Cpi=(%5Cpi_1,%5Cpi_2,%5Cldots,%5Cpi_n)"> in the probability simplex <img src="https://latex.codecogs.com/png.latex?%5CDelta%5E%7Bn-1%7D">. Each coordinate <img src="https://latex.codecogs.com/png.latex?%5Cpi_i"> represents the predicted probability of outcome <img src="https://latex.codecogs.com/png.latex?i"> occurring. How should we evaluate the quality of such probabilistic forecasts?</p>
<p>A scoring rule assigns a numerical reward <img src="https://latex.codecogs.com/png.latex?s(%5Cpi,Y)"> to the probabilistic forecast <img src="https://latex.codecogs.com/png.latex?%5Cpi"> when outcome <img src="https://latex.codecogs.com/png.latex?Y"> occurs. If the true distribution of the outcome <img src="https://latex.codecogs.com/png.latex?Y"> is <img src="https://latex.codecogs.com/png.latex?p">, the expected reward for reporting <img src="https://latex.codecogs.com/png.latex?%5Cpi"> is <span id="eq-S"><img src="https://latex.codecogs.com/png.latex?%0AS(%5Cpi,p)%20%5Cequiv%20%5Csum_%7Bi=1%7D%5En%20p_i%20%5C,%20s(%5Cpi,i).%0A%5Ctag%7B1%7D"></span></p>
<p>Although the function <img src="https://latex.codecogs.com/png.latex?s:%20%5CDelta%5E%7Bn-1%7D%20%5Ctimes%20%5B1:n%5D%20%5Cto%20%5Cmathbb%7BR%7D"> is generally non-linear, the function <img src="https://latex.codecogs.com/png.latex?S"> can be extended to a function from <img src="https://latex.codecogs.com/png.latex?%5CDelta%5E%7Bn-1%7D%20%5Ctimes%20%5Cmathbb%7BR%7D%5En"> to <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D">, linear in its second argument, through Equation&nbsp;1 by interpreting <img src="https://latex.codecogs.com/png.latex?p"> as a vector in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5En">. The remark that it is linear in its second argument will reveal to be very useful later. Furthermore, if one denotes by <img src="https://latex.codecogs.com/png.latex?%5Cdelta_i%20=%20(0,%5Cldots,0,1,0,%5Cldots,0)%20%5Cin%20%5CDelta%5E%7Bn-1%7D"> the Dirac measure at <img src="https://latex.codecogs.com/png.latex?i">, then the scoring rule can be recovered from the expected reward via</p>
<p><img src="https://latex.codecogs.com/png.latex?s(%5Cpi,i)%20=%20S(%5Cpi,%5Cdelta_i)."></p>
<p>The central requirement for the design of scoring rules is that a forecaster has no incentive to misreport their beliefs. This means that if the forecaster’s belief about the distribution of <img src="https://latex.codecogs.com/png.latex?Y"> is given by the probability distribution <img src="https://latex.codecogs.com/png.latex?%5Cpi%20%5Cin%5CDelta%5E%7Bn-1%7D">, then reporting <img src="https://latex.codecogs.com/png.latex?%5Cpi"> should maximize their expected reward. There are a number of situations in which such a design is desirable. For example, in market settings where agents are asked to provide probabilistic forecasts, proper scoring rules incentivize truthful reporting of beliefs. A scoring rule is called proper if the mapping <img src="https://latex.codecogs.com/png.latex?%5Cpi%20%5Cmapsto%20S(%5Cpi,%20p)"> attains its maximum at <img src="https://latex.codecogs.com/png.latex?%5Cpi=p">. Formally, this means that for all two distributions <img src="https://latex.codecogs.com/png.latex?p,%5Cpi%20%5Cin%20%5CDelta%5E%7Bn-1%7D">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AS(p,p)%20%5Cge%20S(%5Cpi,%20p).%0A"></p>
<p>This condition ensures that the best strategy, in expectation, is to report one’s genuine probabilities. If the inequality is strict whenever <img src="https://latex.codecogs.com/png.latex?%5Cpi%20%5Cne%20p">, the scoring rule is called strictly proper. Proper scoring rules have a long history in statistics and decision theory. The natural question arises: what do proper scoring rules look like, and how can we construct them? What functional forms can we use for <img src="https://latex.codecogs.com/png.latex?s(%5Cpi,i)"> that ensure properness?</p>
<p>For each distribution <img src="https://latex.codecogs.com/png.latex?p">, define its self-expected score <img src="https://latex.codecogs.com/png.latex?%0AH(p)=S(p,p)=%5Csum_%7Bi=1%7D%5En%20p_i%20%5C,%20s(p,i).%0A"></p>
<p>It is the average reward a forecaster receives when its reported distribution matches the true distribution. Crucially, the affine function <img src="https://latex.codecogs.com/png.latex?p%20%5Cmapsto%20S(%5Cpi,p)"> describes a supporting hyperplane to the function <img src="https://latex.codecogs.com/png.latex?H"> at the point <img src="https://latex.codecogs.com/png.latex?%5Cpi">: it is linear in <img src="https://latex.codecogs.com/png.latex?p">, matches <img src="https://latex.codecogs.com/png.latex?H"> at <img src="https://latex.codecogs.com/png.latex?p=%5Cpi">, while never exceeding it elsewhere. If one knew that <img src="https://latex.codecogs.com/png.latex?H"> were convex and differentiable, by uniqueness of supporting hyperplanes to convex and differentiable functions, one could immediately write down a representation for <img src="https://latex.codecogs.com/png.latex?S(%5Cpi,p)"> in terms of <img src="https://latex.codecogs.com/png.latex?H">. But <img src="https://latex.codecogs.com/png.latex?H"> is indeed convex since it is the pointwise maximum of the family of affine functions <img src="https://latex.codecogs.com/png.latex?p%20%5Cmapsto%20S(%5Cpi,p)"> indexed by <img src="https://latex.codecogs.com/png.latex?%5Cpi">. Assuming differentiability to keep a few technicalities at bay, this shows that:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0As(%5Cpi,i)%0A&amp;=%20S(%5Cpi,%5Cdelta_i)%0A=%20S(%5Cpi,%20%5Cpi)%20+%20%5Cleft%3C%20%20%5Cnabla%20H(%5Cpi),%20%5Cdelta_i%20-%20%5Cpi%20%20%5Cright%3E%5C%5C%0A&amp;=%20H(%5Cpi)%20+%20%5Cleft%3C%20%20%5Cnabla%20H(%5Cpi),%20%5Cdelta_i%20-%20%5Cpi%20%20%5Cright%3E.%0A%5Cend%7Balign*%7D%0A"></p>
<p>Without assuming differentiability, one can use subgradients instead of gradients to obtain a similar representation. This shows that proper scoring rules <img src="https://latex.codecogs.com/png.latex?s(%5Cpi,i)"> are in one-to-one correspondence with convex functions <img src="https://latex.codecogs.com/png.latex?H(%5Cpi)"> on the probability simplex <img src="https://latex.codecogs.com/png.latex?%5Cpi%20%5Cin%20%5CDelta%5E%7Bn-1%7D">. Similarly, strictly proper scoring rules correspond to strictly convex functions. Extension to continuous sample spaces is possible through the use of functional derivatives instead of gradients or subgradients; see <span class="citation" data-cites="gneiting2007strictly">(Gneiting and Raftery 2007)</span> for details.</p>
<p>Let us look at some examples of proper scoring rules defined through this correspondence:</p>
<ol type="1">
<li><p><strong>Logarithmic Score</strong>: The logarithmic scoring rule is defined as <img src="https://latex.codecogs.com/png.latex?s(%5Cpi,i)%20=%20%5Clog(%5Cpi_i)">. The corresponding self-expected score is the negative Shannon entropy: <img src="https://latex.codecogs.com/png.latex?%0AH(p)%20=%20%5Csum_%7Bi=1%7D%5En%20p_i%20%5Clog(p_i).%0A"> It is interesting to note that the logarithmic scoring rule is essentially the only local proper scoring rule, i.e.&nbsp;one of the type <img src="https://latex.codecogs.com/png.latex?s(%5Cpi,i)%20=%20F(%5Cpi_i,%20i)"> for some function <img src="https://latex.codecogs.com/png.latex?F">. In other words, the score assigned to outcome <img src="https://latex.codecogs.com/png.latex?i"> depends only on the predicted probability <img src="https://latex.codecogs.com/png.latex?%5Cpi_i"> of that outcome, and not on the other predicted probabilities <img src="https://latex.codecogs.com/png.latex?%5Cpi_j"> for <img src="https://latex.codecogs.com/png.latex?j%20%5Cne%20i">. Indeed, assuming <img src="https://latex.codecogs.com/png.latex?F"> smooth for simplicity, the condition of properness easily implies that <img src="https://latex.codecogs.com/png.latex?%5Cpartial_%7B%5Cpi_i%7D%20F(%5Cpi_i,%20i)%20=%20A"> for some constant <img src="https://latex.codecogs.com/png.latex?%5Calpha"> independent of <img src="https://latex.codecogs.com/png.latex?i">. Integrating this relation gives that <img src="https://latex.codecogs.com/png.latex?F(%5Cpi_i,%20i)%20=%20%5Calpha%20%5Clog(%5Cpi_i)%20+%20%5Cbeta_i">, where necessarily <img src="https://latex.codecogs.com/png.latex?%5Calpha%3E0"> for properness, and where <img src="https://latex.codecogs.com/png.latex?B_i"> are arbitrary constants.</p></li>
<li><p><strong>Brier Score</strong>: The Brier scoring rule is given by <img src="https://latex.codecogs.com/png.latex?s(%5Cpi,i)%20=%20%5Cpi_i%20-%20%5Ctfrac12%20%5Csum_%7Bj=1%7D%5En%20%5Cpi_j%5E2">. The associated self-expected score is <img src="https://latex.codecogs.com/png.latex?%0AH(p)%20=%20%5Cfrac12%20%5C,%20%5Csum_%7Bi=1%7D%5En%20p_i%5E2.%0A"></p></li>
<li><p><strong>Spherical Score</strong>: The spherical scoring rule is defined as <img src="https://latex.codecogs.com/png.latex?s(%5Cpi,i)%20=%20%5Cfrac%7B%5Cpi_i%7D%7B%5C%7C%5Cpi%5C%7C_2%7D">. The corresponding self-expected score is <img src="https://latex.codecogs.com/png.latex?%0AH(p)%20=%20%5C%7Cp%5C%7C_2.%0A"></p></li>
<li><p><strong>Energy Score</strong>: consider a distance function <img src="https://latex.codecogs.com/png.latex?d:%20%5B1:n%5D%20%5Ctimes%20%5B1:n%5D%20%5Cto%20%5Cmathbb%7BR%7D_+">. The energy scoring rule is defined through expected distances: <img src="https://latex.codecogs.com/png.latex?%0As(%5Cpi,i)%20=%20-%20%20%7B%5Cleft(%20%20%5Cmathbb%7BE%7D%5Bd(X,i)%5D%20-%20%5Cfrac%2012%20%5C,%20%5Cmathbb%7BE%7D%5Bd(X,X')%5D%20%20%5Cright)%7D%20,%0A"> where <img src="https://latex.codecogs.com/png.latex?X,X'%20%5Csim%20%5Cpi"> are independent. The associated self-expected score is <img src="https://latex.codecogs.com/png.latex?%0AH(p)%20=%20-%5Cfrac12%20%5C,%20%5Cmathbb%7BE%7D%5Bd(X,X')%5D%20=%20-%20%5Cfrac12%20%5C,%5Csum_%7Bi,j=1%7D%5En%20p_i%20p_j%20%5C,%20d(i,j).%0A"> where <img src="https://latex.codecogs.com/png.latex?X,X'%20%5Csim%20p"> are independent. This function is convex in <img src="https://latex.codecogs.com/png.latex?p"> if the distance matrix <img src="https://latex.codecogs.com/png.latex?M_%7Bi,j%7D=d(i,j)"> is negative semi-definite on the subspace of zero-sum vectors, i.e., if for all vectors <img src="https://latex.codecogs.com/png.latex?z%20%5Cin%20%5Cmathbb%7BR%7D%5En"> with <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bi=1%7D%5En%20z_i%20=%200">, one has <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bi,j=1%7D%5En%20z_i%20z_j%20%5C,%20d(i,j)%20%5Cle%200">. Luckily, there are many such distances. For example, if the distance <img src="https://latex.codecogs.com/png.latex?d"> is of the form <img src="https://latex.codecogs.com/png.latex?d(i,j)%20=%20%5C%7C%5Cvarphi_i%20-%20%5Cvarphi_j%5C%7C_2%5E2"> for some (feature) vectors <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_1,%5Cldots,%5Cvarphi_n%20%5Cin%20%5Cmathbb%7BR%7D%5Em">, then the corresponding distance matrix is negative semi-definite on the subspace of zero-sum vectors. In a continuous setting, for example when <img src="https://latex.codecogs.com/png.latex?%5B1:n%5D"> is replaced by <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5Ed">, one could take <img src="https://latex.codecogs.com/png.latex?%5Cvarphi(x)=x"> to obtain the energy score associated to the squared Euclidean distance; this would leads to <img src="https://latex.codecogs.com/png.latex?H(%5Cpi)%20=%20-%20%5Cfrac12%20%5C,%20%5Cmathbb%7BE%7D%5B%5C%7CX-X'%5C%7C_2%5E2%5D%20=%20-%20%5Ctext%7BVar%7D(X)"> when <img src="https://latex.codecogs.com/png.latex?X,X'%20%5Csim%20%5Cpi"> are independent. This shows that in that case the function <img src="https://latex.codecogs.com/png.latex?H"> is <strong>not</strong> strictly convex since it depends only on the variance of the distribution, so entirely flat on the subspace of distributions with fixed variance! For this reason, the energy score with squared Euclidean distance is proper but typically not strictly proper. In fact, one can check that for any <img src="https://latex.codecogs.com/png.latex?0%3C%20%5Cbeta%20%3C%202">, the distance defined as <img src="https://latex.codecogs.com/png.latex?d(i,j)%20=%20%5C%7C%5Cvarphi_i%20-%20%5Cvarphi_j%5C%7C_2%5E%5Cbeta"> also leads to a negative semi-definite distance matrix on the subspace of zero-sum vectors. But contrarily to the case <img src="https://latex.codecogs.com/png.latex?%5Cbeta=2"> of squared Euclidean distance, when choosing <img src="https://latex.codecogs.com/png.latex?0%3C%5Cbeta%3C2">, the associated energy score is strictly proper <span class="citation" data-cites="schoenberg1938metric">(Schoenberg 1938)</span> <span class="citation" data-cites="szekely2013energy">(Székely and Rizzo 2013)</span>. This includes, in particular, the case <img src="https://latex.codecogs.com/png.latex?%5Cbeta=1"> which corresponds to the standard Euclidean distance.</p></li>
</ol>




<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-gneiting2007strictly" class="csl-entry">
Gneiting, Tilmann, and Adrian E Raftery. 2007. <span>“Strictly Proper Scoring Rules, Prediction, and Estimation.”</span> <em>Journal of the American Statistical Association</em> 102 (477). Taylor &amp; Francis: 359–78.
</div>
<div id="ref-schoenberg1938metric" class="csl-entry">
Schoenberg, Isaac J. 1938. <span>“Metric Spaces and Positive Definite Functions.”</span> <em>Transactions of the American Mathematical Society</em> 44 (3). JSTOR: 522–36.
</div>
<div id="ref-szekely2013energy" class="csl-entry">
Székely, Gábor J, and Maria L Rizzo. 2013. <span>“Energy Statistics: A Class of Statistics Based on Distances.”</span> <em>Journal of Statistical Planning and Inference</em> 143 (8). Elsevier: 1249–72.
</div>
</div></section></div> ]]></description>
  <category>diffusion</category>
  <guid>https://alexxthiery.github.io/notes/scoring_rules/scoring.html</guid>
  <pubDate>Fri, 21 Nov 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Masked Discrete Diffusion</title>
  <link>https://alexxthiery.github.io/notes/DiscreteDiff/DiscreteDiff.html</link>
  <description><![CDATA[ 





<!-- 
Consider a finite state space $\{M, 1,2, \ldots, V\}$ where $M$ is a special state corresponding to a masked value and $1, \ldots, V$ correspond to the possible values of a token (e.g., a word in a vocabulary of size $V$). On the time interval $[0,T]$, we consider a continuous Markov chain with initial distribution $p_0$ and infinitesimal rate matrix $Q_t \in \bbR^{(V+1) \times (V+1)}$,

$$
\P(X_{t+h} = j \mid X_t = i) = Q_t(i,j) \, h + o(h).
$$

Bayes' rule immediately shows that the time-reversal of this Markov chain is also a Markov chain with infinitesimal rate matrix $Q^{\star}_t$ satisfying:

$$
Q^{\star}_t(i,j) = \frac{p_t(j)}{p_t(i)} \, Q_t(j,i),
$$

where $p_t$ is the marginal distribution of $X_t$. We have 

$$\P(X_{t-h} = j \mid X_t = i) = Q^{\star}_t(i,j) \, h + o(h).$$

We are interested in modeling a Markov chain that progressively masks the initial value into the masked state $M$ as time $t$ goes from $0$ to $T$. Furthermore, only transitions towards the masked state $M$ are allowed, and once the process has jumped to the masked state $M$, it stays there forever. This means that outside the diagonal, the only non-zero entries of the infinitesimal rate matrix $Q_t$ are of the form $Q_t(i,M)$ for $i \in \{1, \ldots, V\}$. For convenience, we denote by $\tau$ the (almost surely unique) jump time of this Markov chain. We assume that $\tau < T$ almost surely, so that the process ends up at time $T$ at the masked state $M$ with probability one.

Now, to model text sequences of length $L$ for example, we consider $L$ independent copies of this Markov chain, i.e., $\overline{X}_t = (X_t^1, \ldots, X_t^L)$ where each $X_t^i$ is an independent Markov chain with infinitesimal rate matrix $Q_t$. This Markov process ends up at time $T$ at a fully masked sequence $\overline{X}_T = (M, \ldots, M)$ with probability one. If one can accurately model the time-reversal of this process, one can use this time-reversal to progressively unmask a fully masked sequence into a realistic sequence. That is the basic idea behind the (discrete) diffusion models. In our case, since jump times are almost surely distinct, the rate matrix of the joint process $\overline{X}_t$ is only non-zero when a single coordinate jumps. This means that, if $x,y \in \{M,1,\ldots,V\}^L$ differ by a single coordinate, say the $i$-th coordinate, then the infinitesimal rate matrix $\overline{Q}_t$ of the joint process satisfies:

$$
\overline{Q}_t(x,y) = Q_t(x^i,y_i).
$$

Similarly, the time-reversal of this joint process has infinitesimal rate matrix $\overleftarrow{\overline{Q}}_t$ satisfying:

$$
\overline{Q}^{\star}_t(x,y) = \frac{\overline{p}_t(y)}{\overline{p}_t(x)} \, Q_t(y_i,x^i),
$$

where $\overline{p}_t$ is the marginal distribution of $\overline{X}_t$. Now, $x$ and $y$ differ by a single coordinate $i$ so that, necessarily, $x^i = M$ and $y_i \in \{1, \ldots, V\}$. Let us denote by $S$ the set of indices $j$ such that $x^j \neq M$ (i.e., the set of unmasked coordinates in $x$). To observe that $x$ at time $t$, this means that the jump time of the $(L - |S|)$ masked coordinates must be smaller than $t$, while the jump time of the $|S|$ unmasked coordinates must be larger than $t$:

$$
\overline{p}_t(x) = \P(\tau < t)^{L-|S|} \, \P(\tau \geq t)^{|S|} \, \blue{ \overline{p}_0(x^{S}) }.
$$

Similarly, to observe $y$ at time $t$, the jump time of the $(L - |S| - 1)$ masked coordinates must be smaller than $t$, the jump time of the $|S|+1$ unmasked coordinates must be larger than $t$:

$$
\overline{p}_t(y) = \P(\tau < t)^{L-|S|-1} \, \P(\tau \geq t)^{|S|+1} \, \blue{ \overline{p}_0(x^{S}) \, \overline{p}_0(x^i \mid x^{S}) }.
$$

This means that the time-reversal rate matrix satisfies:

$$
\overline{Q}^{\star}_t(x,y) = R(t) \, \blue{\overline{p}_0(x^i \mid x^{S}) } \, Q_t(M, x^i),
$$

with time-dependent scalar $R(t) = \frac{\P(\tau \geq t)}{\P(\tau < t)}$. This means that, in practice, in order to model the time-reversal of this masked discrete diffusion process, one only needs to model the conditional distribution $\blue{\overline{p}_0(x^i \mid x^{S}) }$ of the data distribution $\overline{p}_0$. Standard BERT-like, masked language models, and transformers are perfectly suited to model such conditional distributions. This also shows that these discrete diffusion processes are in fact almost identical to masked language models, so one should not be surprised that they achieve similar performance on text generation tasks.

--- -->
<section id="masked-discrete-diffusion" class="level3">
<h3 class="anchored" data-anchor-id="masked-discrete-diffusion">Masked Discrete Diffusion</h3>
<p>We consider a finite state space <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BX%7D%20=%20%5C%7BM,%201,2,%20%5Cldots,%20V%5C%7D,%0A"> where <img src="https://latex.codecogs.com/png.latex?M"> is a special <strong>masked</strong> state and <img src="https://latex.codecogs.com/png.latex?1,%20%5Cldots,%20V"> correspond to token values in a vocabulary of size <img src="https://latex.codecogs.com/png.latex?V">. On the time interval <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D">, we define a continuous-time Markov chain with initial distribution <img src="https://latex.codecogs.com/png.latex?p_0"> and time-dependent infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?Q_t%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B(V+1)%5Ctimes(V+1)%7D"> so that for any <img src="https://latex.codecogs.com/png.latex?x%20%5Cne%20y">, <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BP%7D(X_%7Bt+h%7D%20=%20y%20%5Cmid%20X_t%20=%20x)%20=%20Q_t(x,y)%20%5C,%20h%20+%20o(h).%0A"></p>
<p>If the <strong>total jump rate</strong> out of state <img src="https://latex.codecogs.com/png.latex?x"> is <img src="https://latex.codecogs.com/png.latex?J_t(x)%20=%20%5Csum_%7By%20%5Cne%20x%7D%20Q_t(x,y)"> , then</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(X_%7Bt+h%7D%20=%20x%20%5Cmid%20X_t%20=%20x)%20=%201%20-%20J_t(x)%20%5C,%20h%20+%20o(h)."></p>
<p>Bayes’ rule implies that the time-reversal of this Markov chain is itself Markov, with infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?Q_t%5E%7B%5Cstar%7D"> satisfying <img src="https://latex.codecogs.com/png.latex?%0AQ_t%5E%7B%5Cstar%7D(x,y)%20=%20%5Cfrac%7Bp_t(y)%7D%7Bp_t(x)%7D%20%5C,%20Q_t(y,x),%0A"> where <img src="https://latex.codecogs.com/png.latex?p_t"> is the marginal distribution of <img src="https://latex.codecogs.com/png.latex?X_t"> at time <img src="https://latex.codecogs.com/png.latex?t">. We have: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BP%7D(X_%7Bt-h%7D%20=%20y%20%5Cmid%20X_t%20=%20x)%20=%20Q_t%5E%7B%5Cstar%7D(x,y)%20%5C,%20h%20+%20o(h).%0A"></p>
<p>We are interested in modeling a Markov chain that progressively masks the initial value into the masked state <img src="https://latex.codecogs.com/png.latex?M"> as time <img src="https://latex.codecogs.com/png.latex?t"> goes from <img src="https://latex.codecogs.com/png.latex?0"> to <img src="https://latex.codecogs.com/png.latex?T">. Transitions are only allowed from any token <img src="https://latex.codecogs.com/png.latex?i%20%5Cin%20%5C%7B1,%5Cdots,V%5C%7D"> to the masked state <img src="https://latex.codecogs.com/png.latex?M">, and once in <img src="https://latex.codecogs.com/png.latex?M"> the process remains there. Thus, outside the diagonal, the only nonzero entries of <img src="https://latex.codecogs.com/png.latex?Q_t"> are <img src="https://latex.codecogs.com/png.latex?Q_t(x,M)">. As it will be useful later, we denote by <img src="https://latex.codecogs.com/png.latex?%5Ctau"> the jump time to <img src="https://latex.codecogs.com/png.latex?M"> and we assume <img src="https://latex.codecogs.com/png.latex?%5Ctau%20%3C%20T"> almost surely, so that <img src="https://latex.codecogs.com/png.latex?X_T%20=%20M"> with probability one, and that <img src="https://latex.codecogs.com/png.latex?%5Ctau"> has a continuous distribution. In words: the process starts at some token value and at a random time <img src="https://latex.codecogs.com/png.latex?%5Ctau"> jumps to the masked state <img src="https://latex.codecogs.com/png.latex?M">, where it remains until time <img src="https://latex.codecogs.com/png.latex?T">.</p>
</section>
<section id="extension-to-sequences" class="level3">
<h3 class="anchored" data-anchor-id="extension-to-sequences">Extension to Sequences</h3>
<p>We are interested in modeling sequences comprised of <img src="https://latex.codecogs.com/png.latex?L"> discrete tokens, eg: binary images, genomic sequences, chemical compounds, protein sequences, etc… Each token takes value in <img src="https://latex.codecogs.com/png.latex?%5C%7B1,2,%5Cldots,V%5C%7D">. We denote by <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0"> the data distribution over such sequences. For this purpose, we consider <img src="https://latex.codecogs.com/png.latex?L"> independent copies of the above Markov chain, one per coordinate: <img src="https://latex.codecogs.com/png.latex?%0AX_t%20=%20(X_t%5E1,%20%5Cldots,%20X_t%5EL),%0A"> each with rate matrix <img src="https://latex.codecogs.com/png.latex?Q_t"> as defined previously. At time <img src="https://latex.codecogs.com/png.latex?T">, the process reaches the fully masked sequence <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BX%7D_T%20=%20(M,%20%5Cldots,%20M)"> with probability one. Denote by <img src="https://latex.codecogs.com/png.latex?%5Ctau_i"> the jump time of coordinate <img src="https://latex.codecogs.com/png.latex?i">. Since the jump times <img src="https://latex.codecogs.com/png.latex?%5Ctau_i"> are almost surely distinct, the infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BQ%7D_t"> of the joint process is nonzero only when a single coordinate changes. If <img src="https://latex.codecogs.com/png.latex?x,%5Cwidehat%7Bx%7D%20%5Cin%20%5Cmathcal%7BX%7D%5EL"> differ by a single coordinate <img src="https://latex.codecogs.com/png.latex?i">, we have <img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_t(x,%5Cwidehat%7Bx%7D)%20=%20Q_t(x%5Ei,%20%5Cwidehat%7Bx%7D%5Ei).%0A"></p>
<p>As before, the time-reversal has infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D"> satisfying <img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)%20=%20%5Cfrac%7B%5Coverline%7Bp%7D_t(x)%7D%7B%5Coverline%7Bp%7D_t(%5Cwidehat%7Bx%7D)%7D%20%5C,%20Q_t(x%5Ei,%20%5Cwidehat%7Bx%7D%5Ei),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_t"> is the marginal distribution of <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BX%7D_t">. Since <img src="https://latex.codecogs.com/png.latex?x"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D"> differ at coordinate <img src="https://latex.codecogs.com/png.latex?i"> only, for <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)"> to be non-zero, necessarily <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D%5Ei%20=%20M"> and <img src="https://latex.codecogs.com/png.latex?x%5Ei%20%5Cin%20%5C%7B1,%5Cldots,V%5C%7D">. Let <img src="https://latex.codecogs.com/png.latex?S%20=%20%5C%7Bj%20:%20x%5Ej%20%5Cneq%20M%5C%7D"> be the set of unmasked coordinates in <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D">. To observe configuration <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D"> at time <img src="https://latex.codecogs.com/png.latex?t">, the <img src="https://latex.codecogs.com/png.latex?(L%20-%20%7CS%7C)"> masked coordinates must have <img src="https://latex.codecogs.com/png.latex?%5Ctau%20%3C%20t"> and the <img src="https://latex.codecogs.com/png.latex?%7CS%7C"> unmasked ones <img src="https://latex.codecogs.com/png.latex?%5Ctau%20%5Cge%20t">: <img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7Bp%7D_t(%5Cwidehat%7Bx%7D)%20=%20%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%5E%7BL-%7CS%7C%7D%20%5C,%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%5E%7B%7CS%7C%7D%20%5C,%20%5Coverline%7Bp%7D_0(%5Cwidehat%7Bx%7D%5E%7BS%7D).%0A"></p>
<p>Similarly, and since <img src="https://latex.codecogs.com/png.latex?x"> differs from <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D"> only at coordinate <img src="https://latex.codecogs.com/png.latex?i">: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A%5Coverline%7Bp%7D_t(x)%0A&amp;=%20%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%5E%7BL-%7CS%7C-1%7D%20%5C,%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%5E%7B%7CS%7C+1%7D%20%5C,%0A%5Coverline%7Bp%7D_0(x%5E%7BS%20%5Ccup%20%5C%7Bi%5C%7D%7D)%5C%5C%0A&amp;=%20%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%5E%7BL-%7CS%7C-1%7D%20%5C,%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%5E%7B%7CS%7C+1%7D%20%5C,%0A%5Coverline%7Bp%7D_0(%5Cwidehat%7Bx%7D%5E%7BS%7D)%5C,%20%5Coverline%7Bp%7D_0(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D).%0A%5Cend%7Balign*%7D%0A"></p>
<p>This shows that the time-reversal rate matrix becomes <span id="eq-reverse-rate-matrix"><img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)%20=%20R(t)%20%5C,%20%5Coverline%7Bp%7D_0(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)%5C,%20Q_t(x%5Ei,%20M),%0A%5Ctag%7B1%7D"></span></p>
<p>with time dependent scalar <img src="https://latex.codecogs.com/png.latex?R(t)%20=%20%5Cfrac%7B%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%7D%7B%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%7D">. To simulate the reverse process that progressively unmasks a fully masked sequence, one only needs to model the conditional distribution <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0(%5Cwidehat%7Bx%7D%5Ei%20%5Cmid%20x%5E%7BS%7D)"> of the data distribution <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0">. This is precisely the prediction task of masked language models such as BERT, which estimate token probabilities conditioned on visible context.</p>
</section>
<section id="training" class="level3">
<h3 class="anchored" data-anchor-id="training">Training</h3>
<p>To train the denoising model, Equation&nbsp;1 shows that it is natural to parametrize the conditional distribution</p>
<p><img src="https://latex.codecogs.com/png.latex?f_%5Ctheta(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)%20%5Capprox%20%5Coverline%7Bp%7D_0(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)"></p>
<p>for all sets <img src="https://latex.codecogs.com/png.latex?S%20%5Csubset%20%5C%7B1,%5Cldots,L%5C%7D"> with <img src="https://latex.codecogs.com/png.latex?i%20%5Cnotin%20S">. Once done, one can define the rate matrix of the time-reversal process as:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_%7Bt,%5Ctheta%7D%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)%20=%20R(t)%20%5C,%20f_%5Ctheta(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)%20%5C,%20Q_t(x%5Ei,%20M).%0A"></p>
<p>If one denotes by <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D"> the law of the forward noising process started from <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0">, and by <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7B%5Ctheta%7D"> the law of the time-reversal process started from the fully masked sequence <img src="https://latex.codecogs.com/png.latex?(M,M,%20%5Cldots,%20M)"> at time <img src="https://latex.codecogs.com/png.latex?T"> and with learned denoising model <img src="https://latex.codecogs.com/png.latex?f_%5Ctheta">, one can train the model by minimizing</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%7B%5Ctext%7BKL%7D%7D%20%7B%5Cleft(%20%20%5Cmathbb%7BP%7D%5C;%20%7C%7C%20%5C;%20%5Cmathbb%7BP%7D_%7B%5Ctheta%7D%20%20%5Cright)%7D%20%20=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%20%7B%5Cleft(%20%20%5Clog%20%5Cfrac%7B%5Cmathbb%7BP%7D%7D%7B%5Cmathbb%7BP%7D_%7B%5Ctheta%7D%7D%20%20%5Cright)%7D%20.%0A"></p>
<p>Consider a trajectory <img src="https://latex.codecogs.com/png.latex?x_%7B%5B0,T%5D%7D"> of the forward noising process. The jump at time <img src="https://latex.codecogs.com/png.latex?%5Ctau_i"> of the <img src="https://latex.codecogs.com/png.latex?i">-th coordinate is denoted by <img src="https://latex.codecogs.com/png.latex?%5CDelta_i:%20=%20(x_%7B%5Ctau_i%5E-%7D%5Ei,%20x_%7B%5Ctau_i%5E+%7D%5Ei)%20=%20(x_0%5Ei,%20M)">. For simplifying the notations, we denote the reverse jump by <img src="https://latex.codecogs.com/png.latex?%5CDelta_i%5E%7B%5Cstar%7D">. The log-likelihood ratio between the two processes is easily shown to be:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Clog%20%5Cfrac%7B%5Cmathbb%7BP%7D%7D%7B%5Cmathbb%7BP%7D_%7B%5Ctheta%7D%7D(x_%7B%5B0,T%5D%7D)%20=%20%5Clog%20%5Coverline%7Bp%7D_0(x_0)%20+%20%5Csum_i%20%5Clog%20%5Cfrac%7B%5Coverline%7BQ%7D_%7B%5Ctau_i%7D(%5CDelta_i)%7D%7B%5Coverline%7BQ%7D%5E%7B%5Cstar%7D_%7B%5Ctau_i,%20%5Ctheta%7D(%5CDelta_i%5E%7B%5Cstar%7D)%7D%20-%20%5Cint_0%5ET%20%20%7B%5Cleft%5C%7B%20%20%5Coverline%7BJ%7D_t(x_t)%20-%20%5Coverline%7BJ%7D%5E%7B%5Cstar%7D_%7Bt,%5Ctheta%7D(x_t)%20%20%5Cright%5C%7D%7D%20%20%5C,%20dt,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BJ%7D_t"> and <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BJ%7D%5E%7B%5Cstar%7D_%7Bt,%5Ctheta%7D"> are the total jump rates of the forward and reverse processes respectively. Since <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BJ%7D%5E%7B%5Cstar%7D_%7Bt,%5Ctheta%7D(x_t)"> in fact does not depend on <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, minimizing the KL divergence is equivalent to minimizing:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A-%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%20%7B%5Cleft(%20%20%5Csum_%7Bi=1%7D%5EL%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7B%5Ctau_i%7D%5E%7BS_%7B%7B%5Ctau_i%7D%7D%7D)%20%20%5Cright)%7D%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?S_t"> is the set of unmasked coordinates at time <img src="https://latex.codecogs.com/png.latex?t">. It is more convenient to rewrite this quantity as an integral over time so that one can sample a time <img src="https://latex.codecogs.com/png.latex?t"> uniformly in <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D"> during training. With the Dirac delta function <img src="https://latex.codecogs.com/png.latex?%5Cdelta%5B%5Ctau_i%20=%20t%5D">, we can rewrite this expectation as:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A-%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%20%7B%5Cleft(%20%20%5Csum_%7Bi=1%7D%5EL%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7B%5Ctau_i%7D%5E%7BS_%7Bi%7D%7D)%20%20%5Cright)%7D%0A&amp;=%0A-%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%5Cint_%7Bt=0%7D%5E%7BT%7D%20%5Csum_%7Bi=1%7D%5EL%20%5Cdelta%5B%5Ctau_i%20=%20t%5D%20%5C,%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7Bt%7D%5E%7BS_%7Bt%7D%7D)%20%5C,%20dt%5C%5C%0A&amp;=%0A-%5Cint_%7Bt=0%7D%5E%7BT%7D%20%5Cfrac%7B%5Cdot%7B%5Cbeta_t%7D%7D%7B%5Cbeta_t%7D%20%5Csum_%7Bi:%20%5C,%20x_t%5Ei=M%7D%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7Bt%7D%5E%7BS_%7Bt%7D%7D)%20%5C,%20dt%0A%5Cend%7Balign*%7D%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cbeta_t%20=%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cle%20t)"> so that <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(%5Ctau%20%5Cin%20dt%20%7C%20%5Ctau%20%5Cle%20t)%20=%20%5Cfrac%7B%5Cdot%7B%5Cbeta_t%7D%7D%7B%5Cbeta_t%7D%20%5C,%20dt">. For training, it suffices to sample <img src="https://latex.codecogs.com/png.latex?t"> uniformly in <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D">, then choose <img src="https://latex.codecogs.com/png.latex?X_0%20%5Csim%20%5Coverline%7Bp%7D_0">, then sample the noised configuration <img src="https://latex.codecogs.com/png.latex?X_t"> according to the forward process, and finally obtain an unbiased estimate of the loss. The term <img src="https://latex.codecogs.com/png.latex?%5Cdot%7B%5Cbeta_t%7D/%5Cbeta_t"> is large for small <img src="https://latex.codecogs.com/png.latex?t">, counter-balancing the fact that the reconstruction task is much easier when only a few tokens are masked. For standard denoising <a href="../../notes/DDPM/DDPM.html">diffusion model</a>, there is a similar “signal-to-noise” weighting term that balances the easy and hard denoising tasks.</p>
</section>
<section id="conclusion" class="level3">
<h3 class="anchored" data-anchor-id="conclusion">Conclusion</h3>
<p>Discrete diffusion models with one-way masking are mathematically almost identical to masked language models. Hence their similar behavior and performance on text generation tasks are not coincidental. The ideas summarized in these notes were developed in a very interesting stream of papers, including <span class="citation" data-cites="ou2024your">(Ou et al. 2024)</span>, <span class="citation" data-cites="sahoo2024simple">(Sahoo et al. 2024)</span>, <span class="citation" data-cites="shi2024simplified">(Shi et al. 2024)</span> and a number of more recent works. One of the potential drawbacks of such masked discrete diffusion models is that the support of the noising distribution is typically strictly smaller, and indeed often much smaller, than the whole state space. This means that when the denoising model is not perfect and wanders outside the support of the noising distribution, one can quickly end up in regions never seen during training. This can leads to poor sample quality and unstable behavior. Other discrete diffusion models such as the ones reaching the uniform distribution over all tokens at time <img src="https://latex.codecogs.com/png.latex?T"> are not as badly affected by this issue, although they do suffer from other important computational and modeling challenges. Exciting research directions remain to be explored in this area!</p>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-ou2024your" class="csl-entry">
Ou, Jingyang, Shen Nie, Kaiwen Xue, Fengqi Zhu, Jiacheng Sun, Zhenguo Li, and Chongxuan Li. 2024. <span>“Your Absorbing Discrete Diffusion Secretly Models the Conditional Distributions of Clean Data.”</span> <em>arXiv Preprint arXiv:2406.03736</em>.
</div>
<div id="ref-sahoo2024simple" class="csl-entry">
Sahoo, Subham, Marianne Arriola, Yair Schiff, Aaron Gokaslan, Edgar Marroquin, Justin Chiu, Alexander Rush, and Volodymyr Kuleshov. 2024. <span>“Simple and Effective Masked Diffusion Language Models.”</span> <em>Advances in Neural Information Processing Systems</em> 37: 130136–84.
</div>
<div id="ref-shi2024simplified" class="csl-entry">
Shi, Jiaxin, Kehang Han, Zhe Wang, Arnaud Doucet, and Michalis Titsias. 2024. <span>“Simplified and Generalized Masked Diffusion for Discrete Data.”</span> <em>Advances in Neural Information Processing Systems</em> 37: 103131–67.
</div>
</div></section></div> ]]></description>
  <category>DDPM</category>
  <category>score</category>
  <guid>https://alexxthiery.github.io/notes/DiscreteDiff/DiscreteDiff.html</guid>
  <pubDate>Mon, 20 Oct 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Masked Discrete Diffusion</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/DiscreteDiff.html</link>
  <description><![CDATA[ 





<!-- 
Consider a finite state space $\{M, 1,2, \ldots, V\}$ where $M$ is a special state corresponding to a masked value and $1, \ldots, V$ correspond to the possible values of a token (e.g., a word in a vocabulary of size $V$). On the time interval $[0,T]$, we consider a continuous Markov chain with initial distribution $p_0$ and infinitesimal rate matrix $Q_t \in \bbR^{(V+1) \times (V+1)}$,

$$
\P(X_{t+h} = j \mid X_t = i) = Q_t(i,j) \, h + o(h).
$$

Bayes' rule immediately shows that the time-reversal of this Markov chain is also a Markov chain with infinitesimal rate matrix $Q^{\star}_t$ satisfying:

$$
Q^{\star}_t(i,j) = \frac{p_t(j)}{p_t(i)} \, Q_t(j,i),
$$

where $p_t$ is the marginal distribution of $X_t$. We have 

$$\P(X_{t-h} = j \mid X_t = i) = Q^{\star}_t(i,j) \, h + o(h).$$

We are interested in modeling a Markov chain that progressively masks the initial value into the masked state $M$ as time $t$ goes from $0$ to $T$. Furthermore, only transitions towards the masked state $M$ are allowed, and once the process has jumped to the masked state $M$, it stays there forever. This means that outside the diagonal, the only non-zero entries of the infinitesimal rate matrix $Q_t$ are of the form $Q_t(i,M)$ for $i \in \{1, \ldots, V\}$. For convenience, we denote by $\tau$ the (almost surely unique) jump time of this Markov chain. We assume that $\tau < T$ almost surely, so that the process ends up at time $T$ at the masked state $M$ with probability one.

Now, to model text sequences of length $L$ for example, we consider $L$ independent copies of this Markov chain, i.e., $\overline{X}_t = (X_t^1, \ldots, X_t^L)$ where each $X_t^i$ is an independent Markov chain with infinitesimal rate matrix $Q_t$. This Markov process ends up at time $T$ at a fully masked sequence $\overline{X}_T = (M, \ldots, M)$ with probability one. If one can accurately model the time-reversal of this process, one can use this time-reversal to progressively unmask a fully masked sequence into a realistic sequence. That is the basic idea behind the (discrete) diffusion models. In our case, since jump times are almost surely distinct, the rate matrix of the joint process $\overline{X}_t$ is only non-zero when a single coordinate jumps. This means that, if $x,y \in \{M,1,\ldots,V\}^L$ differ by a single coordinate, say the $i$-th coordinate, then the infinitesimal rate matrix $\overline{Q}_t$ of the joint process satisfies:

$$
\overline{Q}_t(x,y) = Q_t(x^i,y_i).
$$

Similarly, the time-reversal of this joint process has infinitesimal rate matrix $\overleftarrow{\overline{Q}}_t$ satisfying:

$$
\overline{Q}^{\star}_t(x,y) = \frac{\overline{p}_t(y)}{\overline{p}_t(x)} \, Q_t(y_i,x^i),
$$

where $\overline{p}_t$ is the marginal distribution of $\overline{X}_t$. Now, $x$ and $y$ differ by a single coordinate $i$ so that, necessarily, $x^i = M$ and $y_i \in \{1, \ldots, V\}$. Let us denote by $S$ the set of indices $j$ such that $x^j \neq M$ (i.e., the set of unmasked coordinates in $x$). To observe that $x$ at time $t$, this means that the jump time of the $(L - |S|)$ masked coordinates must be smaller than $t$, while the jump time of the $|S|$ unmasked coordinates must be larger than $t$:

$$
\overline{p}_t(x) = \P(\tau < t)^{L-|S|} \, \P(\tau \geq t)^{|S|} \, \blue{ \overline{p}_0(x^{S}) }.
$$

Similarly, to observe $y$ at time $t$, the jump time of the $(L - |S| - 1)$ masked coordinates must be smaller than $t$, the jump time of the $|S|+1$ unmasked coordinates must be larger than $t$:

$$
\overline{p}_t(y) = \P(\tau < t)^{L-|S|-1} \, \P(\tau \geq t)^{|S|+1} \, \blue{ \overline{p}_0(x^{S}) \, \overline{p}_0(x^i \mid x^{S}) }.
$$

This means that the time-reversal rate matrix satisfies:

$$
\overline{Q}^{\star}_t(x,y) = R(t) \, \blue{\overline{p}_0(x^i \mid x^{S}) } \, Q_t(M, x^i),
$$

with time-dependent scalar $R(t) = \frac{\P(\tau \geq t)}{\P(\tau < t)}$. This means that, in practice, in order to model the time-reversal of this masked discrete diffusion process, one only needs to model the conditional distribution $\blue{\overline{p}_0(x^i \mid x^{S}) }$ of the data distribution $\overline{p}_0$. Standard BERT-like, masked language models, and transformers are perfectly suited to model such conditional distributions. This also shows that these discrete diffusion processes are in fact almost identical to masked language models, so one should not be surprised that they achieve similar performance on text generation tasks.

--- -->
<section id="masked-discrete-diffusion" class="level3">
<h3 class="anchored" data-anchor-id="masked-discrete-diffusion">Masked Discrete Diffusion</h3>
<p>We consider a finite state space <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BX%7D%20=%20%5C%7BM,%201,2,%20%5Cldots,%20V%5C%7D,%0A"> where <img src="https://latex.codecogs.com/png.latex?M"> is a special <strong>masked</strong> state and <img src="https://latex.codecogs.com/png.latex?1,%20%5Cldots,%20V"> correspond to token values in a vocabulary of size <img src="https://latex.codecogs.com/png.latex?V">. On the time interval <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D">, we define a continuous-time Markov chain with initial distribution <img src="https://latex.codecogs.com/png.latex?p_0"> and time-dependent infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?Q_t%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B(V+1)%5Ctimes(V+1)%7D"> so that for any <img src="https://latex.codecogs.com/png.latex?x%20%5Cne%20y">, <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BP%7D(X_%7Bt+h%7D%20=%20y%20%5Cmid%20X_t%20=%20x)%20=%20Q_t(x,y)%20%5C,%20h%20+%20o(h).%0A"></p>
<p>If the <strong>total jump rate</strong> out of state <img src="https://latex.codecogs.com/png.latex?x"> is <img src="https://latex.codecogs.com/png.latex?J_t(x)%20=%20%5Csum_%7By%20%5Cne%20x%7D%20Q_t(x,y)"> , then</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(X_%7Bt+h%7D%20=%20x%20%5Cmid%20X_t%20=%20x)%20=%201%20-%20J_t(x)%20%5C,%20h%20+%20o(h)."></p>
<p>Bayes’ rule implies that the time-reversal of this Markov chain is itself Markov, with infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?Q_t%5E%7B%5Cstar%7D"> satisfying <img src="https://latex.codecogs.com/png.latex?%0AQ_t%5E%7B%5Cstar%7D(x,y)%20=%20%5Cfrac%7Bp_t(y)%7D%7Bp_t(x)%7D%20%5C,%20Q_t(y,x),%0A"> where <img src="https://latex.codecogs.com/png.latex?p_t"> is the marginal distribution of <img src="https://latex.codecogs.com/png.latex?X_t"> at time <img src="https://latex.codecogs.com/png.latex?t">. We have: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BP%7D(X_%7Bt-h%7D%20=%20y%20%5Cmid%20X_t%20=%20x)%20=%20Q_t%5E%7B%5Cstar%7D(x,y)%20%5C,%20h%20+%20o(h).%0A"></p>
<p>We are interested in modeling a Markov chain that progressively masks the initial value into the masked state <img src="https://latex.codecogs.com/png.latex?M"> as time <img src="https://latex.codecogs.com/png.latex?t"> goes from <img src="https://latex.codecogs.com/png.latex?0"> to <img src="https://latex.codecogs.com/png.latex?T">. Transitions are only allowed from any token <img src="https://latex.codecogs.com/png.latex?i%20%5Cin%20%5C%7B1,%5Cdots,V%5C%7D"> to the masked state <img src="https://latex.codecogs.com/png.latex?M">, and once in <img src="https://latex.codecogs.com/png.latex?M"> the process remains there. Thus, outside the diagonal, the only nonzero entries of <img src="https://latex.codecogs.com/png.latex?Q_t"> are <img src="https://latex.codecogs.com/png.latex?Q_t(x,M)">. As it will be useful later, we denote by <img src="https://latex.codecogs.com/png.latex?%5Ctau"> the jump time to <img src="https://latex.codecogs.com/png.latex?M"> and we assume <img src="https://latex.codecogs.com/png.latex?%5Ctau%20%3C%20T"> almost surely, so that <img src="https://latex.codecogs.com/png.latex?X_T%20=%20M"> with probability one, and that <img src="https://latex.codecogs.com/png.latex?%5Ctau"> has a continuous distribution. In words: the process starts at some token value and at a random time <img src="https://latex.codecogs.com/png.latex?%5Ctau"> jumps to the masked state <img src="https://latex.codecogs.com/png.latex?M">, where it remains until time <img src="https://latex.codecogs.com/png.latex?T">.</p>
</section>
<section id="extension-to-sequences" class="level3">
<h3 class="anchored" data-anchor-id="extension-to-sequences">Extension to Sequences</h3>
<p>We are interested in modeling sequences comprised of <img src="https://latex.codecogs.com/png.latex?L"> discrete tokens, eg: binary images, genomic sequences, chemical compounds, protein sequences, etc… Each token takes value in <img src="https://latex.codecogs.com/png.latex?%5C%7B1,2,%5Cldots,V%5C%7D">. We denote by <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0"> the data distribution over such sequences. For this purpose, we consider <img src="https://latex.codecogs.com/png.latex?L"> independent copies of the above Markov chain, one per coordinate: <img src="https://latex.codecogs.com/png.latex?%0AX_t%20=%20(X_t%5E1,%20%5Cldots,%20X_t%5EL),%0A"> each with rate matrix <img src="https://latex.codecogs.com/png.latex?Q_t"> as defined previously. At time <img src="https://latex.codecogs.com/png.latex?T">, the process reaches the fully masked sequence <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BX%7D_T%20=%20(M,%20%5Cldots,%20M)"> with probability one. Denote by <img src="https://latex.codecogs.com/png.latex?%5Ctau_i"> the jump time of coordinate <img src="https://latex.codecogs.com/png.latex?i">. Since the jump times <img src="https://latex.codecogs.com/png.latex?%5Ctau_i"> are almost surely distinct, the infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BQ%7D_t"> of the joint process is nonzero only when a single coordinate changes. If <img src="https://latex.codecogs.com/png.latex?x,%5Cwidehat%7Bx%7D%20%5Cin%20%5Cmathcal%7BX%7D%5EL"> differ by a single coordinate <img src="https://latex.codecogs.com/png.latex?i">, we have <img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_t(x,%5Cwidehat%7Bx%7D)%20=%20Q_t(x%5Ei,%20%5Cwidehat%7Bx%7D%5Ei).%0A"></p>
<p>As before, the time-reversal has infinitesimal rate matrix <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D"> satisfying <img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)%20=%20%5Cfrac%7B%5Coverline%7Bp%7D_t(x)%7D%7B%5Coverline%7Bp%7D_t(%5Cwidehat%7Bx%7D)%7D%20%5C,%20Q_t(x%5Ei,%20%5Cwidehat%7Bx%7D%5Ei),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_t"> is the marginal distribution of <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BX%7D_t">. Since <img src="https://latex.codecogs.com/png.latex?x"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D"> differ at coordinate <img src="https://latex.codecogs.com/png.latex?i"> only, for <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)"> to be non-zero, necessarily <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D%5Ei%20=%20M"> and <img src="https://latex.codecogs.com/png.latex?x%5Ei%20%5Cin%20%5C%7B1,%5Cldots,V%5C%7D">. Let <img src="https://latex.codecogs.com/png.latex?S%20=%20%5C%7Bj%20:%20x%5Ej%20%5Cneq%20M%5C%7D"> be the set of unmasked coordinates in <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D">. To observe configuration <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D"> at time <img src="https://latex.codecogs.com/png.latex?t">, the <img src="https://latex.codecogs.com/png.latex?(L%20-%20%7CS%7C)"> masked coordinates must have <img src="https://latex.codecogs.com/png.latex?%5Ctau%20%3C%20t"> and the <img src="https://latex.codecogs.com/png.latex?%7CS%7C"> unmasked ones <img src="https://latex.codecogs.com/png.latex?%5Ctau%20%5Cge%20t">: <img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7Bp%7D_t(%5Cwidehat%7Bx%7D)%20=%20%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%5E%7BL-%7CS%7C%7D%20%5C,%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%5E%7B%7CS%7C%7D%20%5C,%20%5Coverline%7Bp%7D_0(%5Cwidehat%7Bx%7D%5E%7BS%7D).%0A"></p>
<p>Similarly, and since <img src="https://latex.codecogs.com/png.latex?x"> differs from <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bx%7D"> only at coordinate <img src="https://latex.codecogs.com/png.latex?i">: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A%5Coverline%7Bp%7D_t(x)%0A&amp;=%20%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%5E%7BL-%7CS%7C-1%7D%20%5C,%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%5E%7B%7CS%7C+1%7D%20%5C,%0A%5Coverline%7Bp%7D_0(x%5E%7BS%20%5Ccup%20%5C%7Bi%5C%7D%7D)%5C%5C%0A&amp;=%20%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%5E%7BL-%7CS%7C-1%7D%20%5C,%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%5E%7B%7CS%7C+1%7D%20%5C,%0A%5Coverline%7Bp%7D_0(%5Cwidehat%7Bx%7D%5E%7BS%7D)%5C,%20%5Coverline%7Bp%7D_0(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D).%0A%5Cend%7Balign*%7D%0A"></p>
<p>This shows that the time-reversal rate matrix becomes <span id="eq-reverse-rate-matrix"><img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_t%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)%20=%20R(t)%20%5C,%20%5Coverline%7Bp%7D_0(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)%5C,%20Q_t(x%5Ei,%20M),%0A%5Ctag%7B1%7D"></span></p>
<p>with time dependent scalar <img src="https://latex.codecogs.com/png.latex?R(t)%20=%20%5Cfrac%7B%5Cmathbb%7BP%7D(%5Ctau%20%5Cge%20t)%7D%7B%5Cmathbb%7BP%7D(%5Ctau%20%3C%20t)%7D">. To simulate the reverse process that progressively unmasks a fully masked sequence, one only needs to model the conditional distribution <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0(%5Cwidehat%7Bx%7D%5Ei%20%5Cmid%20x%5E%7BS%7D)"> of the data distribution <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0">. This is precisely the prediction task of masked language models such as BERT, which estimate token probabilities conditioned on visible context.</p>
</section>
<section id="training" class="level3">
<h3 class="anchored" data-anchor-id="training">Training</h3>
<p>To train the denoising model, Equation&nbsp;1 shows that it is natural to parametrize the conditional distribution</p>
<p><img src="https://latex.codecogs.com/png.latex?f_%5Ctheta(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)%20%5Capprox%20%5Coverline%7Bp%7D_0(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)"></p>
<p>for all sets <img src="https://latex.codecogs.com/png.latex?S%20%5Csubset%20%5C%7B1,%5Cldots,L%5C%7D"> with <img src="https://latex.codecogs.com/png.latex?i%20%5Cnotin%20S">. Once done, one can define the rate matrix of the time-reversal process as:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BQ%7D_%7Bt,%5Ctheta%7D%5E%7B%5Cstar%7D(%5Cwidehat%7Bx%7D,%20x)%20=%20R(t)%20%5C,%20f_%5Ctheta(x%5Ei%20%5Cmid%20%5Cwidehat%7Bx%7D%5E%7BS%7D)%20%5C,%20Q_t(x%5Ei,%20M).%0A"></p>
<p>If one denotes by <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D"> the law of the forward noising process started from <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bp%7D_0">, and by <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D_%7B%5Ctheta%7D"> the law of the time-reversal process started from the fully masked sequence <img src="https://latex.codecogs.com/png.latex?(M,M,%20%5Cldots,%20M)"> at time <img src="https://latex.codecogs.com/png.latex?T"> and with learned denoising model <img src="https://latex.codecogs.com/png.latex?f_%5Ctheta">, one can train the model by minimizing</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%7B%5Ctext%7BKL%7D%7D%20%7B%5Cleft(%20%20%5Cmathbb%7BP%7D%5C;%20%7C%7C%20%5C;%20%5Cmathbb%7BP%7D_%7B%5Ctheta%7D%20%20%5Cright)%7D%20%20=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%20%7B%5Cleft(%20%20%5Clog%20%5Cfrac%7B%5Cmathbb%7BP%7D%7D%7B%5Cmathbb%7BP%7D_%7B%5Ctheta%7D%7D%20%20%5Cright)%7D%20.%0A"></p>
<p>Consider a trajectory <img src="https://latex.codecogs.com/png.latex?x_%7B%5B0,T%5D%7D"> of the forward noising process. The jump at time <img src="https://latex.codecogs.com/png.latex?%5Ctau_i"> of the <img src="https://latex.codecogs.com/png.latex?i">-th coordinate is denoted by <img src="https://latex.codecogs.com/png.latex?%5CDelta_i:%20=%20(x_%7B%5Ctau_i%5E-%7D%5Ei,%20x_%7B%5Ctau_i%5E+%7D%5Ei)%20=%20(x_0%5Ei,%20M)">. For simplifying the notations, we denote the reverse jump by <img src="https://latex.codecogs.com/png.latex?%5CDelta_i%5E%7B%5Cstar%7D">. The log-likelihood ratio between the two processes is easily shown to be:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Clog%20%5Cfrac%7B%5Cmathbb%7BP%7D%7D%7B%5Cmathbb%7BP%7D_%7B%5Ctheta%7D%7D(x_%7B%5B0,T%5D%7D)%20=%20%5Clog%20%5Coverline%7Bp%7D_0(x_0)%20+%20%5Csum_i%20%5Clog%20%5Cfrac%7B%5Coverline%7BQ%7D_%7B%5Ctau_i%7D(%5CDelta_i)%7D%7B%5Coverline%7BQ%7D%5E%7B%5Cstar%7D_%7B%5Ctau_i,%20%5Ctheta%7D(%5CDelta_i%5E%7B%5Cstar%7D)%7D%20-%20%5Cint_0%5ET%20%20%7B%5Cleft%5C%7B%20%20%5Coverline%7BJ%7D_t(x_t)%20-%20%5Coverline%7BJ%7D%5E%7B%5Cstar%7D_%7Bt,%5Ctheta%7D(x_t)%20%20%5Cright%5C%7D%7D%20%20%5C,%20dt,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BJ%7D_t"> and <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BJ%7D%5E%7B%5Cstar%7D_%7Bt,%5Ctheta%7D"> are the total jump rates of the forward and reverse processes respectively. Since <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BJ%7D%5E%7B%5Cstar%7D_%7Bt,%5Ctheta%7D(x_t)"> in fact does not depend on <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, minimizing the KL divergence is equivalent to minimizing:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A-%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%20%7B%5Cleft(%20%20%5Csum_%7Bi=1%7D%5EL%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7B%5Ctau_i%7D%5E%7BS_%7B%7B%5Ctau_i%7D%7D%7D)%20%20%5Cright)%7D%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?S_t"> is the set of unmasked coordinates at time <img src="https://latex.codecogs.com/png.latex?t">. It is more convenient to rewrite this quantity as an integral over time so that one can sample a time <img src="https://latex.codecogs.com/png.latex?t"> uniformly in <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D"> during training. With the Dirac delta function <img src="https://latex.codecogs.com/png.latex?%5Cdelta%5B%5Ctau_i%20=%20t%5D">, we can rewrite this expectation as:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A-%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%20%7B%5Cleft(%20%20%5Csum_%7Bi=1%7D%5EL%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7B%5Ctau_i%7D%5E%7BS_%7Bi%7D%7D)%20%20%5Cright)%7D%0A&amp;=%0A-%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%7D%20%5Cint_%7Bt=0%7D%5E%7BT%7D%20%5Csum_%7Bi=1%7D%5EL%20%5Cdelta%5B%5Ctau_i%20=%20t%5D%20%5C,%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7Bt%7D%5E%7BS_%7Bt%7D%7D)%20%5C,%20dt%5C%5C%0A&amp;=%0A-%5Cint_%7Bt=0%7D%5E%7BT%7D%20%5Cfrac%7B%5Cdot%7B%5Cbeta_t%7D%7D%7B%5Cbeta_t%7D%20%5Csum_%7Bi:%20%5C,%20x_t%5Ei=M%7D%20%5Clog%20f_%5Ctheta(X_0%5Ei%20%5Cmid%20X_%7Bt%7D%5E%7BS_%7Bt%7D%7D)%20%5C,%20dt%0A%5Cend%7Balign*%7D%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cbeta_t%20=%20%5Cmathbb%7BP%7D(%5Ctau%20%5Cle%20t)"> so that <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D(%5Ctau%20%5Cin%20dt%20%7C%20%5Ctau%20%5Cle%20t)%20=%20%5Cfrac%7B%5Cdot%7B%5Cbeta_t%7D%7D%7B%5Cbeta_t%7D%20%5C,%20dt">. For training, it suffices to sample <img src="https://latex.codecogs.com/png.latex?t"> uniformly in <img src="https://latex.codecogs.com/png.latex?%5B0,T%5D">, then choose <img src="https://latex.codecogs.com/png.latex?X_0%20%5Csim%20%5Coverline%7Bp%7D_0">, then sample the noised configuration <img src="https://latex.codecogs.com/png.latex?X_t"> according to the forward process, and finally obtain an unbiased estimate of the loss. The term <img src="https://latex.codecogs.com/png.latex?%5Cdot%7B%5Cbeta_t%7D/%5Cbeta_t"> is large for small <img src="https://latex.codecogs.com/png.latex?t">, counter-balancing the fact that the reconstruction task is much easier when only a few tokens are masked. For standard denoising <a href="../../notes/DDPM/DDPM.html">diffusion model</a>, there is a similar “signal-to-noise” weighting term that balances the easy and hard denoising tasks.</p>
</section>
<section id="conclusion" class="level3">
<h3 class="anchored" data-anchor-id="conclusion">Conclusion</h3>
<p>Discrete diffusion models with one-way masking are mathematically almost identical to masked language models. Hence their similar behavior and performance on text generation tasks are not coincidental. The ideas summarized in these notes were developed in a very interesting stream of papers, including <span class="citation" data-cites="ou2024your">(<strong>ou2024your?</strong>)</span>, <span class="citation" data-cites="sahoo2024simple">(<strong>sahoo2024simple?</strong>)</span>, <span class="citation" data-cites="shi2024simplified">(<strong>shi2024simplified?</strong>)</span> and a number of more recent works. One of the potential drawbacks of such masked discrete diffusion models is that the support of the noising distribution is typically strictly smaller, and indeed often much smaller, than the whole state space. This means that when the denoising model is not perfect and wanders outside the support of the noising distribution, one can quickly end up in regions never seen during training. This can leads to poor sample quality and unstable behavior. Other discrete diffusion models such as the ones reaching the uniform distribution over all tokens at time <img src="https://latex.codecogs.com/png.latex?T"> are not as badly affected by this issue, although they do suffer from other important computational and modeling challenges. Exciting research directions remain to be explored in this area!</p>


</section>

 ]]></description>
  <category>DDPM</category>
  <category>score</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/DiscreteDiff.html</guid>
  <pubDate>Mon, 20 Oct 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Schrödinger Bridges</title>
  <link>https://alexxthiery.github.io/notes/shrodinger_bridge/shrodinger.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/shrodinger_bridge/erwin.jpg" class="img-fluid figure-img" style="width:35.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Erwin_Schr%C3%B6dinger">Erwin Schrödinger</a> (1887 – 1961)</figcaption>
</figure>
</div>
</div>
<p>Consider two discrete probability distributions <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1"> over <img src="https://latex.codecogs.com/png.latex?%5B%5B1,n%5D%5D">. We would like to find a <a href="https://en.wikipedia.org/wiki/Coupling_(probability)">coupling</a> <img src="https://latex.codecogs.com/png.latex?%5Cgamma(x_0,x_1)"> between <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1"> such that, under this coupling <img src="https://latex.codecogs.com/png.latex?(X_0,X_1)%20%5Csim%20%5Cgamma">, the distance <img src="https://latex.codecogs.com/png.latex?d(X_0,X_1)"> between <img src="https://latex.codecogs.com/png.latex?X_0"> and <img src="https://latex.codecogs.com/png.latex?X_1"> is small. Naturally, this can be formulated as the following <a href="https://en.wikipedia.org/wiki/Transportation_theory_(mathematics)">optimal transport</a> problem:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20d(x_0,x_1)%20%5C,%20%5Cgamma(x_0,x_1),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5CPi(%5Cnu_0,%20%5Cnu_1)"> is the set of couplings between <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1">. It is a <a href="https://en.wikipedia.org/wiki/Linear_programming">linear program</a> and can be solved efficiently when <img src="https://latex.codecogs.com/png.latex?n"> is not too large. However, the optimal transport plan is often very sparse since it puts mass on at most <img src="https://latex.codecogs.com/png.latex?(2n-1)"> pairs <img src="https://latex.codecogs.com/png.latex?(x_0,x_1)">. This can be undesirable in some applications. Furthermore, small changes in the distributions <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1"> can lead to large changes in the optimal transport plan. This sensitivity can be problematic in practice, especially when the distributions are estimated from data.</p>
<section id="static-shrödinger-bridge-problem" class="level3">
<h3 class="anchored" data-anchor-id="static-shrödinger-bridge-problem">Static Shrödinger Bridge Problem</h3>
<p>A standard way to address these issues is to add an entropic regularization term to the objective function. The resulting problem is known as the Schrödinger bridge problem and can be formulated as follows. Consider a reference joint distribution <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)"> over <img src="https://latex.codecogs.com/png.latex?%5B%5B1,n%5D%5D%20%5Ctimes%20%5B%5B1,n%5D%5D"> and find the coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma(x_0,x_1)"> that minimizes the Kullback-Leibler divergence to <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> while matching the marginals <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1">:</p>
<p><span id="eq-kl-contrained"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20%5Cgamma(x_0,x_1)%20%5Clog%20%5Cfrac%7B%5Cgamma(x_0,x_1)%7D%7B%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%7D.%0A%5Ctag%7B1%7D"></span></p>
<p><strong>Remark (invariance under separable rescaling).</strong> Only the “interaction structure” of <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> matters: if one replaces <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> by <img src="https://latex.codecogs.com/png.latex?%5Ctilde%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5Cpropto%20a(x_0)%5C,%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5C,b(x_1)"> with positive <img src="https://latex.codecogs.com/png.latex?a,b">, then the optimal coupling can still be written in the same form below, with the factors <img src="https://latex.codecogs.com/png.latex?a,b"> absorbed into the potentials. Equivalently, the solution depends on <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> only through its kernel up to left/right diagonal scaling.</p>
<p>A common choice for the reference measure is a distribution of the form <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%20%5Cpropto%20%5Cexp(-d(x_0,x_1)/%5Cvarepsilon)"> (optionally times separable factors). This choice encourages the coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> to put more mass on pairs <img src="https://latex.codecogs.com/png.latex?(x_0,x_1)"> that are close according to the distance <img src="https://latex.codecogs.com/png.latex?d">, and the resulting optimization problem can be rewritten (up to an additive constant) as:</p>
<p><span id="eq-entropic-ot"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20d(x_0,x_1)%20%5C,%20%5Cgamma(x_0,x_1)%20%20%5Ctextcolor%7Bblue%7D%7B%5C;%20-%20%5C;%20%5Cvarepsilon%5C,%20%5Cmathrm%7BH%7D(%5Cgamma)%7D%0A%5Ctag%7B2%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BH%7D(%5Cgamma)%20=%20-%20%5Csum_%7Bx_0,x_1%7D%20%5Cgamma(x_0,x_1)%20%5Clog%20%5Cgamma(x_0,x_1)"> is the <a href="https://en.wikipedia.org/wiki/Entropy_(information_theory)">entropy</a> of the coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma">. Note that since the marginals of <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> are fixed, it is also equivalent (up to constants) to replacing the entropy term by the <a href="https://en.wikipedia.org/wiki/Kullback–Leibler_divergence">Kullback-Leibler</a> divergence to the independent coupling <img src="https://latex.codecogs.com/png.latex?%5Cnu_0(x_0)%20%5Cotimes%20%5Cnu_1(x_1)">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20d(x_0,x_1)%20%5C,%20%5Cgamma(x_0,x_1)%20%20%5Ctextcolor%7Bblue%7D%7B%5C;%20+%20%5C;%20%5Cvarepsilon%5C,%20D_%7B%5Ctext%7BKL%7D%7D(%5Cgamma%20%5Cmid%20%5Cnu_0%20%5Cotimes%20%5Cnu_1)%7D.%0A"></p>
<p>Writing the <a href="https://en.wikipedia.org/wiki/Duality_(optimization)">Lagrange dual</a> formulation of the problem Equation&nbsp;2 provides fast algorithms to solve it such as the <a href="https://en.wikipedia.org/wiki/Iterative_proportional_fitting">iterative proportional fitting</a> procedure (IPFP), also known as the Sinkhorn-Knopp algorithm in the optimal transport literature <span class="citation" data-cites="cuturi2013sinkhorn">(Cuturi 2013)</span>. Importantly, it also almost immediately shows that the optimal coupling has a very simple form,</p>
<p><span id="eq-schrodinger-solution"><img src="https://latex.codecogs.com/png.latex?%0A%5Cgamma(x_0,x_1)%20=%20f(x_0)%20%5C,%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%20%5C,%20g(x_1).%0A%5Ctag%7B3%7D"></span></p>
<p>These potentials must satisfy the marginal constraints, equivalently the <strong>Schrödinger/Sinkhorn scaling equations</strong>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%5Cnu_0(x_0)%20&amp;=%20%5Csum_%7Bx_1%7D%20f(x_0)%5C,%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5C,%20g(x_1),%5C%5C%0A%5Cnu_1(x_1)%20&amp;=%20%5Csum_%7Bx_0%7D%20f(x_0)%5C,%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5C,%20g(x_1).%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<details>
<summary>
Some details:
</summary>
<p style="color: blue;">
The Lagrangian of the constrained convex optimization Equation&nbsp;1 reads: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A%5Csum_%7Bx_0,x_1%7D%20%5Cgamma(x_0,x_1)%20%5Clog%20%5Cfrac%7B%5Cgamma(x_0,x_1)%7D%7B%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%7D%0A&amp;+%20%5Csum_%7Bx_0%7D%20%5Calpha(x_0)%20%5Cleft(%20%5Cnu_0(x_0)%20-%20%5Csum_%7Bx_1%7D%20%5Cgamma(x_0,x_1)%20%5Cright)%5C%5C%0A&amp;+%20%5Csum_%7Bx_1%7D%20%5Cbeta(x_1)%20%5Cleft(%20%5Cnu_1(x_1)%20-%20%5Csum_%7Bx_0%7D%20%5Cgamma(x_0,x_1)%20%5Cright).%0A%5Cend%7Balign*%7D%0A"> There is no need to impose a constraint on the total mass of <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> since it is automatically satisfied by the marginal constraints. For a fixed set of dual variables <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">, minimizing the Lagrangian with respect to <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> leads to the optimum <img src="https://latex.codecogs.com/png.latex?%5Cgamma_%7B%5Calpha,%20%5Cbeta%7D(x_0,x_1)%20=%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%20%5C,%20e%5E%7B%5Calpha(x_0)%20+%20%5Cbeta(x_1)%20-1%7D">, hence proving Equation&nbsp;3 with <img src="https://latex.codecogs.com/png.latex?f=e%5E%7B%5Calpha-1%7D"> and <img src="https://latex.codecogs.com/png.latex?g=e%5E%5Cbeta"> (up to scaling). Plugging this expression back into the Lagrangian gives: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Calpha,%20%5Cbeta)%20=%20%5Csum_%7Bx_0%7D%20%5Calpha(x_0)%20%5C,%20%5Cnu_0(x_0)%20+%20%5Csum_%7Bx_1%7D%20%5Cbeta(x_1)%20%5C,%20%5Cnu_1(x_1)%20-%20%5Csum_%7Bx_0,x_1%7D%20%5Cgamma_%7B%5Calpha,%20%5Cbeta%7D(x_0,x_1).%0A"> Alternating maximization in <img src="https://latex.codecogs.com/png.latex?(%5Calpha,%5Cbeta)"> corresponds to alternately enforcing the two marginal constraints, i.e.&nbsp;IPFP / Sinkhorn scaling. Directly maximizing the Lagrange dual <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D(%5Calpha,%20%5Cbeta)"> using gradient ascent methods such as <a href="https://en.wikipedia.org/wiki/Limited-memory_BFGS">L-BFGS</a> is also possible and can lead to faster convergence in some cases. Note that the dual problem only has <img src="https://latex.codecogs.com/png.latex?2n"> variables, while the primal problem has <img src="https://latex.codecogs.com/png.latex?n%5E2"> variables!
</p>
</details>
</section>
<section id="dynamic-schrödinger-bridge-problem" class="level3">
<h3 class="anchored" data-anchor-id="dynamic-schrödinger-bridge-problem">Dynamic Schrödinger Bridge Problem</h3>
<p>Now, suppose that the reference distribution <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)"> is given as the two-time marginal of a Markov process <img src="https://latex.codecogs.com/png.latex?(X_t)_%7Bt%20%5Cin%20%5B0,1%5D%7D"> with transition kernels <img src="https://latex.codecogs.com/png.latex?p%5E%7B%5Ctext%7Bref%7D%7D_%7Bs,t%7D(x_s,x_t)"> and path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D"> on trajectories <img src="https://latex.codecogs.com/png.latex?x_%7B%5B0,1%5D%7D">.</p>
<p>The dynamic Schrödinger bridge problem consists in finding a new path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D"> on trajectories <img src="https://latex.codecogs.com/png.latex?x_%7B%5B0,1%5D%7D"> such that the starting and ending marginals are <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1">, while minimizing the Kullback-Leibler divergence to the reference path distribution <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cmathbb%7BQ%7D:%5C%20%5Cmathbb%7BQ%7D_0=%5Cnu_0,%5C%20%5Cmathbb%7BQ%7D_1=%5Cnu_1%7D%5C;%20%5Cmathrm%7BKL%7D(%5Cmathbb%7BQ%7D%5Cmid%20%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D).%0A"></p>
<p>When the reference is Markov, the chain rule for KL (disintegration with respect to <img src="https://latex.codecogs.com/png.latex?(X_0,X_1)">) shows this is equivalent to the static Schrödinger bridge problem for the two-time marginal of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D">: one first solves for the optimal endpoint coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma%5E%5Cstar(x_0,x_1)">, and then fills in intermediate times using the <strong>reference bridges</strong> <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D(%5Ccdot%5Cmid%20X_0=x_0,X_1=x_1)">:</p>
<ol type="1">
<li>Sample the endpoints <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_1)%20%5Csim%20%5Cgamma%5E%5Cstar(x_0,x_1)">.<br>
</li>
<li>Sample the intermediate points according to the conditional law of the reference process given the endpoints, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?(X_t)_%7Bt%20%5Cin%20(0,1)%7D%20%5Csim%20%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D(%5Ccdot%20%5Cmid%20X_0,%20X_1)">.</li>
</ol>
<p><strong>Continuous-Time Stochastic Processes:</strong></p>
<p>A typical setting is when the reference process <img src="https://latex.codecogs.com/png.latex?(X_t)"> is given as the solution of a stochastic differential equation of the form</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20=%20b_t(X_t)%20%5C,%20dt%20+%20%5Csigma%20%5C,%20dW_t,%0A"></p>
<p>started from some initial distribution (one may take it to be <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> without loss of generality, since any mismatch can be absorbed into the endpoint tilt below). The solution to the dynamic Schrödinger bridge problem is given by the twisted path distribution:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%5Cmathbb%7BQ%7D%5E%5Cstar%7D%7Bd%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D%7D(x_%7B%5B0,1%5D%7D)%0A%5Cpropto%20f(X_0)%5C,g(X_1),%0A"></p>
<p>for endpoint potentials <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> satisfying the marginal constraints at <img src="https://latex.codecogs.com/png.latex?t=0"> and <img src="https://latex.codecogs.com/png.latex?t=1">.</p>
<p>The marginal density at intermediate time <img src="https://latex.codecogs.com/png.latex?t%5Cin%5B0,1%5D"> factorizes as:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Aq_t(x)%20=%20p_t%5E%7B%5Ctext%7Bref%7D%7D(x)%5C,%5Cwidehat%7B%5Cvarphi%7D_t(x)%5C,%5Cvarphi_t(x),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?p_t%5E%7B%5Ctext%7Bref%7D%7D"> is the time-<img src="https://latex.codecogs.com/png.latex?t"> marginal density of the reference process, and where the time-dependent Schrödinger potentials are defined by:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%5Cvarphi_t(x)%20&amp;=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D%7D%5Bg(X_1)%5Cmid%20X_t=x%5D,%5C%5C%0A%5Cwidehat%7B%5Cvarphi%7D_t(x)%20&amp;=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D%7D%5Bf(X_0)%5Cmid%20X_t=x%5D,%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>(with <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_1%20%5Cequiv%20g"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_0%20%5Cequiv%20f">, up to normalization). Naturally, the dynamics of the Schrödinger bridge process can be described as a new stochastic differential equation obtained by applying a <a href="../../notes/doob_transforms/doob.html">Doob h-transform</a> to the reference SDE,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20=%20b_t(X_t)%5C,dt%20+%20%20%5Ctextcolor%7Bblue%7D%7B%5Csigma%20%5Csigma%5E%5Ctop%20%5Cnabla_x%20%5Clog%20%5Cvarphi_t(%20X_t)%5C,dt%7D%20+%20%5Csigma%5C,dW_t,%0A"></p>
<p>where, as explained in these previous <a href="../../notes/doob_transforms/doob.html">notes</a>, the function <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t(x)"> is the harmonic extension of the terminal potential <img src="https://latex.codecogs.com/png.latex?g"> defined above.</p>
<p><strong>Discrete-Time Markov Chains:</strong></p>
<p>It is often useful to state the Schrödinger bridge dynamics in a discrete setting. Let the reference process be a Markov chain <img src="https://latex.codecogs.com/png.latex?X_0,%20%5Cldots,%20X_T"> with one-step kernels <img src="https://latex.codecogs.com/png.latex?M_k(x,dy)">, i.e. <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D(X_%7Bk+1%7D%5Cin%20dy%5Cmid%20X_k=x)=M_k(x,dy).%0A"> Let <img src="https://latex.codecogs.com/png.latex?g"> be the terminal potential at time <img src="https://latex.codecogs.com/png.latex?T"> and define the backward (harmonic) potentials defined by <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_T%20%5Cequiv%20g"> and recursively as: <img src="https://latex.codecogs.com/png.latex?%0A%5Cvarphi_k(x)%20=%20%5Cint%20M_k(x,dy)%5C,%5Cvarphi_%7Bk+1%7D(y).%0A"></p>
<p>Then the Schrödinger bridge <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D%5E%5Cstar"> is Markov and its <strong>forward transition kernels</strong> are given by the discrete Doob <img src="https://latex.codecogs.com/png.latex?h">-transform: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BQ%7D%5E%5Cstar(X_%7Bk+1%7D%5Cin%20dy%5Cmid%20X_k=x)%0A=%5Cfrac%7BM_k(x,dy)%5C,%5Cvarphi_%7Bk+1%7D(y)%7D%7B%5Cvarphi_k(x)%7D.%0A"> This is the discrete-time counterpart of the continuous-time drift correction <img src="https://latex.codecogs.com/png.latex?b_t%20%5Cmapsto%20b_t%20+%20%5Csigma%5Csigma%5E%5Ctop%5Cnabla%5Clog%5Cvarphi_t(%5Ccdot)">.</p>
<p>In general, Schrödinger bridge problems are difficult problems since the endpoint potentials <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> need to be found such that the marginal constraints are satisfied. These recent years have seen the development of many numerical methods to solve this problem approximately, especially in the machine learning community, eg: <span class="citation" data-cites="shi2023diffusion">(Shi et al. 2023)</span>; <span class="citation" data-cites="de2021diffusion">(De Bortoli et al. 2021)</span>; <span class="citation" data-cites="vargas2021solving">(Vargas et al. 2021)</span>; <span class="citation" data-cites="chen2021likelihood">(Chen, Liu, and Theodorou 2021)</span>.</p>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-chen2021likelihood" class="csl-entry">
Chen, Tianrong, Guan-Horng Liu, and Evangelos A Theodorou. 2021. <span>“Likelihood Training of Schrodinger Bridge Using Forward-Backward Sdes Theory.”</span> <em>arXiv Preprint arXiv:2110.11291</em>.
</div>
<div id="ref-cuturi2013sinkhorn" class="csl-entry">
Cuturi, Marco. 2013. <span>“Sinkhorn Distances: Lightspeed Computation of Optimal Transport.”</span> <em>Advances in Neural Information Processing Systems</em> 26.
</div>
<div id="ref-de2021diffusion" class="csl-entry">
De Bortoli, Valentin, James Thornton, Jeremy Heng, and Arnaud Doucet. 2021. <span>“Diffusion Schrodinger Bridge with Applications to Score-Based Generative Modeling.”</span> <em>Advances in Neural Information Processing Systems</em> 34: 17695–709.
</div>
<div id="ref-shi2023diffusion" class="csl-entry">
Shi, Yuyang, Valentin De Bortoli, Andrew Campbell, and Arnaud Doucet. 2023. <span>“Diffusion Schrodinger Bridge Matching.”</span> <em>Advances in Neural Information Processing Systems</em> 36: 62183–223.
</div>
<div id="ref-vargas2021solving" class="csl-entry">
Vargas, Francisco, Pierre Thodoroff, Austen Lamacraft, and Neil Lawrence. 2021. <span>“Solving Schrodinger Bridges via Maximum Likelihood.”</span> <em>Entropy</em> 23 (9). MDPI: 1134.
</div>
</div></section></div> ]]></description>
  <category>SDE</category>
  <category>markov</category>
  <guid>https://alexxthiery.github.io/notes/shrodinger_bridge/shrodinger.html</guid>
  <pubDate>Sat, 18 Oct 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Schrödinger Bridges</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/shrodinger.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/adjoint_samplers_draft/erwin.jpg" class="img-fluid figure-img" style="width:35.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Erwin_Schr%C3%B6dinger">Erwin Schrödinger</a> (1887 – 1961)</figcaption>
</figure>
</div>
</div>
<p>Consider two discrete probability distributions <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1"> over <img src="https://latex.codecogs.com/png.latex?%5B%5B1,n%5D%5D">. We would like to find a <a href="https://en.wikipedia.org/wiki/Coupling_(probability)">coupling</a> <img src="https://latex.codecogs.com/png.latex?%5Cgamma(x_0,x_1)"> between <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1"> such that, under this coupling <img src="https://latex.codecogs.com/png.latex?(X_0,X_1)%20%5Csim%20%5Cgamma">, the distance <img src="https://latex.codecogs.com/png.latex?d(X_0,X_1)"> between <img src="https://latex.codecogs.com/png.latex?X_0"> and <img src="https://latex.codecogs.com/png.latex?X_1"> is small. Naturally, this can be formulated as the following <a href="https://en.wikipedia.org/wiki/Transportation_theory_(mathematics)">optimal transport</a> problem:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20d(x_0,x_1)%20%5C,%20%5Cgamma(x_0,x_1),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5CPi(%5Cnu_0,%20%5Cnu_1)"> is the set of couplings between <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1">. It is a <a href="https://en.wikipedia.org/wiki/Linear_programming">linear program</a> and can be solved efficiently when <img src="https://latex.codecogs.com/png.latex?n"> is not too large. However, the optimal transport plan is often very sparse since it puts mass on at most <img src="https://latex.codecogs.com/png.latex?(2n-1)"> pairs <img src="https://latex.codecogs.com/png.latex?(x_0,x_1)">. This can be undesirable in some applications. Furthermore, small changes in the distributions <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1"> can lead to large changes in the optimal transport plan. This sensitivity can be problematic in practice, especially when the distributions are estimated from data.</p>
<section id="static-shrödinger-bridge-problem" class="level3">
<h3 class="anchored" data-anchor-id="static-shrödinger-bridge-problem">Static Shrödinger Bridge Problem</h3>
<p>A standard way to address these issues is to add an entropic regularization term to the objective function. The resulting problem is known as the Schrödinger bridge problem and can be formulated as follows. Consider a reference joint distribution <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)"> over <img src="https://latex.codecogs.com/png.latex?%5B%5B1,n%5D%5D%20%5Ctimes%20%5B%5B1,n%5D%5D"> and find the coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma(x_0,x_1)"> that minimizes the Kullback-Leibler divergence to <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> while matching the marginals <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1">:</p>
<p><span id="eq-kl-contrained"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20%5Cgamma(x_0,x_1)%20%5Clog%20%5Cfrac%7B%5Cgamma(x_0,x_1)%7D%7B%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%7D.%0A%5Ctag%7B1%7D"></span></p>
<p><strong>Remark (invariance under separable rescaling).</strong> Only the “interaction structure” of <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> matters: if one replaces <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> by <img src="https://latex.codecogs.com/png.latex?%5Ctilde%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5Cpropto%20a(x_0)%5C,%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5C,b(x_1)"> with positive <img src="https://latex.codecogs.com/png.latex?a,b">, then the optimal coupling can still be written in the same form below, with the factors <img src="https://latex.codecogs.com/png.latex?a,b"> absorbed into the potentials. Equivalently, the solution depends on <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D"> only through its kernel up to left/right diagonal scaling.</p>
<p>A common choice for the reference measure is a distribution of the form <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%20%5Cpropto%20%5Cexp(-d(x_0,x_1)/%5Cvarepsilon)"> (optionally times separable factors). This choice encourages the coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> to put more mass on pairs <img src="https://latex.codecogs.com/png.latex?(x_0,x_1)"> that are close according to the distance <img src="https://latex.codecogs.com/png.latex?d">, and the resulting optimization problem can be rewritten (up to an additive constant) as:</p>
<p><span id="eq-entropic-ot"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20d(x_0,x_1)%20%5C,%20%5Cgamma(x_0,x_1)%20%20%5Ctextcolor%7Bblue%7D%7B%5C;%20-%20%5C;%20%5Cvarepsilon%5C,%20%5Cmathrm%7BH%7D(%5Cgamma)%7D%0A%5Ctag%7B2%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BH%7D(%5Cgamma)%20=%20-%20%5Csum_%7Bx_0,x_1%7D%20%5Cgamma(x_0,x_1)%20%5Clog%20%5Cgamma(x_0,x_1)"> is the <a href="https://en.wikipedia.org/wiki/Entropy_(information_theory)">entropy</a> of the coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma">. Note that since the marginals of <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> are fixed, it is also equivalent (up to constants) to replacing the entropy term by the <a href="https://en.wikipedia.org/wiki/Kullback–Leibler_divergence">Kullback-Leibler</a> divergence to the independent coupling <img src="https://latex.codecogs.com/png.latex?%5Cnu_0(x_0)%20%5Cotimes%20%5Cnu_1(x_1)">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cgamma%20%5Cin%20%5CPi(%5Cnu_0,%20%5Cnu_1)%7D%20%5C;%20%5Csum_%7Bx_0,x_1%7D%20d(x_0,x_1)%20%5C,%20%5Cgamma(x_0,x_1)%20%20%5Ctextcolor%7Bblue%7D%7B%5C;%20+%20%5C;%20%5Cvarepsilon%5C,%20D_%7B%5Ctext%7BKL%7D%7D(%5Cgamma%20%5Cmid%20%5Cnu_0%20%5Cotimes%20%5Cnu_1)%7D.%0A"></p>
<p>Writing the <a href="https://en.wikipedia.org/wiki/Duality_(optimization)">Lagrange dual</a> formulation of the problem Equation&nbsp;2 provides fast algorithms to solve it such as the <a href="https://en.wikipedia.org/wiki/Iterative_proportional_fitting">iterative proportional fitting</a> procedure (IPFP), also known as the Sinkhorn-Knopp algorithm in the optimal transport literature <span class="citation" data-cites="cuturi2013sinkhorn">(<strong>cuturi2013sinkhorn?</strong>)</span>. Importantly, it also almost immediately shows that the optimal coupling has a very simple form,</p>
<p><span id="eq-schrodinger-solution"><img src="https://latex.codecogs.com/png.latex?%0A%5Cgamma(x_0,x_1)%20=%20f(x_0)%20%5C,%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%20%5C,%20g(x_1).%0A%5Ctag%7B3%7D"></span></p>
<p>These potentials must satisfy the marginal constraints, equivalently the <strong>Schrödinger/Sinkhorn scaling equations</strong>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%5Cnu_0(x_0)%20&amp;=%20%5Csum_%7Bx_1%7D%20f(x_0)%5C,%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5C,%20g(x_1),%5C%5C%0A%5Cnu_1(x_1)%20&amp;=%20%5Csum_%7Bx_0%7D%20f(x_0)%5C,%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%5C,%20g(x_1).%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<details>
<summary>
Some details:
</summary>
<p style="color: blue;">
The Lagrangian of the constrained convex optimization Equation&nbsp;1 reads: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A%5Csum_%7Bx_0,x_1%7D%20%5Cgamma(x_0,x_1)%20%5Clog%20%5Cfrac%7B%5Cgamma(x_0,x_1)%7D%7B%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%7D%0A&amp;+%20%5Csum_%7Bx_0%7D%20%5Calpha(x_0)%20%5Cleft(%20%5Cnu_0(x_0)%20-%20%5Csum_%7Bx_1%7D%20%5Cgamma(x_0,x_1)%20%5Cright)%5C%5C%0A&amp;+%20%5Csum_%7Bx_1%7D%20%5Cbeta(x_1)%20%5Cleft(%20%5Cnu_1(x_1)%20-%20%5Csum_%7Bx_0%7D%20%5Cgamma(x_0,x_1)%20%5Cright).%0A%5Cend%7Balign*%7D%0A"> There is no need to impose a constraint on the total mass of <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> since it is automatically satisfied by the marginal constraints. For a fixed set of dual variables <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">, minimizing the Lagrangian with respect to <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> leads to the optimum <img src="https://latex.codecogs.com/png.latex?%5Cgamma_%7B%5Calpha,%20%5Cbeta%7D(x_0,x_1)%20=%20%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)%20%5C,%20e%5E%7B%5Calpha(x_0)%20+%20%5Cbeta(x_1)%20-1%7D">, hence proving Equation&nbsp;3 with <img src="https://latex.codecogs.com/png.latex?f=e%5E%7B%5Calpha-1%7D"> and <img src="https://latex.codecogs.com/png.latex?g=e%5E%5Cbeta"> (up to scaling). Plugging this expression back into the Lagrangian gives: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Calpha,%20%5Cbeta)%20=%20%5Csum_%7Bx_0%7D%20%5Calpha(x_0)%20%5C,%20%5Cnu_0(x_0)%20+%20%5Csum_%7Bx_1%7D%20%5Cbeta(x_1)%20%5C,%20%5Cnu_1(x_1)%20-%20%5Csum_%7Bx_0,x_1%7D%20%5Cgamma_%7B%5Calpha,%20%5Cbeta%7D(x_0,x_1).%0A"> Alternating maximization in <img src="https://latex.codecogs.com/png.latex?(%5Calpha,%5Cbeta)"> corresponds to alternately enforcing the two marginal constraints, i.e.&nbsp;IPFP / Sinkhorn scaling. Directly maximizing the Lagrange dual <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D(%5Calpha,%20%5Cbeta)"> using gradient ascent methods such as <a href="https://en.wikipedia.org/wiki/Limited-memory_BFGS">L-BFGS</a> is also possible and can lead to faster convergence in some cases. Note that the dual problem only has <img src="https://latex.codecogs.com/png.latex?2n"> variables, while the primal problem has <img src="https://latex.codecogs.com/png.latex?n%5E2"> variables!
</p>
</details>
</section>
<section id="dynamic-schrödinger-bridge-problem" class="level3">
<h3 class="anchored" data-anchor-id="dynamic-schrödinger-bridge-problem">Dynamic Schrödinger Bridge Problem</h3>
<p>Now, suppose that the reference distribution <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7B%5Cmathrm%7Bref%7D%7D(x_0,x_1)"> is given as the two-time marginal of a Markov process <img src="https://latex.codecogs.com/png.latex?(X_t)_%7Bt%20%5Cin%20%5B0,1%5D%7D"> with transition kernels <img src="https://latex.codecogs.com/png.latex?p%5E%7B%5Ctext%7Bref%7D%7D_%7Bs,t%7D(x_s,x_t)"> and path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D"> on trajectories <img src="https://latex.codecogs.com/png.latex?x_%7B%5B0,1%5D%7D">.</p>
<p>The dynamic Schrödinger bridge problem consists in finding a new path measure <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D"> on trajectories <img src="https://latex.codecogs.com/png.latex?x_%7B%5B0,1%5D%7D"> such that the starting and ending marginals are <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> and <img src="https://latex.codecogs.com/png.latex?%5Cnu_1">, while minimizing the Kullback-Leibler divergence to the reference path distribution <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathop%7B%5Cmathrm%7Bargmin%7D%7D_%7B%5Cmathbb%7BQ%7D:%5C%20%5Cmathbb%7BQ%7D_0=%5Cnu_0,%5C%20%5Cmathbb%7BQ%7D_1=%5Cnu_1%7D%5C;%20%5Cmathrm%7BKL%7D(%5Cmathbb%7BQ%7D%5Cmid%20%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D).%0A"></p>
<p>When the reference is Markov, the chain rule for KL (disintegration with respect to <img src="https://latex.codecogs.com/png.latex?(X_0,X_1)">) shows this is equivalent to the static Schrödinger bridge problem for the two-time marginal of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D">: one first solves for the optimal endpoint coupling <img src="https://latex.codecogs.com/png.latex?%5Cgamma%5E%5Cstar(x_0,x_1)">, and then fills in intermediate times using the <strong>reference bridges</strong> <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D(%5Ccdot%5Cmid%20X_0=x_0,X_1=x_1)">:</p>
<ol type="1">
<li>Sample the endpoints <img src="https://latex.codecogs.com/png.latex?(X_0,%20X_1)%20%5Csim%20%5Cgamma%5E%5Cstar(x_0,x_1)">.<br>
</li>
<li>Sample the intermediate points according to the conditional law of the reference process given the endpoints, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?(X_t)_%7Bt%20%5Cin%20(0,1)%7D%20%5Csim%20%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D(%5Ccdot%20%5Cmid%20X_0,%20X_1)">.</li>
</ol>
<p><strong>Continuous-Time Stochastic Processes:</strong></p>
<p>A typical setting is when the reference process <img src="https://latex.codecogs.com/png.latex?(X_t)"> is given as the solution of a stochastic differential equation of the form</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20=%20b_t(X_t)%20%5C,%20dt%20+%20%5Csigma%20%5C,%20dW_t,%0A"></p>
<p>started from some initial distribution (one may take it to be <img src="https://latex.codecogs.com/png.latex?%5Cnu_0"> without loss of generality, since any mismatch can be absorbed into the endpoint tilt below). The solution to the dynamic Schrödinger bridge problem is given by the twisted path distribution:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%5Cmathbb%7BQ%7D%5E%5Cstar%7D%7Bd%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D%7D(x_%7B%5B0,1%5D%7D)%0A%5Cpropto%20f(X_0)%5C,g(X_1),%0A"></p>
<p>for endpoint potentials <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> satisfying the marginal constraints at <img src="https://latex.codecogs.com/png.latex?t=0"> and <img src="https://latex.codecogs.com/png.latex?t=1">.</p>
<p>The marginal density at intermediate time <img src="https://latex.codecogs.com/png.latex?t%5Cin%5B0,1%5D"> factorizes as:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Aq_t(x)%20=%20p_t%5E%7B%5Ctext%7Bref%7D%7D(x)%5C,%5Cwidehat%7B%5Cvarphi%7D_t(x)%5C,%5Cvarphi_t(x),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?p_t%5E%7B%5Ctext%7Bref%7D%7D"> is the time-<img src="https://latex.codecogs.com/png.latex?t"> marginal density of the reference process, and where the time-dependent Schrödinger potentials are defined by:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%5Cvarphi_t(x)%20&amp;=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D%7D%5Bg(X_1)%5Cmid%20X_t=x%5D,%5C%5C%0A%5Cwidehat%7B%5Cvarphi%7D_t(x)%20&amp;=%20%5Cmathbb%7BE%7D_%7B%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D%7D%5Bf(X_0)%5Cmid%20X_t=x%5D,%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>(with <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_1%20%5Cequiv%20g"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7B%5Cvarphi%7D_0%20%5Cequiv%20f">, up to normalization). Naturally, the dynamics of the Schrödinger bridge process can be described as a new stochastic differential equation obtained by applying a <a href="../../notes/doob_transforms/doob.html">Doob h-transform</a> to the reference SDE,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20=%20b_t(X_t)%5C,dt%20+%20%20%5Ctextcolor%7Bblue%7D%7B%5Csigma%20%5Csigma%5E%5Ctop%20%5Cnabla_x%20%5Clog%20%5Cvarphi_t(%20X_t)%5C,dt%7D%20+%20%5Csigma%5C,dW_t,%0A"></p>
<p>where, as explained in these previous <a href="../../notes/doob_transforms/doob.html">notes</a>, the function <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_t(x)"> is the harmonic extension of the terminal potential <img src="https://latex.codecogs.com/png.latex?g"> defined above.</p>
<p><strong>Discrete-Time Markov Chains:</strong></p>
<p>It is often useful to state the Schrödinger bridge dynamics in a discrete setting. Let the reference process be a Markov chain <img src="https://latex.codecogs.com/png.latex?X_0,%20%5Cldots,%20X_T"> with one-step kernels <img src="https://latex.codecogs.com/png.latex?M_k(x,dy)">, i.e. <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BP%7D%5E%7B%5Ctext%7Bref%7D%7D(X_%7Bk+1%7D%5Cin%20dy%5Cmid%20X_k=x)=M_k(x,dy).%0A"> Let <img src="https://latex.codecogs.com/png.latex?g"> be the terminal potential at time <img src="https://latex.codecogs.com/png.latex?T"> and define the backward (harmonic) potentials defined by <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_T%20%5Cequiv%20g"> and recursively as: <img src="https://latex.codecogs.com/png.latex?%0A%5Cvarphi_k(x)%20=%20%5Cint%20M_k(x,dy)%5C,%5Cvarphi_%7Bk+1%7D(y).%0A"></p>
<p>Then the Schrödinger bridge <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D%5E%5Cstar"> is Markov and its <strong>forward transition kernels</strong> are given by the discrete Doob <img src="https://latex.codecogs.com/png.latex?h">-transform: <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BQ%7D%5E%5Cstar(X_%7Bk+1%7D%5Cin%20dy%5Cmid%20X_k=x)%0A=%5Cfrac%7BM_k(x,dy)%5C,%5Cvarphi_%7Bk+1%7D(y)%7D%7B%5Cvarphi_k(x)%7D.%0A"> This is the discrete-time counterpart of the continuous-time drift correction <img src="https://latex.codecogs.com/png.latex?b_t%20%5Cmapsto%20b_t%20+%20%5Csigma%5Csigma%5E%5Ctop%5Cnabla%5Clog%5Cvarphi_t(%5Ccdot)">.</p>
<p>In general, Schrödinger bridge problems are difficult problems since the endpoint potentials <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> need to be found such that the marginal constraints are satisfied. These recent years have seen the development of many numerical methods to solve this problem approximately, especially in the machine learning community, eg: <span class="citation" data-cites="shi2023diffusion">(<strong>shi2023diffusion?</strong>)</span>; <span class="citation" data-cites="de2021diffusion">(<strong>de2021diffusion?</strong>)</span>; <span class="citation" data-cites="vargas2021solving">(<strong>vargas2021solving?</strong>)</span>; <span class="citation" data-cites="chen2021likelihood">(<strong>chen2021likelihood?</strong>)</span>.</p>


</section>

 ]]></description>
  <category>SDE</category>
  <category>markov</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/shrodinger.html</guid>
  <pubDate>Sat, 18 Oct 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Infinite Products</title>
  <link>https://alexxthiery.github.io/notes/infinite_products/inft_prod.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/infinite_products/hadamard.jpg" class="img-fluid figure-img" style="width:60.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Jacques_Hadamard">Jacques Hadamard</a> (1865 – 1963)</figcaption>
</figure>
</div>
</div>
<p>Any polynomial <img src="https://latex.codecogs.com/png.latex?P(z)"> can be expressed as the product of its zeros, <img src="https://latex.codecogs.com/png.latex?P(z)%20=%20c%20%5Cprod_%7Bk=1%7D%5En%20(z%20-%20z_k)">. Now, consider an entire function <img src="https://latex.codecogs.com/png.latex?f(z)"> with an infinite number of zeros <img src="https://latex.codecogs.com/png.latex?z_k">. Necessarily, the zeros must accumulate only at infinity, and one could be tempted to compare <img src="https://latex.codecogs.com/png.latex?f"> to <img src="https://latex.codecogs.com/png.latex?c%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(z%20-%20z_k)">. Indeed, this does not work since there is no hope for the product to converge. Instead, it seems more reasonable to consider <img src="https://latex.codecogs.com/png.latex?c%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1%20-%20z/z_k)"> since for a given <img src="https://latex.codecogs.com/png.latex?z">, this product has a better chance to converge for <img src="https://latex.codecogs.com/png.latex?(1%20-%20z/z_k)%20%5Cto%201"> for <img src="https://latex.codecogs.com/png.latex?k%20%5Cto%20%5Cinfty">. For simplicity, one can assume that the <img src="https://latex.codecogs.com/png.latex?z_k"> are non-zero, since otherwise, one can just add a factor <img src="https://latex.codecogs.com/png.latex?z%5Em"> to the product, where <img src="https://latex.codecogs.com/png.latex?m"> is the multiplicity of the zero at <img src="https://latex.codecogs.com/png.latex?0">.</p>
<p>There are indeed a few issues. First, one needs the condition <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bk%20%5Cgeq%201%7D%201/%7Cz_k%7C"> to ensure convergence. Second, even if this condition is satisfied, any function of the type <img src="https://latex.codecogs.com/png.latex?e%5E%7Bg(z)%7D%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1%20-%20z/z_k)">, where <img src="https://latex.codecogs.com/png.latex?g"> is an entire function, would also share the same zeros. The first issue is quite easily taken care of. Instead of considering terms of the type <img src="https://latex.codecogs.com/png.latex?(1%20-%20z/z_k)">, one needs to consider terms that converge much faster to <img src="https://latex.codecogs.com/png.latex?1"> as <img src="https://latex.codecogs.com/png.latex?z_k%20%5Cto%20%5Cinfty">, and only vanish at <img src="https://latex.codecogs.com/png.latex?z_k">. A natural choice is <img src="https://latex.codecogs.com/png.latex?E_p(z/z_k)"> with</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AE_p(z)%20=%20(1%20-%20z)%20%5C,%20%5Cexp%5Cleft(z%20+%20%5Cfrac%7Bz%5E2%7D%7B2%7D%20+%20%5Ccdots%20+%20%5Cfrac%7Bz%5Ep%7D%7Bp%7D%5Cright)%20%5Capprox_0%201%20-%20%5Cfrac%7Bz%5E%7Bp+1%7D%7D%7Bp+1%7D.%0A"></p>
<p>It is then easy to see, for example, that the product <img src="https://latex.codecogs.com/png.latex?%5Cprod_k%20E_k(z/z_k)"> is well defined for <img src="https://latex.codecogs.com/png.latex?z%20%5Cin%20%5Cmathbb%7BC%7D"> and precisely vanishes at the <img src="https://latex.codecogs.com/png.latex?z_k">. If one knew that the zeros satisfied <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bk%20%5Cgeq%201%7D%201/%7Cz_k%7C%5E%7Bp+1%7D%20%3C%20%5Cinfty">, then one could use instead <img src="https://latex.codecogs.com/png.latex?%5Cprod_k%20E_p(z/z_k)">. However, this approach is of often of limited use since, as mentioned above, one can always multiply by an entire function <img src="https://latex.codecogs.com/png.latex?e%5E%7Bg(z)%7D"> to obtain another entire function with the same zeros.</p>
<p>To make progress, one can impose some growth condition on the entire function <img src="https://latex.codecogs.com/png.latex?f(z)">. For example, an entire function <img src="https://latex.codecogs.com/png.latex?f(z)"> is said to be of order <img src="https://latex.codecogs.com/png.latex?%5Crho"> if</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%7Cf(z)%7C%20%5Cleq%20C_%7B%5Cvarepsilon%7D%20%5C,%20%5Cexp%5Cleft(%7Cz%7C%5E%7B%5Crho%20+%20%5Cvarepsilon%7D%5Cright)%20%5Cqquad%20%5Ctext%7Bfor%20all%20%7D%20%5Cvarepsilon%3E%200.%0A"></p>
<p>For example, one can readily see that the sine function is of order <img src="https://latex.codecogs.com/png.latex?1">, and any polynomial is of order <img src="https://latex.codecogs.com/png.latex?0">. If one knows that the entire function <img src="https://latex.codecogs.com/png.latex?f(z)"> is of order <img src="https://latex.codecogs.com/png.latex?%5Crho"> and has zeros <img src="https://latex.codecogs.com/png.latex?z_k"> (counted with multiplicity), then <a href="https://en.wikipedia.org/wiki/Hadamard_factorization_theorem">Hadamard’s factorization theorem</a> states that, in fact, the function <img src="https://latex.codecogs.com/png.latex?f"> can be expressed as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Af(z)%20=%20e%5E%7BP(z)%7D%5C,%20z%5Em%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20E_%7Bd%7D%20%5Cleft(%5Cfrac%7Bz%7D%7Bz_k%7D%5Cright)%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?m"> is the multiplicity of the zero at <img src="https://latex.codecogs.com/png.latex?0">, <img src="https://latex.codecogs.com/png.latex?d%20=%20%5Clfloor%20%5Crho%20%5Crfloor">, and <img src="https://latex.codecogs.com/png.latex?P(z)"> is a polynomial of degree at most <img src="https://latex.codecogs.com/png.latex?d">.</p>
<section id="some-natural-examples" class="level3">
<h3 class="anchored" data-anchor-id="some-natural-examples">Some natural examples</h3>
<p>One can then asks oneself what are some natural entire functions that vanish at some predetermined set of zeros. For example, what functions vanish on all the integers? Such a function cannot be of order less than one since otherwise it could be writtem as <img src="https://latex.codecogs.com/png.latex?z%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1-z/k)(1+z/k)">, but this product does not converge. Any entire function of order <img src="https://latex.codecogs.com/png.latex?1"> that has a simple zero at each integer is of the form</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign%7D%0Af(z)%0A&amp;=%20e%5E%7Baz%20+%20b%7D%20%5C,%20z%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D(1-z/k)(1+z/k)%20e%5E%7Bz/z_k%7D%20%5C,%20e%5E%7B-z/z_k%7D%5C%5C%0A&amp;=%20e%5E%7Baz%20+%20b%7D%20%5C,%20z%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1-z%5E2/k%5E2).%0A%5Cend%7Balign%7D%0A"></p>
<p>Checking the Taylor expansion of sine at zero, one finds that the celebrated formula:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Csin(%5Cpi%20z)%20=%20%5Cpi%20%5C,%20z%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20%5Cleft(1%20-%20%5Cfrac%7Bz%5E2%7D%7Bk%5E2%7D%5Cright)%0A"></p>
<p>and a similar interesting example by taking the derivatives of <img src="https://latex.codecogs.com/png.latex?log%20%5Csin(%5Cpi%20z)">. Now, what about a function that vanishes on all the negative integers? Again, such a function needs to be of order at least one. Hadamard’s factorization theorem then tells us that such a function is, up to a multiplicative constant, of the form</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ag(z)%20=%20e%5E%7Baz%7D%20%5C,%20z%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1%20+%20z/k)%20e%5E%7B-z/k%7D.%0A"></p>
<p>Naturally, since such a function vanishes on all the negative integers, one of the first things one would like to try is to look at <img src="https://latex.codecogs.com/png.latex?g(z+1)"> and relate it to <img src="https://latex.codecogs.com/png.latex?g"> itself. Since <img src="https://latex.codecogs.com/png.latex?g(z+1)"> vanishes on <img src="https://latex.codecogs.com/png.latex?%5C%7B-1,%20-2,%20%5Cldots%5C%7D">, one knows that it can be expressed as <img src="https://latex.codecogs.com/png.latex?e%5E%7Ba'z%20+%20b'%7D%20%5C,%20z%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1%20+%20z/k)%20e%5E%7B-z/k%7D"> so that <img src="https://latex.codecogs.com/png.latex?z%20%5C,%20g(z+1)"> is almost the same as <img src="https://latex.codecogs.com/png.latex?g(z)">. One can then do some algebra to choose the constant <img src="https://latex.codecogs.com/png.latex?a"> so that <img src="https://latex.codecogs.com/png.latex?z%20%5C,%20g(z+1)%20=%20g(z)">. One finds that the correct choice is the <a href="https://en.wikipedia.org/wiki/Euler's_constant">Euler-Mascheroni constant</a>,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Aa%20=%20%5Cgamma%20=%20%5Clim_%7Bn%20%5Cto%20%5Cinfty%7D%20%5Cleft(%20%5Csum_%7Bk=1%7D%5En%20%5Cfrac%7B1%7D%7Bk%7D%20-%20%5Clog%20n%20%5Cright).%0A"></p>
<p>This gives the final expression for <img src="https://latex.codecogs.com/png.latex?g(z)"> as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ag(z)%20=%20e%5E%7B%5Cgamma%20z%7D%20%5C,%20z%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1%20+%20z/k)%20e%5E%7B-z/k%7D.%0A"></p>
<p>Furthermore, since <img src="https://latex.codecogs.com/png.latex?g(z)/z%20%5Cto%201"> as <img src="https://latex.codecogs.com/png.latex?s%20%5Cto%200">, it follows that <img src="https://latex.codecogs.com/png.latex?g(1)=1">, from which the identity <img src="https://latex.codecogs.com/png.latex?z%20%5C,%20g(z+1)%20=%20g(z)"> gives that <img src="https://latex.codecogs.com/png.latex?1/g(n+1)%20=%20n!">. In other words, <img src="https://latex.codecogs.com/png.latex?g(z)"> is an analytic continuation on the whole complex plane of the inverse of the <a href="https://en.wikipedia.org/wiki/Gamma_function">Gamma function</a>,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CGamma(z)%20=%20e%5E%7B-%5Cgamma%20z%7D%20%5C,%20z%5E%7B-1%7D%20%5C,%20%5Cprod_%7Bk%20%5Cgeq%201%7D%20(1%20+%20z/k)%5E%7B-1%7D%20e%5E%7Bz/k%7D.%0A"></p>
<p>This generalizes the usual definition <img src="https://latex.codecogs.com/png.latex?%5CGamma(z)%20=%20%5Cint_0%5E%5Cinfty%20t%5E%7Bz-1%7D%20e%5E%7B-t%7D%20%5C,%20dt"> valid for <img src="https://latex.codecogs.com/png.latex?%5CRe(z)%20%3E%200"> to the whole complex plane.</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/infinite_products/Gamma_abs_3D.png" class="img-fluid figure-img" style="width:60.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Gamma_function">Gamma function</a></figcaption>
</figure>
</div>
</div>
<p>The connection to the sine function is also almost immediate. Indeed, the function <img src="https://latex.codecogs.com/png.latex?g(z)%20g(-z)"> vanishes on all the integers and the infinite product immediately shows that <img src="https://latex.codecogs.com/png.latex?g(z)g(-z)%20=%20-z%20%5C,%20%5Csin(%5Cpi%20z)%20/%20%5Cpi">. But since <img src="https://latex.codecogs.com/png.latex?g(-z)/(-z)%20=%20g(1-z)">, one obtains that <img src="https://latex.codecogs.com/png.latex?g(z)%20g(1-z)%20=%20%5Csin(%5Cpi%20z)%20/%20%5Cpi">, i.e.</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CGamma(z)%20%5C,%20%5CGamma(1-z)%20=%20%5Cfrac%7B%5Cpi%7D%7B%5Csin(%5Cpi%20z)%7D.%0A"> This is the celebrated <a href="https://en.wikipedia.org/wiki/Reflection_formula">Euler reflection formula</a>, from which it also follows that <img src="https://latex.codecogs.com/png.latex?%5CGamma(1/2)%20=%20%5Csqrt%7B%5Cpi%7D">.</p>
</section>
<section id="zeta-function" class="level3">
<h3 class="anchored" data-anchor-id="zeta-function">Zeta function</h3>
<p>Let’s conclude these notes by deriving the analytic continuation of the Riemann <a href="https://en.wikipedia.org/wiki/Riemann_zeta_function">zeta function</a> <img src="https://latex.codecogs.com/png.latex?%5Czeta(s)%20=%20%5Csum_%7Bn=1%7D%5E%5Cinfty%20n%5E%7B-s%7D">, originnaly defined for <img src="https://latex.codecogs.com/png.latex?%5CRe(s)%20%3E%201">, to the whole complex plane. I have always found this proof very elegant. A common trick that is used in many places is to do a change of variable in the definition of the Gamma function to obtains that</p>
<p><img src="https://latex.codecogs.com/png.latex?n%5E%7B-s%7D%20=%20%5CGamma(s)%5E%7B-1%7D%20%5C,%20%5Cint_0%5E%5Cinfty%20e%5E%7B-nt%7D%20t%5E%7Bs-1%7D%20%5C,%20dt."></p>
<p>It is valid for <img src="https://latex.codecogs.com/png.latex?%5CRe(s)%20%3E%200">. This allows one to obtain express the zeta function as:</p>
<p><span id="eq-boring"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign%7D%0A%5Czeta(s)%0A&amp;=%20%5CGamma(s)%5E%7B-1%7D%20%5Cint_0%5E%5Cinfty%20%20%7B%5Cleft%5C%7B%20%20%5Csum_%7Bn=1%7D%5E%5Cinfty%20e%5E%7B-t%20x%7D%20%20%5Cright%5C%7D%7D%20%20%5C,%20t%5E%7Bs-1%7D%20%5C,%20dt%5C%5C%0A&amp;=%20%5CGamma(s)%5E%7B-1%7D%20%5Cint_0%5E%5Cinfty%20%5Cfrac%7B1%7D%7Be%5E%7Bt%7D%20-%201%7D%20%5C,%20t%5E%7Bs-1%7D%20%5C,%20dt.%0A%5Cend%7Balign%7D%0A%5Ctag%7B1%7D"></span></p>
<p>From the previous discussion, one knows that <img src="https://latex.codecogs.com/png.latex?%5CGamma(s)%5E%7B-1%7D"> is an entire function of order <img src="https://latex.codecogs.com/png.latex?1">, and the integral converges for <img src="https://latex.codecogs.com/png.latex?%5CRe(s)%20%3E%200"> except for <img src="https://latex.codecogs.com/png.latex?s%20=%201">; in other words, this already gives a meromorphic continuation of <img src="https://latex.codecogs.com/png.latex?%5Czeta(s)"> to the domain <img src="https://latex.codecogs.com/png.latex?%5CRe(s)%20%3E%200"> with a simple pole at <img src="https://latex.codecogs.com/png.latex?s%20=%201">. Since things get nasty near <img src="https://latex.codecogs.com/png.latex?t=0">, the standard approach consist in splitting the integral into two parts. The part <img src="https://latex.codecogs.com/png.latex?%5Cint_1%5E%5Cinfty%20%5Cfrac%7B1%7D%7Be%5Et%20-%201%7D%20%5C,%20t%5E%7Bs-1%7D%20%5C,%20dt"> defines an entire function and one only needs to take care of the integral <img src="https://latex.codecogs.com/png.latex?%5Cint_0%5E1%20%5Cfrac%7B1%7D%7Be%5Et%20-%201%7D%20%5C,%20t%5E%7Bs-1%7D%20%5C,%20dt">. This can be done by expressing <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7Be%5Et%20-%201%7D%20=%20%5Csum_%7Bm=0%7D%5E%7B%5Cinfty%7D%20B_m%20%5C,%20t%5Em%20/%20m!">, where <img src="https://latex.codecogs.com/png.latex?B_m"> are the <a href="https://en.wikipedia.org/wiki/Bernoulli_number">Bernoulli numbers</a> and integrating each term, but the way <a href="https://en.wikipedia.org/wiki/Bernhard_Riemann">Bernhard Riemann</a> did it is way more fun. The idea is to note use the boring <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bn=1%7D%5E%5Cinfty%20e%5E%7B-n%20t%7D"> but instead introduce the way more interesting function</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Ctheta(t)%20=%20%5Csum_%7Bn%20%5Cin%20%5Cmathbb%7BZ%7D%7D%20e%5E%7B-%5Cpi%20n%5E2%20t%7D%20=%201%20+%202%20%5C,%20J(t)%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?J(t)%20=%20%5Csum_%7Bn=1%7D%5E%5Cinfty%20e%5E%7B-%5Cpi%20n%5E2%20t%7D">, defined for <img src="https://latex.codecogs.com/png.latex?t%3E0">. Note that the function <img src="https://latex.codecogs.com/png.latex?J(t)"> decreases exponentially rapidly to <img src="https://latex.codecogs.com/png.latex?0"> as <img src="https://latex.codecogs.com/png.latex?t%20%5Cto%20%5Cinfty">. In other words, instead of Equation&nbsp;1 one can just as easily write</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B1%7D%7B%5Cpi%5E%7Bs/2%7D%20%5C,%20n%5Es%7D%20=%20%5Cfrac%7B1%7D%7B%5CGamma(s/2)%7D%20%5Cint_0%5E%5Cinfty%20e%5E%7B-%5Cpi%20n%5E2%20t%7D%20%5C,%20t%5E%7B%7Bs/2%7D-1%7D%20%5C,%20dt.%0A"></p>
<p>This slight change of parametrization allows to write the zeta function as</p>
<p><span id="eq-less-boring"><img src="https://latex.codecogs.com/png.latex?%0A%5Czeta(s)%20=%20%5Cfrac%7B%5Cpi%5E%7Bs/2%7D%7D%7B%5CGamma(s/2)%7D%20%5Cint_0%5E%5Cinfty%20J(t)%20%5C,%20t%5E%7B%7Bs/2%7D-1%7D%20%5C,%20dt.%0A%5Ctag%7B2%7D"></span></p>
<p>One has not gained much doing this since there is indeed still an issue at <img src="https://latex.codecogs.com/png.latex?t=0"> where <img src="https://latex.codecogs.com/png.latex?J(t)"> diverges. However, the Jacobi theta function <img src="https://latex.codecogs.com/png.latex?%5Ctheta(t)"> enjoys some interesting symmetries. Crucially, the <a href="https://en.wikipedia.org/wiki/Poisson_summation_formula">Poisson summation</a> formula applied to the Gaussian function <img src="https://latex.codecogs.com/png.latex?x%20%5Cmapsto%20e%5E%7B-%5Cpi%20x%5E2%20t%7D"> gives that <img src="https://latex.codecogs.com/png.latex?%5Ctheta(t)"> satisfies modular&nbsp;inversion&nbsp;symmetry:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Ctheta(t)%20=%20%5Cfrac%7B1%7D%7B%5Csqrt%7Bt%7D%7D%20%5C,%20%5Ctheta(1/t).%0A"></p>
<p>This means that splitting <img src="https://latex.codecogs.com/png.latex?%5Cint_0%5E%7B%5Cinfty%7D%20=%20%5Cint_0%5E1%20+%20%5Cint_1%5E%7B%5Cinfty%7D"> in Equation&nbsp;2, using the change of variable <img src="https://latex.codecogs.com/png.latex?t%20%5Cmapsto%201/t"> to map <img src="https://latex.codecogs.com/png.latex?%5Cint_0%5E1"> to <img src="https://latex.codecogs.com/png.latex?%5Cint_1%5E%7B%5Cinfty%7D"> and finally use the modular inversion symmetry of the theta function leads after standard algebra:</p>
<p><span id="eq-zeta-expansion"><img src="https://latex.codecogs.com/png.latex?%0A%5Czeta(s)%20=%20%5Cfrac%7B%5Cpi%5E%7Bs/2%7D%7D%7B%5CGamma(s/2)%7D%20%20%7B%5Cleft%5C%7B%0A%5Cunderbrace%7B%5Cint_%7B1%7D%5E%7B%5Cinfty%7D%20J(t)%20%5C,%20%20%7B%5Cleft(%20t%5E%7B(1-s)/2%7D%20+%20t%5E%7Bs/2%7D%20%5Cright)%7D%20%20%5C,%20%5Cfrac%7Bdt%7D%7Bt%7D%20-%20%5Cfrac%7B1%7D%7B1-s%7D%20-%20%5Cfrac%7B1%7D%7Bs%7D%20%7D_%7B%5CLambda(s)%7D%0A%5Cright%5C%7D%7D%20.%0A%5Ctag%7B3%7D"></span></p>
<p>First, one can note that since <img src="https://latex.codecogs.com/png.latex?J(t)"> decreases exponentially quickly to <img src="https://latex.codecogs.com/png.latex?0"> as <img src="https://latex.codecogs.com/png.latex?t%20%5Cto%20%5Cinfty">, the integral above defines and entire function. This means that the expression above defines a meromorphic continuation of <img src="https://latex.codecogs.com/png.latex?%5Czeta(s)"> to the whole complex plane with a simple pole at <img src="https://latex.codecogs.com/png.latex?s%20=%201">. There is no pole at <img src="https://latex.codecogs.com/png.latex?s=0"> since the simple zero of <img src="https://latex.codecogs.com/png.latex?%5CGamma(s/2)%5E%7B-1%7D"> takes care of it and gives the value <img src="https://latex.codecogs.com/png.latex?%5Czeta(0)%20=%20-1/2">. This also shows that the <img src="https://latex.codecogs.com/png.latex?%5Czeta"> function inherits from <img src="https://latex.codecogs.com/png.latex?%5CGamma(s/2)%5E%7B-1%7D"> a simple zero at all the negative even integers, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5Czeta(-2n)%20=%200"> for <img src="https://latex.codecogs.com/png.latex?n%20%5Cgeq%201">. And there are indeed a few other zeros, as the plot below shows… and they seem to be located on the critical line <img src="https://latex.codecogs.com/png.latex?%5CRe(s)%20=%201/2">…</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/infinite_products/zeta_plot.jpg" class="img-fluid figure-img" style="width:60.0%"></p>
<figcaption>Zeta function, where are the zeros?</figcaption>
</figure>
</div>
</div>
<p>What is remarkable is that the term inside the curly brackets of Equation&nbsp;3 is symmetric in <img src="https://latex.codecogs.com/png.latex?s"> and <img src="https://latex.codecogs.com/png.latex?1-s">, i.e.&nbsp;symmetric with respect to the vertical line <img src="https://latex.codecogs.com/png.latex?%5CRe(s)%20=%201/2"> in the complex plane. This means that the function <img src="https://latex.codecogs.com/png.latex?%5CLambda(s)%20=%20%5Czeta(s)%20%5C,%20%5CGamma(s/2)%20%5C,%20%5Cpi%5E%7B-s/2%7D"> satisfies the functional equation</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CLambda(s)%20=%20%5CLambda(1-s).%0A"></p>


</section>

 ]]></description>
  <category>complex_analysis</category>
  <guid>https://alexxthiery.github.io/notes/infinite_products/inft_prod.html</guid>
  <pubDate>Sat, 14 Jun 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Fisher-Rao Geometry</title>
  <link>https://alexxthiery.github.io/notes/fisher-rao/distance.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/fisher-rao/rao.jpg" class="img-fluid figure-img" style="width:60.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/C._R._Rao">Calyampudi Radhakrishna Rao</a> (1920 – 2023)</figcaption>
</figure>
</div>
</div>
<section id="fisher-rao-metric" class="level3">
<h3 class="anchored" data-anchor-id="fisher-rao-metric">Fisher-Rao metric</h3>
<p>Suppose we want to define a distance on the space of probability densities on <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5Ed">. A natural but naive approach is to use an <img src="https://latex.codecogs.com/png.latex?L%5E2">-type distance:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ad(%5Crho_1,%20%5Crho_2)%5E2%20=%20%5Cint_%7B%5Cmathbb%7BR%7D%5Ed%7D%20%7C%5Crho_1(x)%20-%20%5Crho_2(x)%7C%5E2%20%5C,%20dx,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Crho_i"> are densities with respect to the Lebesgue measure. However, this definition has several shortcomings. For instance, if we change the base measure to <img src="https://latex.codecogs.com/png.latex?%5Cmu(x)%20%5C,%20dx"> for some positive density <img src="https://latex.codecogs.com/png.latex?%5Cmu">, and define the distance as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cint%20%5Cleft%7C%5Cfrac%7B%5Crho_1(x)%7D%7B%5Cmu(x)%7D%20-%20%5Cfrac%7B%5Crho_2(x)%7D%7B%5Cmu(x)%7D%5Cright%7C%5E2%20%5Cmu(x)%20%5C,%20dx,%0A"></p>
<p>we obtain a different value. Perhaps more troubling, the distance is not invariant under reparametrizations. Let <img src="https://latex.codecogs.com/png.latex?T"> be a diffeomorphism of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5Ed">, and set <img src="https://latex.codecogs.com/png.latex?y%20=%20T(x)">. Then the transformed densities become <img src="https://latex.codecogs.com/png.latex?%5Crho%5EY_i(y)%20=%20%5Crho%5EX_i(x)%20%5C,%20%7CJ_T(x)%7C%5E%7B-1%7D">, where <img src="https://latex.codecogs.com/png.latex?J_T"> is the Jacobian determinant. In general,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cint%20%7C%5Crho%5EY_1(y)%20-%20%5Crho%5EY_2(y)%7C%5E2%20%5C,%20dy%20%5Cneq%20%5Cint%20%7C%5Crho%5EX_1(x)%20-%20%5Crho%5EX_2(x)%7C%5E2%20%5C,%20dx,%0A"></p>
<p>so the distance depends on the choice of coordinates. That is, measuring in Cartesian or polar coordinates yields different results—an undesirable feature. Ideally, we seek a distance that is invariant under reparametrizations and changes of base measure, such as the <a href="https://en.wikipedia.org/wiki/Total_variation_distance_of_probability_measures">total variation distance</a>,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ad_%7BTV%7D(%5Crho_1,%20%5Crho_2)%20=%20%5Cint_%7B%5Cmathbb%7BR%7D%5Ed%7D%20%7C%5Crho_1(x)%20-%20%5Crho_2(x)%7C%20%5C,%20dx.%0A"></p>
<p>One potential drawback of the total variation distance is that it is not differentiable, which can make it difficult to use in optimization problems. An alternative is to consider <a href="https://en.wikipedia.org/wiki/F-divergence"><img src="https://latex.codecogs.com/png.latex?f">-divergences</a>, defined as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ad_f(%5Crho_1,%20%5Crho_2)%20=%20%5Cint_%7B%5Cmathbb%7BR%7D%5Ed%7D%20f%20%5Cleft(%20%5Cfrac%7Bd%5Crho_1%7D%7Bd%5Crho_2%7D%20%5Cright)%20%5Crho_2(dx),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?f"> is a convex function with <img src="https://latex.codecogs.com/png.latex?f(1)%20=%200">. These divergences are differentiable and invariant under reparametrizations and changes of base measure, although they are not symmetric and thus not true distances. Locally, however, all <img src="https://latex.codecogs.com/png.latex?f">-divergences are equivalent, as a second-order Taylor expansion shows:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ad_f(%5Crho%20+%20d%20%5Crho,%20%5C,%20%5Crho)%20=%20%20%5Ctextrm%7B(cst)%7D%20%5Ctimes%20%5Cint%20%5Cleft(%20%5Cfrac%7Bd%20%5Crho%7D%7B%5Crho%7D%20%5Cright)%5E2%20%5C,%20%5Crho(dx)%20+%20o(%5C%7Cd%20%5Crho%5C%7C%5E2).%0A"></p>
<p>This means that all these divergences describe the same local geometry, defined by the Fisher-Rao information metric. Furthermore, it is relatively straightforward to derive the global geometry induced by the <a href="https://en.wikipedia.org/wiki/Fisher_information_metric">Fisher information metric</a>. Consider the mapping <img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cmapsto%20%5Csqrt%7B%5Crho%7D">, which maps a density <img src="https://latex.codecogs.com/png.latex?%5Crho"> to an element of the unit sphere <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BS%7D"> of <img src="https://latex.codecogs.com/png.latex?L%5E2(%5Cmathbb%7BR%7D%5Ed)">. Since</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5C%7C%20%5Csqrt%7B%5Crho_1%7D%20-%20%5Csqrt%7B%5Crho_2%7D%20%5C%7C_%7BL%5E2%7D%5E2%20=%20d_f(%5Crho_1,%20%5Crho_2)%0A"></p>
<p>for <img src="https://latex.codecogs.com/png.latex?f(x)%20=%20%7C1%20-%20%5Csqrt%7Bx%7D%7C%5E2">, and we have just seen that any <img src="https://latex.codecogs.com/png.latex?f">-divergence is locally equivalent to the Fisher-Rao metric, it follows that the geometry induced by the Fisher-Rao information information metric is the same as the geometry induced by the <img src="https://latex.codecogs.com/png.latex?L%5E2">-norm on the unit sphere of <img src="https://latex.codecogs.com/png.latex?L%5E2(%5Cmathbb%7BR%7D%5Ed)">. This implies that the geodesic distance between two densities <img src="https://latex.codecogs.com/png.latex?%5Crho_1"> and <img src="https://latex.codecogs.com/png.latex?%5Crho_2"> is given (up to an irrelevant constant) by the <img src="https://latex.codecogs.com/png.latex?L%5E2">-geodesic distance between the points <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B%5Crho_1%7D%20%5Cin%20%5Cmathcal%7BS%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B%5Crho_2%7D%20%5Cin%20%5Cmathcal%7BS%7D">. In other words, the geodesic distance, i.e.&nbsp;the Fisher-Rao distance, is given by</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ad_%7BFR%7D(%5Crho_1,%20%5Crho_2)%20=%20%5Carccos%20%5Cleft(%20%5Clangle%20%5Csqrt%7B%5Crho_1%7D,%20%5Csqrt%7B%5Crho_2%7D%20%5Crangle_%7BL%5E2%7D%20%5Cright).%0A"></p>
<p>The geodesic path is a great circle, <img src="https://latex.codecogs.com/png.latex?t%20%5Cmapsto%20%5Crho_t">, where <img src="https://latex.codecogs.com/png.latex?%5Crho_t%20%5Cpropto%20%5Cleft((1-t)%20%5Csqrt%7B%5Crho_1%7D%20+%20t%20%5Csqrt%7B%5Crho_2%7D%20%5Cright)%5E2"> for <img src="https://latex.codecogs.com/png.latex?t%20%5Cin%20%5B0,1%5D">. This shows, for example, that the Fisher-Rao geodesic between two Gaussian densities is composed of densities that are Gaussian mixtures; i.e., the geodesic is not composed of Gaussian densities in general. In other words, probability mass is not transported along the geodesic but reshaped, unlike the Wasserstein metric, which describes transport of probability mass. Note in passing that the <a href="https://en.wikipedia.org/wiki/Hellinger_distance">Hellinger distance</a>, defined as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ad_H(%5Crho_1,%20%5Crho_2)%5E2%20=%20%5Cint%20%5Cleft(%20%5Csqrt%7B%5Crho_1(x)%7D%20-%20%5Csqrt%7B%5Crho_2(x)%7D%20%5Cright)%5E2%20%5C,%20dx,%0A"></p>
<p>is just just a slightly rescaled version of the Fisher-Rao distance since they are related by a deterministic function, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?d_H%20=%20%5Csqrt%7B2(1-%5Ccos(d_%7BFR%7D))%7D">. In this sense, the Hellinger distance is equivalent to the Fisher-Rao distance, and both describe a “correct” way to measure distances between probability densities for many applications.</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/fisher-rao/FR_geodesic.gif" class="img-fluid figure-img" style="width:80.0%"></p>
<figcaption>Here is how a geodesic paths looks like under the Fisher-Rao metric</figcaption>
</figure>
</div>
</div>
</section>
<section id="gradient-flow" class="level3">
<h3 class="anchored" data-anchor-id="gradient-flow">Gradient flow</h3>
<p>What do gradient flows look like in this Fisher-Rao geometry? For example, for a given distribution <img src="https://latex.codecogs.com/png.latex?%5Cpi">, the gradient flow of <img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cmapsto%20%5Cmathrm%7BKL%7D(%5Crho,%20%5Cpi)"> under the Wasserstein metric is given by the <a href="https://en.wikipedia.org/wiki/Continuity_equation">transport equation</a>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cpartial_t%20%5Crho%20=%20-%5Cnabla%20%5Ccdot%20%5Cleft(%20%5Crho%20%5C,%20%5Cnabla%20%5Clog%20%5Cfrac%7B%5Cpi%7D%7B%5Crho%7D%20%5Cright),%0A"></p>
<p>which describes the Langevin dynamics of the process <img src="https://latex.codecogs.com/png.latex?dX%20=%20%5Cnabla%20%5Clog%20%5Cpi(X)%20%5C,%20dt%20+%20%5Csqrt%7B2%7D%20%5C,%20dB">, as informally described in these <a href="../../notes/wasserstein_langevin/wasserstein_langevin.html">notes</a>. So what does the gradient flow of <img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cmapsto%20%5Cmathrm%7BKL%7D(%5Crho,%20%5Cpi)"> look like in the Fisher-Rao geometry?</p>
<p>To answer this, one can consider the square-root mapping <img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cmapsto%20%5Csqrt%7B%5Crho%7D%20%5Cequiv%20%5CPhi(%5Crho)%20%5Cin%20%5Cmathcal%7BS%7D">, express everything in terms of <img src="https://latex.codecogs.com/png.latex?%5CPhi(%5Crho)">, compute the <img src="https://latex.codecogs.com/png.latex?L%5E2">-gradient on the unit sphere <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BS%7D"> (which is straightforward), and finally map back to the density <img src="https://latex.codecogs.com/png.latex?%5Crho"> using the inverse mapping <img src="https://latex.codecogs.com/png.latex?%5CPhi%5E%7B-1%7D">. One readily finds that the gradient flow is described by:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cpartial_t%20%5Crho%20=%20%5Clog%20%5Cfrac%7B%5Cpi%7D%7B%5Crho%7D%20-%20%5Cmathbb%7BE%7D_%5Crho%20%5Cleft%5B%20%5Clog%20%5Cfrac%7B%5Cpi%7D%7B%5Crho%7D%20%5Cright%5D.%0A"></p>
<p>This is quite intuitive: the flow tries to increase <img src="https://latex.codecogs.com/png.latex?%5Crho"> in regions where <img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cll%20%5Cpi"> and decrease <img src="https://latex.codecogs.com/png.latex?%5Crho"> in regions where <img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cgg%20%5Cpi">. Discretizing this flow can naturally be done using sampling-based methods. If <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bi=1%7D%5EN%20w_i%20%5C,%20%5Cdelta(x_i)"> is a system of <img src="https://latex.codecogs.com/png.latex?N"> weighted particles approximating <img src="https://latex.codecogs.com/png.latex?%5Crho">, following the Fisher-Rao gradient flow corresponds to updating the weights as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Aw_i%20%5Cmapsto%20%5Cfrac%7B%20w_i%20%5C,%20(%5Cpi(x_i)%20/%20%5Crho(x_i))%5E%7B%5Cvarepsilon%7D%7D%7B%5Csum_%7Bj=1%7D%5EN%20w_j%20%5C,%20(%5Cpi(x_j)%20/%20%5Crho(x_j))%5E%7B%5Cvarepsilon%7D%7D%0A"></p>
<p>for a small <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%3E%200"> time-step. Indeed, it is because <img src="https://latex.codecogs.com/png.latex?%5Cpartial_t%20%5Crho(x)%20=%20v(x)">, where <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D_%7B%5Crho%7D%5Bv%5D=0">, can be discretized by updating the weights as <img src="https://latex.codecogs.com/png.latex?w_i%20%5Cmapsto%20w_i%20%5C,%20%5Cexp%5B%5Cvarepsilon%5C,%20v(x_i)%5D%20/%20Z">. This is very much related to the resampling step in sequential Monte Carlo methods, and the recent article <span class="citation" data-cites="crucinio2025sequential">(Crucinio and Pathiraja 2025)</span> make these connections explicit.</p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/fisher-rao/FR_gradient_flow.gif" class="img-fluid figure-img" style="width:80.0%"></p>
<figcaption>Minimising <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D(%5Crho,%20%5Cpi)"> with Fisher-Rao gradient flow</figcaption>
</figure>
</div>
</div>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-crucinio2025sequential" class="csl-entry">
Crucinio, Francesca R, and Sahani Pathiraja. 2025. <span>“Sequential Monte Carlo Approximations of Wasserstein–Fisher–Rao Gradient Flows.”</span> <em>arXiv Preprint arXiv:2506.05905</em>.
</div>
</div></section></div> ]]></description>
  <category>probability</category>
  <category>information-geometry</category>
  <guid>https://alexxthiery.github.io/notes/fisher-rao/distance.html</guid>
  <pubDate>Thu, 12 Jun 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Adjoint method for sensitivities</title>
  <link>https://alexxthiery.github.io/notes/adjoint_method/adjoint.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/adjoint_method/pontryagin.jpg" class="img-fluid figure-img" style="width:60.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Lev_Pontryagin">Lev Pontryagin</a> (1908 - 1988)</figcaption>
</figure>
</div>
</div>
<section id="table-of-contents" class="level2">
<h2 class="anchored" data-anchor-id="table-of-contents">Table of Contents</h2>
<ul>
<li>Linear Systems</li>
<li>Adjoint Method</li>
<li>PDE Inverse Problems</li>
<li>Controlled Diffusions</li>
</ul>
<p>The adjoint method is, at its core, the same idea as <a href="https://en.wikipedia.org/wiki/Backpropagation">backpropagation</a> or <a href="https://en.wikipedia.org/wiki/Automatic_differentiation">reverse-mode</a> automatic differentiation. In practice, though, it’s often helpful to understand how it works under the hood. Basic implementations of backprop can be sub-optimal or impractical (eg. memory intensive), especially in settings like <a href="https://en.wikipedia.org/wiki/PDE-constrained_optimization">PDE-constrained optimization</a> or stochastic optimal control.</p>
<section id="linear-systems" class="level3">
<h3 class="anchored" data-anchor-id="linear-systems">Linear Systems</h3>
<p>For a parameter <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D">, consider <img src="https://latex.codecogs.com/png.latex?x%20=%20x(%5Ctheta)"> the solution of the linear system</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AA%20x%20=%20b,%0A"></p>
<p>where both the matrix <img src="https://latex.codecogs.com/png.latex?A%20=%20A(%5Ctheta)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%20%5Ctimes%20d_x%7D"> and the vector <img src="https://latex.codecogs.com/png.latex?b%20=%20b(%5Ctheta)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> depend on <img src="https://latex.codecogs.com/png.latex?%5Ctheta">. This setup is typical when discretizing PDEs: <img src="https://latex.codecogs.com/png.latex?A"> arises from the differential operator, and <img src="https://latex.codecogs.com/png.latex?b"> from the source term. We are interested in a loss function of the type</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20F(%5Ctheta,%20x(%5Ctheta)),%0A"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?F:%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D%20%5Ctimes%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D%20%5Cto%20%5Cmathbb%7BR%7D">. We aim to compute the derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta">. The chain rule gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20F_x%20A%5E%7B-1%7D%20%5Cleft(%20A_%5Ctheta%20%5C,%20x%20-%20b_%5Ctheta%20%5Cright)%20%5C;%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B1,%20d_%5Ctheta%7D.%0A"></p>
<p>The notation <img src="https://latex.codecogs.com/png.latex?F_%5Ctheta%20=%20%5Cnabla_%5Ctheta%20F%5E%5Ctop%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B1,%20d_%5Ctheta%7D"> denotes the Jacobian of <img src="https://latex.codecogs.com/png.latex?F"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, and similarly notations are used for <img src="https://latex.codecogs.com/png.latex?F_x"> and <img src="https://latex.codecogs.com/png.latex?A_%5Ctheta"> and <img src="https://latex.codecogs.com/png.latex?b_%5Ctheta">. As usual, the jacobian can be thought of as the transpose of the gradient for scalar functions. When <img src="https://latex.codecogs.com/png.latex?d_x%20%5Cgg%201"> and <img src="https://latex.codecogs.com/png.latex?d_%5Ctheta%20%5Cgg%201">, directly computing <img src="https://latex.codecogs.com/png.latex?A%5E%7B-1%7D"> is not feasible. Naively evaluating <img src="https://latex.codecogs.com/png.latex?A%5E%7B-1%7D%20(A_%5Ctheta%20x%20-%20b_%5Ctheta)"> would require <img src="https://latex.codecogs.com/png.latex?d_%5Ctheta"> linear solves, each of one of complexity cubic in <img src="https://latex.codecogs.com/png.latex?d_x">. A better approach is to first compute <img src="https://latex.codecogs.com/png.latex?%5Clambda%5E%5Ctop%20=%20F_x%20A%5E%7B-1%7D"> by solving the so-called adjoint system</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AA%5E%5Ctop%20%5Clambda%20=%20F_x%5E%5Ctop.%0A"></p>
<p>This requires only one linear solve. Once <img src="https://latex.codecogs.com/png.latex?%5Clambda%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> is computed, the jacobian simplifies to</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20%5Clambda%5E%5Ctop%20(A_%5Ctheta%20x%20-%20b_%5Ctheta).%0A"></p>
</section>
<section id="adjoint-method" class="level3">
<h3 class="anchored" data-anchor-id="adjoint-method">Adjoint Method</h3>
<p>Now consider a more general situation where <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D"> are related by an implicit equation</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CPhi(x,%20%5Ctheta)%20=%200%0A"></p>
<p>for some function <img src="https://latex.codecogs.com/png.latex?%5CPhi:%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D%20%5Ctimes%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D%20%5Cto%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> that satisfies the usual conditions for the implicit function <a href="https://en.wikipedia.org/wiki/Implicit_function_theorem">theorem</a> to hold. Differentiating gives <img src="https://latex.codecogs.com/png.latex?x_%5Ctheta%20=%20-%5CPhi_x%5E%7B-1%7D%20%5CPhi_%5Ctheta">. As before, we want the sensitivity with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D(%5Ctheta)%20=%20F(x(%5Ctheta),%20%5Ctheta)">. It equals <img src="https://latex.codecogs.com/png.latex?D_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20F_x%20%5CPhi_x%5E%7B-1%7D%20%5CPhi_%5Ctheta"> and can also be expressed as <img src="https://latex.codecogs.com/png.latex?D_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20%5Clambda%5E%5Ctop%20%5CPhi_%5Ctheta"> where <img src="https://latex.codecogs.com/png.latex?%5Clambda%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> is the solution of the adjoint system</p>
<p><span id="eq-adjoint"><img src="https://latex.codecogs.com/png.latex?%0A%5CPhi_x%5E%5Ctop%20%5Clambda%20=%20F_x%5E%5Ctop.%0A%5Ctag%7B1%7D"></span></p>
<p>Another way to present this computation is to note that, for <strong>any</strong> vector <img src="https://latex.codecogs.com/png.latex?%5Clambda%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D">, we have</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20F(x(%5Ctheta),%20%5Ctheta)%20-%20%5Clambda%5E%5Ctop%20%5CPhi(x(%5Ctheta),%20%5Ctheta)%0A"></p>
<p>since <img src="https://latex.codecogs.com/png.latex?%5CPhi(x(%5Ctheta),%20%5Ctheta)%20%5Cequiv%200">. As will soon become clear, introducing the “adjoint” variable <img src="https://latex.codecogs.com/png.latex?%5Clambda"> allows one to eliminate cumbersome terms when computing <img src="https://latex.codecogs.com/png.latex?D_%5Ctheta%20%5Cmathcal%7BL%7D">. Differentiation with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20%5Clambda%5E%5Ctop%20%5CPhi_%5Ctheta%20+%20%20%7B%5Cleft(%20%20F_x%20-%20%5Clambda%5E%5Ctop%20%5CPhi_x%20%5Cright)%7D%20%20x_%5Ctheta.%0A"></p>
<p>The term <img src="https://latex.codecogs.com/png.latex?x_%5Ctheta%20=%20-%5CPhi_x%5E%7B-1%7D%20%5CPhi_%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x,%20d_%5Ctheta%7D"> is cumbersome (eg. intractable in high-dimensional settings), and we would like to eliminate it. To this end, it suffices to choose <img src="https://latex.codecogs.com/png.latex?%5Clambda"> so that the term <img src="https://latex.codecogs.com/png.latex?F_x%20-%20%5Clambda%5E%5Ctop%20%5CPhi_x"> vanishes; indeed, this is exactly the adjoint-system Equation&nbsp;1.</p>
</section>
<section id="pde-inverse-problems" class="level3">
<h3 class="anchored" data-anchor-id="pde-inverse-problems">PDE Inverse Problems</h3>
<p>Let us see how this works in the context of PDE-constrained optimization. Let <img src="https://latex.codecogs.com/png.latex?%5COmega%20%5Csubset%20%5Cmathbb%7BR%7D%5Ed"> be a domain and let <img src="https://latex.codecogs.com/png.latex?%5Ckappa:%20%5COmega%20%5Cto%20%5Cmathbb%7BR%7D"> be a scalar field. Consider the PDE</p>
<p><span id="eq-elliptic"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20%20%7B%5Cleft(%20%20e%5E%7B%5Ckappa(x)%7D%20%5Cnabla%20u%20%20%5Cright)%7D%20%20=%20f,%0A%5Ctag%7B2%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?f"> is a given source term. The field <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> describes the diffusion, or permeability, properties of the medium. We are interested in the solution <img src="https://latex.codecogs.com/png.latex?u"> of the PDE on a bounded domain <img src="https://latex.codecogs.com/png.latex?%5COmega%20%5Csubset%20%5Cmathbb%7BR%7D%5Ed"> with Dirichlet boundary conditions <img src="https://latex.codecogs.com/png.latex?u(x)%20=%200"> for <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cpartial%20%5COmega">. For each field <img src="https://latex.codecogs.com/png.latex?%5Ckappa">, the elliptic PDE determines a unique solution <img src="https://latex.codecogs.com/png.latex?u">. We are interested in minimizing the quantity</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ckappa)%20=%20%5Cint_%5COmega%20F(u(x))%20%5C,%20dx,%0A"></p>
<p>for some given function <img src="https://latex.codecogs.com/png.latex?F:%20%5Cmathbb%7BR%7D%20%5Cto%20%5Cmathbb%7BR%7D">. A common case is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ckappa)%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5C,%20%5Cint_%5COmega%20%5Cleft%7C%20u(x)%20-%20u%5E%5Cstar(x)%20%5Cright%7C%5E2%20%5C,%20w(x)%20%5C,%20dx,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> is a target solution and <img src="https://latex.codecogs.com/png.latex?w(x)%3E0"> is a weight. The goal is to adjust the field <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> so that <img src="https://latex.codecogs.com/png.latex?u"> matches <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> as closely as possible. To carry out the minimization of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ckappa">, one needs the derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ckappa">. To that end, define the augmented functional</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D%20=%20%5Cint_%5COmega%20F(u(x))%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5Cleft(%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20u)%20-%20f%20%5Cright)%20%5C,%20dx,%0A"></p>
<p>for an auxiliary field <img src="https://latex.codecogs.com/png.latex?%5Clambda%20:%20%5COmega%20%5Cto%20%5Cmathbb%7BR%7D"> that will be chosen later. As before, a good choice of <img src="https://latex.codecogs.com/png.latex?%5Clambda"> can simplify the computations. Let <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20%5Ckappa"> be a perturbation of <img src="https://latex.codecogs.com/png.latex?%5Ckappa">. This induces a perturbation <img src="https://latex.codecogs.com/png.latex?u%20+%20%5Cdelta%20u"> in the solution and the first order variation of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> reads:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cdelta%20%5Cmathcal%7BL%7D%20=%20%5Cint_%5COmega%20F'(u)%20%5C,%20%5Cdelta%20u%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20%5Cdelta%20u)%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cdelta%20%5Ckappa%20%5Cnabla%20u)%20%5C,%20dx.%0A"></p>
<p>The term involving <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20u"> is inconvenient. Assuming <img src="https://latex.codecogs.com/png.latex?%5Clambda"> also satisfies Dirichlet boundary conditions, which we can indeed assume seems we are free to define <img src="https://latex.codecogs.com/png.latex?%5Clambda"> in any manner we want, we integrate by parts:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cdelta%20%5Cmathcal%7BL%7D%20=%20%5Cint_%5COmega%20%5Cleft(%20F'(u)%20-%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20%5Clambda)%20%5Cright)%20%5Cdelta%20u%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cdelta%20%5Ckappa%20%5Cnabla%20u)%20%5C,%20dx.%0A"></p>
<p>To eliminate the <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20u"> term, choose <img src="https://latex.codecogs.com/png.latex?%5Clambda"> to satisfy the adjoint equation</p>
<p><span id="eq-adjoint-elliptic"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20%5Clambda)%20=%20F'(u),%0A%5Ctag%7B3%7D"></span></p>
<p>with Dirichlet boundary conditions. Then, an integration by parts gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A%5Cdelta%20%5Cmathcal%7BL%7D%0A&amp;=%20-%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cdelta%20%5Ckappa%20%5Cnabla%20u)%20%5C,%20dx%5C%5C%0A&amp;=%20%5Cint_%5COmega%20e%5E%7B%5Ckappa%7D%20%5C,%20%5Cleft%3C%20%20%5Cnabla%20u,%20%5Cnabla%20%5Clambda%20%20%5Cright%3E%20%5C,%20%5Cdelta%20%5Ckappa%20%5C,%20dx%0A=%20%5Cleft%3C%20g,%20%5Cdelta%20%5Ckappa%20%5Cright%3E_%7BL%5E2(%5COmega)%7D.%0A%5Cend%7Balign*%7D%0A"></p>
<p>This means that the <img src="https://latex.codecogs.com/png.latex?L%5E2"> gradient of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> is given by:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ag%20=%20e%5E%7B%5Ckappa%7D%20%5C,%20%5Cleft%3C%20%20%5Cnabla%20u,%20%5Cnabla%20%5Clambda%20%20%5Cright%3E,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Clambda:%20%5COmega%20%5Cto%20%5Cmathbb%7BR%7D"> solves the adjoint system Equation&nbsp;3. This shows that the gradient of the objective can be computed at the same computational cost as the solution the original PDE Equation&nbsp;2. This expression can be used directly in gradient-based optimization schemes.</p>
</section>
<section id="controlled-diffusions" class="level3">
<h3 class="anchored" data-anchor-id="controlled-diffusions">Controlled Diffusions</h3>
<p>Consider the <a href="https://en.wikipedia.org/wiki/Ordinary_differential_equation">ODE</a> on <img src="https://latex.codecogs.com/png.latex?%5B0,%20T%5D">:</p>
<p><span id="eq-ode-forward"><img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7Bx%7D%20=%20b(t,%20%5Ctheta,%20x),%0A%5Ctag%7B4%7D"></span></p>
<p>with initial condition <img src="https://latex.codecogs.com/png.latex?x(0)%20=%20%5Cmu(%5Ctheta)">, where <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D">. The drift term <img src="https://latex.codecogs.com/png.latex?b(t,%20%5Ctheta,%20x)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> is parameterized by <img src="https://latex.codecogs.com/png.latex?%5Ctheta">. We want the sensitivity of the functional</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20%5Cint_0%5ET%20f(t,%20%5Ctheta,%20x(t))%20%5C,%20dt%20+%20g(%5Ctheta,%20x(T)),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> are given functions. As before, it is often helpful to introduce an auxiliary function <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> and write:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20%5Cmathcal%7BL%7D(%5Ctheta)%20-%20%5Cint_0%5ET%20%5Clambda%5E%5Ctop%20%5C,%20%5Cunderbrace%7B%20%20%7B%5Cleft(%20%20%5Cdot%7Bx%7D%20-%20b%20%20%5Cright)%7D%20%20%7D_%7B%5Cequiv%200%7D%20%5C,%20dt.%0A"></p>
<p>Differentiating with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> and integrating by parts gives:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0AD_%5Ctheta%20%5Cmathcal%7BL%7D%0A&amp;=%20%5Cint_0%5ET%20%5Cleft(%20f_%5Ctheta%20+%20%5Clambda%5E%5Ctop%20b_%5Ctheta%20%5Cright)%20%5C,%20dt%20+%20g_%5Ctheta(%5Ctheta,%20x(T))%20+%20%5Clambda%5E%5Ctop(0)%20%5Cmu_%5Ctheta%20%5C%5C%0A&amp;%5Cquad%20+%20%5Cleft(%20g_x%20-%20%5Clambda%5E%5Ctop(T)%20%5Cright)%20%5C,%20x_%5Ctheta(T)%0A+%20%5Cint_0%5ET%20%5Cleft(%20f_x%20+%20%5Cdot%7B%5Clambda%7D%5E%5Ctop%20+%20%5Clambda%5E%5Ctop%20b_x%20%5Cright)%20x_%5Ctheta(t)%20%5C,%20dt.%0A%5Cend%7Baligned%7D%0A"></p>
<p>To eliminate the dependence on <img src="https://latex.codecogs.com/png.latex?x_%5Ctheta(t)">, choose <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)"> to satisfy the adjoint system:</p>
<p><span id="eq-adjoint-ode"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Bcases%7D%0A%5Cdot%7B%5Clambda%7D(t)%20=%20-%5Cnabla_x%20f%20-%20b_x%5E%5Ctop%20%5Clambda(t),%20%5C%5C%0A%5Clambda(T)%20=%20%5Cnabla_x%20g.%0A%5Cend%7Bcases%7D%0A%5Ctag%7B5%7D"></span></p>
<p>This is a linear ODE with a terminal condition <img src="https://latex.codecogs.com/png.latex?%5Clambda(T)%20=%20%5Cnabla_x%20g"> that needs to be solved backward in time. This means that for computing the derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D">, one can first solve the forward ODE Equation&nbsp;4 to obtain <img src="https://latex.codecogs.com/png.latex?x(t)">, and then solve the adjoint system Equation&nbsp;5 backward in time to obtain <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)">. The Jacobian (i.e.&nbsp;transpose of the gradient) of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> is then given by</p>
<p><span id="eq-gradient-ode"><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D%0A=%20%5Cint_0%5ET%20%5Cleft(%20f_%5Ctheta%20+%20%5Clambda%5E%5Ctop%20b_%5Ctheta%20%5Cright)%20dt%20+%20g_%5Ctheta(%5Ctheta,%20x(T))%20+%20%5Clambda%5E%5Ctop(0)%20%5Cmu_%5Ctheta.%0A%5Ctag%7B6%7D"></span></p>
<p>The term <img src="https://latex.codecogs.com/png.latex?%5Clambda%5E%5Ctop%20b_%5Ctheta"> is a vector jacobian product, and can be computed efficiently. This formulation is often referred to as the “continuous adjoint method” or “adjoint sensitivity analysis” or “optimize-then-discretize” and dates back to the work of <span class="citation" data-cites="pontryagin2018mathematical">(Pontryagin 1962)</span>. A naive implementation of <a href="https://en.wikipedia.org/wiki/Backpropagation">backpropagation</a> can be inefficient memory-wise since quantities such as <img src="https://latex.codecogs.com/png.latex?f_%5Ctheta"> would typically be stored along the forward pass. When <img src="https://latex.codecogs.com/png.latex?d_%5Ctheta%20%5Cgg%201">, as is for example the case when the drift is parameterized by a neural network, this can be impractical. Instead, it may be more efficient to store the forward trajectory <img src="https://latex.codecogs.com/png.latex?x(t)"> only, and recompute all the other quantities during the backward pass; there is a slight computational cost but potentially very large memory savings. In machine-learning settings, this often means the possibility to exploit much larger batch sizes. Similarly, if implicit methods are used to solve the ODE instead of a simple <a href="https://en.wikipedia.org/wiki/Euler–Maruyama_method">Euler-Maruyama</a> scheme, backpropagation through the implicit solver can be tricky.</p>
<p>Nothing really changes when considering a <a href="https://en.wikipedia.org/wiki/Stochastic_differential_equation">SDE</a> with additive noise instead,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Adx%20=%20b(t,%20%5Ctheta,%20x)%20%5C,%20dt%20+%20%5Csigma(t)%20%5C,%20dW_t.%0A"></p>
<p>Informally, one can apply the same reasoning as previously to the controlled ODE: <img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7Bx%7D%20%5C,%20=%20%5C,%20b(t,%20%5Ctheta,%20x)%20+%20%5Csigma(t)%20%5C,%20dW_t/dt.%0A"></p>
<p>Again, it suffices to solve the SDE forward in time to obtains <img src="https://latex.codecogs.com/png.latex?x(t)"> and then solve the same exact same adjoint ODE Equation&nbsp;5 backward in time to obtain <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)">: it is still an ordinary differential equation. The derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> is then given by the same expression Equation&nbsp;6. For SDEs with multiplicative noise, the adjoint system is slightly more complicated, but hardly changes the overall picture. Finally, note that in the case the two functions <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> do not depend on <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> and one chooses <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%20x_0"> and the initial condition <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7Bx_0%7D%20=%20x_0">, Equation&nbsp;6 shows that <img src="https://latex.codecogs.com/png.latex?D_%7Bx_0%7D%20%5Cmathcal%7BL%7D=%20%20%7B%5Cleft(%20%5Cnabla_%7Bx_0%7D%20%5Cmathcal%7BL%7D%20%5Cright)%7D%20%5E%5Ctop%20=%20%5Clambda(0)%5E%5Ctop">. More generally, this shows that:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Clambda(t)%20=%20%5Cnabla_%7Bx(t)%7D%20%5C,%20%20%7B%5Cleft%5C%7B%20%20%5Cint_t%5ET%20f(s,%20%5Ctheta,%20x(s))%20%5C,%20ds%20+%20g(%5Ctheta,%20x(T))%20%5Cright%5C%7D%7D%20.%0A"></p>



</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-pontryagin2018mathematical" class="csl-entry">
Pontryagin, Lev Semenovich. 1962. <em>Mathematical Theory of Optimal Processes</em>.
</div>
</div></section></div> ]]></description>
  <category>ODE</category>
  <category>PDE</category>
  <category>Adjoint</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_method/adjoint.html</guid>
  <pubDate>Fri, 09 May 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Adjoint method for sensitivities</title>
  <link>https://alexxthiery.github.io/notes/adjoint_samplers_draft/adjoint.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/adjoint_samplers_draft/pontryagin.jpg" class="img-fluid figure-img" style="width:60.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Lev_Pontryagin">Lev Pontryagin</a> (1908 - 1988)</figcaption>
</figure>
</div>
</div>
<section id="table-of-contents" class="level2">
<h2 class="anchored" data-anchor-id="table-of-contents">Table of Contents</h2>
<ul>
<li>Linear Systems</li>
<li>Adjoint Method</li>
<li>PDE Inverse Problems</li>
<li>Controlled Diffusions</li>
</ul>
<p>The adjoint method is, at its core, the same idea as <a href="https://en.wikipedia.org/wiki/Backpropagation">backpropagation</a> or <a href="https://en.wikipedia.org/wiki/Automatic_differentiation">reverse-mode</a> automatic differentiation. In practice, though, it’s often helpful to understand how it works under the hood. Basic implementations of backprop can be sub-optimal or impractical (eg. memory intensive), especially in settings like <a href="https://en.wikipedia.org/wiki/PDE-constrained_optimization">PDE-constrained optimization</a> or stochastic optimal control.</p>
<section id="linear-systems" class="level3">
<h3 class="anchored" data-anchor-id="linear-systems">Linear Systems</h3>
<p>For a parameter <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D">, consider <img src="https://latex.codecogs.com/png.latex?x%20=%20x(%5Ctheta)"> the solution of the linear system</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AA%20x%20=%20b,%0A"></p>
<p>where both the matrix <img src="https://latex.codecogs.com/png.latex?A%20=%20A(%5Ctheta)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%20%5Ctimes%20d_x%7D"> and the vector <img src="https://latex.codecogs.com/png.latex?b%20=%20b(%5Ctheta)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> depend on <img src="https://latex.codecogs.com/png.latex?%5Ctheta">. This setup is typical when discretizing PDEs: <img src="https://latex.codecogs.com/png.latex?A"> arises from the differential operator, and <img src="https://latex.codecogs.com/png.latex?b"> from the source term. We are interested in a loss function of the type</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20F(%5Ctheta,%20x(%5Ctheta)),%0A"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?F:%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D%20%5Ctimes%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D%20%5Cto%20%5Cmathbb%7BR%7D">. We aim to compute the derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta">. The chain rule gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20F_x%20A%5E%7B-1%7D%20%5Cleft(%20A_%5Ctheta%20%5C,%20x%20-%20b_%5Ctheta%20%5Cright)%20%5C;%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B1,%20d_%5Ctheta%7D.%0A"></p>
<p>The notation <img src="https://latex.codecogs.com/png.latex?F_%5Ctheta%20=%20%5Cnabla_%5Ctheta%20F%5E%5Ctop%20%5Cin%20%5Cmathbb%7BR%7D%5E%7B1,%20d_%5Ctheta%7D"> denotes the Jacobian of <img src="https://latex.codecogs.com/png.latex?F"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, and similarly notations are used for <img src="https://latex.codecogs.com/png.latex?F_x"> and <img src="https://latex.codecogs.com/png.latex?A_%5Ctheta"> and <img src="https://latex.codecogs.com/png.latex?b_%5Ctheta">. As usual, the jacobian can be thought of as the transpose of the gradient for scalar functions. When <img src="https://latex.codecogs.com/png.latex?d_x%20%5Cgg%201"> and <img src="https://latex.codecogs.com/png.latex?d_%5Ctheta%20%5Cgg%201">, directly computing <img src="https://latex.codecogs.com/png.latex?A%5E%7B-1%7D"> is not feasible. Naively evaluating <img src="https://latex.codecogs.com/png.latex?A%5E%7B-1%7D%20(A_%5Ctheta%20x%20-%20b_%5Ctheta)"> would require <img src="https://latex.codecogs.com/png.latex?d_%5Ctheta"> linear solves, each of one of complexity cubic in <img src="https://latex.codecogs.com/png.latex?d_x">. A better approach is to first compute <img src="https://latex.codecogs.com/png.latex?%5Clambda%5E%5Ctop%20=%20F_x%20A%5E%7B-1%7D"> by solving the so-called adjoint system</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AA%5E%5Ctop%20%5Clambda%20=%20F_x%5E%5Ctop.%0A"></p>
<p>This requires only one linear solve. Once <img src="https://latex.codecogs.com/png.latex?%5Clambda%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> is computed, the jacobian simplifies to</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20%5Clambda%5E%5Ctop%20(A_%5Ctheta%20x%20-%20b_%5Ctheta).%0A"></p>
</section>
<section id="adjoint-method" class="level3">
<h3 class="anchored" data-anchor-id="adjoint-method">Adjoint Method</h3>
<p>Now consider a more general situation where <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D"> are related by an implicit equation</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CPhi(x,%20%5Ctheta)%20=%200%0A"></p>
<p>for some function <img src="https://latex.codecogs.com/png.latex?%5CPhi:%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D%20%5Ctimes%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D%20%5Cto%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> that satisfies the usual conditions for the implicit function <a href="https://en.wikipedia.org/wiki/Implicit_function_theorem">theorem</a> to hold. Differentiating gives <img src="https://latex.codecogs.com/png.latex?x_%5Ctheta%20=%20-%5CPhi_x%5E%7B-1%7D%20%5CPhi_%5Ctheta">. As before, we want the sensitivity with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D(%5Ctheta)%20=%20F(x(%5Ctheta),%20%5Ctheta)">. It equals <img src="https://latex.codecogs.com/png.latex?D_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20F_x%20%5CPhi_x%5E%7B-1%7D%20%5CPhi_%5Ctheta"> and can also be expressed as <img src="https://latex.codecogs.com/png.latex?D_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20%5Clambda%5E%5Ctop%20%5CPhi_%5Ctheta"> where <img src="https://latex.codecogs.com/png.latex?%5Clambda%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> is the solution of the adjoint system</p>
<p><span id="eq-adjoint"><img src="https://latex.codecogs.com/png.latex?%0A%5CPhi_x%5E%5Ctop%20%5Clambda%20=%20F_x%5E%5Ctop.%0A%5Ctag%7B1%7D"></span></p>
<p>Another way to present this computation is to note that, for <strong>any</strong> vector <img src="https://latex.codecogs.com/png.latex?%5Clambda%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D">, we have</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20F(x(%5Ctheta),%20%5Ctheta)%20-%20%5Clambda%5E%5Ctop%20%5CPhi(x(%5Ctheta),%20%5Ctheta)%0A"></p>
<p>since <img src="https://latex.codecogs.com/png.latex?%5CPhi(x(%5Ctheta),%20%5Ctheta)%20%5Cequiv%200">. As will soon become clear, introducing the “adjoint” variable <img src="https://latex.codecogs.com/png.latex?%5Clambda"> allows one to eliminate cumbersome terms when computing <img src="https://latex.codecogs.com/png.latex?D_%5Ctheta%20%5Cmathcal%7BL%7D">. Differentiation with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D=%20F_%5Ctheta%20-%20%5Clambda%5E%5Ctop%20%5CPhi_%5Ctheta%20+%20%20%7B%5Cleft(%20%20F_x%20-%20%5Clambda%5E%5Ctop%20%5CPhi_x%20%5Cright)%7D%20%20x_%5Ctheta.%0A"></p>
<p>The term <img src="https://latex.codecogs.com/png.latex?x_%5Ctheta%20=%20-%5CPhi_x%5E%7B-1%7D%20%5CPhi_%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x,%20d_%5Ctheta%7D"> is cumbersome (eg. intractable in high-dimensional settings), and we would like to eliminate it. To this end, it suffices to choose <img src="https://latex.codecogs.com/png.latex?%5Clambda"> so that the term <img src="https://latex.codecogs.com/png.latex?F_x%20-%20%5Clambda%5E%5Ctop%20%5CPhi_x"> vanishes; indeed, this is exactly the adjoint-system Equation&nbsp;1.</p>
</section>
<section id="pde-inverse-problems" class="level3">
<h3 class="anchored" data-anchor-id="pde-inverse-problems">PDE Inverse Problems</h3>
<p>Let us see how this works in the context of PDE-constrained optimization. Let <img src="https://latex.codecogs.com/png.latex?%5COmega%20%5Csubset%20%5Cmathbb%7BR%7D%5Ed"> be a domain and let <img src="https://latex.codecogs.com/png.latex?%5Ckappa:%20%5COmega%20%5Cto%20%5Cmathbb%7BR%7D"> be a scalar field. Consider the PDE</p>
<p><span id="eq-elliptic"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20%20%7B%5Cleft(%20%20e%5E%7B%5Ckappa(x)%7D%20%5Cnabla%20u%20%20%5Cright)%7D%20%20=%20f,%0A%5Ctag%7B2%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?f"> is a given source term. The field <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> describes the diffusion, or permeability, properties of the medium. We are interested in the solution <img src="https://latex.codecogs.com/png.latex?u"> of the PDE on a bounded domain <img src="https://latex.codecogs.com/png.latex?%5COmega%20%5Csubset%20%5Cmathbb%7BR%7D%5Ed"> with Dirichlet boundary conditions <img src="https://latex.codecogs.com/png.latex?u(x)%20=%200"> for <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cpartial%20%5COmega">. For each field <img src="https://latex.codecogs.com/png.latex?%5Ckappa">, the elliptic PDE determines a unique solution <img src="https://latex.codecogs.com/png.latex?u">. We are interested in minimizing the quantity</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ckappa)%20=%20%5Cint_%5COmega%20F(u(x))%20%5C,%20dx,%0A"></p>
<p>for some given function <img src="https://latex.codecogs.com/png.latex?F:%20%5Cmathbb%7BR%7D%20%5Cto%20%5Cmathbb%7BR%7D">. A common case is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ckappa)%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5C,%20%5Cint_%5COmega%20%5Cleft%7C%20u(x)%20-%20u%5E%5Cstar(x)%20%5Cright%7C%5E2%20%5C,%20w(x)%20%5C,%20dx,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> is a target solution and <img src="https://latex.codecogs.com/png.latex?w(x)%3E0"> is a weight. The goal is to adjust the field <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> so that <img src="https://latex.codecogs.com/png.latex?u"> matches <img src="https://latex.codecogs.com/png.latex?u%5E%5Cstar"> as closely as possible. To carry out the minimization of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ckappa">, one needs the derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ckappa">. To that end, define the augmented functional</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D%20=%20%5Cint_%5COmega%20F(u(x))%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5Cleft(%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20u)%20-%20f%20%5Cright)%20%5C,%20dx,%0A"></p>
<p>for an auxiliary field <img src="https://latex.codecogs.com/png.latex?%5Clambda%20:%20%5COmega%20%5Cto%20%5Cmathbb%7BR%7D"> that will be chosen later. As before, a good choice of <img src="https://latex.codecogs.com/png.latex?%5Clambda"> can simplify the computations. Let <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20%5Ckappa"> be a perturbation of <img src="https://latex.codecogs.com/png.latex?%5Ckappa">. This induces a perturbation <img src="https://latex.codecogs.com/png.latex?u%20+%20%5Cdelta%20u"> in the solution and the first order variation of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> reads:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cdelta%20%5Cmathcal%7BL%7D%20=%20%5Cint_%5COmega%20F'(u)%20%5C,%20%5Cdelta%20u%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20%5Cdelta%20u)%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cdelta%20%5Ckappa%20%5Cnabla%20u)%20%5C,%20dx.%0A"></p>
<p>The term involving <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20u"> is inconvenient. Assuming <img src="https://latex.codecogs.com/png.latex?%5Clambda"> also satisfies Dirichlet boundary conditions, which we can indeed assume seems we are free to define <img src="https://latex.codecogs.com/png.latex?%5Clambda"> in any manner we want, we integrate by parts:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cdelta%20%5Cmathcal%7BL%7D%20=%20%5Cint_%5COmega%20%5Cleft(%20F'(u)%20-%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20%5Clambda)%20%5Cright)%20%5Cdelta%20u%20%5C,%20dx%20-%20%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cdelta%20%5Ckappa%20%5Cnabla%20u)%20%5C,%20dx.%0A"></p>
<p>To eliminate the <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20u"> term, choose <img src="https://latex.codecogs.com/png.latex?%5Clambda"> to satisfy the adjoint equation</p>
<p><span id="eq-adjoint-elliptic"><img src="https://latex.codecogs.com/png.latex?%0A%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cnabla%20%5Clambda)%20=%20F'(u),%0A%5Ctag%7B3%7D"></span></p>
<p>with Dirichlet boundary conditions. Then, an integration by parts gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A%5Cdelta%20%5Cmathcal%7BL%7D%0A&amp;=%20-%5Cint_%5COmega%20%5Clambda%20%5C,%20%5Cnabla%20%5Ccdot%20(e%5E%7B%5Ckappa%7D%20%5Cdelta%20%5Ckappa%20%5Cnabla%20u)%20%5C,%20dx%5C%5C%0A&amp;=%20%5Cint_%5COmega%20e%5E%7B%5Ckappa%7D%20%5C,%20%5Cleft%3C%20%20%5Cnabla%20u,%20%5Cnabla%20%5Clambda%20%20%5Cright%3E%20%5C,%20%5Cdelta%20%5Ckappa%20%5C,%20dx%0A=%20%5Cleft%3C%20g,%20%5Cdelta%20%5Ckappa%20%5Cright%3E_%7BL%5E2(%5COmega)%7D.%0A%5Cend%7Balign*%7D%0A"></p>
<p>This means that the <img src="https://latex.codecogs.com/png.latex?L%5E2"> gradient of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> is given by:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ag%20=%20e%5E%7B%5Ckappa%7D%20%5C,%20%5Cleft%3C%20%20%5Cnabla%20u,%20%5Cnabla%20%5Clambda%20%20%5Cright%3E,%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Clambda:%20%5COmega%20%5Cto%20%5Cmathbb%7BR%7D"> solves the adjoint system Equation&nbsp;3. This shows that the gradient of the objective can be computed at the same computational cost as the solution the original PDE Equation&nbsp;2. This expression can be used directly in gradient-based optimization schemes.</p>
</section>
<section id="controlled-diffusions" class="level3">
<h3 class="anchored" data-anchor-id="controlled-diffusions">Controlled Diffusions</h3>
<p>Consider the <a href="https://en.wikipedia.org/wiki/Ordinary_differential_equation">ODE</a> on <img src="https://latex.codecogs.com/png.latex?%5B0,%20T%5D">:</p>
<p><span id="eq-ode-forward"><img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7Bx%7D%20=%20b(t,%20%5Ctheta,%20x),%0A%5Ctag%7B4%7D"></span></p>
<p>with initial condition <img src="https://latex.codecogs.com/png.latex?x(0)%20=%20%5Cmu(%5Ctheta)">, where <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_%5Ctheta%7D">. The drift term <img src="https://latex.codecogs.com/png.latex?b(t,%20%5Ctheta,%20x)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> is parameterized by <img src="https://latex.codecogs.com/png.latex?%5Ctheta">. We want the sensitivity of the functional</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20%5Cint_0%5ET%20f(t,%20%5Ctheta,%20x(t))%20%5C,%20dt%20+%20g(%5Ctheta,%20x(T)),%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> are given functions. As before, it is often helpful to introduce an auxiliary function <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bd_x%7D"> and write:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BL%7D(%5Ctheta)%20=%20%5Cmathcal%7BL%7D(%5Ctheta)%20-%20%5Cint_0%5ET%20%5Clambda%5E%5Ctop%20%5C,%20%5Cunderbrace%7B%20%20%7B%5Cleft(%20%20%5Cdot%7Bx%7D%20-%20b%20%20%5Cright)%7D%20%20%7D_%7B%5Cequiv%200%7D%20%5C,%20dt.%0A"></p>
<p>Differentiating with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> and integrating by parts gives:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0AD_%5Ctheta%20%5Cmathcal%7BL%7D%0A&amp;=%20%5Cint_0%5ET%20%5Cleft(%20f_%5Ctheta%20+%20%5Clambda%5E%5Ctop%20b_%5Ctheta%20%5Cright)%20%5C,%20dt%20+%20g_%5Ctheta(%5Ctheta,%20x(T))%20+%20%5Clambda%5E%5Ctop(0)%20%5Cmu_%5Ctheta%20%5C%5C%0A&amp;%5Cquad%20+%20%5Cleft(%20g_x%20-%20%5Clambda%5E%5Ctop(T)%20%5Cright)%20%5C,%20x_%5Ctheta(T)%0A+%20%5Cint_0%5ET%20%5Cleft(%20f_x%20+%20%5Cdot%7B%5Clambda%7D%5E%5Ctop%20+%20%5Clambda%5E%5Ctop%20b_x%20%5Cright)%20x_%5Ctheta(t)%20%5C,%20dt.%0A%5Cend%7Baligned%7D%0A"></p>
<p>To eliminate the dependence on <img src="https://latex.codecogs.com/png.latex?x_%5Ctheta(t)">, choose <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)"> to satisfy the adjoint system:</p>
<p><span id="eq-adjoint-ode"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Bcases%7D%0A%5Cdot%7B%5Clambda%7D(t)%20=%20-%5Cnabla_x%20f%20-%20b_x%5E%5Ctop%20%5Clambda(t),%20%5C%5C%0A%5Clambda(T)%20=%20%5Cnabla_x%20g.%0A%5Cend%7Bcases%7D%0A%5Ctag%7B5%7D"></span></p>
<p>This is a linear ODE with a terminal condition <img src="https://latex.codecogs.com/png.latex?%5Clambda(T)%20=%20%5Cnabla_x%20g"> that needs to be solved backward in time. This means that for computing the derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D">, one can first solve the forward ODE Equation&nbsp;4 to obtain <img src="https://latex.codecogs.com/png.latex?x(t)">, and then solve the adjoint system Equation&nbsp;5 backward in time to obtain <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)">. The Jacobian (i.e.&nbsp;transpose of the gradient) of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> is then given by</p>
<p><span id="eq-gradient-ode"><img src="https://latex.codecogs.com/png.latex?%0AD_%5Ctheta%20%5Cmathcal%7BL%7D%0A=%20%5Cint_0%5ET%20%5Cleft(%20f_%5Ctheta%20+%20%5Clambda%5E%5Ctop%20b_%5Ctheta%20%5Cright)%20dt%20+%20g_%5Ctheta(%5Ctheta,%20x(T))%20+%20%5Clambda%5E%5Ctop(0)%20%5Cmu_%5Ctheta.%0A%5Ctag%7B6%7D"></span></p>
<p>The term <img src="https://latex.codecogs.com/png.latex?%5Clambda%5E%5Ctop%20b_%5Ctheta"> is a vector jacobian product, and can be computed efficiently. This formulation is often referred to as the “continuous adjoint method” or “adjoint sensitivity analysis” or “optimize-then-discretize” and dates back to the work of <span class="citation" data-cites="pontryagin2018mathematical">(<strong>pontryagin2018mathematical?</strong>)</span>. A naive implementation of <a href="https://en.wikipedia.org/wiki/Backpropagation">backpropagation</a> can be inefficient memory-wise since quantities such as <img src="https://latex.codecogs.com/png.latex?f_%5Ctheta"> would typically be stored along the forward pass. When <img src="https://latex.codecogs.com/png.latex?d_%5Ctheta%20%5Cgg%201">, as is for example the case when the drift is parameterized by a neural network, this can be impractical. Instead, it may be more efficient to store the forward trajectory <img src="https://latex.codecogs.com/png.latex?x(t)"> only, and recompute all the other quantities during the backward pass; there is a slight computational cost but potentially very large memory savings. In machine-learning settings, this often means the possibility to exploit much larger batch sizes. Similarly, if implicit methods are used to solve the ODE instead of a simple <a href="https://en.wikipedia.org/wiki/Euler–Maruyama_method">Euler-Maruyama</a> scheme, backpropagation through the implicit solver can be tricky.</p>
<p>Nothing really changes when considering a <a href="https://en.wikipedia.org/wiki/Stochastic_differential_equation">SDE</a> with additive noise instead,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Adx%20=%20b(t,%20%5Ctheta,%20x)%20%5C,%20dt%20+%20%5Csigma(t)%20%5C,%20dW_t.%0A"></p>
<p>Informally, one can apply the same reasoning as previously to the controlled ODE: <img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7Bx%7D%20%5C,%20=%20%5C,%20b(t,%20%5Ctheta,%20x)%20+%20%5Csigma(t)%20%5C,%20dW_t/dt.%0A"></p>
<p>Again, it suffices to solve the SDE forward in time to obtains <img src="https://latex.codecogs.com/png.latex?x(t)"> and then solve the same exact same adjoint ODE Equation&nbsp;5 backward in time to obtain <img src="https://latex.codecogs.com/png.latex?%5Clambda(t)">: it is still an ordinary differential equation. The derivative of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> with respect to <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> is then given by the same expression Equation&nbsp;6. For SDEs with multiplicative noise, the adjoint system is slightly more complicated, but hardly changes the overall picture. Finally, note that in the case the two functions <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> do not depend on <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> and one chooses <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%20x_0"> and the initial condition <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7Bx_0%7D%20=%20x_0">, Equation&nbsp;6 shows that <img src="https://latex.codecogs.com/png.latex?D_%7Bx_0%7D%20%5Cmathcal%7BL%7D=%20%20%7B%5Cleft(%20%5Cnabla_%7Bx_0%7D%20%5Cmathcal%7BL%7D%20%5Cright)%7D%20%5E%5Ctop%20=%20%5Clambda(0)%5E%5Ctop">. More generally, this shows that:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Clambda(t)%20=%20%5Cnabla_%7Bx(t)%7D%20%5C,%20%20%7B%5Cleft%5C%7B%20%20%5Cint_t%5ET%20f(s,%20%5Ctheta,%20x(s))%20%5C,%20ds%20+%20g(%5Ctheta,%20x(T))%20%5Cright%5C%7D%7D%20.%0A"></p>


</section>
</section>

 ]]></description>
  <category>ODE</category>
  <category>PDE</category>
  <category>Adjoint</category>
  <guid>https://alexxthiery.github.io/notes/adjoint_samplers_draft/adjoint.html</guid>
  <pubDate>Fri, 09 May 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Sparse GP</title>
  <link>https://alexxthiery.github.io/notes/sparse_GP/sparse_gp.html</link>
  <description><![CDATA[ 





<p><em>These notes are mainly for my own reference; I’m pretty clueless about GPs at the moment, and that needs to change. Read at your own risk; typos and mistakes are likely.</em></p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><video src="SparseGP.mp4" class="img-fluid quarto-figure quarto-figure-center" style="width:100.0%" controls=""><a href="SparseGP.mp4">Video</a></video></p>
</figure>
</div>
<p>Let <img src="https://latex.codecogs.com/png.latex?f(%5Ccdot)%20%5Csim%20%5Cmathrm%7BGP%7D(m,%20K)"> denote a Gaussian Process (GP) prior with zero mean <img src="https://latex.codecogs.com/png.latex?m=0"> and covariance kernel <img src="https://latex.codecogs.com/png.latex?K">. Assume we observe <img src="https://latex.codecogs.com/png.latex?n%20%5Cgg%201"> noisy measurements <img src="https://latex.codecogs.com/png.latex?y%20=%20(y_i)_%7Bi=1%7D%5En"> of <img src="https://latex.codecogs.com/png.latex?f_i%20=%20f(x_i)"> at input locations <img src="https://latex.codecogs.com/png.latex?x%20=%20(x_i)_%7Bi=1%7D%5En">. The goal is to compute the posterior of <img src="https://latex.codecogs.com/png.latex?f%20=%20(f_i)_%7Bi=1%7D%5En"> and to infer GP hyperparameters. The main challenge with GP models is the cubic complexity of the matrix inversion required to many of the posterior computations.</p>
<p>Sparse GPs are a class of approaches that aim to reduce this complexity by approximating the full GP posterior with a smaller set of so-called inducing variables <img src="https://latex.codecogs.com/png.latex?u=(u_1,%20%5Cldots,%20u_m)"> that entirely describe an approximate posterior distribution. Consider <img src="https://latex.codecogs.com/png.latex?m%20%5Cll%20n"> locations <img src="https://latex.codecogs.com/png.latex?z=(z_i)_%7Bi=1%7D%5Em"> called inducing points and set <img src="https://latex.codecogs.com/png.latex?u_i%20=%20f(z_i)"> for the latent function values at the inducing points. The Gaussian random variables <img src="https://latex.codecogs.com/png.latex?u_i"> can be used as inducing random variable; the choice of inducing points <img src="https://latex.codecogs.com/png.latex?z"> defines a different set of inducing variables <img src="https://latex.codecogs.com/png.latex?u">. In this setting, optimizing the inducing variables simply means optimizing the locations of the inducing points <img src="https://latex.codecogs.com/png.latex?z">. The strategy is to approximate the posterior of <img src="https://latex.codecogs.com/png.latex?(u,f)"> with a tractable distribution <img src="https://latex.codecogs.com/png.latex?q(u,f)">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ap(u,f%20%5Cmid%20y)%20%5C,%20=%20%5C,%20%5Cfrac%7Bp(u)%20%5C,%20p(f%20%5Cmid%20u)%20%5C,%20p(y%20%5Cmid%20f)%7D%7Bp(y)%7D%20%5C;%20%5Capprox%20%5C;%20q(u,f).%0A"></p>
<p>Later, we will see that setting <img src="https://latex.codecogs.com/png.latex?u_i%20=%20f(z_i)"> is indeed not the only choice of inducing variables, but let’s keep it to this for now. We have <img src="https://latex.codecogs.com/png.latex?p(u)%20=%20N(0,K_u)"> and <img src="https://latex.codecogs.com/png.latex?p(f%20%5Cmid%20u)%20=%20N(%5Cmu_%7Bf%7Cu%7D,%20K_%7Bf%7Cu%7D)"> where</p>
<p><span id="eq-conditionals"><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Balign*%7D%0A%5Cmu_%7Bf%7Cu%7D%20&amp;=%20K_%7Bfu%7D%20K_u%5E%7B-1%7D%20u%5C%5C%0AK_%7Bf%7Cu%7D%20&amp;=%20K_f%20-%20K_%7Bfu%7D%20K_u%5E%7B-1%7D%20K_%7Buf%7D.%0A%5Cend%7Balign*%7D%0A%5Cright.%0A%5Ctag%7B1%7D"></span></p>
<p>where <img src="https://latex.codecogs.com/png.latex?K_u"> is the covariance matrix of the inducing variables <img src="https://latex.codecogs.com/png.latex?u"> and <img src="https://latex.codecogs.com/png.latex?K_%7Bfu%7D"> is the covariance matrix between <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?u">. Evaluating <img src="https://latex.codecogs.com/png.latex?p(f%20%5Cmid%20u)"> involves inverting <img src="https://latex.codecogs.com/png.latex?K_%7Bf%7Cu%7D%20%5Cin%20%5Cmathbb%7BR%7D%5E%7Bn,n%7D">, which typically scales as <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BO%7D(n%5E3)">, hence intractable for large <img src="https://latex.codecogs.com/png.latex?n">. To approximate <img src="https://latex.codecogs.com/png.latex?p(u,f%20%5Cmid%20y)"> with another distribution <img src="https://latex.codecogs.com/png.latex?q(u,f)">, one can minimize the Kullback-Leibler divergence <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D%5Bq(u,f)%20%5C%7C%20p(u,f%20%5Cmid%20y)%5D">, i.e.</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cint%20q(u)%20%5C,%20q(f%7Cu)%20%5C,%20%5Clog%20%20%7B%5Cleft%5C%7B%20%20%5Cfrac%7Bq(u)%20%5C,%20q(f%7Cu)%7D%7Bp(u)%20%5C,%20%20%5Ctextcolor%7Bred%7D%7Bp(f%20%5Cmid%20u)%7D%20%5C,%20p(y%20%5Cmid%20f)%7D%20%20%5Cright%5C%7D%7D%20%20%5C,%20du%20%5C,%20df%20%5C,%20+%20%5C,%20%5Clog%20p(y).%0A"></p>
<p>It is not extremely helpful since the intractable term <img src="https://latex.codecogs.com/png.latex?%20%5Ctextcolor%7Bred%7D%7Bp(f%20%5Cmid%20u)%7D"> is present. However, <span class="citation" data-cites="titsias2009variational">(Titsias 2009)</span> proposes to set <img src="https://latex.codecogs.com/png.latex?q(f%7Cu)%20=%20p(f%7Cu)">, i.e.&nbsp;to consider an approximate posterior of the form:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Aq(u,f)%20=%20q(u)%20%5C,%20p(f%20%5Cmid%20u).%0A"></p>
<p>Note that the correct posterior distribution is typically not of this form, although when the number of inducing points is large enough, this approximations becomes increasingly accurate. With this class of approximate posterior, the expectation <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5CPhi(f)%20%5Cmid%20y%5D"> of some functional <img src="https://latex.codecogs.com/png.latex?%5CPhi"> is approximated as <img src="https://latex.codecogs.com/png.latex?%5Cint%20%5Cmathbb%7BE%7D%5B%5CPhi(f)%20%5Cmid%20u%5D%20%5C,%20q(u)%20%5C,%20du">. For example, if <img src="https://latex.codecogs.com/png.latex?q(u)%20=%20%5Cmathcal%7BN%7D(%5Cmu_q,%20K_q)"> is a Gaussian variational distribution, the posterior distribution of <img src="https://latex.codecogs.com/png.latex?f_%5Cstar%20=%20f(x_%5Cstar)"> at a new location <img src="https://latex.codecogs.com/png.latex?x_%5Cstar"> is approximated as <img src="https://latex.codecogs.com/png.latex?K_%7B%5Cstar,u%7D%20%5C,%20K_%7Bu%7D%5E%7B-1%7D%20%5Cmathcal%7BN%7D(%5Cmu_q,%20K_q)%20+%20K_%7B%5Cstar%7Cu%7D">; it is a Gausian with</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Balign*%7D%0A%5Ctextrm%7Bmean%7D%20&amp;=%20K_%7B%5Cstar,u%7D%20%5C,%20K_%7Bu%7D%5E%7B-1%7D%20%5Cmu_q%5C%5C%0A%5Ctextrm%7Bcov%7D%20&amp;=%20K_%7B%5Cstar,u%7D%20%5C,%20K_%7Bu%7D%5E%7B-1%7D%20%5C,%20K_q%20%5C,%20K_%7Bu%7D%5E%7B-1%7D%20K_%7Bu,%5Cstar%7D%20+%20K_%7B%5Cstar%7Cu%7D%0A%5Cend%7Balign*%7D%0A%5Cright.%0A"></p>
<p>Optimizing the inducing variables is equivalent to minimizing the free energy quantity</p>
<p><span id="eq-variational"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BF%7D%5C;%20%5Cequiv%20%5C;%20%5Cint%20q(u)%20%5C,%20p(f%7Cu)%20%5C,%20%5Clog%20%20%7B%5Cleft%5C%7B%20%20%5Cfrac%7Bq(u)%7D%7Bp(u)%20%5C,%20p(y%20%5Cmid%20f)%7D%20%20%5Cright%5C%7D%7D%20%20%5C,%20du%20%5C,%20df,%0A%5Ctag%7B2%7D"></span></p>
<p>over the variational distribution <img src="https://latex.codecogs.com/png.latex?q(u)"> and choice of inducing variables. For a fixed set of inducing variables (eg. set of inducing points), it is clear that the optimal variational distribution is given by</p>
<p><span id="eq-optimal-variational"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0Aq_%7B%5Cstar%7D(u)%0A&amp;=%20p(u)%20%5Cexp%20%7B%5Cleft%5C%7B%20%20%5Cint%20p(f%7Cu)%20%5C,%20%5Clog%20%20%7B%5Cleft(%20p(y%20%5Cmid%20f)%20%5Cright)%7D%20%20%5C,%20df%20%20%5Cright%5C%7D%7D%20%20/%20%5Cmathcal%7BZ%7D%5C%5C%0A&amp;=%20p(u)%20%5Cexp%20%7B%5Cleft%5C%7B%20%20%5Cmathbb%7BE%7D%5B%5Clog%20p(y%20%5Cmid%20f)%20%5Cmid%20u%5D%20%20%5Cright%5C%7D%7D%20%20/%20%5Cmathcal%7BZ%7D%0A%5Cend%7Balign*%7D%0A%5Ctag%7B3%7D"></span></p>
<p>for some normalization constant <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BZ%7D=%20%5Cint%20p(u)%20%5Cexp%20%7B%5Cleft%5C%7B%20%20%5Cmathbb%7BE%7D%5B%5Clog%20p(y%20%5Cmid%20f)%20%5Cmid%20u%5D%20%20%5Cright%5C%7D%7D%20%20%5C,%20du">; this can be seen by expressing Equation&nbsp;2 as KL divergence, as similarly done for example when deriving the Coordinate Ascent Variational Inference (CAVI) method,</p>
<p><span id="eq-free-energy"><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BF%7D=%20D_%7B%5Ctext%7BKL%7D%7D%5Bq(u)%20%5Cmid%20q_%7B%5Cstar%7D(u)%5D%20%5C,%20-%20%5C,%20%5Clog%20%5Cmathcal%7BZ%7D.%0A%5Ctag%7B4%7D"></span></p>
<p>Equation&nbsp;3 shows that <img src="https://latex.codecogs.com/png.latex?q_%7B%5Cstar%7D(u)"> is the prior <img src="https://latex.codecogs.com/png.latex?p(u)"> weighted by a term that is large when the observations <img src="https://latex.codecogs.com/png.latex?y"> are likely given <img src="https://latex.codecogs.com/png.latex?u">, i.e.&nbsp;when <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Clog%20p(y%20%5Cmid%20f)%20%5Cmid%20u%5D"> is large.</p>
<section id="nystrom-approximation" class="level3">
<h3 class="anchored" data-anchor-id="nystrom-approximation">Nystrom approximation</h3>
<p>Before describing the simple and most important case of additive Gaussian noise, let’s give a brief reminder on the Nystrom approximation. The distribution of <img src="https://latex.codecogs.com/png.latex?f%20%5Cmid%20u"> is Gaussian with mean <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7Bf%7Cu%7D%20=%20K_%7Bfu%7D%20K_u%5E%7B-1%7D%20u"> and covariance <img src="https://latex.codecogs.com/png.latex?K_%7Bf%7Cu%7D">. This means that <img src="https://latex.codecogs.com/png.latex?K_%7Bfu%7D%20K_u%5E%7B-1%7D%20u%20+%20%5Cmathcal%7BN%7D(0,%20K_%7Bf%7Cu%7D)"> is distributed as the unconditional distribution <img src="https://latex.codecogs.com/png.latex?f%20%5Csim%20%5Cmathcal%7BN%7D(0,%20K_f)">. In particular:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0AK_f%0A&amp;=%20K_%7Bfu%7D%20K_u%5E%7B-1%7D%20K_u%20K_u%5E%7B-1%7D%20K_%7Buf%7D%20+%20K_%7Bf%7Cu%7D%20%5C%5C%0A&amp;=%20%20%5Ctextcolor%7Bred%7D%7BK_%7Bfu%7D%20K_u%5E%7B-1%7D%20K_%7Buf%7D%7D%20+%20K_%7Bf%7Cu%7D%20%5C%5C%0A&amp;=%20%20%5Ctextcolor%7Bblue%7D%7B%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D%7D%20+%20K_%7Bf%7Cu%7D%0A%5Cend%7Balign*%7D%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?%20%5Ctextcolor%7Bblue%7D%7B%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D%7D%20%5Cequiv%20K_%7Bfu%7D%20K_u%5E%7B-1%7D%20K_%7Buf%7D"> is the so-called <a href="https://en.wikipedia.org/wiki/Low-rank_matrix_approximations">Nystrom approximation</a> of the covariance matrix <img src="https://latex.codecogs.com/png.latex?K_f"> based on the inducing variable <img src="https://latex.codecogs.com/png.latex?u">. This shows that the Nystrom approximation <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D"> simply consists in ignoring the conditional variance term <img src="https://latex.codecogs.com/png.latex?K_%7Bf%7Cu%7D">, and is thus an underestimate of the covariance matrix <img src="https://latex.codecogs.com/png.latex?K_f">. Furthermore, if <img src="https://latex.codecogs.com/png.latex?u"> is very informative of <img src="https://latex.codecogs.com/png.latex?f">, then <img src="https://latex.codecogs.com/png.latex?K_%7Bf%7Cu%7D"> is small and the Nystrom approximation is accurate.</p>
</section>
<section id="observation-with-additive-gaussian-noise" class="level3">
<h3 class="anchored" data-anchor-id="observation-with-additive-gaussian-noise">Observation with additive Gaussian noise</h3>
<p>The case of additive Gaussian noise is particularly simple. Assume that</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ay_i%20=%20f_i%20+%20%5Cvarepsilon_i%0A%5Cqquad%20%5Ctext%7Bwith%7D%20%5Cqquad%0A%5Cvarepsilon_i%20%5Csim%20%5Cmathcal%7BN%7D(0,%20%5Csigma%5E2)%0A"></p>
<p>where the noise terms <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon_i"> are independent. Since <img src="https://latex.codecogs.com/png.latex?f%7Cu%20%5Csim%20%5Cmathcal%7BN%7D(%5Cmu_%7Bf%7Cu%7D,%20K_%7Bf%7Cu%7D)">, algebra gives that</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5B%5Clog%20p(y%20%5Cmid%20f)%20%5Cmid%20u%5D%20=%0A%5Clog%5B%20%5Cmathcal%7BN%7D(y;%20%5Cmu_%7Bf%7Cu%7D,%20%5Csigma%5E2%20%5C,%20I)%20%5D%20-%20%5Cfrac%7B1%7D%7B2%20%5Csigma%5E2%7D%20%5C,%20%5Cmathop%7B%5Cmathrm%7BTr%7D%7D(%20K_%7Bf%7Cu%7D%20)"></p>
<p>Using that <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7Bf%7Cu%7D%20=%20K_%7Bfu%7D%20K_u%5E%7B-1%7D%20u"> and the <a href="https://en.wikipedia.org/wiki/Woodbury_matrix_identity">matrix inversion lemma</a> it quickly follows that optimal variational distribution is <img src="https://latex.codecogs.com/png.latex?q_%7B%5Cstar%7D(u)%20=%20%5Cmathcal%7BN%7D(%5Cmu_%7B%5Cstar%7D,%20K_%7B%5Cstar%7D)"> with</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%5Cmu_%7B%5Cstar%7D%20&amp;=%20K_%7Buf%7D%20%5C,%20%20%7B%5Cleft(%20%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D%20+%20%5Csigma%5E2%20I%20%5Cright)%7D%20%5E%7B-1%7D%20%5C,%20y%5C%5C%0AK_%7B%5Cstar%7D%20&amp;=%20K_u%20-%20K_%7Buf%7D%20%5C,%20%20%7B%5Cleft(%20%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D%20+%20%5Csigma%5E2%20I%20%5Cright)%7D%20%5E%7B-1%7D%20%5C,%20K_%7Bfu%7D.%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>Indeed, these are approximations of the exact condition moments,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%5Cmu_%7Bu%7Cy%7D%20&amp;=%20K_%7Buf%7D%20%5C,%20%20%7B%5Cleft(%20K_%7Bf%7D%20+%20%5Csigma%5E2%20I%20%5Cright)%7D%20%5E%7B-1%7D%20%5C,%20y%5C%5C%0AK_%7Bu%7Cy%7D%20&amp;=%20K_u%20-%20K_%7Buf%7D%20%5C,%20%20%7B%5Cleft(%20K_%7Bf%7D%20+%20%5Csigma%5E2%20I%20%5Cright)%7D%20%5E%7B-1%7D%20%5C,%20K_%7Bfu%7D.%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>where the Nystrom approximation <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D%20%5Capprox%20K_f"> is used instead. One then finds that <img src="https://latex.codecogs.com/png.latex?%5Clog%20%5Cmathcal%7BZ%7D=%20%5Clog%20%5Cmathcal%7BN%7D(y;%200,%20%5Cwidehat%7BK%7D%5Eu_f%20+%20%5Csigma%5E2%20I)%20-%20%5Cfrac%7B1%7D%7B2%5Csigma%5E2%7D%20%5Cmathop%7B%5Cmathrm%7BTr%7D%7D(K_%7Bf%7Cu%7D)">. With the optimal variational distribution <img src="https://latex.codecogs.com/png.latex?q_%5Cstar(u)">, Equation&nbsp;4 gives that the free energy is:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BF%7D%0A=%20-%5Clog%20%5Cmathcal%7BN%7D%20%7B%5Cleft(%20y;%200,%20%5C;%20%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D%20+%20%5Csigma%5E2%20I%20%5Cright)%7D%20%20+%20%5Cfrac%7B1%7D%7B2%5Csigma%5E2%7D%20%5Cmathop%7B%5Cmathrm%7BTr%7D%7DK_%7Bf%7Cu%7D%20%5C%5C%0A"></p>
<p>Furthermore, note that exact likelihood of the observations is <img src="https://latex.codecogs.com/png.latex?p(y)%20=%20%5Cmathcal%7BN%7D%20%7B%5Cleft(%20y;%200,%20%5C;%20K_f%20+%20%5Csigma%5E2%20I%20%5Cright)%7D%20"> so that the free energy can be expressed as</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathcal%7BF%7D%0A%5C;%20=%20%5C;%0A-%5Clog%20%5Cwidehat%7Bp%7D%5Eu(y)%20+%20%5Cfrac%7B1%7D%7B2%5Csigma%5E2%7D%20%5Cmathop%7B%5Cmathrm%7BTr%7D%7DK_%7Bf%7Cu%7D%20%5C%5C%0A"></p>
<p>for pseudo-likelihood <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bp%7D%5Eu(y)%20=%20%5Cmathcal%7BN%7D%20%7B%5Cleft(%20y;%200,%20%5C;%20%5Cwidehat%7BK%7D%5E%7Bu%7D_%7Bf%7D%20+%20%5Csigma%5E2%20I%20%5Cright)%7D%20">. This shows that <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D"> is given by: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0AD_%7B%5Ctext%7BKL%7D%7D&amp;%5Bq(u,f)%20%5Cmid%20p(u,f%20%5Cmid%20y)%5D%0A=%0A%5Cmathcal%7BF%7D+%20%5Clog%20p(y)%20%5C%5C%0A&amp;=%0A%5Clog%20%5Cfrac%7Bp(y)%7D%7B%5Cwidehat%7Bp%7D%5Eu(y)%7D%0A+%0A%5Cfrac%7B1%7D%7B2%5Csigma%5E2%7D%20%5Cmathop%7B%5Cmathrm%7BTr%7D%7DK_%7Bf%7Cu%7D.%0A%5Cend%7Balign*%7D%0A"></p>
<p>The term <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BTr%7D%7DK_%7Bf%7Cu%7D"> is just the sum of the conditional variances <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BVar%7D%7D%20%7B%5Cleft(%20f_i%20%7C%20u%20%5Cright)%7D%20"> and can be thought of as a regularization term,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AR%20=%20%5Cfrac%7B1%7D%7B2%5Csigma%5E2%7D%20%5Cmathop%7B%5Cmathrm%7BTr%7D%7DK_%7Bf%7Cu%7D%20=%0A%5Cfrac12%20%5C,%20%5Csum_%7Bi=1%7D%5En%20%5Cfrac%7B%5Cmathop%7B%5Cmathrm%7BVar%7D%7D%20%7B%5Cleft(%20f_i%20%7C%20u%20%5Cright)%7D%20%7D%7B%5Csigma%5E2%7D.%0A"></p>
<p>As the number of inducing variables <img src="https://latex.codecogs.com/png.latex?m"> increases, the pseudo-likelihood becomes more accurate <img src="https://latex.codecogs.com/png.latex?%5Cwidehat%7Bp%7D%5Eu(y)%20%5Cto%20p(y)">, the conditional variances <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BVar%7D%7D%20%7B%5Cleft(%20f_i%20%7C%20u%20%5Cright)%7D%20%20%5Cto%200"> shrink to zero, and the KL divergence <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7BKL%7D%7D%5Bq(u,f)%20%5Cmid%20p(u,f%20%5Cmid%20y)%5D"> approaches zero.</p>
<p>The animation at the start of this note illustrates the effect of optimizing the location of the inducing points <img src="https://latex.codecogs.com/png.latex?z"> with a very simple gradient descent. A few experiments show that it is worth being careful with the initial choice of inducing points. Inducing points chosen very far from the data essentially remain fixed during the optimization (ie. the gradient is very small). Initializing with <a href="https://en.wikipedia.org/wiki/K-means%2B%2B">k-means++</a> clustering of the data points seems to be a robust strategy and give an almost optimal choice of inducing points.</p>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-titsias2009variational" class="csl-entry">
Titsias, Michalis. 2009. <span>“Variational Learning of Inducing Variables in Sparse Gaussian Processes.”</span> In <em>Artificial Intelligence and Statistics</em>, 567–74. PMLR.
</div>
</div></section></div> ]]></description>
  <category>GP</category>
  <guid>https://alexxthiery.github.io/notes/sparse_GP/sparse_gp.html</guid>
  <pubDate>Thu, 17 Apr 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Self Avoiding Walks</title>
  <link>https://alexxthiery.github.io/notes/SAW/SAW.html</link>
  <description><![CDATA[ 





<!-- \begin{figure}[h]
\centering
\includegraphics[width=0.3\textwidth]{polymer-selfavoiding.png}
\caption{A 2D self-avoiding walk}
\end{figure} -->
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/SAW/polymer-selfavoiding.png" class="img-fluid figure-img" style="width:35.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Self-avoiding_walk">A 2D self-avoiding walk</a></figcaption>
</figure>
</div>
</div>
<p><em>These notes present comments on the “Self-avoiding walks” assignment given to the “ST3247: Simulations” class. Most of the drafts that have been submitted so far describe variations of importance sampling. The purpose of these notes is to suggest directions for slightly more advanced Monte Carlo methods that can be used to estimate the connective constant <img src="https://latex.codecogs.com/png.latex?%5Cmu"> of self-avoiding walks. These are only pointers and suggestions.</em></p>
<section id="the-problems-and-notations" class="level3">
<h3 class="anchored" data-anchor-id="the-problems-and-notations">The problems and notations</h3>
<p>Recall that we are trying to estimate the <a href="https://en.wikipedia.org/wiki/Connective_constant">connective constant</a> <img src="https://latex.codecogs.com/png.latex?%5Cmu"> of self-avoiding walks (SAW) in the 2D lattice <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D%5E2">. If <img src="https://latex.codecogs.com/png.latex?c_L"> denotes the number of SAWs of length <img src="https://latex.codecogs.com/png.latex?L">, we have the following asymptotic behavior:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ac_L%20%5C;%20%5Csim%20%5C;%20A%20%5C,%20%5Cmu%5EL%20%5C,%20L%5E%7B%5Cgamma%7D%0A"></p>
<p>for some unknown constants <img src="https://latex.codecogs.com/png.latex?A">, <img src="https://latex.codecogs.com/png.latex?%5Cmu">, and <img src="https://latex.codecogs.com/png.latex?%5Cgamma">. The main objective of the assignment is to estimate <img src="https://latex.codecogs.com/png.latex?%5Cmu">, which can also be expressed as the limit of <img src="https://latex.codecogs.com/png.latex?c_L%5E%7B1/L%7D"> as <img src="https://latex.codecogs.com/png.latex?L%20%5Cto%20%5Cinfty">. As of today, the <a href="https://en.wikipedia.org/wiki/Connective_constant">best known estimate</a> is <img src="https://latex.codecogs.com/png.latex?%5Cmu%20%5Capprox%202.638158533032790(3)">, which required several tens of thousand hours of CPU time to compute. To estimate <img src="https://latex.codecogs.com/png.latex?%5Cmu">, one must approximate the number of SAWs of length <img src="https://latex.codecogs.com/png.latex?L"> starting at the origin for large values of <img src="https://latex.codecogs.com/png.latex?L"> if one hopes to get a good estimate.</p>
<p>Consider a sequence <img src="https://latex.codecogs.com/png.latex?z_%7B0:L%7D%20=%20(z_0,%20z_1,%20%5Cdots,%20z_L)"> of <img src="https://latex.codecogs.com/png.latex?L+1"> distinct vertices in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D%5E2"> with <img src="https://latex.codecogs.com/png.latex?z_0%20=%20(0,0)"> and <img src="https://latex.codecogs.com/png.latex?%5C%7Cz_%7Bk+1%7D%20-%20z_k%5C%7C=1"> for all <img src="https://latex.codecogs.com/png.latex?0%20%5Cleq%20k%20%5Cleq%20L-1">, i.e., a walk of length <img src="https://latex.codecogs.com/png.latex?L">. For notational convenience, let us introduce the function <img src="https://latex.codecogs.com/png.latex?%5Cvarphi%5E%7B%5Ctextrm%7Bwalk%7D%7D(z_%7B:L%7D)"> that returns one if <img src="https://latex.codecogs.com/png.latex?z_%7B0:L%7D"> is a correct walk of length <img src="https://latex.codecogs.com/png.latex?L">, and zero otherwise. In particular, this function returns zero if two consecutive vertices are the same, or if the walk does not start at zero. Similarly, introduce the function <img src="https://latex.codecogs.com/png.latex?%5Cvarphi%5E%7B%5Ctextrm%7BSAW%7D%7D(z_%7B:L%7D)"> that returns one if <img src="https://latex.codecogs.com/png.latex?z_%7B0:L%7D"> is a SAW of length <img src="https://latex.codecogs.com/png.latex?L">. One can define two important probability mass functions:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ap%5E%7B%5Ctextrm%7Bwalk%7D%7D_%7BL%7D(z_%7B0:L%7D)%20=%20%5Cfrac%7B%5Cvarphi_L%5E%7B%5Ctextrm%7Bwalk%7D%7D(z_%7B0:L%7D)%7D%7B4%5EL%7D%0A%5Cqquad%20%5Ctextrm%7Band%7D%20%5Cqquad%0Ap%5E%7B%5Ctextrm%7BSAW%7D%7D_%7BL%7D(z_%7B0:L%7D)%20=%20%5Cfrac%7B%5Cvarphi_L%5E%7B%5Ctextrm%7BSAW%7D%7D(z_%7B0:L%7D)%7D%7Bc_L%7D.%0A"></p>
<p>They describe the uniform distributions on all the walks of length <img src="https://latex.codecogs.com/png.latex?L"> and all the SAWs of length <img src="https://latex.codecogs.com/png.latex?L">, respectively.</p>
</section>
<section id="importance-sampling" class="level3">
<h3 class="anchored" data-anchor-id="importance-sampling">Importance sampling</h3>
<p>One can approximate <img src="https://latex.codecogs.com/png.latex?c_L"> with naive Monte Carlo by estimating the proportion <img src="https://latex.codecogs.com/png.latex?p_L"> of walks that are SAWs,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ap_L%20=%20%5Cmathbb%7BE%7D_%7Bp%5E%7B%5Ctextrm%7Bwalk%7D%7D_%7BL%7D%7D%20%5Cleft%5B%20%5Cvarphi_L%5E%7B%5Ctextrm%7BSAW%7D%7D(z_%7B0:L%7D)%20%5Cright%5D%0A=%0A%5Cfrac%7B1%7D%7B4%5EL%7D%20%5Csum_%7Bz_%7B0:L%7D%7D%20%5Cvarphi_L%5E%7B%5Ctextrm%7BSAW%7D%7D(z_%7B0:L%7D).%0A"></p>
<p>This is an absolute disaster since the proportion of SAWs among all walks is extremely small. One can do significantly better using importance sampling. For this, consider a proposal distribution that starts at the origin and continues by choosing uniformly among the four neighbors of the last vertex that have not been visited yet. If there are no unvisited neighbors, the walk continues by standing still until length <img src="https://latex.codecogs.com/png.latex?L"> is reached: the resulting path is not even a valid walk, so <img src="https://latex.codecogs.com/png.latex?p%5E%7B%5Ctextrm%7Bwalk%7D%7D_%7BL%7D(z_%7B0:L%7D)%20=%200"> as well as <img src="https://latex.codecogs.com/png.latex?p%5E%7B%5Ctextrm%7BSAW%7D%7D_%7BL%7D(z_%7B0:L%7D)%20=%200">. The probability mass function of the proposal distribution is easy to compute, so estimating <img src="https://latex.codecogs.com/png.latex?p_L"> with importance sampling is straightforward. This is usually called the Rosenbluth method <span class="citation" data-cites="rosenbluth1955monte">(Rosenbluth and Rosenbluth 1955)</span>. <em>[<strong>Note to students</strong>: make it much clearer in your report that the Rosenbluth method is just importance sampling. Do note that even the “rejected” walks have to be taken into account!]</em></p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/SAW/SAW_SMC.png" class="img-fluid figure-img" style="width:95.0%"></p>
<figcaption>Importance Sampling (Rosenbluth method)</figcaption>
</figure>
</div>
</div>
<p>As one can see, the quality quickly deteriorates as <img src="https://latex.codecogs.com/png.latex?L"> increases. This is because the number of accepted walks is very small, and, among them, the importance weights are highly unequal.<br>
<em>[<strong>Note to students</strong>: you should explain this much more clearly, and possibly explore this more quantitatively. The reason it is failing is not only that the number of accepted walks is small]</em></p>
</section>
<section id="recursive-formulation" class="level3">
<h3 class="anchored" data-anchor-id="recursive-formulation">Recursive formulation</h3>
<p>We have just seen that importance sampling will not be able to estimate <img src="https://latex.codecogs.com/png.latex?c_L"> for large values of <img src="https://latex.codecogs.com/png.latex?L">. This makes accurate estimates of <img src="https://latex.codecogs.com/png.latex?%5Cmu"> difficult to obtain this way.</p>
<p>To make progress, one can exploit the recursive structure of the problem. Let us define the concatenation of two walks. Given a first walk <img src="https://latex.codecogs.com/png.latex?z%5E%7B(A)%7D_%7B0:L_A%7D"> and a second walk <img src="https://latex.codecogs.com/png.latex?z%5E%7B(B)%7D_%7B0:L_B%7D">, one can define a new walk of length <img src="https://latex.codecogs.com/png.latex?L_A%20+%20L_B"> by starting at the origin, following the <img src="https://latex.codecogs.com/png.latex?L_A"> increments of the first walk, then the <img src="https://latex.codecogs.com/png.latex?L_B"> increments of the second. The concatenation of two SAWs is not always a SAW. However, it is not hard to prove the following. Define <img src="https://latex.codecogs.com/png.latex?B(L_A,%20L_B)%20%5Cin%20(0,1)"> as the probability that, when sampling SAWs <img src="https://latex.codecogs.com/png.latex?z%5E%7B(A)%7D_%7B0:L_A%7D"> and <img src="https://latex.codecogs.com/png.latex?z%5E%7B(B)%7D_%7B0:L_B%7D"> independently and uniformly at random, their concatenation is still a SAW. Then:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AB(L_A,%20L_B)%20%5C;%20=%20%5C;%20%5Cfrac%7Bc_%7BL_A%20+%20L_B%7D%7D%7Bc_%7BL_A%7D%20%5C,%20c_%7BL_B%7D%7D.%0A"></p>
<p><em>[<strong>Note to students</strong>: it is OK for you to use this fact. It’s even better if you can prove it, but not absolutely necessary.]</em></p>
<p>Assuming one can generate SAWs of length <img src="https://latex.codecogs.com/png.latex?L"> uniformly at random ( a problem that will be discussed later), we can estimate <img src="https://latex.codecogs.com/png.latex?%5Cmu"> in several ways:</p>
<ol type="1">
<li><p>For small values of <img src="https://latex.codecogs.com/png.latex?L_1">, the number of SAWs <img src="https://latex.codecogs.com/png.latex?c_%7BL_1%7D"> is known exactly (e.g., <img src="https://latex.codecogs.com/png.latex?c_1%20=%204">, <img src="https://latex.codecogs.com/png.latex?c_%7B10%7D%20=%2044100">). Suppose one can generate SAWs of length <img src="https://latex.codecogs.com/png.latex?L_2%20%5Cgg%201">. One can then estimate <img src="https://latex.codecogs.com/png.latex?B(L_1,%20L_2)"> empirically. Since <img src="https://latex.codecogs.com/png.latex?c_L%20%5C;%20%5Csim%20%5C;%20A%20%5C,%20%5Cmu%5EL%20%5C,%20L%5E%7B%5Cgamma%7D">, it follows that, for <img src="https://latex.codecogs.com/png.latex?L_1"> fixed and <img src="https://latex.codecogs.com/png.latex?L_2%20%5Cto%20%5Cinfty">, <img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bc_%7BL_1+L_2%7D%7D%7Bc_%7BL_2%7D%7D%20%5Capprox%20%5Cmu%5E%7BL_1%7D.%0A"> Using the fact that <img src="https://latex.codecogs.com/png.latex?B(L_1,%20L_2)%20=%20c_%7BL_1+L_2%7D%20/%20(c_%7BL_2%7D%20c_%7BL_1%7D)">, one can then estimate <img src="https://latex.codecogs.com/png.latex?%5Cmu"> from the estimate of <img src="https://latex.codecogs.com/png.latex?B(L_1,%20L_2)">.</p></li>
<li><p>Alternatively, one can estimate <img src="https://latex.codecogs.com/png.latex?c_L"> for large <img src="https://latex.codecogs.com/png.latex?L"> recursively. For example, starting from <img src="https://latex.codecogs.com/png.latex?c_%7B10%7D%20=%2044100">, estimate <img src="https://latex.codecogs.com/png.latex?B(10,10)"> to compute <img src="https://latex.codecogs.com/png.latex?c_%7B20%7D">, then use <img src="https://latex.codecogs.com/png.latex?B(20,20)"> to compute <img src="https://latex.codecogs.com/png.latex?c_%7B40%7D">, and so on. Using this method and about <img src="https://latex.codecogs.com/png.latex?5"> hours of CPU time (see below for details) with <img src="https://latex.codecogs.com/png.latex?10,000"> SAWs of lengths <img src="https://latex.codecogs.com/png.latex?10,%2020,%20%5Cdots,%202560">, I obtained <img src="https://latex.codecogs.com/png.latex?%5Cmu%20%5Capprox%202.643">.</p></li>
</ol>
</section>
<section id="generating-saws" class="level3">
<h3 class="anchored" data-anchor-id="generating-saws">Generating SAWs</h3>
<p>The previous discussion shows that, once we know how to generate uniform SAWs, we can estimate <img src="https://latex.codecogs.com/png.latex?%5Cmu"> relatively easily. One of the most common methods is the pivot algorithm: see <a href="https://clisby.net/projects/sm_simulator/">here</a> for a nice visualization. The principle is simple: given a SAW, randomly select a pivot site and apply a symmetry operation (like rotation or reflection) to one part of the walk. If the resulting walk remains self-avoiding, accept it; otherwise, reject it. Repeating this process generates diverse, approximately uniform SAWs.<br>
<em>[<strong>Note to students</strong>: explain this much more clearly if you decide to use it]</em></p>
<p>In short, the pivot algorithm updates a SAW by applying a symmetry operation to a subpath. Given a SAW <img src="https://latex.codecogs.com/png.latex?z_%7B0:L%7D">, one can obtain another SAW by applying to it the pivot algorithm a (large) number of times. To obtain a nearly independent SAW of length <img src="https://latex.codecogs.com/png.latex?L"> starting from <img src="https://latex.codecogs.com/png.latex?z_%7B0:L%7D">, one typically need to apply about <img src="https://latex.codecogs.com/png.latex?L"> pivot steps. While it can be slow for large <img src="https://latex.codecogs.com/png.latex?L">, it is far more efficient than naive importance sampling.<br>
<em>[<strong>Note to students</strong>: efficiently implementing the pivot algorithm is non-trivial, but LLM assistants can help a lot, and are actually quite useful for code optimization]</em></p>
</section>
<section id="sequential-monte-carlo" class="level3">
<h3 class="anchored" data-anchor-id="sequential-monte-carlo">Sequential Monte Carlo</h3>
<p>To estimate <img src="https://latex.codecogs.com/png.latex?c_L"> for large <img src="https://latex.codecogs.com/png.latex?L">, one can use Sequential Monte Carlo (SMC). The idea is to grow a population of <img src="https://latex.codecogs.com/png.latex?N"> SAWs in parallel and estimate <img src="https://latex.codecogs.com/png.latex?c_L"> by recursively estimating the ratios <img src="https://latex.codecogs.com/png.latex?c_%7BL+1%7D/c_L">. Suppose you have <img src="https://latex.codecogs.com/png.latex?N"> SAWs of length <img src="https://latex.codecogs.com/png.latex?L">. Try to extend each SAW by choosing a neighbor of the last vertex that has not been visited yet. This is a form of importance sampling, giving <img src="https://latex.codecogs.com/png.latex?N"> new walks of length <img src="https://latex.codecogs.com/png.latex?L+1"> with associated weights (some of them being non-valid walks!). Then, <em>resample</em> <img src="https://latex.codecogs.com/png.latex?N"> times from this weighted set to get <img src="https://latex.codecogs.com/png.latex?N"> new SAWs of length <img src="https://latex.codecogs.com/png.latex?L+1"> (with possible duplicates). Apply the pivot algorithm to eliminate these duplicates and generate more diverse SAWs.<br>
<em>[<strong>Note to students</strong>: if you decide to use SMC, explain it much more clearly. It’s not entirely straightforward to understand or implement, but it is one of the most powerful and versatile Monte Carlo methods to this day. A good investment of your time if you decide to understand SMC]</em></p>
<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/SAW/SMC_mu_estimates.png" class="img-fluid figure-img" style="width:95.0%"></p>
<figcaption>Sequential Monte Carlo</figcaption>
</figure>
</div>
</div>
</section>
<section id="improving-the-estimation-of-mu" class="level3">
<h3 class="anchored" data-anchor-id="improving-the-estimation-of-mu">Improving the estimation of <img src="https://latex.codecogs.com/png.latex?%5Cmu"></h3>
<p>Suppose you have estimates of <img src="https://latex.codecogs.com/png.latex?(%5Clog%20c_L)/L"> for various <img src="https://latex.codecogs.com/png.latex?L">. Since</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B%5Clog%20c_L%7D%7BL%7D%20%5Capprox%20%5Clog%20A%20%5Ccdot%20%5Cfrac%7B1%7D%7BL%7D%20+%20%5Clog%20%5Cmu%20+%20%5Cgamma%20%5Ccdot%20%5Cfrac%7B%5Clog%20L%7D%7BL%7D,%0A"></p>
<p>you can fit a linear regression to estimate <img src="https://latex.codecogs.com/png.latex?%5Clog%20A">, <img src="https://latex.codecogs.com/png.latex?%5Clog%20%5Cmu">, and <img src="https://latex.codecogs.com/png.latex?%5Cgamma">. I tried this approach using a naive and non-optimized SMC implementation with <img src="https://latex.codecogs.com/png.latex?N=1000"> and <img src="https://latex.codecogs.com/png.latex?L=1000">, running for 10 hours on a free (and bad) online CPU, and obtained <img src="https://latex.codecogs.com/png.latex?%5Cmu%20%5Capprox%202.6366">.<br>
<em>[<strong>Note to students</strong>: can you do much better?]</em></p>
</section>
<section id="running-long-simulations" class="level3">
<h3 class="anchored" data-anchor-id="running-long-simulations">Running long simulations</h3>
<p>The best known estimate of <img src="https://latex.codecogs.com/png.latex?%5Cmu"> required several tens of thousands of CPU hours. While writing these notes, I was able to run simulations easily and for free using <a href="https://deepnote.com">deepNote</a>: it was my first time using it, and it was very user friendly. This allowed me to run simulations for 8 hours on a (free but slow) CPU without issue. Launch simulations in the evening and let them run overnight. <em>[<strong>Note to students</strong>: for the more motivated ones, you can try writing GPU-friendly code to run simulations, possibly on Google Colab]</em></p>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-rosenbluth1955monte" class="csl-entry">
Rosenbluth, Marshall N, and Arianna W Rosenbluth. 1955. <span>“Monte Carlo Calculation of the Average Extension of Molecular Chains.”</span> <em>The Journal of Chemical Physics</em> 23 (2). American Institute of Physics: 356–59.
</div>
</div></section></div> ]]></description>
  <category>monte-carlo</category>
  <guid>https://alexxthiery.github.io/notes/SAW/SAW.html</guid>
  <pubDate>Fri, 04 Apr 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Jarzynski and Crooks</title>
  <link>https://alexxthiery.github.io/notes/jarzynski/jarzynski.html</link>
  <description><![CDATA[ 





<div style="text-align:center;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://alexxthiery.github.io/notes/jarzynski/jarzynski_crooks.png" class="img-fluid figure-img" style="width:80.0%"></p>
<figcaption><a href="https://en.wikipedia.org/wiki/Christopher_Jarzynski">Christopher Jarzynski</a> and <a href="https://en.wikipedia.org/wiki/Gavin_E._Crooks">Gavin Crooks</a></figcaption>
</figure>
</div>
</div>
<p>Consider a sequence of densities on <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D%5ED"> indexed by time parameter <img src="https://latex.codecogs.com/png.latex?t%20%5Cin%20%5B0,T%5D">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cpi_t(x)%20%5C;%20=%20%5C;%20%5Cfrac%7B%20e%5E%7B-U_t(x)%7D%7D%7BZ_t%7D%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?U_t:%20%5Cmathbb%7BR%7D%5ED%20%5Cto%20%5Cmathbb%7BR%7D"> is time-dependent potential function and <img src="https://latex.codecogs.com/png.latex?Z_t"> is the normalizing constant. We are in fact really interested in studying the final density <img src="https://latex.codecogs.com/png.latex?%5Cpi_T"> and the bridging sequence of densities <img src="https://latex.codecogs.com/png.latex?%5Cpi_t"> is just a tool to get there, starting from an initial and tractable density <img src="https://latex.codecogs.com/png.latex?%5Cpi_0">. If one initializes a particle <img src="https://latex.codecogs.com/png.latex?X_0%20%5Csim%20%5Cpi_0"> and evolves it according to the <a href="https://en.wikipedia.org/wiki/Langevin_equation">Langevin</a> dynamics</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20%5C;%20=%20%5C;%20-%5Cnabla%20U_t(X_t)%20%5C,%20dt%20+%20%5Csqrt%7B2%7D%20%5C,%20dW_t%0A"></p>
<p>one can hope that the distribution of <img src="https://latex.codecogs.com/png.latex?X_T"> will be close to <img src="https://latex.codecogs.com/png.latex?%5Cpi_T">. This would be the case if one evolved the particle according <img src="https://latex.codecogs.com/png.latex?dX_t%20%5C;%20=%20%5C;%20-%5Cgamma%20%5Cnabla%20U_t(X_t)%20%5C,%20dt%20+%20%5Csqrt%7B2%20%5Cgamma%7D%20%5C,%20dW_t"> and let <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20%5Cto%20%5Cinfty"> since in that case <img src="https://latex.codecogs.com/png.latex?X_t"> would be distributed according to <img src="https://latex.codecogs.com/png.latex?%5Cpi_t"> for all <img src="https://latex.codecogs.com/png.latex?t">. Can one correct the distribution of <img src="https://latex.codecogs.com/png.latex?X_T"> with importance sampling weights?</p>
<p>I like the approach presented in <span class="citation" data-cites="vargas2023transport">(Vargas et al. 2024)</span> and these notes are my attempt to understand it. One very fruitful idea that has been used in a number of works in the Monte-Carlo literature is to look at a probability distribution of interest as the marginal of a joint distribution and to carry out computations and build numerical methods on the joint distribution <span class="citation" data-cites="del2006sequential">(Del Moral, Doucet, and Jasra 2006)</span>. Indeed, there is a lot of flexibility in the choice of the joint distribution.</p>
<p>Here, we can also consider the diffusion process <img src="https://latex.codecogs.com/png.latex?Y_T"> that runs backward in times and that is initialized according to <img src="https://latex.codecogs.com/png.latex?%5Cpi_T"> and follows the same Langevin dynamics (backward in time). Again, one expects the distribution of <img src="https://latex.codecogs.com/png.latex?Y_t"> to be close to <img src="https://latex.codecogs.com/png.latex?%5Cpi_t">. It is more intuitive to discuss discretized version of the process. For a time discretization <img src="https://latex.codecogs.com/png.latex?%5Cdelta%20=%20T/N">, we consider the forward Markov chain <img src="https://latex.codecogs.com/png.latex?X_t"> defined as:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0Ax_%7Bt%20+%20%5Cdelta%7D%20&amp;=%20x_t%20-%20%5Cnabla%20U_t(x_t)%20%5C,%20%5Cdelta%20+%20%5Csqrt%7B2%20%5Cdelta%7D%20%5C,%20%5Cxi_t%5C%5C%0Ax_0%20&amp;%5Csim%20%5Cpi_0%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>as well as the backward Markov chain <img src="https://latex.codecogs.com/png.latex?Y_t"> defined as <img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0Ay_%7Bt%7D%20&amp;=%20y_%7Bt%20+%20%5Cdelta%7D%20-%20%5Cnabla%20U_%7Bt%20+%20%5Cdelta%7D(y_%7Bt%20+%20%5Cdelta%7D)%20%5C,%20%5Cdelta%20+%20%5Csqrt%7B2%20%5Cdelta%7D%20%5C,%20%5Cxi_t%5C%5C%0Ay_T%20&amp;%5Csim%20%5Cpi_T.%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>The quantities <img src="https://latex.codecogs.com/png.latex?%5Cxi_t%20%5Csim%20%5Cmathcal%7BN%7D(0,I)"> are i.i.d. standard Gaussian random variables. Let us continue with these discretized versions and denote by <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7BX%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5E%7BY%7D"> the probability measures associated with the discretized processes. For a discretized path <img src="https://latex.codecogs.com/png.latex?%5Cunderline%7Bz%7D%20=%20(z_0,%20z_%7B%5Cdelta%7D,%20%5Cldots,%20z_%7BT%7D)"> and notation <img src="https://latex.codecogs.com/png.latex?t_k%20=%20k%20%5Cdelta">, we have:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0A%5Cmathbb%7BP%7D%5EX(%5Cunderline%7Bz%7D)%20&amp;=%0A%5Cpi_0(z_0)%20%5C,%20%5Cexp%20%7B%5Cleft%5C%7B%20-%5Cfrac%7B1%7D%7B4%20%5Cdelta%7D%20%5Csum_%7Bk=0%7D%5E%7BN-1%7D%20%5C%7Cz_%7Bt_%7Bk+1%7D%7D%20-%20%5Bz_%7Bt_k%7D%20-%20%5Cnabla%20U_%7Bt_k%7D(z_%7Bt_k%7D)%5C,%5Cdelta%5D%5C%7C%5E2%20%5Cright%5C%7D%7D%20%5C%5C%0A%5Cmathbb%7BP%7D%5EY(%5Cunderline%7Bz%7D)%20&amp;=%0A%5Cpi_T(z_T)%20%5C,%20%5Cexp%20%7B%5Cleft%5C%7B%20-%5Cfrac%7B1%7D%7B4%20%5Cdelta%7D%20%5Csum_%7Bk=0%7D%5E%7BN-1%7D%20%5C%7Cz_%7Bt_%7Bk%7D%7D%20-%20%5Bz_%7Bt_%7Bk+1%7D%7D%20-%20%5Cnabla%20U_%7Bt_%7Bk+1%7D%7D(z_%7Bt_%7Bk+1%7D%7D)%5C,%5Cdelta%5D%5C%7C%5E2%20%5Cright%5C%7D%7D%20.%0A%5Cend%7Baligned%7D%0A"></p>
<p>One can compute the ratio <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BP%7D%5EY(z)%20/%20%5Cmathbb%7BP%7D%5EX(z)"> and examine its limit as <img src="https://latex.codecogs.com/png.latex?N%20%5Cto%20%5Cinfty">. Algebra gives:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B%5Cmathbb%7BP%7D%5EY%7D%7B%5Cmathbb%7BP%7D%5EX%7D(%5Cunderline%7Bz%7D)%20=%0A%5Cfrac%7B%5Cpi_T(z_T)%7D%7B%5Cpi_0(z_0)%7D%20%5C,%0A%5Cexp%20%7B%5Cleft%5C%7B%20%5Csum_%7Bk=0%7D%5E%7BN-1%7D%20%5Cleft%3C%20z_%7Bt_%7Bk+1%7D%7D%20-%20z_%7Bt_k%7D,%20%5Cfrac%7B%5Cnabla%20U_%7Bt_k%7D(z_%7Bt_k%7D)%20+%20%5Cnabla%20U_%7Bt_%7Bk+1%7D%7D(z_%7Bt_%7Bk+1%7D%7D)%7D%7B2%7D%20%20%5Cright%3E%20%5Cright%5C%7D%7D%20%20%20+%20%5Cmathcal%7BO%7D(%5Cdelta%5E%7B1/2%7D).%0A"></p>
<p>One could probably use some <a href="https://en.wikipedia.org/wiki/Stratonovich_integral">Stratonovich</a> calculus to study this, but I always forget these things, so let’s use Ito instead. Write</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cnabla%20U_%7Bt_k%7D(z_%7Bt_k%7D)%20+%20%5Cnabla%20U_%7Bt_%7Bk+1%7D%7D(z_%7Bt_%7Bk+1%7D%7D)%7D%7B2%7D%0A=%0A%5Cnabla%20U_%7Bt_k%7D(z_%7Bt_k%7D)%20+%20%5Cfrac%7B1%7D%7B2%7D%20%5Cmathrm%7BHess%7D_%7BU_%7Bt_%7Bk%7D%7D%7D%20(z_%7Bt_%7Bk%7D%7D)%20(z_%7Bt_%7Bk+1%7D%7D%20-%20z_%7Bt_k%7D)%0A+%0A%5Cmathcal%7BO%7D(%5Cdelta).%0A"></p>
<p>Consequently, in the limit <img src="https://latex.codecogs.com/png.latex?N%20%5Cto%20%5Cinfty">, the quantity converges to:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%5Cmathbb%7BP%7D%5EY%7D%7Bd%5Cmathbb%7BP%7D%5EX%7D(%5Cunderline%7Bz%7D)%20%5C;%20=%20%5C;%0A%5Cfrac%7B%5Cpi_T(z_T)%7D%7B%5Cpi_0(z_0)%7D%20%5C,%0A%5Cexp%20%7B%5Cleft%5C%7B%20%20%5Cint_%7Bt=0%7D%5ET%20%5Cnabla%20U_t(z_t)%20%5C,%20dz_t%0A+%0A%5Cfrac%7B1%7D%7B2%7D%20%5Cint_0%5ET%20%5Cleft%3C%20dz_t,%20%5Cmathrm%7BHess%7D_%7BU_t%7D(z_t)%20%5C,%20dz_t%20%5Cright%3E%0A%5Cright%5C%7D%7D%20.%0A"></p>
<p>One can obtain a slightly simpler formuler using Ito’s lemma. Since <img src="https://latex.codecogs.com/png.latex?d%20U_t(z_t)%20=%20%5Cpartial_t%20U_t(z_T)%20%5C,%20dt%20+%20%5Cleft%3C%20%5Cnabla%20U_t(z_t),%20dz_t%20%5Cright%3E%20+%20%5Cfrac%7B1%7D%7B2%7D%20%5Cleft%3C%20dz_t,%20%5Cmathrm%7BHess%7D_%7BU_t%7D(z_t)%20%5C,%20dz_t%20%5Cright%3E">, we also have:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%20%5Cmathbb%7BP%7D%5EY%7D%7Bd%20%5Cmathbb%7BP%7D%5EX%7D(%5Cunderline%7Bz%7D)%0A=%0A%5Cfrac%7B%5Cpi_T(z_T)%7D%7B%5Cpi_0(z_0)%7D%20%5C,%0A%5Cexp%20%7B%5Cleft%5C%7B%20%20U_T(z_T)%20-%20U_0(z_0)%20-%20%5Cint_0%5ET%20%5Cpartial_t%20U_t(z_t)%20%5C,%20dt%20%5Cright%5C%7D%7D%20.%0A"></p>
<p>Since <img src="https://latex.codecogs.com/png.latex?%5Cpi_t(z_t)%20=%20%5Cexp(-U_t(z_t))%20/%20Z_t">, this gives the <a href="https://en.wikipedia.org/wiki/Crooks_fluctuation_theorem">Crooks relation</a>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%20%5Cmathbb%7BP%7D%5EY%7D%7Bd%20%5Cmathbb%7BP%7D%5EX%7D(%5Cunderline%7Bz%7D)%0A=%0A%5Cfrac%7BZ_0%7D%7BZ_T%7D%20%5C,%0A%5Cexp%20%7B%5Cleft%5C%7B%20%20-%20%5Cint_0%5ET%20%5Cpartial_t%20U_t(z_t)%20%5C,%20dt%20%5Cright%5C%7D%7D%20.%0A"></p>
<p>Integrating over trajectories of <img src="https://latex.codecogs.com/png.latex?X_t">, since <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D_%7BX%7D%5B(d%20%5Cmathbb%7BP%7D%5EY%20/%20d%20%5Cmathbb%7BP%7D%5EX)(X)%5D%20=%201">, one obtains the <a href="https://en.wikipedia.org/wiki/Jarzynski_equality">Jarzynski equality</a> <img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7BZ_T%7D%7BZ_0%7D%20%5C;%20=%20%5C;%20%5Cmathbb%7BE%7D_%7BX%7D%20%20%7B%5Cleft%5B%20%20%5Cexp%20%7B%5Cleft%5C%7B%20%20-%20%5Cint_0%5ET%20%5Cpartial_t%20U_t(X_t)%20%5C,%20dt%20%5Cright%5C%7D%7D%20%20%5Cright%5D%7D%0A"></p>
<p>which is indeed also central to sequential Monte-Carlo methods. As described in <span class="citation" data-cites="vargas2023transport">(Vargas et al. 2024)</span>, the same approach can be used to slightly generalize the Crooks relation. Indeed, suppose that one instead consider the dynamics:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdX_t%20%5C;%20=%20%5C;%20-%5Cnabla%20U_t(X_t)%20%5C,%20dt%20%20%5Ctextcolor%7Bblue%7D%7B+%20b_t(X_t)%20%5C,%20dt%7D%20+%20%5Csqrt%7B2%7D%20%5C,%20dW_t%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?b:%20%5Cmathbb%7BR%7D%5ED%20%5Cto%20%5Cmathbb%7BR%7D%5ED"> is a control function. One can consider the backward dynamics <img src="https://latex.codecogs.com/png.latex?Y_t"> that is initialized according to <img src="https://latex.codecogs.com/png.latex?%5Cpi_T"> and follows the dynamics <img src="https://latex.codecogs.com/png.latex?dY_t%20=%20-%5Cnabla%20U_t(Y_t)%20%5C,%20dt%20%20%5Ctextcolor%7Bred%7D%7B-%7D%20b(Y_t)%20%5C,%20dt%20+%20%5Csqrt%7B2%7D%20%5C,%20dW_t"> backward in time, i.e.</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0Ax_%7Bt%20+%20%5Cdelta%7D%20&amp;=%20x_t%20-%20%5Cnabla%20U_t(x_t)%20%5C,%20%5Cdelta%20+%20b_t(x_t)%20%5C,%20%5Cdelta%20+%20%5Csqrt%7B2%20%5Cdelta%7D%20%5C,%20%5Cxi_t%5C%5C%0Ay_%7Bt%7D%20&amp;=%20y_%7Bt%20+%20%5Cdelta%7D%20-%20%5Cnabla%20U_%7Bt%20+%20%5Cdelta%7D(y_%7Bt%20+%20%5Cdelta%7D)%20%5C,%20%5Cdelta%20%20%5Ctextcolor%7Bred%7D%7B-%7D%20b_%7Bt%20+%20%5Cdelta%7D(y_%7Bt%20+%20%5Cdelta%7D)%20%5C,%20%5Cdelta%20+%20%5Csqrt%7B2%20%5Cdelta%7D%20%5C,%20%5Cxi_t.%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>The minus sign for the backward dynamics <img src="https://latex.codecogs.com/png.latex?Y_t"> is natural. Indeed, one would like the dynamics of <img src="https://latex.codecogs.com/png.latex?Y_t"> to be as close as possible to the time-reversal of the dynamics of <img src="https://latex.codecogs.com/png.latex?X_t">. Furthermore, one knows that the <a href="../../notes/reverse_and_tweedie/reverse_and_tweedie.html">backward dynamics</a> of <img src="https://latex.codecogs.com/png.latex?X_t"> is given by</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdY_t%20=%20%20%5Ctextcolor%7Bred%7D%7B+%7D%20%5Cnabla%20U_t(Y_t)%20%5C,%20dt%20%20%5Ctextcolor%7Bred%7D%7B-%7D%20b_t(Y_t)%20%5C,%20dt%20+%202%20%5Cnabla%20%5Clog%20p_t(Y_t)%20%5C,%20dt%20+%20%5Csqrt%7B2%7D%20%5C,%20dW_t%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?p_t"> is the marginal distribution of <img src="https://latex.codecogs.com/png.latex?X_t"> at time <img src="https://latex.codecogs.com/png.latex?t">. Since we would like <img src="https://latex.codecogs.com/png.latex?p_t%20=%20%5Cpi_t%20=%20%5Cexp(-U_t)%20/%20Z_t">, in that case this gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AdY_t%20=%20-%5Cnabla%20U_t(Y_t)%20%5C,%20dt%20%20%5Ctextcolor%7Bred%7D%7B-%7D%20b_t(Y_t)%20%5C,%20dt%20+%20%5Csqrt%7B2%7D%20%5C,%20dW_t,%0A"></p>
<p>which is exactly the dynamics we chose for <img src="https://latex.codecogs.com/png.latex?Y_t">.One can then follow the exact same steps as done previously, using that the quadratic variation is <img src="https://latex.codecogs.com/png.latex?%5Cleft%3C%20dz_t,%20dz_t%20%5Cright%3E%20=%202%20%5C,%20dt">, to obtain that</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7Bd%20%5Cmathbb%7BP%7D%5EY%7D%7Bd%20%5Cmathbb%7BP%7D%5EX%7D(%5Cunderline%7Bz%7D)%0A=%0A%5Cfrac%7BZ_0%7D%7BZ_T%7D%20%5C,%0A%5Cexp%20%7B%5Cleft%5C%7B%20%20%5Cint_0%5ET%20-%5Cpartial_t%20U_t(z_t)%20%20%5Ctextcolor%7Bblue%7D%7B+%20%5Cnabla%20%5Ccdot%20b_t(z_t)%20-%20%5Cleft%3C%20%5Cnabla%20U_t(z_t),%20b_t(z_t)%20%5Cright%3E%7D%20%5C,%20dt%20%5Cright%5C%7D%7D%20.%0A"></p>
<p>This for example shows that, for <img src="https://latex.codecogs.com/png.latex?dX_t%20%5C;%20=%20%5C;%20-%5Cnabla%20U_t(X_t)%20%5C,%20dt%20%20%5Ctextcolor%7Bblue%7D%7B+%20b_t(X_t)%20%5C,%20dt%7D%20+%20%5Csqrt%7B2%7D%20%5C,%20dW_t"> initialized according to <img src="https://latex.codecogs.com/png.latex?%5Cpi_0">, we have:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7BZ_T%7D%7BZ_0%7D%20%5C;%20=%20%5C;%20%5Cmathbb%7BE%7D_%7BX%7D%20%20%7B%5Cleft%5C%7B%20%20%5Cexp%20%7B%5Cleft%5C%7B%20%20%5Cint_0%5ET%20-%5Cpartial_t%20U_t(X_t)%20%20%5Ctextcolor%7Bblue%7D%7B+%20%5Cnabla%20%5Ccdot%20b_t(X_t)%20-%20%5Cleft%3C%20%5Cnabla%20U_t(X_t),%20b_t(X_t)%20%5Cright%3E%7D%20%5C,%20dt%20%5Cright%5C%7D%7D%20%20%5Cright%5C%7D%7D%20.%0A"></p>
<p>This generalization of the Crooks relation is also explored in <span class="citation" data-cites="albergo2024nets">(Albergo and Vanden-Eijnden 2024)</span> where an alternative derivation by directly exploiting the <a href="https://en.wikipedia.org/wiki/Fokker–Planck_equation">Fokker-Planck</a> equation. Crucially, <span class="citation" data-cites="albergo2024nets">(Albergo and Vanden-Eijnden 2024)</span> note that, if the control function <img src="https://latex.codecogs.com/png.latex?b_t:%20%5Cmathbb%7BR%7D%5ED%20%5Cto%20%5Cmathbb%7BR%7D%5ED"> is chosen so that</p>
<p><span id="eq-nets"><img src="https://latex.codecogs.com/png.latex?%0A-%5Cpartial_t%20U_t(x)%20+%20%5Cnabla%20%5Ccdot%20b_t(x)%20-%20%5Cleft%3C%20%5Cnabla%20U_t(x),%20b_t(x)%20%5Cright%3E%0A=%0A%5Cfrac%7Bd%7D%7Bdt%7D%20%5C,%20%5Clog%20Z_t%0A%5Ctag%7B1%7D"></span></p>
<p>then the term <img src="https://latex.codecogs.com/png.latex?%5Cint_0%5ET%20-%5Cpartial_t%20U_t(X_t)%20+%20%5Cnabla%20%5Ccdot%20b_t(X_t)%20-%20%5Cleft%3C%20%5Cnabla%20U_t(X_t),%20b_t(X_t)%20%5Cright%3E%20%5C,%20dt"> is indeed constant, which gives a zero-variance estimator of the free energy difference <img src="https://latex.codecogs.com/png.latex?%5Clog(Z_T/Z_0)">. Indeed, it is a formidable challenge to solve the high-dimensional PDE Equation&nbsp;1 and <span class="citation" data-cites="albergo2024nets">(Albergo and Vanden-Eijnden 2024)</span> propose interesting <a href="https://en.wikipedia.org/wiki/Physics-informed_neural_networks">PINNs</a>-based methods to do so.</p>
<section id="some-references" class="level3">
<h3 class="anchored" data-anchor-id="some-references">Some References:</h3>
<ul>
<li>The original papers by Jarzynski <span class="citation" data-cites="jarzynski1997nonequilibrium">(Jarzynski 1997)</span> and Crooks <span class="citation" data-cites="crooks1999entropy">(Crooks 1999)</span>.</li>
<li>The book <span class="citation" data-cites="stoltz2010free">(Stoltz, Rousset, et al. 2010)</span> is excellent!</li>
<li>The two papers that prompted these notes: <span class="citation" data-cites="vargas2023transport">(Vargas et al. 2024)</span> and <span class="citation" data-cites="albergo2024nets">(Albergo and Vanden-Eijnden 2024)</span>.</li>
</ul>



</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-albergo2024nets" class="csl-entry">
Albergo, Michael S, and Eric Vanden-Eijnden. 2024. <span>“Nets: A Non-Equilibrium Transport Sampler.”</span> <em>arXiv Preprint arXiv:2410.02711</em>.
</div>
<div id="ref-crooks1999entropy" class="csl-entry">
Crooks, Gavin E. 1999. <span>“Entropy Production Fluctuation Theorem and the Nonequilibrium Work Relation for Free Energy Differences.”</span> <em>Physical Review E</em> 60 (3). APS: 2721.
</div>
<div id="ref-del2006sequential" class="csl-entry">
Del Moral, Pierre, Arnaud Doucet, and Ajay Jasra. 2006. <span>“Sequential Monte Carlo Samplers.”</span> <em>Journal of the Royal Statistical Society Series B: Statistical Methodology</em> 68 (3). Oxford University Press: 411–36.
</div>
<div id="ref-jarzynski1997nonequilibrium" class="csl-entry">
Jarzynski, Christopher. 1997. <span>“Nonequilibrium Equality for Free Energy Differences.”</span> <em>Physical Review Letters</em> 78 (14). APS: 2690.
</div>
<div id="ref-stoltz2010free" class="csl-entry">
Stoltz, Gabriel, Mathias Rousset, et al. 2010. <em>Free Energy Computations: A Mathematical Perspective</em>. World Scientific.
</div>
<div id="ref-vargas2023transport" class="csl-entry">
Vargas, Francisco, Shreyas Padhy, Denis Blessing, and Nikolas Nüsken. 2024. <span>“Transport Meets Variational Inference: Controlled Monte Carlo Diffusions.”</span> <em>ICLR 2024</em>.
</div>
</div></section></div> ]]></description>
  <category>SDE</category>
  <category>markov</category>
  <guid>https://alexxthiery.github.io/notes/jarzynski/jarzynski.html</guid>
  <pubDate>Fri, 21 Feb 2025 16:00:00 GMT</pubDate>
</item>
</channel>
</rss>
