Adjoint Matching through the Lens of the Stochastic Maximum Principle in Optimal Control

Carles Domingo-Enrich, Jiequn HanarXiv 2026

TL;DR

This paper places "Adjoint Matching"—a popular method for fine-tuning diffusion and flow models—on a rigorous control-theoretic foundation by deriving it from the Stochastic Maximum Principle (SMP). The authors generalize the method to handle complex, state-dependent diffusions and reveal that adjoint matching implicitly solves a long-standing computational bottleneck in stochastic optimal control by bypassing an intractable martingale term.

What Problem Does This Paper Address?

Generative models like diffusion and flow matching are highly effective, but often require post-training or "reward fine-tuning" to maximize sample quality or align with specific target distributions (like the Boltzmann distribution in molecular modeling). This fine-tuning process can be mathematically framed as a Stochastic Optimal Control (SOC) problem, where the goal is to find an optimal control policy (the model's vector field) under Stochastic Differential Equation (SDE) constraints.

A recently proposed method called Adjoint Matching successfully tackled this by framing control learning as an $L^2$ regression problem solved backward in time. However, it was derived heuristically and restricted to simple, control-affine setups with time-dependent noise. Modern generative models are moving toward non-Gaussian, state-dependent diffusion processes (like geometric Brownian motion or simplex diffusions). The original heuristic formulation of adjoint matching fails in these regimes, creating a critical need for a rigorous, generalized theory.

Methods

The authors bridge the gap between machine learning heuristics and classical control theory through the following contributions:

  1. Hamiltonian Basic Adjoint Matching (BAM): They introduce a generalized Hamiltonian framework for SOC problems with arbitrary control-dependent drift, diffusion, and convex running costs. BAM utilizes pathwise first- and second-order adjoint equations to provide unbiased estimators of the cost-to-go gradient and Hessian.
  2. The Lean Adjoint Matching (AM) Loss: They show that when the diffusion depends only on time (the standard setting for most current diffusion models), the second-order Hessian terms drop out of the stationarity conditions. This mathematically justifies the "lean" version of the loss used in prior work.
  3. Continuous-Time Method of Successive Approximations (MSA): Crucially, they prove that the gradient flow of the lean AM loss is exactly equivalent to a continuous-time MSA derived from the Stochastic Maximum Principle (SMP).

A summary of the various Hamiltonians and adjoint processes mapped out by this unification can be seen below:

Key Hamiltonians and adjoint processes used in this paper.

Datasets

The authors evaluated their generalized framework on two target-steering problems featuring state-dependent geometric Brownian motion (GBM) dynamics:

  • Synthetic Correlated GBM: A multi-dimensional setup steering toward an equally weighted three-component Gaussian mixture target across ambient dimensions $d \in \{2, 5, 10, 20\}$.
  • MNIST VAE Latent Bridge: A 16-dimensional coordinate system based on the latent space of a convolutional Variational Autoencoder (VAE) trained on the MNIST dataset, steering the latent distribution toward specific target digits (e.g., digit 5, 7, and 9).

Key Insights and Ideas

  • Bypassing the Intractable Martingale: In classical stochastic control, applying the SMP is notoriously difficult because the backward SDE contains an unknown martingale integrand ($q_t$) that is implicitly defined and hard to compute. The paper's major "aha!" moment is demonstrating that the lean Adjoint Matching gradient flow naturally provides an unbiased estimator of the Hamiltonian gradient without ever needing to explicitly compute $q_t$.
  • When Discarded Terms Matter: The lean AM loss discards certain diffusion-Jacobian terms. The authors reveal that while this is perfectly fine for time-dependent noise, it causes severe degradation when the noise is state-dependent. Retaining these terms (via the new BAM formulation) is mathematically necessary to prevent the model from failing.

Key Results

The experiments validated that the generalized BAM framework significantly outperforms the lean AM approach when state-dependent diffusion is present:

  • Mode Preservation: In the 20-dimensional synthetic GBM experiment, lean AM suffered from mode collapse, assigning virtually zero mass to one of the target components. BAM successfully retained all three modes.
  • Quantitative Superiority: Across all dimensions and MNIST target digits, BAM achieved lower excess policy costs, lower total-variation (TV) distance to target weights, and lower sliced-Wasserstein distances. For instance, on the MNIST latent bridge for digit 5, BAM achieved a Latent Sliced-Wasserstein error of $0.121$ versus lean AM's $0.532$, and a vastly superior image-space LeNet-FID score ($1.810$ vs $17.423$).

Limitations and Future Work

  • Computational Cost of Full Control-Dependence: While BAM simplifies nicely when diffusion is independent of the control, a fully control-dependent diffusion setting would require simulating a $d \times d$ second-order adjoint matrix SDE, which could become computationally prohibitive in very high dimensions.
  • Smoothness Assumptions: The theoretical guarantees rely on standard, classical smoothness ($C^1$/$C^2$) and regularity conditions of the drift, diffusion, and cost functions.
  • Discrete Extensions: The current machinery relies heavily on continuous-time Itô calculus. Extending this rigorous Hamiltonian viewpoint to discrete-state diffusion models remains an open avenue for future research.

Summary updated

BibTeX
@misc{domingoenrich2026adjoint,
  author = {Carles Domingo-Enrich and Jiequn Han},
  title = {{Adjoint Matching through the Lens of the Stochastic Maximum Principle in Optimal Control}},
  year = {2026},
  eprint = {2604.08580},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.08580},
}
Figure