Contrastive Distribution Matching for Amortized Sequential Monte Carlo in Discrete Diffusion

Jaihoon Kim, Taehoon Yoon, Prin Phunyaphibarn, Seungjun Kim, Morteza Mardani, Minhyuk Sung

TL;DR

This paper introduces Contrastive Distribution Matching (CDM), a novel framework that significantly speeds up inference for discrete diffusion models when generating data aligned with specific rewards. CDM achieves this by learning a "twist function" that efficiently guides the generation process, overcoming the computational bottleneck of traditional methods.

What Problem Does This Paper Address?

Discrete diffusion models are powerful for generating structured data like text or DNA sequences. However, a key challenge arises when we want to generate data that is not just realistic but also optimized for a specific reward (e.g., toxicity score, protein designability). This often involves using a technique called Sequential Monte Carlo (SMC) with a "twist function" to guide the sampling towards higher rewards. The problem is that in discrete settings, estimating this optimal twist function requires computationally expensive Monte Carlo approximations, making inference slow, especially when the reward calculation itself is costly. This paper aims to solve this inference bottleneck by learning the twist function efficiently.

Methods

The core innovation is Contrastive Distribution Matching (CDM). Instead of directly estimating the twist function using costly Monte Carlo methods at inference time, CDM learns a parameterized twist function using a neural network. This learned function can then be evaluated in constant time, amortizing the inference cost.

Key aspects of the CDM method include:

  • Contrastive Learning Objective: CDM uses a novel contrastive learning objective that aligns the distribution generated by the learned twist function with the desired reward-tilted target distribution. This involves using both "positive" (high-reward) and "negative" (low-reward) samples to train the twist function.
  • Diffusion-Native Training: The training process leverages the closed-form forward kernels of discrete diffusion models. This allows for efficient training by reusing clean samples across multiple timesteps and gradient updates, significantly reducing the need for expensive reward evaluations during training.
  • Amortized Inference: The learned twist function is parameterized as a lightweight head attached to the existing diffusion model's backbone. This ensures that evaluating the twist function adds negligible computational overhead (less than 5%) to the standard diffusion model inference.

Datasets

The paper evaluates CDM on several real-world applications, implying the use of relevant datasets for each:

  • Toxic Text Generation: Uses a DiT-parameterized MDM pretrained on OpenWebText.
  • Regulatory DNA Sequence Design: Uses a CNN-based MDM trained on an enhancer activity dataset.
  • Protein Designability: Uses DPLM-2, a multimodal diffusion protein language model.
  • Diffusion Large Language Model Alignment: Uses LLaDA-8B-Instruct as the base dLLM.

Key Insights and Ideas

  • Amortizing Inference Cost: The most significant insight is that the costly Monte Carlo estimation of the twist function in discrete diffusion SMC can be replaced by a learned, fast-to-evaluate neural network. This is crucial for making reward-aligned generation practical.
  • Contrastive Learning for Twist Functions: Applying contrastive learning, which has shown success in other domains, to learn the twist function is effective. It helps mitigate train-test distributional mismatches and leads to more robust twist function estimation.
  • Leveraging Diffusion's Forward Process: The paper cleverly exploits the properties of diffusion models, specifically their closed-form forward kernels, to design a highly efficient training scheme. This allows for significant reuse of data and reduces the burden of repeated reward evaluations.
  • Synergy with Fine-Tuning: CDM is shown to be compatible with and complementary to existing proposal fine-tuning methods, leading to even better performance.

Key Results

  • Superior Scaling: CDM consistently outperforms existing baselines (e.g., Best-of-N, SMC, Soft Value) in terms of reward achieved per unit of wall-clock time across diverse applications.
  • Negligible Inference Overhead: The learned twist function adds less than 5% computational overhead to the base diffusion model inference.
  • Effective Across Applications: CDM demonstrates strong performance in toxic text generation, regulatory DNA sequence design, protein designability, and diffusion LLM alignment.
  • Efficient Training: The contrastive learning objective and diffusion-native training scheme lead to faster convergence and more efficient training compared to previous methods like Soft Value.
  • Improved Diversity: CDM mitigates mode collapse issues often observed in fine-tuned models, maintaining diversity while achieving comparable rewards.

Limitations and Future Work

  • Complex Reward Architectures: The authors acknowledge that modeling highly complex rewards might require more advanced twist function architectures.
  • Sparse Signals: Learning expected future rewards in settings with extremely sparse signals remains a challenge.
  • Future Work: The authors suggest extending the framework to natively support binary and categorical reward structures.

Summary updated

BibTeX
@inproceedings{kim2026contrastive,
  author = {Jaihoon Kim and Taehoon Yoon and Prin Phunyaphibarn and Seungjun Kim and Morteza Mardani and Minhyuk Sung},
  title = {{Contrastive Distribution Matching for Amortized Sequential Monte Carlo in Discrete Diffusion}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=fGFv81kGOt},
}
Figure