Discrete Adjoint Matching

Oswin So, Brian Karrer, Chuchu Fan, Ricky T. Q. Chen, Guan-Horng Liu

TL;DR

Discrete Adjoint Matching (DAM) brings the efficiency of adjoint-based fine-tuning to discrete generative models, such as diffusion-based Large Language Models (LLMs). By leveraging Continuous-Time Markov Chains (CTMC) and a novel statistical estimator derived from Dynkin’s formula, DAM allows models to be optimized for non-differentiable rewards in massive discrete state spaces where traditional gradient-based methods fail.

The Challenge of Discrete State Spaces

Fine-tuning generative models often involves "entropy-regularized reward optimization." The goal is to shift a model's distribution toward high-reward regions (e.g., correct math answers) while staying close to a pre-trained "base" model to maintain general capabilities.

In continuous spaces (like image generation), Adjoint Matching (AM) has emerged as a powerful tool. It uses the gradient of the reward to "nudge" the model's drift. However, discrete spaces—like the sequences of tokens in an LLM—are "nowhere differentiable." You cannot take the gradient of a reward function over a discrete jump from one word to another. Consequently, transferring the success of AM to discrete models has been a major roadblock, forcing researchers to rely on high-variance policy gradient methods or complex approximations.

Introducing Discrete Adjoint Matching (DAM)

To overcome these limitations, the authors introduce Discrete Adjoint Matching (DAM), which reformulates the adjoint matching problem for Continuous-Time Markov Chains (CTMC).

Algorithm 1: Discrete Adjoint Matching

Key technical components of the DAM approach include:

  • The Discrete Adjoint: Unlike the continuous version that uses control theory (Bellman equations), DAM is derived from a purely statistical standpoint using Dynkin’s formula. This provides a way to estimate the optimal transition rates of a jump process.
  • Multiplicative Perturbation: In continuous AM, the adjoint term is added to the model's drift. In DAM, the discrete adjoint perturbs the base transition rates multiplicatively, which naturally respects the non-negativity requirements of probability rates.
  • Importance-Weighted Estimator: To handle the astronomical state spaces of LLMs (e.g., $10^{300}$ possible sequences), the authors propose an importance-sampling-based adjoint. This makes the computation tractable by focusing on high-probability trajectories rather than summing over the entire vocabulary at every step.
  • Generalized KL (gKL) Matching: Instead of a standard $\ell_2$ loss, DAM uses a generalized Kullback–Leibler divergence as the objective function to better capture the probabilistic structure of discrete transition rates.

Experimental Setup and Key Results

The researchers evaluated DAM across two distinct regimes: synthetic 2D grids and mathematical reasoning tasks using the LLaDA-8B-Instruct model.

Visual Fidelity on Synthetic Tasks

On low-dimensional "Checkerboard" and "Pinwheel" tasks, DAM was compared against analytically known optimal solutions.

Comparison of DAM against baselines on synthetic 2D grids

As shown above, DAM was the only method that visually and quantitatively converged to the true target distribution. Competing methods like D1 and SVDD failed to capture the sharp boundaries of the reward functions.

Mathematical Reasoning and Generalization

When fine-tuning the diffusion-based LLM on complex benchmarks, DAM consistently outperformed state-of-the-art baselines:

  • Sudoku: DAM achieved a staggering 88-89% accuracy, while the D1 baseline plateaued between 13% and 24%.
  • Countdown: DAM reached 60.2% accuracy (at sequence length 128), significantly higher than D1’s 43.8%.
  • Generalization: Models trained with DAM at a sequence length of 128 tokens generalized well when tested at 256 or 512 tokens, showing more robust learning than policy-gradient-style approximations.

Key Insights and Future Directions

By using Dynkin’s formula, the authors bypass the convoluted Hamilton-Jacobi-Bellman derivations typical of adjoint methods. This suggests that adjoint matching is fundamentally a statistical estimation problem, opening the door for its application to any Feller process. Furthermore, the paper demonstrates a critical bias-variance tradeoff: a naive "analytic" adjoint is prohibitively expensive and noisy, making their importance-weighted version the key to stable, large-scale LLM training.

Limitations: The primary limitation is that the current implementation is optimized for masked CTMCs (where tokens only transition from a "mask" state to a specific word). While this covers most modern discrete diffusion models, extending DAM to non-masked CTMCs—where any token can jump to any other token—remains a complex future challenge. Additionally, while DAM is more stable than policy gradients, it still requires generating model trajectories during training, carrying a computational overhead.

Summary updated

BibTeX
@inproceedings{so2026discrete,
  author = {Oswin So and Brian Karrer and Chuchu Fan and Ricky T. Q. Chen and Guan-Horng Liu},
  title = {{Discrete Adjoint Matching}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=VXB4xxAgOf},
}
Figure