Unlocking Guidance for Discrete State-Space Diffusion and Flow Models

Hunter Nisonoff, Junhao Xiong, Stephan Allenspach, Jennifer Listgarten · DOI

Abstract

Controllable generation in discrete state spaces, such as DNA sequences and molecular graphs, has historically been hindered by the exponential complexity of calculating normalizing constants. We present Discrete Guidance (DG), a framework that leverages continuous-time Markov chains (CTMCs) to make guided sampling mathematically exact and computationally tractable. By restricting transitions to single-dimension changes in infinitesimal time, DG reduces complexity from exponential to linear. We further introduce Taylor-Approximated Guidance (TAG) for high-dimensional efficiency. Our methods demonstrate state-of-the-art performance in generating molecules with specific properties, cell-type-specific DNA sequences, and stable mini-proteins.

Introduction

In generative AI, "guidance" is essential for steering models toward specific outputs. While well-established in continuous domains (e.g., image generation) via score functions, guidance in discrete spaces—such as DNA, proteins, and molecular graphs—remains a significant challenge. Applying Bayes' theorem to steer a discrete model typically requires summing over an exponential number of possible next states ($S^D$ for a sequence of length $D$ with $S$ characters), making exact guidance computationally impossible in discrete-time settings.

Methods: The Continuous-Time Advantage

The core innovation of this work is the transition from discrete-time to continuous-time Markov chains (CTMCs). In a continuous-time framework, the probability of multiple dimensions changing simultaneously at any infinitesimal time step $dt$ is zero. Consequently, the model only needs to consider transitions where a single dimension changes. This shift collapses the complexity of the normalizing constant from $S^D$ to $D \times (S-1) + 1$, transforming an intractable problem into a linear one.

Conceptual overview of Discrete Guidance: (a) unconditional generation, (b) the property predictor, and (c) the resulting guided generation process.

Discrete Guidance (DG) and TAG

Using this framework, we derive an exact formula to adjust transition rates based on a predictor (classifier or regressor). Transitions leading to states with higher predicted likelihoods of the desired property are boosted. To further enhance efficiency for large-scale models, we introduce Taylor-Approximated Guidance (TAG). By using a first-order Taylor expansion, TAG approximates the guidance signal with a single forward and backward pass of the predictor, bringing the efficiency of continuous-space score-based guidance to discrete data.

Experimental Results

We validated Discrete Guidance across three scientific domains:

  1. Small Molecules (QMugs): Guided generation of SMILES strings to control ring counts and lipophilicity (LogP). DG significantly outperformed existing discrete-time models like DiGress, achieving lower Mean Absolute Error (MAE) for target properties.
  2. DNA Sequences: Generation of cell-type-specific enhancer sequences. DG matched or exceeded the performance of Dirichlet Flow Matching, producing sequences with higher target class probabilities and maintaining biological realism.
  3. Protein Stability: In an inverse folding task, stability guidance (FMIF-DG) achieved success rates of 80-100% in generating stable proteins that maintain their 3D fold, whereas unguided models frequently failed.

Discussion and Future Work

Discrete Guidance allows for the repurposing of large, unlabeled foundation models for specific tasks using small, specialized predictors. While highly effective, challenges remain in training "noisy predictors" for corrupted inputs and ensuring 100% chemical validity in SMILES generation. Beyond the sciences, DG holds potential for controllable text generation in Large Language Models, offering a principled alternative to current heuristic methods.

Summary updated

BibTeX
@inproceedings{nisonoff2025unlocking,
  author = {Hunter Nisonoff and Junhao Xiong and Stephan Allenspach and Jennifer Listgarten},
  title = {{Unlocking Guidance for Discrete State-Space Diffusion and Flow Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=XsgHl54yO7},
}
Figure