Discrete Flow Matching

Despite Flow Matching and diffusion models having emerged as powerful generative paradigms for continuous variables such as images and videos, their application to high-dimensional discrete data, such as language, is still limited. In this work, we present Discrete Flow Matching, a novel discrete flow paradigm designed specifically for generating discrete data. Discrete Flow Matching offers several key contributions:(i) it works with a general family of probability paths interpolating between source and target distributions; (ii) it allows for a generic formula for sampling from these probability paths using learned posteriors such as the probability denoiser ($x$-prediction) and noise-prediction ($\epsilon$-prediction); (iii) practically, focusing on specific probability paths defined with different schedulers improves generative perplexity compared to previous discrete diffusion and flow models; and (iv) by scaling Discrete Flow Matching models up to 1.7B parameters, we reach 6.7% Pass@1 and 13.4% Pass@10 on HumanEval and 6.7% Pass@1 and 20.6% Pass@10 on 1-shot MBPP coding benchmarks. Our approach is capable of generating high-quality discrete data in a non-autoregressive fashion, significantly closing the gap between autoregressive models and discrete flow models.

Paper

Similar papers

Peer review

Reviewer 7VEG8/10 · confidence 4/52024-06-30

Summary

This paper presents Discrete Flow Matching, a new method for generating discrete data, such as language. The approach uses a general family of probability paths between source and target distributions. It offers a formula for sampling from these paths using learned posteriors. By focusing on specific probability paths, it improves generative perplexity compared to previous similar models. When scaled up, the method achieves notable performance on benchmarks. This approach bridges the gap between autoregressive models and discrete flow models.

Strengths

The method is well-motivated for solving the discrete-state data in flow matching.

Weaknesses

- In line 32, you mention one advantage of FM is its flexibility in handling non-Gaussian target distributions. Have you demonstrated this case? - The method's description is unclear and confusing. I cannot distinguish which part pertains to Campbell's methods and which part is yours. - In Table 2, it's unclear why the results from Austin et al. [2021a] are poor, as no explanation is provided. - In Line 214, I'm not entirely sure what the difference is. Perhaps a table could clarify it? - In Figure 3, the Inception Score (IS) needs to be included to demonstrate the diversity of image generation. - Except the perplexity, how about the performance on BLEU, bertscore? - Diversity is a significant concern for flow-based models. What about the result on diversity-related metrics? - In F.1, in the context of conditional generation, it's unclear what the source (src) and target (tgt) samples are. Are they conditional prompts, target prompts, or a combination of Gaussian noise and target prompts? - In section H, there is no qualitative analysis of unconditional generation. - In Section H, I did not see the color red. I only observed the background colors: grey and yellow. - It will be great that the code can be provided. - Related works are missing. it's important to note that flow matching has been utilized in various domains to capture the reader's interest. E.g., boosting diffusion[1],image generation[5], depth estimation[2], motiom[3], even text generation[4]. [1]. Boosting Latent Diffusion with Flow Matching [2]. DepthFM: Fast Monocular Depth Estimation with Flow Matching [3]. Motion Flow Matching for Human Motion Synthesis and Editing [4]. Flow Matching for Conditional Text Generation in a Few Sampling Steps [5], Latent Space Editing in Transformer-based Flow Matching

Questions

as above

Rating

8

Confidence

4

Soundness

2

Presentation

2

Contribution

3

Limitations

as above

Authorsrebuttal2024-08-07

**Comment: In section H, there is no qualitative analysis of unconditional generation.** Per the reviewer's suggestion, we added unconditional samples, generated by our model (attached in the pdf in the main response). We will add these samples to the revised version. **Commnet: In Section H, I did not see the color red. I only observed the background colors: gray and yellow.** This is a mistake, prompts are marked in gray, we will fix it in the revised version. **Comment: It will be great that the code can be provided.** We are planning on releasing the code not much after the paper is published. **Comment: Related works are missing.** We thank the reviewer for the suggestion, we will add the relevant related works to the revised version.

Reviewer 7VEG2024-08-07

thanks for your reply

i am looking forwards to the code.

Authorsrebuttal2024-08-11

We are planning to release the code around the time of publication. As we near the end of the discussion period, we would be happy to address any further clarifications or concerns regarding the other comments raised by the reviewer.

Reviewer 7VEG2024-08-13

strong accept

Thanks for the author's reply; my concerns are resolved. I have one suggestion for the draft: emphasize more in the main paper about the instantiation of the scheduler, as it's critical for performance.

Reviewer vMd57/10 · confidence 4/52024-07-12

Summary

The paper proposes an approach to generative modelling for discrete data, i.e. multidimensional distributions where the variable along every dimension can take value in a finite set. This is an alternative approach to autoregressive generative modelling for discrete data which is currently actively studied for language and code generation. The philosophy of the proposed method is heavily inspired by the Flow Matching algorithm [1] and Continuous Time Markov Chains (CTMC), which were previously used in [2] to propose a similar model. That is, for a given CTMC, the authors define the vector field generating samples from this CTMC by local updates of the samples (independently along every dimension). Based on the PMF (Probability Mass Function) of the CTMC, the authors derive a formula for the vector field. Furthermore, they introduce the continuity equation analogous to the continuous case, which allows for an easy validation that the change of the density given by CTMC corresponds to the vector field. The authors perform an ablation study of some of their design choices and extensive empirical studies for generation of code, language, and discrete-valued images. The proposed model outperforms the competitors bridging the gap between flow-based models and autoregressive models. [1] Lipman, Yaron, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. "Flow matching for generative modeling." *arXiv preprint arXiv:2210.02747* (2022). [2] Campbell, Andrew, Jason Yim, Regina Barzilay, Tom Rainforth, and Tommi Jaakkola. "Generative flows on discrete state-spaces: Enabling multimodal flows with applications to protein co-design." arXiv preprint arXiv:2402.04997 (2024).

Strengths

The paper presents a complete study of the actively studied topic in the field. It is clearly written, the developments presented in the paper are novel and are properly studied empirically. The paper is of great interest to the NeurIPS community.

Weaknesses

The paper presents a complete study and its methodological part does not raise any major concerns. However, I would like to ask the authors to clarify the following question. Why do posteriors in eq. 15 define a proper distribution? Indeed, according to eq. 8, the linear combination of the conditional distributions with the schedulers should define a correct distribution (sum up to $1$). If we simply try to sum over all possible $x^i$ in eq. 15, we won’t get $1$, hence eq. 15 does not define a posterior. This is an important detail when defining the objective in eq. 25, which is the cross entropy between distributions. The minor - Descriptions of the schedulers on lines 96 and 98 are not complete, i.e. there are no conditions that schedulers have to define correct probability distributions in eqs. (9,10) and the scheduler $\kappa^3$ is missing a description. - Figure 2. The plots presented in the figure have $d = 2$ unlike what is stated in the caption. - At the beginning of the paper, the authors introduce the notation of random variables as capital letters (e.g. $X_t$). This creates confusion in equations 13-17 because there the authors clearly mean $X_t$ to be the value of a random variable. - There is a typo in line 160 when describing the panel of Fig. 2. - There is a typo in line 163 when defining the vector field $v(x,z)$. - There is a type in line 582. Index $\ell$ is not a function of $j$ according to eq. (36). - I haven’t checked thoroughly, but I think equations on the top of page 19 should have a summation over $j\neq \ell$ instead of the summation over all possible $j$.

Questions

I would suggest adding a discussion of the variable-length generation. It is an important difference with autoregressive modelling and I’m wondering how the authors handle this issue given that their model has two important properties: 1. Conditional generation for partially masked sequences. 2. Independence of the conditional distributions between dimensions. The questions I would like to have answered are: 1. Does one have to define the length of the generated sequence before generation? If so how this can be decided? 2. What’s the computational cost if one continues generating the sequence in the autoregressive way?

Rating

7

Confidence

4

Soundness

4

Presentation

3

Contribution

3

Limitations

NeurIPS Paper Checklist does not follow the required format. The paper adequately discusses the limitations of the proposed approach. The only thing that is not cover enough in the paper is the variable-length generation.

Reviewer ppDj6/10 · confidence 3/52024-07-13

Summary

The paper introduces a novel approach called Discrete Flow Matching, which adapts continuous flow models to discrete sequential data. It extends prior work by integrating discrete state spaces and time-dependent schedulers into a unified framework for non-autoregressive generative modeling. Methodologically, Discrete FM employs generating probability velocities derived from learned posteriors and schedulers, enabling efficient sampling and correction processes. This approach facilitates the transformation of noise distributions into target data distributions with enhanced flexibility and performance. Experimental evaluations across language modeling, code generation, and image generation tasks demonstrate significant improvements over existing methods. Specifically, the model achieves state-of-the-art results on various benchmarks, including HumanEval and MBPP coding tasks, showcasing its efficacy in generating high-quality outputs.

Strengths

- The methodology design is solid with formal analysis and mathematical proofs. - The paper conducted a set of experiments in language modeling, code generation, and image generation tasks, showcasing the most promising results to date in a non-autoregressive context. - Technical details about the methodologies are rich. And the experimental setup includes detailed descriptions of the methodologies used, such as masked source training, conditional couplings, probability path schedulers, and corrector steps, which are pivotal for the model's performance.

Weaknesses

- The method is heavily based on the Continuous-Time discrete Markov Chain (CTMC) paradigm from Campbell et al., although this paper proposed theoretical and empirical improvements such as the unified formulation for more general probabilistic paths and velocity as well as the scheduler designs. - There are still performance gap in code generation evaluation when compared with autoregressive language models.

Questions

- I am a bit confused with Eq 10 especially the scheduler terms. Please explain or tell if there are mistakes. - What are the main reasons for discrete flow matching to require significantly large number of evaluations?

Rating

6

Confidence

3

Soundness

4

Presentation

4

Contribution

3

Limitations

The authors acknowledged their limitations such as the number of evaluation is high compared to continuous flow matching.

Reviewer oYBb5/10 · confidence 4/52024-07-13

Summary

The paper presents a discrete flow matching method for modeling discrete data with discrete state space. The paper presents unified frameworks for training and sampling from the discrete probabilistic model. Importantly, the paper also studied scaling up the model to 1.7B parameters and tested the model on code generation tasks. Comprehensive experiments shows that the proposed method outperform existing methods and also close the gap to autoregressive models.

Strengths

1. Impressive empirical studies with 1.8B scaling up model. To my knowledge, this is the first discrete diffusion that scaled up to this scale. 2. The paper provides a principled view of the discrete diffusion model, and proposes several novel techniques such as backward sampling in conditional generation scenarios. 3. The paper is very clearly written and well organized.

Weaknesses

The paper lacks some experiments on common benchmarks used in existing discrete diffusion models, e.g., LM1B and OWT. I understand the scaling-up experiments on HumanEval are more challenging, but I believe a comparison on the common benchmark would be important to justify the effectiveness over existing methods.

Questions

See weakness.

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

I didn't find limitations specifically discussed in the paper, though the author marked it discussed in the checklist. Please correct me if I missed it.

Reviewer vMd52024-08-07

response acknowledgment

Thank you for your response! Everything is clear. Sorry for the confusion in some of the questions.

Authorsrebuttal2024-08-11

As we approach the deadline for the authors-reviewers discussion, we would like to kindly inquire if there are any additional questions from the reviewers. We are happy to address any remaining clarifications or concerns.

Reviewer ppDj2024-08-12

Thanks for the response that addressed my concerns. I would keep the rating to recommend acceptance.

Program Chairsdecision2024-09-25

Decision

Accept (spotlight)

© 2026 NYSGPT2525 LLC