Score-based Continuous-time Discrete Diffusion Models

Haoran Sun, Lijun Yu, Bo Dai, Dale Schuurmans, Hanjun Dai

Introduction

Diffusion models have become the gold standard for continuous data generation, largely due to the success of the score-based perspective. In this framework, a model learns to follow the gradient of the log-likelihood (the "score") to reverse a noise-injecting process. However, this approach breaks down for discrete data (e.g., text, categorical labels, or quantized pixels) because gradients are not properly defined for discrete variables.

Previous attempts to adapt diffusion to categorical data either relied on discrete-time steps, which limits sampling flexibility, or used ELBO-based objectives, which can be less stable than score-matching. This paper introduces Score-based Discrete Diffusion Models (SDDM), bridging the gap between continuous-time score-based modeling and discrete data generation through a novel stochastic jump process.

Methodology: Score-based Discrete Diffusion Models

The core innovation of SDDM lies in extending score matching to general categorical data within a continuous-time framework.

1. Continuous-Time Markov Chains (CTMC): Instead of adding Gaussian noise, the forward process is modeled as a "jump process." Discrete states transition to others over continuous time according to a rate matrix, allowing the reverse process to denoise via a CTMC.

2. Categorical Ratio Matching: Because gradients do not exist in discrete spaces, the authors define the discrete analog of the "score" as the ratio of marginal probabilities between different states. They derive a simple, unbiased estimator that allows training a neural network to estimate these ratios by matching conditional marginal distributions, bypassing the need to compute intractable marginals.

3. The Hollow Transformer: To make the model efficient, the authors propose a new architecture. Standard masked models require $O(D)$ passes (one for each dimension) to generate data. The "Hollow Transformer" uses a specific masking pattern to ensure the prediction for dimension $d$ depends on all other dimensions but not itself. This allows for $O(1)$ (single-pass) evaluations during training and sampling.

The Hollow Transformer architecture

4. Analytical Sampling: The formulation admits an analytical simulation during backward sampling. This closed-form expression for the reverse process avoids the simulation errors typically found in Euler-based solvers, leading to better samples with fewer steps.

Experiments and Results

The authors evaluated SDDM across diverse domains, demonstrating its robustness and high-quality generation capabilities.

Synthetic 2D Benchmarks: The model was tested on seven classic distributions (e.g., 2spirals, moons, checkerboard) converted into 32-dimensional binary data using Gray codes. SDDM consistently outperformed existing Energy-Based Model (EBM) baselines in terms of Maximum Mean Discrepancy (MMD), capturing complex shapes more accurately.

Synthetic 2D benchmark distributions

Image Modeling (CIFAR10): To handle high-dimensional image data, SDDM was applied in the latent space of a pretrained VQGAN, treating the 64-dimensional hash codes as categorical data. It achieved an FID of 12.23, significantly outperforming other discrete diffusion methods like $\tau$LDR (FID 40.06) and D3PM (FID 16.47) under the same settings.

Monophonic Music Modeling: On a cleaned version of the Lakh pianoroll dataset, where sequences of notes are categorical variables, SDDM achieved the lowest Hellinger Distance (0.3736) compared to several multinomial and "birth/death" diffusion variants.

Key Insights and Future Directions

A major takeaway from SDDM is that in discrete space, the "score" effectively tells you the relative likelihood of jumping to a different state, rather than a direction to move. Furthermore, because the model is defined in continuous time, it is highly robust to "sampling budgets." While discrete-time models degrade quickly with fewer sampling steps, SDDM maintains high quality even when steps are drastically reduced.

Limitations: * Architecture Complexity: Designing "hollow" versions of state-of-the-art architectures remains a non-trivial engineering task. * Ordinal Information: The current categorical approach treats all categories as equally distant, failing to exploit ordinal relationships (e.g., pixel intensities). * Mixed Spaces: The current framework focuses purely on discrete data. Unifying this with continuous SDEs to handle mixed datasets containing both categorical and continuous features is a promising future direction.

Summary updated

BibTeX
@inproceedings{sun2023score,
  author = {Haoran Sun and Lijun Yu and Bo Dai and Dale Schuurmans and Hanjun Dai},
  title = {{Score-based Continuous-time Discrete Diffusion Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=BYWWwSY2G5s},
}
Figure