NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Discrete Flow Matching

Itai Gat, Tal Remez, Neta Shaul, Felix Kreuk, Ricky T. Q. Chen, Gabriel Synnaeve, Yossi Adi, Yaron Lipman

Executive Summary

Discrete Flow Matching (DFM) is a novel generative paradigm that brings the mathematical elegance of continuous flow matching to discrete data, such as language and code. By scaling up to 1.7 billion parameters, DFM significantly closes the performance gap between non-autoregressive models and traditional autoregressive ones, achieving state-of-the-art results for non-autoregressive models on complex coding benchmarks like HumanEval.

The Challenge of Discrete Data

Generative AI has historically seen a massive split in methodologies based on data types. Continuous data (like images and video) is dominated by diffusion and flow models, while discrete data (like text and code) is dominated by autoregressive (AR) models like GPT.

This split exists because discrete tokens lack a natural "direction" to move in. In image diffusion, you can slightly nudge a pixel's color value; in text, you cannot slightly nudge the word "cat" toward "dog." Previous attempts to bridge this gap—such as embedding tokens into continuous space or using discrete diffusion—often struggled with high-dimensional data, resulting in poor coherence or requiring massive amounts of sampling steps. The authors of this paper aim to create a robust, theoretically grounded framework for discrete flows that can compete with the quality of AR models while remaining non-autoregressive.

Introducing Discrete Flow Matching (DFM)

The authors introduce Discrete Flow Matching, building upon the framework of Continuous-Time discrete Markov Chains (CTMC).

Comparison of continuous and discrete flows and divergences.

Key technical innovations include:

  • Probability Velocity ($u_t$): DFM defines a "probability velocity" field that describes the rate of change of state probabilities over time. Remarkably, the authors prove that the formula for this velocity in the discrete case is identical in form to its continuous counterpart.
  • Unified Sampling: DFM provides a generic formula for sampling that works with different learned posteriors, such as the "probability denoiser" ($x$-prediction) or "noise-prediction" ($\epsilon$-prediction).
  • Corrector Sampling: The framework includes a general theory for "corrector" steps, allowing the model to reintroduce noise during the sampling process to refine and "fix" the generated sequence.
  • Advanced Schedulers: Instead of simple linear transitions from noise to data, the authors explore a family of probability paths (like cubic polynomials) and find that these time-dependent schedulers are pivotal for maximizing performance.

Theoretical and Practical Insights

  • Mathematical Symmetry: The most striking insight is that the generating probability velocity for discrete flows mirrors the continuous case. This suggests that the underlying principles of Flow Matching are more universal than previously thought.
  • MaskGit is a Special Case: The authors mathematically prove that MaskGit, a popular masked modeling approach, is actually a specific instance of Discrete Flow Matching where the posterior is time-independent.
  • Non-Autoregressive Coding is Possible: DFM is the first non-autoregressive method to achieve non-trivial, competitive results on complex coding tasks. This challenges the long-held assumption that the strict "next-token prediction" of AR models is the only viable way to handle logical code structures.
  • The Power of Schedulers: The paper demonstrates that the path taken from noise to data matters immensely. Tuning the "path" and "corrector" schedulers led to substantial improvements in generative perplexity.

Performance and Benchmarks

The models were trained and evaluated across several domains, including language, code, and images, yielding impressive results:

  • Coding Performance: The 1.7B parameter DFM model achieved 6.7% Pass@1 and 13.4% Pass@10 on HumanEval. On the 1-shot MBPP benchmark, it reached 6.7% Pass@1 and 20.6% Pass@10.
  • Text Quality: In conditional generation, the model produced text with a generative perplexity of 9.7 (as measured by Llama-3 8B). This outperformed a 1.7B AR baseline (22.3) and approached the performance of Llama-2 7B (8.3).
  • Image Generation: On a fully discrete version of CIFAR10 (treating color values as 256 discrete tokens), DFM achieved a state-of-the-art FID score of 3.63 at 1024 steps, outperforming both MaskGit and previous discrete flow models.
  • Inference Speed: At 256 steps, the non-autoregressive DFM was found to be ~2.5x faster than an equivalent autoregressive model on a single A100 GPU.

Limitations and Future Directions

While DFM represents a major leap forward, it still faces challenges. First, its sampling efficiency has not yet reached the extreme efficiency seen in continuous flow models; it requires more network evaluations (NFEs) to reach peak quality compared to some AR generation methods. Second, DFM currently does not benefit from KV-caching, a standard optimization for AR models, which limits its raw throughput in certain scenarios. Finally, the authors note that they have only scratched the surface of the vast design space for probability paths and schedulers, suggesting that even better performance is likely possible with further tuning.

Summary updated

BibTeX
@inproceedings{gat2024discrete,
  author = {Itai Gat and Tal Remez and Neta Shaul and Felix Kreuk and Ricky T. Q. Chen and Gabriel Synnaeve and Yossi Adi and Yaron Lipman},
  title = {{Discrete Flow Matching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=GTDKo3Sv9p},
}
Figure