Abstract
Generative models for discrete data, such as text tokens or categorical labels, often struggle with "guidance"—the process of steering generation toward specific targets. Traditional methods rely on continuous-space approximations that fail in discrete settings. We present Discrete Guidance Matching, a framework based on Continuous-Time Markov Chains (CTMC) that provides exact transition rates for guidance. Our "posterior-based" approach achieves higher generation quality and is approximately 1.6x faster than previous state-of-the-art techniques by requiring only a single forward pass per sampling step.
Introduction
The success of diffusion and flow matching models in continuous domains (like image generation) has spurred interest in applying similar principles to discrete data. Guidance is a critical component of these models, allowing users to steer outputs toward specific classes or high-reward states. In continuous spaces, guidance is typically achieved via the "score"—the gradient of the log-density.
However, discrete spaces lack gradients. Previous attempts to bridge this gap used first-order Taylor approximations to mimic continuous behavior. This approach is fundamentally flawed because discrete states do not possess the inherent smoothness required for Taylor expansions. For instance, in a large vocabulary, the proximity of token indices does not reflect semantic similarity, making Euclidean gradients meaningless. Furthermore, existing discrete guidance methods often require multiple expensive model evaluations per step, leading to significant computational overhead.
Methodology: Discrete Guidance Matching
To address these limitations, we introduce a framework built on the mathematics of Continuous-Time Markov Chains. Our primary contribution is Posterior-Based Guidance, which derives the exact transition rate needed to move from a source distribution to a target distribution without relying on shaky approximations.
Key Technical Innovations
- Exact Transition Rates: By utilizing CTMC theory, we calculate the precise rates required for guidance, ensuring mathematical rigor where previous methods used heuristics.
- Efficiency via Single Forward Pass: A major bottleneck in discrete guidance has been the need for multiple function calls per step. Our method reduces this to a single forward pass, significantly boosting sampling speed.
- Bregman Divergence Training: Standard $\ell_2$ loss is ill-suited for density ratios, which are strictly positive. We employ a training objective based on Bregman divergence ($F(x) = \langle x, \log x \rangle$) to better capture the nature of the data.
- Regularization: We incorporate a regularization term that enables the model to learn from both source data and target distribution samples, enhancing alignment.
Results and Discussion
We validated Discrete Guidance Matching across 2D simulations, text-to-image generation (GenEval), and multimodal understanding benchmarks.
Efficiency and Exactness
The theoretical advantages of our method translate directly into empirical gains. As shown in the comparison below, our posterior-based approach is the only method that provides exact guidance with just a single function call.
Performance Highlights
- Speed: In 2D experiments, we observed a 1.6x speedup compared to rate-based guidance.
- Fidelity: On synthetic datasets like "rings," our method maintained distribution integrity even at high guidance strengths ($\gamma=20$), whereas predictor-based methods introduced significant distortion.
- Benchmark Success: On the GenEval benchmark, our method outperformed the FUDOKI baseline in complex tasks like "Counting" and "Color Attribution." It also showed consistent improvements across multimodal benchmarks (POPE, MME-P, etc.), demonstrating its utility for preference alignment (RLHF).
Conclusion
Discrete Guidance Matching provides a unified, mathematically sound framework for steering discrete generative models. By replacing approximations with exact derivations, we achieve superior generation quality and efficiency. Future work will explore scaling these techniques to the largest frontier models and extending exact guidance to more complex structures like molecular lattices.
Summary updated